summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Dickow <jjdickow@gmail.com>2015-11-17 08:38:12 -0500
committerJustin Dickow <jjdickow@gmail.com>2015-11-17 08:38:12 -0500
commit6916a4ea20083315cbf732f1de3c57916f83213b (patch)
treeaa9200b397fa8937808daf67d7b81189426fee7e
parent5d5d8cffbbc7a846b7399fae0c6c323e1012ab9c (diff)
parentd6120b98447ff89c1cfab05545709c9e70829347 (diff)
downloadsmartdevicelink-6916a4ea20083315cbf732f1de3c57916f83213b.tar.gz
Merge branch 'refs/heads/release/4.0.0'4.0.0
Conflicts: README.md
-rw-r--r--CMakeLists.txt388
-rw-r--r--README.md56
-rw-r--r--cmake/Modules/FindSqlite3.cmake125
-rw-r--r--customer-specific/pasa/src/appMain/smartDeviceLink.ini177
-rw-r--r--src/3rd_party-static/MessageBroker/CMakeLists.txt2
-rw-r--r--src/3rd_party-static/MessageBroker/include/CMessageBroker.hpp10
-rw-r--r--src/3rd_party-static/MessageBroker/include/CMessageBrokerRegistry.hpp15
-rw-r--r--src/3rd_party-static/MessageBroker/src/client/mb_controller.cpp6
-rw-r--r--src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBroker.cpp232
-rw-r--r--src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBrokerRegistry.cpp73
-rw-r--r--src/3rd_party-static/MessageBroker/src/lib_messagebroker/websocket_handler.cpp89
-rw-r--r--src/3rd_party-static/MessageBroker/src/server/mb_tcpserver.cpp104
-rw-r--r--src/3rd_party-static/jsoncpp/src/lib_json/json_reader.cpp2
-rw-r--r--src/3rd_party/CMakeLists.txt4
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp6
-rw-r--r--src/3rd_party/apache-log4cxx-cmake/CMakeLists.txt13
-rw-r--r--src/3rd_party/apr-1.5.0/include/apr.h30
-rw-r--r--src/3rd_party/dbus-1.7.8/Makefile.in42
-rw-r--r--src/3rd_party/dbus-1.7.8/aclocal.m410
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/Makefile.in59
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/configure304
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/Makefile.in37
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/Makefile.in54
-rw-r--r--src/3rd_party/dbus-1.7.8/test/Makefile.in40
-rw-r--r--src/3rd_party/dbus-1.7.8/test/name-test/Makefile.in24
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/Makefile.in29
-rw-r--r--src/3rd_party/dbus-cmake/CMakeLists.txt13
-rw-r--r--src/appMain/CMakeLists.txt159
-rw-r--r--src/appMain/life_cycle.cc60
-rw-r--r--src/appMain/life_cycle.h2
-rw-r--r--src/appMain/main.cc64
-rw-r--r--src/appMain/sdl_preloaded_pt.json4260
-rw-r--r--src/appMain/smartDeviceLink.ini75
-rw-r--r--src/components/CMakeLists.txt4
-rw-r--r--src/components/HMI/IVSU/PROPRIETARY_REQUEST3
-rw-r--r--src/components/HMI/app/AppViews.js11
-rw-r--r--src/components/HMI/app/SDLApp.js4
-rw-r--r--src/components/HMI/app/controller/SettingsController.js37
-rw-r--r--src/components/HMI/app/controller/sdl/AppController.js4
-rw-r--r--src/components/HMI/app/controller/sdl/Controller.js88
-rw-r--r--src/components/HMI/app/controller/sdl/MediaController.js2
-rw-r--r--src/components/HMI/app/controller/sdl/NonMediaController.js2
-rw-r--r--src/components/HMI/app/controller/sdl/RPCController.js108
-rw-r--r--src/components/HMI/app/model/media/CDModel.js2
-rw-r--r--src/components/HMI/app/model/sdl/AppModel.js31
-rw-r--r--src/components/HMI/app/model/sdl/MediaModel.js12
-rw-r--r--src/components/HMI/app/model/sdl/Model.js113
-rw-r--r--src/components/HMI/app/model/sdl/NonMediaModel.js10
-rw-r--r--src/components/HMI/app/model/sdl/VehicleInfoModel.js28
-rw-r--r--src/components/HMI/app/view/WarningView.js17
-rw-r--r--src/components/HMI/app/view/home/controlButtons.js5
-rw-r--r--src/components/HMI/app/view/home/statusMediaView.js2
-rw-r--r--src/components/HMI/app/view/info/appsView.js37
-rw-r--r--src/components/HMI/app/view/infoView.js16
-rw-r--r--src/components/HMI/app/view/media/common/LeftMenuView.js1
-rw-r--r--src/components/HMI/app/view/media/sdl/controllsView.js4
-rw-r--r--src/components/HMI/app/view/media/sdlmediaView.js4
-rw-r--r--src/components/HMI/app/view/mediaView.js2
-rw-r--r--src/components/HMI/app/view/sdl/AlertPopUp.js2
-rw-r--r--src/components/HMI/app/view/sdl/ExitAppView.js22
-rw-r--r--src/components/HMI/app/view/sdl/PopUp.js26
-rw-r--r--src/components/HMI/app/view/sdl/TTSPopUp.js37
-rw-r--r--src/components/HMI/app/view/sdl/VehicleInfoView.js18
-rw-r--r--src/components/HMI/app/view/sdl/shared/interactionChoicesView.js14
-rw-r--r--src/components/HMI/app/view/sdl/shared/turnByTurnView.js40
-rw-r--r--src/components/HMI/css/buttonControls.css10
-rw-r--r--src/components/HMI/css/general.css42
-rw-r--r--src/components/HMI/css/info.css4
-rw-r--r--src/components/HMI/css/media.css43
-rw-r--r--src/components/HMI/css/sdl.css60
-rw-r--r--src/components/HMI/ffw/BasicCommunicationRPC.js212
-rw-r--r--src/components/HMI/ffw/NavigationRPC.js68
-rw-r--r--src/components/HMI/ffw/RPCClient.js49
-rw-r--r--src/components/HMI/ffw/RPCObserver.js235
-rw-r--r--src/components/HMI/ffw/TTSRPC.js64
-rw-r--r--src/components/HMI/ffw/UIRPC.js239
-rw-r--r--src/components/HMI/ffw/VRRPC.js53
-rw-r--r--src/components/application_manager/CMakeLists.txt55
-rw-r--r--src/components/application_manager/include/application_manager/application.h321
-rw-r--r--src/components/application_manager/include/application_manager/application_data_impl.h91
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h185
-rw-r--r--src/components/application_manager/include/application_manager/application_manager.h1
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h776
-rw-r--r--src/components/application_manager/include/application_manager/commands/command.h23
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_impl.h25
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h64
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_request_impl.h10
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h11
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_urls.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h25
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h49
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h4
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h2
-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.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_button_subscription_notification.h76
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_emergency_event_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_play_tone_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h2
-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.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h15
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h21
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h4
-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/generic_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h75
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h3
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h18
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h44
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h3
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h114
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/show_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/slider_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/speak_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h14
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/system_request.h18
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h6
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event.h2
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h10
-rw-r--r--src/components/application_manager/include/application_manager/hmi_capabilities.h61
-rw-r--r--src/components/application_manager/include/application_manager/hmi_command_factory.h2
-rw-r--r--src/components/application_manager/include/application_manager/hmi_state.h186
-rw-r--r--src/components/application_manager/include/application_manager/message.h5
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h143
-rw-r--r--src/components/application_manager/include/application_manager/mobile_command_factory.h4
-rw-r--r--src/components/application_manager/include/application_manager/mobile_message_handler.h11
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_event_observer.h10
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h189
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler_observer.h1
-rw-r--r--src/components/application_manager/include/application_manager/request_controller.h117
-rw-r--r--src/components/application_manager/include/application_manager/request_info.h322
-rw-r--r--src/components/application_manager/include/application_manager/resume_ctrl.h279
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h53
-rw-r--r--src/components/application_manager/include/application_manager/state_context.h75
-rw-r--r--src/components/application_manager/include/application_manager/state_controller.h408
-rw-r--r--src/components/application_manager/include/application_manager/time_metric_observer.h2
-rw-r--r--src/components/application_manager/include/application_manager/usage_statistics.h2
-rw-r--r--src/components/application_manager/src/application_data_impl.cc144
-rw-r--r--src/components/application_manager/src/application_impl.cc461
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc2052
-rw-r--r--src/components/application_manager/src/commands/command_impl.cc5
-rw-r--r--src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc74
-rw-r--r--src/components/application_manager/src/commands/command_request_impl.cc65
-rw-r--r--src/components/application_manager/src/commands/hmi/activate_app_request.cc38
-rw-r--r--src/components/application_manager/src/commands/hmi/activate_app_response.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_app_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_app_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/close_popup_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/close_popup_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/get_system_info_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/get_system_info_response.cc40
-rw-r--r--src/components/application_manager/src/commands/hmi/get_urls.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/get_urls_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc111
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc27
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_send_location_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_send_location_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc111
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc28
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/notification_from_hmi.cc10
-rw-r--r--src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc8
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc82
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc10
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_audio_data_streaming_notification.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/on_button_event_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_button_press_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_button_subscription_notification.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc6
-rw-r--r--src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc24
-rw-r--r--src/components/application_manager/src/commands/hmi/on_emergency_event_notification.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc10
-rw-r--r--src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc13
-rw-r--r--src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_find_applications.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_phone_call_notification.cc16
-rw-r--r--src/components/application_manager/src/commands/hmi/on_play_tone_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_policy_update.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_put_file_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ready_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_received_policy_update.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_record_start_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_status_update_notification.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_context_notification.cc8
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_error_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_request_notification.cc30
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc11
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc9
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc6
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc11
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_update_device_list.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_video_data_streaming_notification.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc9
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc15
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc9
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc9
-rw-r--r--src/components/application_manager/src/commands/hmi/request_from_hmi.cc18
-rw-r--r--src/components/application_manager/src/commands/hmi/request_to_hmi.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/response_from_hmi.cc5
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc136
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_policy_update.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_language_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_language_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_speak_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_speak_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_command_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_command_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_alert_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_alert_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc42
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_language_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_language_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_app_icon_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_app_icon_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_show_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_show_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_slider_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_slider_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/update_app_list_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/update_app_list_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/update_device_list_request.cc12
-rw-r--r--src/components/application_manager/src/commands/hmi/update_device_list_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/update_sdl_request.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/update_sdl_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc22
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_read_did_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_read_did_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_add_command_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_add_command_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_language_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_language_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc4
-rw-r--r--src/components/application_manager/src/commands/mobile/add_command_request.cc101
-rw-r--r--src/components/application_manager/src/commands/mobile/add_command_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc8
-rw-r--r--src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc11
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_request.cc45
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/change_registration_request.cc19
-rw-r--r--src/components/application_manager/src/commands/mobile/change_registration_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc289
-rw-r--r--src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_command_request.cc7
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_command_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_file_request.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_file_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc31
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc19
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc31
-rw-r--r--src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/dial_number_request.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc4
-rw-r--r--src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/get_dtcs_request.cc10
-rw-r--r--src/components/application_manager/src/commands/mobile/get_dtcs_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc21
-rw-r--r--src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/list_files_request.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/list_files_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/on_button_event_notification.cc15
-rw-r--r--src/components/application_manager/src/commands/mobile/on_button_press_notification.cc13
-rw-r--r--src/components/application_manager/src/commands/mobile/on_command_notification.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc14
-rw-r--r--src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc8
-rw-r--r--src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc121
-rw-r--r--src/components/application_manager/src/commands/mobile/on_keyboard_input_notification.cc31
-rw-r--r--src/components/application_manager/src/commands/mobile/on_language_change_notification.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/on_system_request_notification.cc39
-rw-r--r--src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc33
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_interaction_request.cc337
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_interaction_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/put_file_request.cc8
-rw-r--r--src/components/application_manager/src/commands/mobile/put_file_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/read_did_request.cc10
-rw-r--r--src/components/application_manager/src/commands/mobile/read_did_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_request.cc300
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_response.cc16
-rw-r--r--src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc78
-rw-r--r--src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/scrollable_message_request.cc7
-rw-r--r--src/components/application_manager/src/commands/mobile/scrollable_message_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/send_location_request.cc80
-rw-r--r--src/components/application_manager/src/commands/mobile/send_location_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/set_app_icon_request.cc273
-rw-r--r--src/components/application_manager/src/commands/mobile/set_app_icon_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/set_display_layout_request.cc42
-rw-r--r--src/components/application_manager/src/commands/mobile/set_display_layout_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/set_global_properties_request.cc45
-rw-r--r--src/components/application_manager/src/commands/mobile/set_global_properties_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc4
-rw-r--r--src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc6
-rw-r--r--src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/show_request.cc6
-rw-r--r--src/components/application_manager/src/commands/mobile/show_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/slider_request.cc14
-rw-r--r--src/components/application_manager/src/commands/mobile/slider_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/speak_request.cc10
-rw-r--r--src/components/application_manager/src/commands/mobile/speak_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_button_request.cc66
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_button_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc21
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/system_request.cc184
-rw-r--r--src/components/application_manager/src/commands/mobile/system_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc5
-rw-r--r--src/components/application_manager/src/commands/mobile/unregister_app_interface_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc31
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc4
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/update_turn_list_request.cc6
-rw-r--r--src/components/application_manager/src/commands/mobile/update_turn_list_response.cc2
-rw-r--r--src/components/application_manager/src/event_engine/event.cc2
-rw-r--r--src/components/application_manager/src/event_engine/event_dispatcher.cc85
-rw-r--r--src/components/application_manager/src/hmi_capabilities.cc72
-rw-r--r--src/components/application_manager/src/hmi_command_factory.cc30
-rw-r--r--src/components/application_manager/src/hmi_state.cc99
-rw-r--r--src/components/application_manager/src/message.cc2
-rw-r--r--src/components/application_manager/src/message_helper.cc1137
-rw-r--r--src/components/application_manager/src/mobile_command_factory.cc15
-rw-r--r--src/components/application_manager/src/mobile_message_handler.cc44
-rw-r--r--src/components/application_manager/src/policies/policy_event_observer.cc25
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc908
-rw-r--r--src/components/application_manager/src/request_controller.cc611
-rw-r--r--src/components/application_manager/src/request_info.cc315
-rw-r--r--src/components/application_manager/src/resume_ctrl.cpp1512
-rw-r--r--src/components/application_manager/src/state_context.cc62
-rw-r--r--src/components/application_manager/src/state_controller.cc436
-rw-r--r--src/components/application_manager/src/usage_statistics.cc2
-rw-r--r--src/components/application_manager/test/CMakeLists.txt82
-rw-r--r--src/components/application_manager/test/command_impl_test.cc43
-rw-r--r--src/components/application_manager/test/mobile_message_handler_test.cc53
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/application.h559
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/application_data_impl.h329
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/application_impl.h287
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/application_manager.h80
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h120
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/command.h118
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/command_impl.h141
l---------src/components/application_manager/test/mock/include/application_manager/commands/command_notification_from_mobile_impl.h1
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/command_notification_impl.h65
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/command_request_impl.h192
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/command_response_impl.h69
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_request.h80
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/add_statistics_info_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_response.h73
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h1
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls.h71
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls_response.h68
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_response.h72
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h72
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h72
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_response.h72
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_request.h72
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_response.h72
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_from_hmi.h70
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_to_hmi.h59
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_activated_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_deactivated_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_changed_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_consent_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_registered_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_unregistered_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_event_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_press_notification.h74
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_subscription_notification.h1
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_chosen_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_state_changed_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_driver_distraction_notification.h79
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_emergency_event_notification.h1
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_all_applications_notification.h79
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_application_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_file_removed_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_find_applications.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h75
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_phone_call_notification.h78
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_play_tone_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_policy_update.h67
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_put_file_notification.h75
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ready_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_received_policy_update.h70
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_record_start_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_resume_audio_source_notification.h75
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_close_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_start_device_discovery.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_status_update_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_context_notification.h78
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_error_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_info_changed_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_request_notification.h75
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_language_change_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h77
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_started_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_stopped_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_command_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h78
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_language_change_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h77
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_touch_event_notification.h78
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_update_device_list.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_belt_status_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_body_information_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_device_status_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_gps_data_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_my_key_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_odometer_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_prndl_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_rpm_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_speed_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h75
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vin_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_command_notification.h75
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_language_change_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_started_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_stopped_notification.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_from_hmi.h67
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_to_hmi.h68
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_from_hmi.h78
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_to_hmi.h68
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_request.h72
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_response.h72
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h72
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_request.h72
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_response.h72
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h72
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update.h64
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update_response.h70
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_request.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_response.h73
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_response.h1
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_request.h72
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_request.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_request.h93
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h75
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h75
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h75
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_request.h148
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_request.h89
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_request.h95
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_request.h143
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_request.h163
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_request.h180
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_request.h98
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_request.h78
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h85
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_request.h100
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_request.h81
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/dial_number_request.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_request.h81
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/generic_response.h71
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_request.h81
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_request.h95
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_request.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h75
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h75
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_event_notification.h87
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_press_notification.h86
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_command_notification.h76
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_driver_distraction_notification.h78
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hash_change_notification.h76
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification.h74
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h1
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_keyboard_input_notification.h77
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_language_change_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_permissions_change_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_system_request_notification.h77
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_tbt_client_state_notification.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_touch_event_notification.h77
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_vehicle_data_notification.h83
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h133
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_request.h221
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_request.h82
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_request.h81
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_request.h175
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_response.h76
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_request.h131
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_request.h86
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_response.h69
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_request.h88
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_response.h68
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_request.h1
l---------src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_response.h1
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_request.h81
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_request.h122
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_request.h89
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_request.h82
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_response.h68
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_request.h90
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_request.h89
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_response.h68
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_request.h92
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_response.h68
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_request.h94
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_response.h68
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_request.h89
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h98
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_request.h81
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_request.h77
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_response.h73
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_request.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h97
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_request.h98
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_response.h74
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/commands/pending.h76
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/event_engine/event.h148
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/event_engine/event_dispatcher.h118
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/event_engine/event_observer.h117
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/hmi_capabilities.h539
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/hmi_command_factory.h64
l---------src/components/application_manager/test/mock/include/application_manager/hmi_state.h1
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/message.h129
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/message_helper.h495
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/mobile_command_factory.h64
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/mobile_message_handler.h65
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/policies/delegates/app_permission_delegate.h82
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/policies/delegates/statistics_delegate.h83
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/policies/policy_event_observer.h60
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/policies/policy_handler.h420
l---------src/components/application_manager/test/mock/include/application_manager/policies/policy_handler_observer.h1
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/policies/policy_retry_sequence.h55
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler.h48
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_ext.h53
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_impl.h62
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/request_controller.h267
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/request_info.h263
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/resume_ctrl.h286
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/smart_object_keys.h371
l---------src/components/application_manager/test/mock/include/application_manager/state_context.h1
l---------src/components/application_manager/test/mock/include/application_manager/state_controller.h1
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/time_metric_observer.h60
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/usage_statistics.h72
l---------[-rw-r--r--]src/components/application_manager/test/mock/include/application_manager/vehicle_info_data.h72
-rw-r--r--src/components/application_manager/test/request_info_test.cc242
-rw-r--r--src/components/application_manager/test/resumption/include/application_mock.h266
-rw-r--r--src/components/application_manager/test/resumption/include/resumption_data_mock.h86
-rw-r--r--src/components/application_manager/test/resumption/include/resumption_data_test.h133
-rw-r--r--src/components/application_manager/test/resumption/resume_ctrl_test.cc937
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_db_test.cc837
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_json_test.cc394
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_test.cc549
-rw-r--r--src/components/application_manager/test/resumption/smartDeviceLink_test.ini37
-rw-r--r--src/components/application_manager/test/state_controller/CMakeLists.txt51
-rw-r--r--src/components/application_manager/test/state_controller/include/application_manager_mock.h80
-rw-r--r--src/components/application_manager/test/state_controller/include/application_mock.h252
-rw-r--r--src/components/application_manager/test/state_controller/include/state_controller_mock.h60
-rw-r--r--src/components/application_manager/test/state_controller/include/statistics_manager_mock.h52
-rw-r--r--src/components/application_manager/test/state_controller/state_controller_test.cc1483
-rw-r--r--src/components/config_profile/CMakeLists.txt43
-rw-r--r--src/components/config_profile/include/config_profile/ini_file.h2
-rw-r--r--src/components/config_profile/include/config_profile/profile.h132
-rw-r--r--src/components/config_profile/src/ini_file.cc66
-rw-r--r--src/components/config_profile/src/profile.cc1065
-rw-r--r--src/components/config_profile/test/CMakeLists.txt59
-rw-r--r--src/components/config_profile/test/ini_file_test.cc335
-rw-r--r--src/components/config_profile/test/profile_test.cc789
-rw-r--r--src/components/config_profile/test/smartDeviceLink.ini185
-rw-r--r--src/components/config_profile/test/smartDeviceLink_invalid_boolean.ini185
-rw-r--r--src/components/config_profile/test/smartDeviceLink_invalid_int.ini187
-rw-r--r--src/components/config_profile/test/smartDeviceLink_invalid_pairs.ini187
-rw-r--r--src/components/config_profile/test/smartDeviceLink_invalid_string.ini190
-rw-r--r--src/components/config_profile/test/smartDeviceLink_test.ini192
-rw-r--r--src/components/connection_handler/CMakeLists.txt61
-rw-r--r--src/components/connection_handler/include/connection_handler/connection.h134
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler.h25
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler_impl.h52
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler_observer.h10
-rw-r--r--src/components/connection_handler/include/connection_handler/heartbeat_monitor.h33
-rw-r--r--src/components/connection_handler/src/connection.cc47
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc267
-rw-r--r--src/components/connection_handler/src/device.cc4
-rw-r--r--src/components/connection_handler/src/heartbeat_monitor.cc130
-rw-r--r--src/components/connection_handler/test/CMakeLists.txt64
-rw-r--r--src/components/connection_handler/test/connection_handler_impl_test.cc1043
-rw-r--r--src/components/connection_handler/test/connection_test.cc451
-rw-r--r--src/components/connection_handler/test/device_test.cc80
-rw-r--r--src/components/connection_handler/test/heart_beat_monitor_test.cc245
-rw-r--r--src/components/connection_handler/test/include/connection_handler_observer_mock.h70
-rw-r--r--src/components/connection_handler/test/smartDeviceLink.ini165
-rw-r--r--src/components/dbus/CMakeLists.txt43
-rw-r--r--src/components/dbus/include/dbus/message_descriptions.h62
-rw-r--r--src/components/dbus/include/dbus/schema.h62
-rw-r--r--src/components/dbus/src/schema.cc2
-rw-r--r--src/components/dbus/test/CMakeLists.txt53
-rw-r--r--src/components/dbus/test/test_dbus_adapter.cc61
-rw-r--r--src/components/dbus/test/test_dbus_message_controller.cc121
-rw-r--r--src/components/dbus/test/test_schema.cc119
-rw-r--r--src/components/formatters/CMakeLists.txt59
-rw-r--r--src/components/formatters/include/formatters/formatter_json_rpc.h2
-rw-r--r--src/components/formatters/include/formatters/generic_json_formatter.h2
-rw-r--r--src/components/formatters/include/formatters/meta_formatter.h2
-rw-r--r--src/components/formatters/src/formatter_json_rpc.cc2
-rw-r--r--src/components/formatters/src/generic_json_formatter.cc2
-rw-r--r--src/components/formatters/src/meta_formatter.cc2
-rw-r--r--src/components/formatters/test/CFormatterJsonBase_test.cc337
-rw-r--r--src/components/formatters/test/CMakeLists.txt67
-rw-r--r--src/components/formatters/test/CSmartFactory_test.cc397
-rw-r--r--src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc502
-rw-r--r--src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc392
-rw-r--r--src/components/formatters/test/formatter_json_rpc_test.cc199
-rw-r--r--src/components/formatters/test/generic_json_formatter_test.cc162
-rw-r--r--src/components/formatters/test/include/SmartFactoryTestHelper.h167
-rw-r--r--src/components/formatters/test/include/create_smartSchema.h92
-rw-r--r--src/components/formatters/test/include/meta_formatter_test_helper.h83
-rw-r--r--src/components/formatters/test/meta_formatter_test.cc351
-rw-r--r--src/components/formatters/test/src/SmartFactoryTestHelper.cc501
-rw-r--r--src/components/formatters/test/src/create_smartSchema.cc379
-rw-r--r--src/components/formatters/test/src/meta_formatter_test_helper.cc222
-rw-r--r--src/components/hmi_message_handler/CMakeLists.txt87
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter.h2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler.h2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_observer.h2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_sender.h2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/mqueue_adapter.h65
-rw-r--r--src/components/hmi_message_handler/src/dbus_message_adapter.cc5
-rw-r--r--src/components/hmi_message_handler/src/hmi_message_adapter.cc2
-rw-r--r--src/components/hmi_message_handler/src/hmi_message_handler_impl.cc2
-rw-r--r--src/components/hmi_message_handler/src/messagebroker_adapter.cc15
-rw-r--r--src/components/hmi_message_handler/src/mqueue_adapter.cc83
-rw-r--r--src/components/hmi_message_handler/test/CMakeLists.txt56
-rw-r--r--src/components/hmi_message_handler/test/Readme.txt11
-rw-r--r--src/components/hmi_message_handler/test/dbus_message_adapter_test.cc67
-rw-r--r--src/components/hmi_message_handler/test/include/hmi_message_handler/mock_dbus_message_controller.h68
-rw-r--r--src/components/hmi_message_handler/test/include/hmi_message_handler/mock_subscriber.h62
-rw-r--r--src/components/hmi_message_handler/test/include/mock_subscriber.h62
-rw-r--r--src/components/hmi_message_handler/test/mock_subscriber.cc81
-rw-r--r--src/components/hmi_message_handler/test/mqueue_adapter_test.cc94
-rw-r--r--src/components/include/protocol/common.h21
-rw-r--r--src/components/include/protocol/raw_message.h2
-rw-r--r--src/components/include/protocol/service_type.h2
-rw-r--r--src/components/include/protocol_handler/protocol_handler.h4
-rw-r--r--src/components/include/protocol_handler/session_observer.h25
-rw-r--r--src/components/include/security_manager/crypto_manager.h2
-rw-r--r--src/components/include/transport_manager/transport_adapter/device.h2
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter.h23
-rw-r--r--src/components/include/transport_manager/transport_manager.h6
-rw-r--r--src/components/include/transport_manager/transport_manager_listener.h2
-rw-r--r--src/components/include/utils/atomic.h8
-rw-r--r--src/components/include/utils/conditional_variable.h6
-rw-r--r--src/components/include/utils/data_accessor.h38
-rw-r--r--src/components/include/utils/date_time.h64
-rw-r--r--src/components/include/utils/lock.h28
-rw-r--r--src/components/include/utils/logger.h24
-rw-r--r--src/components/include/utils/logger_status.h2
-rw-r--r--src/components/include/utils/macro.h56
-rw-r--r--src/components/include/utils/make_shared.h108
-rw-r--r--src/components/include/utils/memory_barrier.h2
-rw-r--r--src/components/include/utils/message_queue.h22
-rw-r--r--src/components/include/utils/prioritized_queue.h2
-rw-r--r--src/components/include/utils/rwlock.h95
-rw-r--r--src/components/include/utils/shared_ptr.h5
-rw-r--r--src/components/include/utils/threads/CMakeLists.txt5
-rw-r--r--src/components/include/utils/threads/message_loop_thread.h54
-rw-r--r--src/components/include/utils/threads/thread.h146
-rw-r--r--src/components/include/utils/threads/thread_delegate.h64
-rw-r--r--src/components/include/utils/threads/thread_options.h4
-rw-r--r--src/components/include/utils/timer_thread.h484
-rw-r--r--src/components/interfaces/CMakeLists.txt43
-rw-r--r--src/components/interfaces/HMI_API.xml270
-rw-r--r--src/components/interfaces/MOBILE_API.xml10005
-rw-r--r--src/components/interfaces/QT_HMI_API.xml252
-rw-r--r--src/components/media_manager/CMakeLists.txt130
-rw-r--r--src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h67
-rw-r--r--src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h73
-rw-r--r--src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h60
-rw-r--r--src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h2
-rw-r--r--src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h66
-rw-r--r--src/components/media_manager/include/media_manager/audio/pipe_audio_streamer_adapter.h62
-rw-r--r--src/components/media_manager/include/media_manager/audio/socket_audio_streamer_adapter.h62
-rw-r--r--src/components/media_manager/include/media_manager/media_adapter.h58
-rw-r--r--src/components/media_manager/include/media_manager/media_adapter_impl.h61
-rw-r--r--src/components/media_manager/include/media_manager/media_adapter_listener.h58
-rw-r--r--src/components/media_manager/include/media_manager/media_manager.h76
-rw-r--r--src/components/media_manager/include/media_manager/media_manager_impl.h89
-rw-r--r--src/components/media_manager/include/media_manager/pipe_streamer_adapter.h65
-rw-r--r--src/components/media_manager/include/media_manager/socket_streamer_adapter.h67
-rw-r--r--src/components/media_manager/include/media_manager/streamer_listener.h58
-rw-r--r--src/components/media_manager/include/media_manager/video/pipe_video_streamer_adapter.h62
-rw-r--r--src/components/media_manager/include/media_manager/video/socket_video_streamer_adapter.h62
-rw-r--r--src/components/media_manager/include/media_manager/video/video_stream_to_file_adapter.h64
-rw-r--r--src/components/media_manager/src/audio/a2dp_source_player_adapter.cc106
-rw-r--r--src/components/media_manager/src/audio/audio_stream_sender_thread.cc19
-rw-r--r--src/components/media_manager/src/audio/from_mic_recorder_adapter.cc83
-rw-r--r--src/components/media_manager/src/audio/from_mic_recorder_listener.cc68
-rw-r--r--src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc117
-rw-r--r--src/components/media_manager/src/audio/pipe_audio_streamer_adapter.cc6
-rw-r--r--src/components/media_manager/src/audio/socket_audio_streamer_adapter.cc6
-rw-r--r--src/components/media_manager/src/media_adapter_impl.cc66
-rw-r--r--src/components/media_manager/src/media_manager_impl.cc217
-rw-r--r--src/components/media_manager/src/pipe_streamer_adapter.cc70
-rw-r--r--src/components/media_manager/src/socket_streamer_adapter.cc33
-rw-r--r--src/components/media_manager/src/streamer_listener.cc62
-rw-r--r--src/components/media_manager/src/video/pipe_video_streamer_adapter.cc6
-rw-r--r--src/components/media_manager/src/video/socket_video_streamer_adapter.cc6
-rw-r--r--src/components/media_manager/src/video/video_stream_to_file_adapter.cc24
-rw-r--r--src/components/media_manager/test/CMakeLists.txt82
-rw-r--r--src/components/media_manager/test/main.cc7
-rw-r--r--src/components/media_manager/test/media_manager_impl_test.cc92
-rw-r--r--src/components/policy/doc/readme.txt5
-rw-r--r--src/components/policy/src/policy/CMakeLists.txt1
-rw-r--r--src/components/policy/src/policy/include/policy/cache_manager.h189
-rw-r--r--src/components/policy/src/policy/include/policy/cache_manager_interface.h92
-rw-r--r--src/components/policy/src/policy/include/policy/policy_helper.h45
-rw-r--r--src/components/policy/src/policy/include/policy/policy_listener.h46
-rw-r--r--src/components/policy/src/policy/include/policy/policy_manager.h98
-rw-r--r--src/components/policy/src/policy/include/policy/policy_manager_impl.h103
-rw-r--r--src/components/policy/src/policy/include/policy/policy_types.h32
-rw-r--r--src/components/policy/src/policy/include/policy/pt_ext_representation.h6
-rw-r--r--src/components/policy/src/policy/include/policy/pt_representation.h10
-rw-r--r--src/components/policy/src/policy/include/policy/sql_pt_ext_queries.h7
-rw-r--r--src/components/policy/src/policy/include/policy/sql_pt_ext_representation.h14
-rw-r--r--src/components/policy/src/policy/include/policy/sql_pt_queries.h4
-rw-r--r--src/components/policy/src/policy/include/policy/sql_pt_representation.h18
-rw-r--r--src/components/policy/src/policy/include/policy/update_status_manager.h96
-rw-r--r--src/components/policy/src/policy/policy_table/table_struct/enums.cc137
-rw-r--r--src/components/policy/src/policy/policy_table/table_struct/enums.h28
-rw-r--r--src/components/policy/src/policy/policy_table/table_struct/types.cc260
-rw-r--r--src/components/policy/src/policy/policy_table/table_struct/types.h69
-rw-r--r--src/components/policy/src/policy/policy_table/table_struct/validation.cc123
-rw-r--r--src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_database.h2
-rw-r--r--src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_error.h2
-rw-r--r--src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_query.h2
-rw-r--r--src/components/policy/src/policy/qdb_wrapper/src/sql_database.cc2
-rw-r--r--src/components/policy/src/policy/qdb_wrapper/src/sql_error.cc2
-rw-r--r--src/components/policy/src/policy/qdb_wrapper/src/sql_query.cc2
-rw-r--r--src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_database.h8
-rw-r--r--src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_error.h2
-rw-r--r--src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_query.h2
-rw-r--r--src/components/policy/src/policy/sqlite_wrapper/src/sql_database.cc11
-rw-r--r--src/components/policy/src/policy/sqlite_wrapper/src/sql_error.cc2
-rw-r--r--src/components/policy/src/policy/sqlite_wrapper/src/sql_query.cc2
-rw-r--r--src/components/policy/src/policy/src/cache_manager.cc779
-rw-r--r--src/components/policy/src/policy/src/policy_helper.cc430
-rw-r--r--src/components/policy/src/policy/src/policy_manager_impl.cc484
-rw-r--r--src/components/policy/src/policy/src/policy_table.cc2
-rw-r--r--src/components/policy/src/policy/src/sql_pt_ext_queries.cc26
-rw-r--r--src/components/policy/src/policy/src/sql_pt_ext_representation.cc208
-rw-r--r--src/components/policy/src/policy/src/sql_pt_queries.cc34
-rw-r--r--src/components/policy/src/policy/src/sql_pt_representation.cc263
-rw-r--r--src/components/policy/src/policy/src/update_status_manager.cc135
-rw-r--r--src/components/policy/src/policy/usage_statistics/include/usage_statistics/counter.h11
-rw-r--r--src/components/policy/src/policy/usage_statistics/src/counter.cc30
-rw-r--r--src/components/policy/test/CMakeLists.txt45
-rw-r--r--src/components/policy/test/generated_code_test.cc6
-rw-r--r--src/components/policy/test/generated_code_with_sqlite_test.cc155
-rw-r--r--src/components/policy/test/include.cmake6
-rw-r--r--src/components/policy/test/include/mock_cache_manager.h38
-rw-r--r--src/components/policy/test/include/mock_policy_listener.h20
-rw-r--r--src/components/policy/test/include/mock_pt_ext_representation.h2
-rw-r--r--src/components/policy/test/include/mock_pt_representation.h4
-rw-r--r--src/components/policy/test/include/mock_update_status_manager.h6
-rw-r--r--src/components/policy/test/log4cxx.properties14
-rw-r--r--src/components/policy/test/policy.sql546
-rw-r--r--src/components/policy/test/policy_manager_impl_stress_test.cc147
-rw-r--r--src/components/policy/test/policy_manager_impl_test.cc161
-rw-r--r--src/components/policy/test/qdb_wrapper/sql_database_test.cc58
-rw-r--r--src/components/policy/test/sdl_preloaded_pt.json3874
-rw-r--r--src/components/policy/test/shared_library_test.cc13
-rw-r--r--src/components/policy/test/sql_pt_ext_representation_test.cc148
-rw-r--r--src/components/policy/test/sql_pt_representation_test.cc517
-rw-r--r--src/components/policy/test/sqlite_wrapper/sql_database_test.cc106
-rw-r--r--src/components/policy/test/sqlite_wrapper/sql_query_test.cc105
-rw-r--r--src/components/policy/test/usage_statistics_test.cc121
-rw-r--r--src/components/protocol/CMakeLists.txt39
-rw-r--r--src/components/protocol/src/raw_message.cc2
-rw-r--r--src/components/protocol_handler/CMakeLists.txt57
-rw-r--r--src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h28
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h143
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_packet.h108
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_payload.h4
-rw-r--r--src/components/protocol_handler/src/incoming_data_handler.cc123
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc633
-rw-r--r--src/components/protocol_handler/src/protocol_packet.cc335
-rw-r--r--src/components/protocol_handler/src/protocol_payload.cc15
-rw-r--r--src/components/protocol_handler/test/CMakeLists.txt59
-rw-r--r--src/components/protocol_handler/test/include/control_message_matcher.h144
-rw-r--r--src/components/protocol_handler/test/include/protocol_handler_mock.h234
-rw-r--r--src/components/protocol_handler/test/include/protocol_observer_mock.h57
-rw-r--r--src/components/protocol_handler/test/include/session_observer_mock.h112
-rw-r--r--src/components/protocol_handler/test/incoming_data_handler_test.cc798
-rw-r--r--src/components/protocol_handler/test/protocol_handler_tm_test.cc936
-rw-r--r--src/components/protocol_handler/test/protocol_header_validator_test.cc297
-rw-r--r--src/components/protocol_handler/test/protocol_packet_test.cc201
-rw-r--r--src/components/protocol_handler/test/protocol_payload_test.cc270
-rw-r--r--src/components/qt_hmi/CMakeLists.txt6
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h2
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml8
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml15
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml64
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml3
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml37
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml22
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml8
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml66
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml1
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml4
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc2
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc2
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc2
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc2
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc2
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc2
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc2
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc2
-rw-r--r--src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc2
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc2
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h2
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h2
-rw-r--r--src/components/qt_hmi/test/CMakeLists.txt70
-rw-r--r--src/components/qt_hmi/test/qt_hmi_test.cc33
-rw-r--r--src/components/qt_hmi/test/readme.txt14
-rw-r--r--src/components/qt_hmi/test/src/tst_AddCommand.qml320
-rw-r--r--src/components/qt_hmi/test/src/tst_AddSubMenu.qml328
-rw-r--r--src/components/qt_hmi/test/src/tst_DeleteCommand.qml210
-rw-r--r--src/components/qt_hmi/test/src/tst_ScrollableMessage.qml421
-rw-r--r--src/components/qt_hmi/test/src/tst_SetMediaClockTimer.qml292
-rw-r--r--src/components/qt_hmi/test/src/tst_Show.qml363
-rw-r--r--src/components/qt_hmi/test/src/tst_Slider.qml204
-rw-r--r--src/components/resumption/CMakeLists.txt43
-rw-r--r--src/components/resumption/src/last_state.cc10
-rw-r--r--src/components/resumption/test/CMakeLists.txt61
-rw-r--r--src/components/resumption/test/last_state_test.cc102
-rw-r--r--src/components/rpc_base/CMakeLists.txt53
-rw-r--r--src/components/rpc_base/include/rpc_base/gtest_support.h2
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base.h6
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h2
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_inl.h81
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h8
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_message.h62
-rw-r--r--src/components/rpc_base/include/rpc_base/validation_report.h2
-rw-r--r--src/components/rpc_base/src/rpc_base/rpc_base.cc2
-rw-r--r--src/components/rpc_base/test/CMakeLists.txt62
-rw-r--r--src/components/rpc_base/test/rpc_base_dbus_test.cc690
-rw-r--r--src/components/rpc_base/test/rpc_base_json_test.cc373
-rw-r--r--src/components/rpc_base/test/rpc_base_test.cc437
-rw-r--r--src/components/rpc_base/test/validation_report_test.cc156
-rw-r--r--src/components/security_manager/CMakeLists.txt51
-rw-r--r--src/components/security_manager/include/security_manager/security_manager_impl.h2
-rw-r--r--src/components/security_manager/src/security_manager_impl.cc25
-rw-r--r--src/components/security_manager/test/CMakeLists.txt66
-rw-r--r--src/components/security_manager/test/crypto_manager_impl_test.cc462
-rw-r--r--src/components/security_manager/test/include/security_manager_mock.h311
-rw-r--r--src/components/security_manager/test/security_manager_test.cc823
-rw-r--r--src/components/security_manager/test/security_query_matcher.cc123
-rw-r--r--src/components/security_manager/test/security_query_test.cc456
-rw-r--r--src/components/smart_objects/CMakeLists.txt65
-rw-r--r--src/components/smart_objects/include/smart_objects/number_schema_item.h24
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_object.h7
-rw-r--r--src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc94
-rw-r--r--src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc95
-rw-r--r--src/components/smart_objects/test/ArraySchemaItem_test.cc342
-rw-r--r--src/components/smart_objects/test/BoolSchemaItem_test.cc208
-rw-r--r--src/components/smart_objects/test/CMakeLists.txt66
-rw-r--r--src/components/smart_objects/test/CObjectSchemaItem_test.cc453
-rw-r--r--src/components/smart_objects/test/EnumSchemaItem_test.cc272
-rw-r--r--src/components/smart_objects/test/NumberSchemaItem_test.cc813
-rw-r--r--src/components/smart_objects/test/SmartObjectConvertionTime_test.cc714
-rw-r--r--src/components/smart_objects/test/SmartObjectDraft_test.cc364
-rw-r--r--src/components/smart_objects/test/SmartObjectInvalid_test.cc177
-rw-r--r--src/components/smart_objects/test/SmartObjectStress_test.cc336
-rw-r--r--src/components/smart_objects/test/SmartObjectUnit_test.cc584
-rw-r--r--src/components/smart_objects/test/StringSchemaItem_test.cc302
-rw-r--r--src/components/smart_objects/test/map_performance_test.cc75
-rw-r--r--src/components/smart_objects/test/smart_object_performance_test.cc75
-rwxr-xr-xsrc/components/test_main.cc10
-rw-r--r--src/components/time_tester/CMakeLists.txt81
-rw-r--r--src/components/time_tester/include/time_tester/application_manager_observer.h60
-rw-r--r--src/components/time_tester/include/time_tester/json_keys.h2
-rw-r--r--src/components/time_tester/include/time_tester/protocol_handler_observer.h60
-rw-r--r--src/components/time_tester/include/time_tester/time_manager.h76
-rw-r--r--src/components/time_tester/include/time_tester/transport_manager_observer.h60
-rw-r--r--src/components/time_tester/src/application_manager_observer.cc60
-rw-r--r--src/components/time_tester/src/time_manager.cc189
-rw-r--r--src/components/time_tester/src/transport_manager_observer.cc60
-rw-r--r--src/components/time_tester/test/CMakeLists.txt93
-rw-r--r--src/components/time_tester/test/application_manager_metric_test.cc118
-rw-r--r--src/components/time_tester/test/application_manager_observer_test.cc59
-rw-r--r--src/components/time_tester/test/include/time_manager_mock.h57
-rw-r--r--src/components/time_tester/test/log4cxx.properties19
-rw-r--r--src/components/time_tester/test/metric_wrapper_test.cc82
-rw-r--r--src/components/time_tester/test/protocol_handler_metric_test.cc119
-rw-r--r--src/components/time_tester/test/protocol_handler_observer_test.cc81
-rw-r--r--src/components/time_tester/test/time_manager_test.cc72
-rw-r--r--src/components/time_tester/test/transport_manager_metric_test.cc110
-rw-r--r--src/components/time_tester/test/transport_manager_observer_test.cc58
-rw-r--r--src/components/transport_manager/CMakeLists.txt103
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_connection_factory.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device.h7
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h6
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_socket_connection.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/dnssd_service_browser.h24
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h34
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_connection_factory.h13
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_device.h15
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_socket_connection.h10
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h10
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/client_connection_listener.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/connection.h9
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/device_scanner.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/server_connection_factory.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h26
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h51
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_manager_impl.h23
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h20
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/qnx/platform_usb_device.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/qnx/usb_connection.h8
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/qnx/usb_handler.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_connection_factory.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h7
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc2
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_device.cc7
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc71
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc5
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc6
-rw-r--r--src/components/transport_manager/src/tcp/dnssd_service_browser.cc183
-rw-r--r--src/components/transport_manager/src/tcp/tcp_client_listener.cc184
-rw-r--r--src/components/transport_manager/src/tcp/tcp_connection_factory.cc35
-rw-r--r--src/components/transport_manager/src/tcp/tcp_device.cc88
-rw-r--r--src/components/transport_manager/src/tcp/tcp_socket_connection.cc52
-rw-r--r--src/components/transport_manager/src/tcp/tcp_transport_adapter.cc71
-rw-r--r--src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc234
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc226
-rw-r--r--src/components/transport_manager/src/transport_manager_default.cc4
-rw-r--r--src/components/transport_manager/src/transport_manager_impl.cc70
-rw-r--r--src/components/transport_manager/src/usb/libusb/platform_usb_device.cc2
-rw-r--r--src/components/transport_manager/src/usb/libusb/usb_connection.cc3
-rw-r--r--src/components/transport_manager/src/usb/libusb/usb_handler.cc52
-rw-r--r--src/components/transport_manager/src/usb/qnx/platform_usb_device.cc2
-rw-r--r--src/components/transport_manager/src/usb/qnx/usb_connection.cc15
-rw-r--r--src/components/transport_manager/src/usb/qnx/usb_handler.cc2
-rw-r--r--src/components/transport_manager/src/usb/usb_aoa_adapter.cc4
-rw-r--r--src/components/transport_manager/src/usb/usb_connection_factory.cc2
-rw-r--r--src/components/transport_manager/src/usb/usb_device_scanner.cc92
-rw-r--r--src/components/transport_manager/test/CMakeLists.txt82
-rw-r--r--src/components/transport_manager/test/dnssd_service_browser_test.cc147
-rw-r--r--src/components/transport_manager/test/include/client_connection_listener_mock.h62
-rw-r--r--src/components/transport_manager/test/include/connection_mock.h56
-rw-r--r--src/components/transport_manager/test/include/device_mock.h70
-rw-r--r--src/components/transport_manager/test/include/device_scanner_mock.h58
-rw-r--r--src/components/transport_manager/test/include/mock_application.h80
-rw-r--r--src/components/transport_manager/test/include/mock_connection.h69
-rw-r--r--src/components/transport_manager/test/include/mock_connection_factory.h69
-rw-r--r--src/components/transport_manager/test/include/mock_device.h82
-rw-r--r--src/components/transport_manager/test/include/mock_device_scanner.h76
-rw-r--r--src/components/transport_manager/test/include/mock_transport_adapter.h62
-rw-r--r--src/components/transport_manager/test/include/mock_transport_adapter_listener.h94
-rw-r--r--src/components/transport_manager/test/include/mock_transport_manager_listener.h103
-rw-r--r--src/components/transport_manager/test/include/raw_message_matcher.h75
-rw-r--r--src/components/transport_manager/test/include/server_connection_factory_mock.h57
-rw-r--r--src/components/transport_manager/test/include/time_metric_observer_mock.h55
-rw-r--r--src/components/transport_manager/test/include/transport_adapter_controller_mock.h92
-rw-r--r--src/components/transport_manager/test/include/transport_adapter_listener_mock.h123
-rw-r--r--src/components/transport_manager/test/include/transport_adapter_mock.h104
-rw-r--r--src/components/transport_manager/test/include/transport_manager_impl_mock.h54
-rw-r--r--src/components/transport_manager/test/include/transport_manager_listener_mock.h89
-rw-r--r--src/components/transport_manager/test/include/transport_manager_mock.h87
-rw-r--r--src/components/transport_manager/test/mock_application.cc147
-rw-r--r--src/components/transport_manager/test/mock_connection.cc78
-rw-r--r--src/components/transport_manager/test/mock_connection_factory.cc63
-rw-r--r--src/components/transport_manager/test/mock_device.cc85
-rw-r--r--src/components/transport_manager/test/mock_device_scanner.cc103
-rw-r--r--src/components/transport_manager/test/mock_transport_adapter.cc57
-rw-r--r--src/components/transport_manager/test/raw_message_matcher.cc65
-rw-r--r--src/components/transport_manager/test/smartDeviceLink_test.ini55
-rw-r--r--src/components/transport_manager/test/tcp_client_listener_test.cc101
-rw-r--r--src/components/transport_manager/test/tcp_device_test.cc105
-rw-r--r--src/components/transport_manager/test/tcp_transport_adapter_test.cc358
-rw-r--r--src/components/transport_manager/test/transport_adapter_listener_test.cc224
-rw-r--r--src/components/transport_manager/test/transport_adapter_test.cc743
-rw-r--r--src/components/transport_manager/test/transport_manager_default_test.cc46
-rw-r--r--src/components/transport_manager/test/transport_manager_impl_test.cc717
-rw-r--r--src/components/transport_manager/test/transport_manager_instance_test.cc73
-rw-r--r--src/components/transport_manager/test/transport_manager_test.cc394
-rw-r--r--src/components/utils/CMakeLists.txt90
-rw-r--r--src/components/utils/include/utils/back_trace.h6
-rw-r--r--src/components/utils/include/utils/bitstream.h2
-rw-r--r--src/components/utils/include/utils/file_system.h28
-rw-r--r--src/components/utils/include/utils/gen_hash.h50
-rw-r--r--src/components/utils/include/utils/helpers.h119
-rw-r--r--src/components/utils/include/utils/log_message_loop_thread.h1
-rw-r--r--src/components/utils/include/utils/resource_usage.h13
-rw-r--r--src/components/utils/include/utils/signals.h72
-rw-r--r--src/components/utils/include/utils/singleton.h19
-rw-r--r--src/components/utils/include/utils/stl_utils.h27
-rw-r--r--src/components/utils/include/utils/system.h5
-rw-r--r--src/components/utils/include/utils/threads/pulse_thread_delegate.h4
-rw-r--r--src/components/utils/include/utils/threads/thread_validator.h11
-rw-r--r--src/components/utils/src/appenders_loader.cc2
-rw-r--r--src/components/utils/src/back_trace.cc4
-rw-r--r--src/components/utils/src/bitstream.cc2
-rw-r--r--src/components/utils/src/conditional_variable_posix.cc23
-rw-r--r--src/components/utils/src/date_time.cc81
-rw-r--r--src/components/utils/src/file_system.cc42
-rw-r--r--src/components/utils/src/gen_hash.cc53
-rw-r--r--src/components/utils/src/lock_posix.cc57
-rw-r--r--src/components/utils/src/logger_status.cc2
-rw-r--r--src/components/utils/src/resource_usage.cc6
-rw-r--r--src/components/utils/src/rwlock_posix.cc30
-rw-r--r--src/components/utils/src/signals_linux.cc83
-rw-r--r--src/components/utils/src/system.cc21
-rw-r--r--src/components/utils/src/threads/posix_thread.cc293
-rw-r--r--src/components/utils/src/threads/pulse_thread_delegate.cc4
-rw-r--r--src/components/utils/src/threads/thread_delegate.cc6
-rw-r--r--src/components/utils/src/threads/thread_validator.cc15
-rw-r--r--src/components/utils/test/CMakeLists.txt110
-rw-r--r--src/components/utils/test/async_runner_test.cc141
-rw-r--r--src/components/utils/test/atomic_object_test.cc55
-rw-r--r--src/components/utils/test/auto_trace_test.cc102
-rw-r--r--src/components/utils/test/back_trace_test.cc (renamed from src/components/policy/test/main.cc)23
-rw-r--r--src/components/utils/test/bitstream_test.cc230
-rw-r--r--src/components/utils/test/conditional_variable_test.cc132
-rw-r--r--src/components/utils/test/data_accessor_test.cc140
-rw-r--r--src/components/utils/test/date_time_test.cc392
-rw-r--r--src/components/utils/test/file_system_test.cc1165
-rw-r--r--src/components/utils/test/lock_posix_test.cc123
-rw-r--r--src/components/utils/test/log4cxx.properties11
-rw-r--r--src/components/utils/test/log_message_loop_thread_test.cc96
-rw-r--r--src/components/utils/test/main.cc7
-rw-r--r--src/components/utils/test/message_queue_test.cc169
-rw-r--r--src/components/utils/test/messagemeter_test.cc2
-rw-r--r--src/components/utils/test/policy.sql295
-rw-r--r--src/components/utils/test/posix_thread_test.cc312
-rw-r--r--src/components/utils/test/prioritized_queue_test.cc205
-rwxr-xr-xsrc/components/utils/test/qdbserver.sh6
-rw-r--r--src/components/utils/test/resource_usage_test.cc98
-rw-r--r--src/components/utils/test/rwlock_posix_test.cc143
-rw-r--r--src/components/utils/test/scope_guard_test.cc121
-rw-r--r--src/components/utils/test/shared_ptr_test.cc544
-rw-r--r--src/components/utils/test/signals_linux_test.cc55
-rw-r--r--src/components/utils/test/singleton_test.cc189
-rw-r--r--src/components/utils/test/stl_utils_test.cc108
-rw-r--r--src/components/utils/test/system_test.cc125
-rw-r--r--src/components/utils/test/test-qdb.ini11
-rwxr-xr-xsrc/components/utils/test/testscript.sh5
-rw-r--r--src/components/utils/test/thread_validator_test.cc53
-rw-r--r--src/components/utils/test/timer_thread_test.cc153
-rw-r--r--test/CMakeLists.txt15
-rw-r--r--test/components/CMakeLists.txt12
-rw-r--r--test/components/application_manager/CMakeLists.txt2
-rw-r--r--test/components/application_manager/formatters_commands.h2
-rw-r--r--test/components/application_manager/generated_factory.h2
-rw-r--r--test/components/connection_handler/CMakeLists.txt1
-rw-r--r--test/components/connection_handler/include/connection_handler/heart_beat_monitor_test.h32
-rw-r--r--test/components/include/protocol_handler/control_message_matcher.h48
-rw-r--r--test/components/include/protocol_handler/protocol_handler_mock.h4
-rw-r--r--test/components/include/protocol_handler/protocol_observer_mock.h4
-rw-r--r--test/components/include/protocol_handler/session_observer_mock.h2
-rw-r--r--test/components/include/transport_manager/transport_manager_mock.h2
-rw-r--r--test/components/protocol_handler/CMakeLists.txt3
-rw-r--r--test/components/protocol_handler/include/protocol_handler/protocol_handler_mock.h35
-rw-r--r--test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h192
-rw-r--r--test/components/rpc_base/CMakeLists.txt2
-rw-r--r--test/components/security_manager/CMakeLists.txt24
-rw-r--r--test/components/security_manager/include/security_manager/security_manager_mock.h7
-rw-r--r--test/components/security_manager/include/security_manager/security_manager_test.h4
-rw-r--r--test/components/transport_manager/CMakeLists.txt4
-rw-r--r--test/components/transport_manager/include/transport_manager/mock_transport_adapter_listener.h2
-rw-r--r--test/components/transport_manager/include/transport_manager/raw_message_matcher.h5
-rw-r--r--test/components/transport_manager/src/mock_connection.cc6
-rw-r--r--test/components/transport_manager/src/raw_message_matcher.cc68
-rw-r--r--test/components/transport_manager/src/test_dnssd_service_browser.cc2
-rw-r--r--test/components/transport_manager/src/test_tcp_transport_adapter.cc39
-rw-r--r--test/components/transport_manager/transport_manager_instance_test.cc399
-rw-r--r--test/test_suit.cc10
-rw-r--r--tools/intergen/tmp/intergen-cfgcmd.txt1
-rw-r--r--tools/intergen/tmp/intergen-cfgcmd.txt.in1
1605 files changed, 78743 insertions, 52123 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a9d8be65b..b5cf7d118 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,19 +38,17 @@ set (HMI "web" CACHE STRING "HMI type")
option(HMI2 "Use Qt HMI" OFF)
option(EXTENDED_MEDIA_MODE "Turn on and off extended Madia Manager features relates to PulseAudio A2DP and GStreamer" OFF)
option(BUILD_SHARED_LIBS "Build all libraries as shared (if ON) or static (if OFF)" OFF)
-option(BUILD_BT_SUPPORT "Bluetooth support" OFF)
-option(BUILD_USB_SUPPORT "libusb support" OFF)
-option(BUILD_AOA_SUPPORT "libaoa support" OFF)
-option(BUILD_MME_SUPPORT "Apple devices support" OFF)
-option(BUILD_AVAHI_SUPPORT "libavahi support" OFF)
-option(BUILD_RWLOCK_SUPPORT "rwlocks support" OFF)
+option(BUILD_BT_SUPPORT "Bluetooth support" ON)
+option(BUILD_USB_SUPPORT "libusb support" ON)
+option(BUILD_AVAHI_SUPPORT "libavahi support" ON)
option(BUILD_BACKTRACE_SUPPORT "backtrace support" ON)
option(BUILD_TESTS "Possibility to build and run tests" OFF)
option(TIME_TESTER "Enable profiling time test util" ON)
option(ENABLE_LOG "Logging feature" ON)
option(ENABLE_GCOV "gcov code coverage feature" OFF)
+option(ENABLE_SANITIZE "Sanitize tool" OFF)
option(ENABLE_SECURITY "Security Ford protocol protection" ON)
-option(EXTENDED_POLICY_FLAG "Build with specific features and extended functionality" OFF)
+option(ENABLE_HMI_PTU_DECRYPTION "Policy table update parsed by hmi" ON)
set(OS_TYPE_OPTION "$ENV{OS_TYPE}")
set(DEBUG_OPTION "$ENV{DEBUG}")
@@ -62,24 +60,10 @@ set(ENABLE_LOG_OPTION "$ENV{ENABLE_LOG}")
set(ARCH_TYPE_OPTION "$ENV{ARCH_TYPE}")
set(POLICY_OPTION "$ENV{POLICY_TYPE}")
set(SECURITY_OPTION "$ENV{SECURITY_MODE}")
+set(COMPONENTS_DIR ${CMAKE_SOURCE_DIR}/src/components)
+set(SNAPSHOT_TAG "$ENV{SNAPSHOT_TAG}")
-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 .
- DEPENDS HMI_API MOBILE_API v4_protocol_v1_2_no_extra
-)
-
-add_custom_target(ford-tarball
- COMMAND ${CMAKE_SOURCE_DIR}/tools/Utils/export-customer-specific.sh ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} FORD
- COMMAND tar -czv -C /tmp/FORD -f ${CMAKE_BINARY_DIR}/ford.tar.gz .
- DEPENDS HMI_API MOBILE_API v4_protocol_v1_2_no_extra
-)
-add_custom_target(genivi-tarball
- COMMAND ${CMAKE_SOURCE_DIR}/tools/Utils/export-customer-specific.sh ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} genivi
- COMMAND tar -czv -C /tmp/GENIVI -f ${CMAKE_BINARY_DIR}/genivi.tar.gz .
- DEPENDS HMI_API MOBILE_API v4_protocol_v1_2_no_extra
-)
if (ARCH_TYPE_OPTION)
if (NOT (${ARCH_TYPE_OPTION} STREQUAL "x86") AND NOT (${ARCH_TYPE_OPTION} STREQUAL "armv7"))
@@ -150,12 +134,6 @@ if (ENABLE_LOG_OPTION)
endif()
endif()
-if (POLICY_OPTION)
- if (${POLICY_OPTION} STREQUAL "EXTENDED_POLICY")
- message(STATUS "Jenkins integration: Extended policy is used")
- set (EXTENDED_POLICY_FLAG ON)
- endif()
-endif()
if (SECURITY_OPTION)
if (${SECURITY_OPTION} STREQUAL "SEC_OFF")
@@ -164,9 +142,26 @@ if (SECURITY_OPTION)
endif()
endif()
-
#Jenkins integration section end
+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 .
+ DEPENDS HMI_API MOBILE_API v4_protocol_v1_2_no_extra
+)
+
+add_custom_target(ford-tarball
+ COMMAND ${CMAKE_SOURCE_DIR}/tools/Utils/export-customer-specific.sh ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ford
+ COMMAND tar -cz -C /tmp/FORD -f ${CMAKE_BINARY_DIR}/ford.tar.gz .
+ DEPENDS HMI_API MOBILE_API v4_protocol_v1_2_no_extra
+)
+
+add_custom_target(genivi-tarball
+ COMMAND ${CMAKE_SOURCE_DIR}/tools/Utils/export-customer-specific.sh ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} genivi
+ COMMAND tar -cz -C /tmp/GENIVI -f ${CMAKE_BINARY_DIR}/genivi.tar.gz .
+)
+
+
project (${PROJECT})
#ADD_DEPENDENCIES(${PROJECT} Policy)
@@ -177,17 +172,18 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# flag is handled by CMake
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR})
set(ARCHIVE_OUTPUT_DIRECTORY ./bin)
-set(CMAKE_CXX_FLAGS "-fPIC -g3 -ggdb3 -std=gnu++0x -Wall -Werror -Wuninitialized")
-if (ENABLE_GCOV)
+
+set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror -Wuninitialized -Wvla")
+
+if(ENABLE_SANITIZE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
+endif()
+if(ENABLE_GCOV)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
add_definitions(-DGCOV_ENABLED)
endif()
-set(CMAKE_CXX_FLAGS_RELEASE "-fPIC -s -O2") #It will be appended to CMAKE_CXX_FLAGS in release
-
-#include_directories(
-# ../../../src/components/policy/
-# ../../../src/components/rpc_base/
-#)
+set(CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG -s -O2")
+set(CMAKE_CXX_FLAGS_DEBUG " -DDEBUG -g3 -ggdb3")
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_definitions(-DOS_LINUX)
@@ -219,10 +215,6 @@ if (BUILD_AVAHI_SUPPORT)
message(STATUS "Avahi support is enabled")
endif()
-if (BUILD_RWLOCK_SUPPORT)
- add_definitions(-DRWLOCK_SUPPORT)
-endif()
-
if (BUILD_BACKTRACE_SUPPORT)
add_definitions(-DBACKTRACE_SUPPORT)
endif()
@@ -239,16 +231,6 @@ endif()
# TODO(AK): check current OS here
add_definitions(-DOS_POSIX)
-# FIXME(DC): weird logic
-IF(CMAKE_C_FLAGS_DEBUG)
- SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG" )
- add_definitions(-DDEBUG)
-ELSE (CMAKE_C_FLAGS_DEBUG)
- SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRELEASE" )
- add_definitions(-DRELEASE)
-ENDIF(CMAKE_C_FLAGS_DEBUG)
-
-
if (EXTENDED_MEDIA_MODE)
add_definitions(-DEXTENDED_MEDIA_MODE)
# required to find 'glibconfig.h'
@@ -257,6 +239,7 @@ pkg_check_modules(GLIB2 REQUIRED glib-2.0)
add_definitions(${GLIB2_CFLAGS})
endif()
+
# --- Interface generator
find_package(PythonInterp)
@@ -316,9 +299,8 @@ macro (GenerateInterface arg_xml_name arg_namespace parser_type)
)
include_directories (
- ../../../src/components/smart_objects/include
- ../../../src/components/formatters/include/
- ${CMAKE_SOURCE_DIR}/src/components/formatters/include/
+ ${COMPONENTS_DIR}/smart_objects/include
+ ${COMPONENTS_DIR}/formatters/include/
${CMAKE_BINARY_DIR}
)
@@ -327,14 +309,17 @@ endmacro(GenerateInterface)
# --- Useful macro
macro(create_test NAME SOURCES LIBS)
- add_executable("${NAME}" ${SOURCES})
- target_link_libraries("${NAME}" ${LIBS})
- target_link_libraries("${NAME}" Utils)
- if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
- add_test(${NAME} ${CMAKE_SOURCE_DIR}/qnx/remote_run_test.sh ${NAME})
- else()
- add_test(${NAME} ${NAME})
- endif()
+ add_executable("${NAME}" ${CMAKE_SOURCE_DIR}/src/components/test_main.cc ${SOURCES})
+ target_link_libraries("${NAME}" ${LIBS})
+ target_link_libraries("${NAME}" Utils)
+ if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ add_test(${NAME} ${CMAKE_SOURCE_DIR}/qnx/remote_run_test.sh ${NAME})
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ add_test(NAME ${NAME}
+ COMMAND ${NAME} --gtest_output=xml:${CMAKE_BINARY_DIR}/test_results/)
+ else()
+ add_test(${NAME} ${NAME})
+ endif()
endmacro(create_test)
# --replace in list macro
@@ -388,8 +373,8 @@ endif()
# --- Directory with SDL interfaces, global types and ProtocolLib component
include_directories(
- ${CMAKE_SOURCE_DIR}/src/components/include
- ${CMAKE_SOURCE_DIR}/src/components/protocol/include
+ ${COMPONENTS_DIR}/include
+ ${COMPONENTS_DIR}/protocol/include
)
# --- 3rd party libs
@@ -400,66 +385,219 @@ set(3RD_PARTY_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src/3rd_party)
set (install-3rd_party_logger_var "")
set (install-3rd_party_dbus_var "")
-set (is_logger_actual 1)
-set (is_dbus_actual 1)
-set (is_git_folder 1)
-execute_process(
- COMMAND /bin/bash -c "cd ${CMAKE_CURRENT_SOURCE_DIR} && git log . 1>/dev/null 2>&1; if [ $? == 0 ]; then exit 0; else exit 1; fi"
- RESULT_VARIABLE is_git_folder
-)
-if(ENABLE_LOG)
- #build logger
- if(is_git_folder EQUAL 0)
- execute_process(
- COMMAND /bin/bash -c "cd ${CMAKE_CURRENT_SOURCE_DIR} && grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 1>/dev/null 2>&1; if [ $? == 0 ]; then VAR1=\$(readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 2>/dev/null); VAR1=\$(echo $VAR1 | awk '{print \$NF}'); VAR2=\$(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/apache-log4cxx-0.10.0); if [[ \$VAR1 == \$VAR2 ]]; then exit 0; else exit 1; fi; else exit 1; fi"
- RESULT_VARIABLE is_logger_actual
- )
- endif()
- if(is_logger_actual EQUAL 0)
- message(STATUS "Logger is actual.")
+if(NO_REBUILD_3RD_PARTY)
+ set(NO_REBUILD_3RD_PARTY_LOGGER ON)
+ set(NO_REBUILD_3RD_PARTY_DBUS ON)
+endif()
+
+if(FORCE_3RD_PARTY)
+ if(NO_REBUILD_3RD_PARTY)
+ message(FATAL_ERROR "Please don't turn on both FORCE_3RD_PARTY and NO_REBUILD_3RD_PARTY at the same time.")
else()
- message(STATUS "Need to rebuild logger.")
+ set(FORCE_3RD_PARTY_LOGGER ON)
+ set(FORCE_3RD_PARTY_DBUS ON)
+ endif()
+endif()
- add_custom_target(3rd_party_logger
- make
- WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
- )
- #install logger
- #install either to default place with sudo or none-default plase without sudo.
- #to install with sudo to none-default place use manual installation
- add_custom_target(install-3rd_party_logger
- COMMAND /bin/bash -c \"if [ ! ${is_logger_actual} == 0 ]\; then USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\; if [[ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]]\; then sudo make install\; else make install\; fi\; fi\"
- DEPENDS 3rd_party_logger
- WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
- )
+if(ENABLE_LOG)
+ if(NO_REBUILD_3RD_PARTY_LOGGER)
+ message(STATUS "Not rebuilding logger.")
+ else()
+ if(FORCE_3RD_PARTY_LOGGER)
+ message(STATUS "Force to rebuild logger.")
+
+ #build logger
+ add_custom_target(3rd_party_logger
+ make
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+
+ #install logger
+ #install either to default place with sudo or non-default plase without sudo.
+ #to install with sudo to non-default place use manual installation
+ add_custom_target(install-3rd_party_logger
+ COMMAND /bin/bash -c \"USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
+ if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
+ sudo -k \;
+ sudo make install\;
+ else
+ make install\;
+ fi\"
+ DEPENDS 3rd_party_logger
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+ else()
+ #build logger
+ add_custom_target(3rd_party_logger
+ COMMAND /bin/bash -c \"cd ${CMAKE_CURRENT_SOURCE_DIR} &&
+ grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]\; then
+ VAR1=\\$$\( readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 2>/dev/null\)\;
+ VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\;
+ VAR2=-1\;
+ cd ${CMAKE_CURRENT_SOURCE_DIR}\;
+ git log . 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]; then
+ VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/apache-log4cxx-0.10.0\)\;
+ fi\;
+ if [ \\$$VAR1 != \\$$VAR2 ]\; then
+ echo " Need to rebuild logger. " \;
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make\;
+ else
+ echo " Logger is actual. " \;
+ fi\;
+ else
+ echo " Need to build logger. " \;
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make\;
+ fi\"
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+
+ #install logger
+ #install either to default place with sudo or non-default plase without sudo.
+ #to install with sudo to non-default place use manual installation
+ add_custom_target(install-3rd_party_logger
+ COMMAND /bin/bash -c \"cd ${CMAKE_CURRENT_SOURCE_DIR} &&
+ grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]\; then
+ VAR1=\\$$\( readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 2>/dev/null\)\;
+ VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\;
+ VAR2=-1\;
+ cd ${CMAKE_CURRENT_SOURCE_DIR}\;
+ git log . 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]; then
+ VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/apache-log4cxx-0.10.0\)\;
+ fi\;
+ if [ \\$$VAR1 != \\$$VAR2 ]\; then
+ USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
+ if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ sudo -k \;
+ sudo make install\;
+ else
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make install\;
+ fi\;
+ fi\;
+ else
+ USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
+ if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ sudo -k \;
+ sudo make install\;
+ else
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make install\;
+ fi\;
+ fi\"
+ DEPENDS 3rd_party_logger
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+ endif()
+
set (install-3rd_party_logger_var "install-3rd_party_logger")
endif()
endif()
if (HMIADAPTER STREQUAL "dbus")
-#build d-bus
- execute_process(
- COMMAND /bin/bash -c "grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 1>/dev/null 2>&1; if [ $? == 0 ]; then VAR1=\$(readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 2>/dev/null); VAR1=\$(echo $VAR1 | awk '{print \$NF}'); VAR2=\$(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/dbus-1.7.8); if [[ \$VAR1 == \$VAR2 ]]; then exit 0; else exit 1; fi; else exit 1; fi"
- RESULT_VARIABLE is_dbus_actual
- )
- if(is_dbus_actual EQUAL 0)
- message(STATUS "D-Bus is actual.")
+ if(NO_REBUILD_3RD_PARTY_DBUS)
+ message(STATUS "Not rebuilding D-Bus.")
else()
- message(STATUS "Need to rebuild D-Bus.")
-
- add_custom_target(3rd_party_dbus
- make
- WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
- )
- #install d-bus
- #install either to default place with sudo or none default plase without sudo.
- #to install with sudo to none default place use manual installation
- add_custom_target(install-3rd_party_dbus
- COMMAND /bin/bash -c \"if [ ! ${is_dbus_actual} == 0 ]\; then USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\; if [[ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]]\; then sudo make install\; else make install\; fi\; fi\"
- DEPENDS 3rd_party_dbus
- WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
- )
+ if(FORCE_3RD_PARTY_DBUS)
+ message(STATUS "Force to rebuild D-Bus.")
+
+ #build d-bus
+ add_custom_target(3rd_party_dbus
+ make
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+
+ #install d-bus
+ #install either to default place with sudo or non-default plase without sudo.
+ #to install with sudo to non-default place use manual installation
+ add_custom_target(install-3rd_party_dbus
+ COMMAND /bin/bash -c \"USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
+ if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
+ sudo -k \;
+ sudo make install\;
+ else
+ make install\;
+ fi\"
+ DEPENDS 3rd_party_dbus
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+ else()
+ #build d-bus
+ add_custom_target(3rd_party_dbus
+ COMMAND /bin/bash -c \"grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]\; then
+ VAR1=\\$$\(readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 2>/dev/null\)\;
+ VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\;
+ VAR2=-1\;
+ cd ${CMAKE_CURRENT_SOURCE_DIR}\;
+ git log . 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]; then
+ VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/dbus-1.7.8\)\;
+ fi\;
+ if [ \\$$VAR1 != \\$$VAR2 ]\; then
+ echo " Need to rebuild D-Bus. " \;
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make\;
+ else
+ echo " D-Bus is actual. " \;
+ fi\;
+ else
+ echo " Need to build D-Bus. " \;
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make\;
+ fi\"
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+
+ #install d-bus
+ #install either to default place with sudo or non-default plase without sudo.
+ #to install with sudo to non-default place use manual installation
+ add_custom_target(install-3rd_party_dbus
+ COMMAND /bin/bash -c \"grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]\; then
+ VAR1=\\$$\(readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 2>/dev/null\)\;
+ VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\;
+ VAR2=-1\;
+ cd ${CMAKE_CURRENT_SOURCE_DIR}\;
+ git log . 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]; then
+ VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/dbus-1.7.8\)\;
+ fi\;
+ if [ \\$$VAR1 != \\$$VAR2 ]\; then
+ USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
+ if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ sudo -k \;
+ sudo make install\;
+ else
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make install\;
+ fi\;
+ fi\;
+ else
+ USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\;
+ if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ sudo -k \;
+ sudo make install\;
+ else
+ cd ${3RD_PARTY_BINARY_DIRECTORY}\;
+ make install\;
+ fi\;
+ fi\"
+ DEPENDS 3rd_party_dbus
+ WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
+ )
+ endif()
+
set (install-3rd_party_dbus_var "install-3rd_party_dbus")
endif()
endif()
@@ -471,11 +609,20 @@ add_custom_target(install-3rd_party
WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
)
+if(ENABLE_LOG)
+ include_directories ( ${LOG4CXX_INCLUDE_DIRECTORY} )
+endif()
+
if(ENABLE_SECURITY)
add_definitions(-DENABLE_SECURITY)
set(SecurityManagerLibrary SecurityManager)
- set(SecurityManagerIncludeDir ${CMAKE_SOURCE_DIR}/src/components/security_manager/include)
- set(SecurityManagerTestIncludeDir ${CMAKE_SOURCE_DIR}/test/components/security_manager/include)
+ set(SecurityManagerIncludeDir ${COMPONENTS_DIR}/security_manager/include)
+ #set(SecurityManagerTestIncludeDir ${CMAKE_SOURCE_DIR}/test/components/security_manager/include)
+endif()
+
+if(ENABLE_HMI_PTU_DECRYPTION)
+ MESSAGE("USE DHMI_PTU_PARSER")
+ add_definitions(-DUSE_HMI_PTU_DECRYPTION)
endif()
set(RTLIB rt)
@@ -498,6 +645,7 @@ add_subdirectory(./src/3rd_party-static)
# --- Tools
add_subdirectory(./tools)
+
# --- Components
add_subdirectory(./src/components)
@@ -514,8 +662,8 @@ if(BUILD_TESTS)
include(Dart)
#add_subdirectory(./test)
endif()
-
-# Building documentation
+
+# Building documentation
# At first creating directory for generated documentation. Unfortunately doxygen
# cannot generate it byself
diff --git a/README.md b/README.md
index d32d67878..60217e566 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ Pull Requests Welcome!
* [Software Architecture Document](https://app.box.com/s/v5ymu5kathzkwfx8iigxxdpr7d5a2xhh)
* [Transport Manager Programming Guide](https://app.box.com/s/1pjquttvmhf19uujtw4x4fv4t1leqasa)
* [Software Detailed Design](https://app.box.com/s/ohgrvemtx39f8hfea1ab676xxrzvyx1y)
- * [Integration Guidelines](https://app.box.com/s/jkj51mkaa5uganbhjxmtv06lbs8hapa9)
+ * [Integration Guidelines](https://app.box.com/s/ohcgjv61cykgkuhycglju6cc4efr0ym3)
## SDL Core
@@ -49,6 +49,12 @@ Once SDL Core is compiled and installed you can start it from the executable in
%./smartDeviceLinkCore
```
+## Start WEB HMI
+Web HMI is separated from SDL Core and located in another repository. So to make it workable please do next steps.
+
+ 1. Clone http://github.com/smartdevicelink/sdl_hmi.git
+ 2. Follow the instruction from readme file in sdl_hmi repository.
+
## A quick note about dependencies
The dependencies for SDL Core vary based on the configuration. You can change SDL Core's configuration in the top level CMakeLists.txt. We have defaulted this file to a configuration which we believe is common for people who are interested in getting up and running quickly, generally on a Linux VM.
@@ -107,6 +113,54 @@ There are several RPCs that are "required" to be implemented in order for SDL to
* OnSystemRequest
* Speak
+## App Launching
+
+Below are instructions for testing app launching and query with a full system set up.
+
+### SDL Server
+The app querying specification defines an endpoint within Policies where sdl_core will reach out to receive a list of applications that can be launched. The SDL Server provides the back end functionality for app launching and querying.
+
+You can find the SDL Server on [GitHub](https://github.com/smartdevicelink/sdl_server). The README contains detailed instructions for installing and launching the server. Launch the server on your local machine, and direct your browser to http://localhost:3000. Note that you need `mongod` running on your machine before launching the server.
+
+The [App Launching Server Specification](https://github.com/smartdevicelink/sdl_server/blob/master/docs/application_launching_v1.0.md) defines an endpoint `/applications/available/:moduleId.json` which return a list of applications available for launching to the handset for filtering.
+
+To check if there is a module already available you can go to http://localhost:3000/modules.json. If there is a module available, there will be one or more objects in the response array. Keep this response, you'll need the "_id" field for later.
+
+If there is not a module already available, go to http://localhost:3000/cars and define a new vehicle, then check http://localhost:3000/modules.json.
+
+Next, you'll need to define applications that can be launched. Go to http://localhost:3000/apps and define some applications. Make sure that you define a url scheme under the iOS tab of the application. This is required for an application to be launched from SDL. A URL scheme has the format `someScheme://`. Save the URL Scheme you used for later steps.
+
+You'll also need the local ip address of your machine
+
+At the end of the SDL Server set up you should have
+ 1. SDL Server running on your local machine connected to mongo db
+ 2. Your machine's local IP Address
+ 3. The module id of your vehicle
+ 4. The URL Scheme of the app you want to launch
+
+### Mobile
+You need at least one app installed on the test device (presumably an iPhone), which we have built for you, the [V4Tester application](https://app.box.com/s/eeloquc0fhqfmxjjubw7kousf12f3pzg). This application implements SDL 4.0 and will respond to SDL Core's QUERY_APPS system request, as well as filter the response for available applications. If you do not have any other applications on the device, you can only test QUERY_APPS functionality, in which no applications will be sent to sdl core which can be launched.
+
+In order to support the launching of an application, you'll have to create an additional app which responds to the URL Scheme of the application that you set up on the SDL Server. To do so, go to Xcode, select File>New>Project... and under ios/application create a Single View Application. Open the application's Info.plist file (under the Supporting Files section of the project explorer by default). Highlight the Information Property List item and click the plus button to add a new entry to the Property List. From the drop down menu, select URL Types as the key. In the Item 0 dictionary add a "URL Schemes" Array, and make Item 0 in the array the prefix to the URL you previously defined (So if you defined `someScheme://` then Item 0 should be "someScheme"). Make sure the URL identifier matches your application's identifier. When you're finished you should have something that looks like the following. Install this application on your test device. **Note** - this application will only launch during this process, since it is not SDL Connected it will not register with the head unit.
+
+![Plist Example](http://i.imgur.com/AFyJlZQ.png)
+
+At the end of the Mobile device set up you should have
+ 1. The V4 Tester Application installed on your device
+ 2. An application for launching that matches the application submitted to SDL Server
+ 3. Your iPhone should be on the same network as the machine running SDL Server
+
+### SDL Core
+Take the following steps to launch applications from sdl core.
+
+ 1. Install the [correct version of SDL Core](https://github.com/smartdevicelink/sdl_core/pull/39)
+ 2. Add the queryAppsUrl that you saved during sdl server set up in the src/appMain/preloaded_pt.json under the "endpoints" property in the format `http://[local machine ip]:3000/applications/available[moduleId].json`. For example `http://192.168.0.150:3000/applications/available/789b739c47c7490321058200.json`.
+ 3. Run SDL Core
+ 4. Launch the V4 Tester application on the iPhone
+ 5. Connect the application via wifi by entering the IP address of Core into the V4 tester
+ 6. Both applications should show up on the head unit for launching
+ 7. Select the other application, and you should see it launched and brought to the foreground on the phone
+
## Contributions
Conversation regarding the design and development of SmartDeviceLink technology should be directed at the [GENIVI mailing list](https://lists.genivi.org/mailman/listinfo/genivi-smartdevicelink), which anyone can join. Public conference calls regarding the SmartDeviceLink technology will be announced to the GENIVI mailing list, we expect to have conversations every other week. We also encourage interested parties to write issues against our software, and submit pull requests right here in the GitHub repository.
diff --git a/cmake/Modules/FindSqlite3.cmake b/cmake/Modules/FindSqlite3.cmake
index 80d40733c..514ff0b7f 100644
--- a/cmake/Modules/FindSqlite3.cmake
+++ b/cmake/Modules/FindSqlite3.cmake
@@ -1,48 +1,81 @@
-# - find Sqlite 3
-# SQLITE3_INCLUDE_DIR - Where to find Sqlite 3 header files (directory)
-# SQLITE3_LIBRARIES - Sqlite 3 libraries
-# SQLITE3_LIBRARY_RELEASE - Where the release library is
-# SQLITE3_LIBRARY_DEBUG - Where the debug library is
-# SQLITE3_FOUND - Set to TRUE if we found everything (library, includes and executable)
-# Copyright (c) 2010 Pau Garcia i Quiles, <pgquiles@elpauer.org>
+# - Try to find Sqlite3
+# Once done this will define
#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+# SQLITE3_FOUND - system has Sqlite3
+# SQLITE3_INCLUDE_DIRS - the Sqlite3 include directory
+# SQLITE3_LIBRARIES - Link these to use Sqlite3
+# SQLITE3_DEFINITIONS - Compiler switches required for using Sqlite3
#
-# Generated by CModuler, a CMake Module Generator - http://gitorious.org/cmoduler
-IF( SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY_RELEASE AND SQLITE3_LIBRARY_DEBUG )
- SET(SQLITE3_FIND_QUIETLY TRUE)
-ENDIF( SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY_RELEASE AND SQLITE3_LIBRARY_DEBUG )
-FIND_PATH( SQLITE3_INCLUDE_DIR sqlite3.h )
-FIND_LIBRARY(SQLITE3_LIBRARY_RELEASE NAMES sqlite3 )
-FIND_LIBRARY(SQLITE3_LIBRARY_DEBUG NAMES sqlite3 sqlite3d HINTS /usr/lib/debug/usr/lib/ )
-IF( SQLITE3_LIBRARY_RELEASE OR SQLITE3_LIBRARY_DEBUG AND SQLITE3_INCLUDE_DIR )
- SET( SQLITE3_FOUND TRUE )
-ENDIF( SQLITE3_LIBRARY_RELEASE OR SQLITE3_LIBRARY_DEBUG AND SQLITE3_INCLUDE_DIR )
-IF( SQLITE3_LIBRARY_DEBUG AND SQLITE3_LIBRARY_RELEASE )
-# if the generator supports configuration types then set
-# optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
- IF( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
- SET( SQLITE3_LIBRARIES optimized ${SQLITE3_LIBRARY_RELEASE} debug ${SQLITE3_LIBRARY_DEBUG} )
- ELSE( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
- # if there are no configuration types and CMAKE_BUILD_TYPE has no value
- # then just use the release libraries
- SET( SQLITE3_LIBRARIES ${SQLITE3_LIBRARY_RELEASE} )
- ENDIF( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
-ELSEIF( SQLITE3_LIBRARY_RELEASE )
- SET( SQLITE3_LIBRARIES ${SQLITE3_LIBRARY_RELEASE} )
-ELSE( SQLITE3_LIBRARY_DEBUG AND SQLITE3_LIBRARY_RELEASE )
- SET( SQLITE3_LIBRARIES ${SQLITE3_LIBRARY_DEBUG} )
-ENDIF( SQLITE3_LIBRARY_DEBUG AND SQLITE3_LIBRARY_RELEASE )
-IF( SQLITE3_FOUND )
- IF( NOT SQLITE3_FIND_QUIETLY )
- MESSAGE( STATUS "Found Sqlite3 header file in ${SQLITE3_INCLUDE_DIR}")
- MESSAGE( STATUS "Found Sqlite3 libraries: ${SQLITE3_LIBRARIES}")
- ENDIF( NOT SQLITE3_FIND_QUIETLY )
-ELSE(SQLITE3_FOUND)
- IF( SQLITE3_FIND_REQUIRED)
- MESSAGE( FATAL_ERROR "Could not find Sqlite3" )
- ELSE( SQLITE3_FIND_REQUIRED)
- MESSAGE( STATUS "Optional package Sqlite3 was not found" )
- ENDIF( SQLITE3_FIND_REQUIRED)
-ENDIF(SQLITE3_FOUND) \ No newline at end of file
+# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
+#
+# Redistribution and use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+
+if (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS)
+ set(SQLITE3_FOUND TRUE)
+else (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS)
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(_SQLITE3 REQUIRED sqlite3>=3.7.11)
+ else (PKG_CONFIG_FOUND)
+ message(WARNING "PkgConfig isn't installed. You need to sure sqlite3>=3.7.11")
+ endif (PKG_CONFIG_FOUND)
+
+ find_path(SQLITE3_INCLUDE_DIR
+ NAMES
+ sqlite3.h
+ PATHS
+ ${_SQLITE3_INCLUDEDIR}
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ )
+
+ find_library(SQLITE3_LIBRARY
+ NAMES
+ sqlite3
+ PATHS
+ ${_SQLITE3_LIBDIR}
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ if (SQLITE3_LIBRARY)
+ set(SQLITE3_FOUND TRUE)
+ endif (SQLITE3_LIBRARY)
+
+ set(SQLITE3_INCLUDE_DIRS
+ ${SQLITE3_INCLUDE_DIR}
+ )
+
+ if (SQLITE3_FOUND)
+ set(SQLITE3_LIBRARIES
+ ${SQLITE3_LIBRARIES}
+ ${SQLITE3_LIBRARY}
+ )
+ endif (SQLITE3_FOUND)
+
+ if (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)
+ set(SQLITE3_FOUND TRUE)
+ endif (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)
+
+ if (SQLITE3_FOUND)
+ if (NOT Sqlite3_FIND_QUIETLY)
+ message(STATUS "Found Sqlite3: ${SQLITE3_LIBRARIES}")
+ endif (NOT Sqlite3_FIND_QUIETLY)
+ else (SQLITE3_FOUND)
+ if (Sqlite3_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find Sqlite3")
+ endif (Sqlite3_FIND_REQUIRED)
+ endif (SQLITE3_FOUND)
+
+ # show the SQLITE3_INCLUDE_DIRS and SQLITE3_LIBRARIES variables only in the advanced view
+ mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)
+
+endif (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS) \ No newline at end of file
diff --git a/customer-specific/pasa/src/appMain/smartDeviceLink.ini b/customer-specific/pasa/src/appMain/smartDeviceLink.ini
new file mode 100644
index 000000000..3ceb4a2a7
--- /dev/null
+++ b/customer-specific/pasa/src/appMain/smartDeviceLink.ini
@@ -0,0 +1,177 @@
+; The INI-file consists of different chapters.
+; Each chapter begins with the line containing
+; the name in square brackets. Syntax:
+; [chapter]
+; The chapters consists of a set of items with a
+; assinged value. The syntax is:
+; item=value
+; All white spaces an second encounters of chapters
+; or items will be ignored.
+; Remarks start with semicolon or star as first character.
+; It is alowed for names of chapters and items to
+; contain semicolon and star. Possible syntax is:
+; [ chapter ] ;Remark
+; item = value ;Remark
+
+[HMI]
+LaunchHMI = true
+ServerAddress = 127.0.0.1
+ServerPort = 8087
+VideoStreamingPort = 5050
+AudioStreamingPort = 5080
+
+[MAIN]
+SDLVersion = {GIT_COMMIT}
+; Standard min stack size
+; in Ubuntu : PTHREAD_STACK_MIN = 16384
+; in QNX : PTHREAD_STACK_MIN = 256
+;The value of a variable ThreadStackSize used only if its realy needed, other way stack size will be PTHREAD_STACK_MIN
+;
+AppConfigFolder = /fs/mp/etc/AppLink
+AppStorageFolder = /fs/rwdata/storage/sdl
+ThreadStackSize = 16384
+MixingAudioSupported = true
+HMICapabilities = hmi_capabilities.json
+MaxCmdID = 2000000000
+DefaultTimeout = 20000
+; HMI's heart beat timeout. The value specifies seconds.
+HMIHeartBeatTimeout = 3;
+AppDirectoryQuota = 104857600
+AppHMILevelNoneTimeScaleMaxRequests = 0
+AppHMILevelNoneRequestsTimeScale = 10
+AppTimeScaleMaxRequests = 0
+AppRequestsTimeScale = 10
+PendingRequestsAmount = 0
+; Heart beat timeout used for protocol v3. Timeout must be specified in seconds. If timeout is 0 heart beat will be disabled.
+HeartBeatTimeout = 0
+SupportedDiagModes = 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x09, 0x0A, 0x18, 0x19, 0x22, 0x3E
+SystemFilesPath = /fs/images/ivsu_cache
+UseLastState = true
+TimeTestingPort = 8090
+ReadDIDRequest = 5, 1
+GetVehicleDataRequest = 5, 1
+TargetBootCountFile = /fs/rwdata/.flags/boot_count
+TargetTmpDir = /fs/rwdata/logs
+
+[LOGGING]
+LoggerConfigFile = /fs/mp/etc/AppLink/log4cxx.properties
+RemoteLoggingFlagFile = log/capturelog.evt
+RemoteLoggingFlagFilePath = /fs/usb0/
+TargetLogFileHomeDir = /fs/rwdata/logs/
+TargetLogFileNamePattern = smartdevicelink.log
+LogFileMaxSize = 0K
+
+
+[MEDIA MANAGER]
+; where 3 is a number of retries and 1000 is a timeout in milliseconds for request frequency
+StartStreamRetry = 3, 1000
+EnableRedecoding = false
+;VideoStreamConsumer = socket
+;AudioStreamConsumer = socket
+;VideoStreamConsumer = file
+;AudioStreamConsumer = file
+VideoStreamConsumer = pipe
+AudioStreamConsumer = pipe
+;Temp solution: if you change NamedPipePath also change path to pipe in src/components/qt_hmi/qml_model_qtXX/views/SDLNavi.qml
+;Named pipe path will be constructed using AppStorageFolder + name
+NamedVideoPipePath = video_stream_pipe
+NamedAudioPipePath = audio_stream_pipe
+;File path will be constructed using AppStorageFolder + name
+VideoStreamFile = video_stream_file
+AudioStreamFile = audio_stream_file
+; Recording file source (used for audio pass thru emulation only)
+RecordingFileSource = audio.8bit.wav
+; Recording file for audio pass thru
+RecordingFileName = audio.wav
+MQAudioPath = /dev/mqueue/AppLinkAudioPass
+; Defines time in milliseconds for SDL to wait for the next package of raw data over audio service
+AudioDataStoppedTimeout = 1000
+; Defines time in milliseconds for SDL to wait for the next package of raw data over video service
+VideoDataStoppedTimeout = 1000
+
+
+; HelpPromt and TimeOutPrompt is a vector of strings separated by comma
+[GLOBAL PROPERTIES]
+; Delimiter, which will be appended to each TTS chunck, e.g. helpPrompt/timeoutPrompt
+TTSDelimiter = ,
+; Default prompt items, separated by comma
+HelpPromt = Please speak one of the following commands,Please say a command
+; Default prompt items, separated by comma
+TimeOutPromt = Please speak one of the following commands,Please say a command
+HelpTitle = Available Vr Commands List
+; In case mobile app didn't send global properties default global properties will be sent after this timeout
+; max value TTSGlobalPropertiesTimeout 64K
+TTSGlobalPropertiesTimeout = 20
+
+[FILESYSTEM RESTRICTIONS]
+; Max allowed number of PutFile requests for one application in NONE
+PutFileRequest = 5
+; Max allowed number of DeleteFile requests for one application in NONE
+DeleteFileRequest = 5
+; Max allowed number of ListFiles requests for one application in NONE
+ListFilesRequest = 5
+
+[VR COMMANDS]
+HelpCommand = Help
+
+
+[AppInfo]
+; The path for applications info storage.
+AppInfoStorage = app_info.dat
+
+[Policy]
+EnablePolicy = true
+PreloadedPT = sdl_preloaded_pt.json
+PathToSnapshot = sdl_snapshot.json
+; Number of attempts to open policy DB
+AttemptsToOpenPolicyDB = 5
+; Timeout between attempts during opening DB in milliseconds
+OpenAttemptTimeoutMs = 500
+
+[TransportManager]
+TCPAdapterPort = 12345
+MMEDatabase = /dev/qdb/mediaservice_db
+EventMQ = /dev/mqueue/ToSDLCoreUSBAdapter
+AckMQ = /dev/mqueue/FromSDLCoreUSBAdapter
+
+[IAP]
+DefaultHubProtocolIndex = 0
+LegacyProtocol = com.ford.sync.prot
+HubProtocol = com.smartdevicelink.prot
+PoolProtocol = com.smartdevicelink.prot
+IAPSystemConfig = /fs/mp/etc/mm/ipod.cfg
+IAP2SystemConfig = /fs/mp/etc/mm/iap2.cfg
+IAP2HubConnectAttempts = 3
+ConnectionWaitTimeout = 10
+
+[ProtocolHandler]
+; Packet with payload bigger than next value will be marked as a malformed
+; for protocol v3 or higher
+; For v2 protocol MaximumPayloadSize is 1488
+MaximumPayloadSize = 131072
+; Application shall send less #FrequencyCount messages per #FrequencyTime mSecs
+; Frequency check could be disabled by setting #FrequencyTime or
+; #FrequencyCount to Zero
+FrequencyCount = 1000
+FrequencyTime = 1000
+; Enable filtering transport data stream
+; On #MalformedMessageFiltering disable SDl disconnect with the first
+; malformed message detection
+MalformedMessageFiltering = true
+; Boundary values of malformed message detection for connection close
+; Can be disabled by setting #MalformedFrequencyTime or
+; #MalformedFrequencyCount to Zero
+MalformedFrequencyCount = 10
+MalformedFrequencyTime = 1000
+
+[ApplicationManager]
+ApplicationListUpdateTimeout = 2
+; Max allowed threads for handling mobile requests. Currently max allowed is 2
+ThreadPoolSize = 1
+
+# Timeout in seconds for resumption Application HMILevel
+# and resolving conflicts in case if multiple applications initiate resumption
+ApplicationResumingTimeout = 3
+
+# Timeout in seconds for pereodical saving resumption persisten data
+AppSavePersistentDataTimeout = 10 #seconds
diff --git a/src/3rd_party-static/MessageBroker/CMakeLists.txt b/src/3rd_party-static/MessageBroker/CMakeLists.txt
index f2095ae36..87a0fe2a2 100644
--- a/src/3rd_party-static/MessageBroker/CMakeLists.txt
+++ b/src/3rd_party-static/MessageBroker/CMakeLists.txt
@@ -29,6 +29,8 @@ set (MESSAGE_BROKER_SERVER_SOURCES
)
add_library("MessageBroker" ${MESSAGE_BROKER_SOURCES})
+target_link_libraries(MessageBroker Utils)
+
add_library("MessageBrokerClient" ${MESSAGE_BROKER_CLIENT_SOURCES})
target_link_libraries("MessageBrokerClient" "MessageBroker")
diff --git a/src/3rd_party-static/MessageBroker/include/CMessageBroker.hpp b/src/3rd_party-static/MessageBroker/include/CMessageBroker.hpp
index 4de9022ae..c54204379 100644
--- a/src/3rd_party-static/MessageBroker/include/CMessageBroker.hpp
+++ b/src/3rd_party-static/MessageBroker/include/CMessageBroker.hpp
@@ -61,14 +61,20 @@ namespace NsMessageBroker
* \brief Receive data from TCP server (from client).
* \param fd FileDescriptor of socket.
* \param aJSONData JSON string.
+ * \param tryHard give up on first JSON parse error or try to workaround it.
*/
- void onMessageReceived(int fd, std::string& aJSONData);
-
+ void onMessageReceived(int fd, std::string& aJSONData, bool tryHard);
+
/**
* \brief Test of buffer parsing.
*/
void Test();
+ /**
+ * @brief OnSocketClosed should be called if socked is closed by HMI
+ * @param fd socket descriptor
+ */
+ void OnSocketClosed(const int fd);
/**
* \brief Starts MessageBroker.
diff --git a/src/3rd_party-static/MessageBroker/include/CMessageBrokerRegistry.hpp b/src/3rd_party-static/MessageBroker/include/CMessageBrokerRegistry.hpp
index 81d7f79c7..001f978bb 100644
--- a/src/3rd_party-static/MessageBroker/include/CMessageBrokerRegistry.hpp
+++ b/src/3rd_party-static/MessageBroker/include/CMessageBrokerRegistry.hpp
@@ -5,6 +5,7 @@
#include <vector>
#include <iostream>
#include <string>
+#include "utils/lock.h"
/**
* \namespace NsMessageBroker
@@ -46,6 +47,18 @@ namespace NsMessageBroker
void deleteController(std::string name);
/**
+ * \brief Remove all controllers by descriptor
+ * \param fd descriptor
+ */
+ void removeControllersByDescriptor(const int fd);
+
+ /**
+ * \brief Remove all subscribers by descriptor
+ * \param fd descriptor
+ */
+ void removeSubscribersByDescriptor(const int fd);
+
+ /**
* \brief adds notification subscriber to the registry.
* \param fd file descriptor of controller.
* \param name name of property which should be observed.
@@ -85,12 +98,14 @@ namespace NsMessageBroker
* For example PhoneController:1080
*/
std::map <std::string, int> mControllersList;
+ sync_primitives::Lock mControllersListLock;
/**
* \brief Map to store subscribers information like ComponentName.PropertyName:socketFd:.
* For example PhoneController.onPhoneBookChanged:1080
*/
std::multimap <std::string, int> mSubscribersList;
+ sync_primitives::Lock mSubscribersListLock;
};
} /* namespace NsMessageBroker */
diff --git a/src/3rd_party-static/MessageBroker/src/client/mb_controller.cpp b/src/3rd_party-static/MessageBroker/src/client/mb_controller.cpp
index bd8b0e3ed..c37a62dbb 100644
--- a/src/3rd_party-static/MessageBroker/src/client/mb_controller.cpp
+++ b/src/3rd_party-static/MessageBroker/src/client/mb_controller.cpp
@@ -311,6 +311,12 @@ namespace NsMessageBroker
return false;
}
+ if (root.isMember("result") && root.isMember("error"))
+ {
+ /* message can't contain simultaneously result and error*/
+ return false;
+ }
+
if (root.isMember("method"))
{
if (!root["method"].isString())
diff --git a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBroker.cpp b/src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBroker.cpp
index b7df5c0cc..3b14489a8 100644
--- a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBroker.cpp
+++ b/src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBroker.cpp
@@ -4,6 +4,7 @@
* \author AKara
*/
+#include <cassert>
#include <stdio.h>
#include <vector>
@@ -216,6 +217,31 @@ class CMessageBroker_Private {
int popMessageFromWaitQue(CMessage* pMessage);
/**
+ * \brief Tries to remove the parsed part of the buffer
+ * \param root Parsed JSON value
+ * \param aJSONData The string buffer
+ * \return true on success, false on failure
+ */
+ bool cutParsedJSON(const Json::Value& root, std::string& aJSONData);
+
+ /**
+ * \brief Finds the position just after a JSON object or array in a buffer
+ * \param isObject Must be true for object, false for array
+ * \param aJSONData The string buffer
+ * \return The position in the buffer after the object or array on success,
+ * std::strin::npos on failure
+ */
+ size_t jumpOverJSONObjectOrArray(bool isObject, const std::string& aJSONData);
+
+ /**
+ * \brief Finds the position just after a JSON string in a buffer
+ * \param aJSONData The string buffer
+ * \return The position in the buffer after the string on success,
+ * std::strin::npos on failure
+ */
+ size_t jumpOverJSONString(const std::string& aJSONData);
+
+ /**
* \brief Que of messages.
*/
std::deque<CMessage*> mMessagesQueue;
@@ -288,36 +314,183 @@ CMessageBroker* CMessageBroker::getInstance() {
return &instance;
}
-void CMessageBroker::onMessageReceived(int fd, std::string& aJSONData) {
- DBG_MSG(("CMessageBroker::onMessageReceived()\n"));
- while (!aJSONData.empty())
- {
- Json::Value root;
- if (!p->m_reader.parse(aJSONData, root)) {
- DBG_MSG(("Received not JSON string! %s\n", aJSONData.c_str()));
- return;
+
+size_t CMessageBroker_Private::jumpOverJSONObjectOrArray(bool isObject,
+ const std::string& aJSONData) {
+ const char openBracket = isObject? '{' : '[';
+ const char closeBracket = isObject? '}' : ']';
+ int open_minus_close_brackets(1);
+ size_t position = aJSONData.find(openBracket); // Find the beginning of the object
+
+ while ((position != std::string::npos) && (open_minus_close_brackets > 0)) {
+ position = aJSONData.find_first_of(std::string("\"")+openBracket+closeBracket,
+ position+1);
+ if (std::string::npos == position) {
+ break;
+ }
+ if ('"' == aJSONData[position]) {
+ // Ignore string interior, which might contain brackets and escaped "-s
+ do {
+ position = aJSONData.find('"', position+1); // Find the closing quote
+ } while ((std::string::npos != position) && ('\\' == aJSONData[position-1]));
+ } else if (openBracket == aJSONData[position]) {
+ ++open_minus_close_brackets;
+ } else if (closeBracket == aJSONData[position]) {
+ --open_minus_close_brackets;
+ }
+ }
+
+ if ((0 == open_minus_close_brackets) && (std::string::npos != position)) {
+ ++position; // Move after the closing bracket
+ } else {
+ position = std::string::npos;
+ }
+
+ return position;
+}
+
+
+size_t CMessageBroker_Private::jumpOverJSONString(const std::string& aJSONData) {
+ size_t position = aJSONData.find('"'); // Find the beginning of the string
+
+ do {
+ position = aJSONData.find('"', position+1); // Find the closing quote
+ } while ((std::string::npos != position) && ('\\' == aJSONData[position-1]));
+
+ if (std::string::npos != position) {
+ ++position; // Move after the closing quote
+ }
+
+ return position;
+}
+
+
+bool CMessageBroker_Private::cutParsedJSON(const Json::Value& root,
+ std::string& aJSONData) {
+ if (root.isNull() || aJSONData.empty()) {
+ DBG_MSG_ERROR(("JSON is null or the buffer is empty!\n"));
+ return false;
+ }
+
+ std::string parsed_json_str = m_recieverWriter.write(root);
+ DBG_MSG(("Parsed JSON string: '%s'\n", parsed_json_str.c_str()));
+
+ // Trim front spaces (if any)
+ const size_t nonempty_position = aJSONData.find_first_not_of(" \t\n\v\f\r");
+ aJSONData.erase(0, nonempty_position);
+ if (std::string::npos == nonempty_position) {
+ DBG_MSG_ERROR(("Buffer contains only blanks!\n"));
+ return false;
+ }
+
+ // JSON writer puts '\n' at the end. Remove it.
+ const size_t final_lf_pos = parsed_json_str.rfind('\n');
+ if (final_lf_pos == parsed_json_str.length()-1) {
+ parsed_json_str.erase(final_lf_pos, 1);
+ }
+
+ /* RFC 4627: "A JSON value MUST be an object, array, number, or string, or
+ * one of the following three literal names: false null true"
+ * So we will try to find the borders of the parsed part based on its type. */
+
+ size_t position(std::string::npos);
+
+ if (0 == aJSONData.find(parsed_json_str)) {
+ // If by chance parsed JSON is the same in the buffer and is at the beginning
+ position = parsed_json_str.length();
+ } else if (root.isObject() || root.isArray()) {
+ position = jumpOverJSONObjectOrArray(root.isObject(), aJSONData);
+ } else if (root.isString()) {
+ position = jumpOverJSONString(aJSONData);
+ } else if (root.isNumeric()) {
+ position = aJSONData.find_first_not_of("+-0123456789.eE");
+ } else if (root.isBool() || ("null" == parsed_json_str)) {
+ position = aJSONData.find(parsed_json_str);
+ if (std::string::npos != position) {
+ position += parsed_json_str.length();
}
- if(root["jsonrpc"]!="2.0")
- {
- DBG_MSG(("\t Json::Reader::parce didn't set up jsonrpc! jsonrpc = '%s'\n", root["jsonrpc"].asString().c_str()));
- return;
+ } else {
+ DBG_MSG_ERROR(("Unknown JSON type!\n"));
+ }
+
+ if (std::string::npos == position) {
+ DBG_MSG_ERROR(("Error finding JSON object boundaries!\n"));
+ /* This should not happen, because the string is already parsed as a
+ * valid JSON. If this happens then above code is wrong. It is better
+ * to assert() than just return here, because otherwise we may enter an
+ * endless cycle - fail to process one and the same message again and
+ * again. Or we may clear the buffer and return, but in this way we will
+ * loose the next messages, miss a bug here, and create another bug. */
+ assert(std::string::npos != position);
+ return false; // For release version
+ }
+
+ if ((position >= aJSONData.length()) ||
+ ((position == aJSONData.length()-1) && isspace(aJSONData[position]))) {
+ // No next object. Clear entire aJSONData.
+ aJSONData = "";
+ } else {
+ // There is another object. Clear the current one.
+ aJSONData.erase(0, position);
+ }
+
+ return true;
+}
+
+
+void CMessageBroker::onMessageReceived(int fd, std::string& aJSONData, bool tryHard) {
+ DBG_MSG(("CMessageBroker::onMessageReceived(%d, '%s')\n", fd, aJSONData.c_str()));
+
+ while (! aJSONData.empty()) {
+ Json::Value root;
+ if ((! p->m_reader.parse(aJSONData, root)) || root.isNull()) {
+ DBG_MSG_ERROR(("Unable to parse JSON!"));
+ if (! tryHard) {
+ return;
}
- std::string wmes = p->m_recieverWriter.write(root);
- DBG_MSG(("Parsed JSON string:%s; length: %d\n", wmes.c_str(), wmes.length()));
- DBG_MSG(("Buffer is:%s\n", aJSONData.c_str()));
- if (aJSONData.length() > wmes.length()) {
- // wmes string length can differ from buffer substr length
- size_t offset = wmes.length();
- char msg_begin = '{';
- if (aJSONData.at(offset) != msg_begin) {
- offset = aJSONData.find_last_of(msg_begin, offset);
+ uint8_t first_byte = static_cast<uint8_t>(aJSONData[0]);
+ if ((first_byte <= 0x08) || ((first_byte >= 0x80) && (first_byte <= 0x88))) {
+ DBG_MSG((" There is an unparsed websocket header probably.\n"));
+ /* Websocket headers can have FIN flag set in the first byte (0x80).
+ * Then there are 3 zero bits and 4 bits for opcode (from 0x00 to 0x0A).
+ * But actually we don't use opcodes above 0x08.
+ * Use this fact to distinguish websocket header from payload text data.
+ * It can be a coincidence of course, but we have to give it a try. */
+ return;
+ } else if ('{' == aJSONData[0]) {
+ DBG_MSG_ERROR((" Incomplete JSON object probably.\n"));
+ return;
+ } else {
+ DBG_MSG_ERROR((" Step in the buffer and try again...\n"));
+ aJSONData.erase(0, 1);
+ DBG_MSG_ERROR(("Buffer after cut is: '%s'\n", aJSONData.c_str()));
+ continue;
+ }
+
+ } else if (! root.isObject()) {
+ /* JSON RPC 2.0 messages are objects. Batch calls must be pre-rpocessed,
+ * so no need for "and !root.isArray()" */
+ DBG_MSG_ERROR(("Parsed JSON is not an object!\n"));
+ if (! tryHard) {
+ return;
}
- aJSONData.erase(aJSONData.begin(), aJSONData.begin() + offset);
- DBG_MSG(("Buffer after cut is:%s\n", aJSONData.c_str()));
+ // Cut parsed data from the buffer below and continue
+
+ } else if ((!root.isMember("jsonrpc")) || (root["jsonrpc"]!="2.0")) {
+ DBG_MSG_ERROR(("'jsonrpc' is not set correctly in parsed JSON!\n"));
+ if (! tryHard) {
+ return;
+ }
+ // Cut parsed object from the buffer below and continue
+
} else {
- aJSONData = "";
+ // Parsing successful. Pass the message up.
+ p->pushMessage(new CMessage(fd, root));
}
- p->pushMessage(new CMessage(fd, root));
+
+ p->cutParsedJSON(root, aJSONData);
+
+ DBG_MSG(("Buffer after cut is: '%s'\n", aJSONData.c_str()));
}
}
@@ -346,6 +519,13 @@ void CMessageBroker::Test() {
}
}
+void CMessageBroker::OnSocketClosed(const int fd) {
+ DBG_MSG(("CMessageBroker::OnSocketClosed(%d)\n", fd));
+ if (p->mpRegistry) {
+ p->mpRegistry->removeControllersByDescriptor(fd);
+ }
+}
+
void CMessageBroker::startMessageBroker(CSender* pSender) {
DBG_MSG(("CMessageBroker::startMessageBroker()\n"));
p->mpSender = pSender;
@@ -665,7 +845,7 @@ void CMessageBroker_Private::processError(CMessage* pMessage) {
}
void CMessageBroker_Private::sendJsonMessage(int fd, Json::Value message) {
- DBG_MSG(("CMessageBroker::sendJsonMessage()\n"));
+ DBG_MSG(("CMessageBroker::sendJsonMessage(%d)\n", fd));
if (mpSender) {
std::string mes = m_writer.write(message);
int retVal = mpSender->Send(fd, mes);
diff --git a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBrokerRegistry.cpp b/src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBrokerRegistry.cpp
index 169a3a7a4..1e63f0ba3 100644
--- a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBrokerRegistry.cpp
+++ b/src/3rd_party-static/MessageBroker/src/lib_messagebroker/CMessageBrokerRegistry.cpp
@@ -5,7 +5,6 @@
*/
#include "CMessageBrokerRegistry.hpp"
-
#include "libMBDebugHelper.h"
#include <vector>
@@ -32,6 +31,8 @@ namespace NsMessageBroker
DBG_MSG(("CMessageBrokerRegistry::addController()\n"));
bool result = false;
std::map <std::string, int>::iterator it;
+
+ sync_primitives::AutoLock lock(mControllersListLock);
it = mControllersList.find(name);
if (it == mControllersList.end())
{
@@ -41,6 +42,7 @@ namespace NsMessageBroker
{
DBG_MSG(("Controller already exists!\n"));
}
+
DBG_MSG(("Count of controllers: %d\n", mControllersList.size()));
return result;
}
@@ -49,30 +51,61 @@ namespace NsMessageBroker
{
DBG_MSG(("CMessageBrokerRegistry::deleteController()\n"));
std::map <std::string, int>::iterator it;
- it = mControllersList.find(name);
- if (it != mControllersList.end())
+
+ int fd;
{
- int fd = it->second;
- mControllersList.erase(it);
- std::multimap <std::string, int>::iterator it_s = mSubscribersList.begin();
- for (; it_s !=mSubscribersList.end(); ) {
- if (it_s->second == fd) {
- mSubscribersList.erase(it_s++);
- } else {
- ++it_s;
- }
+ sync_primitives::AutoLock lock(mControllersListLock);
+ it = mControllersList.find(name);
+ if (it != mControllersList.end())
+ {
+ fd = it->second;
+ mControllersList.erase(it);
+ } else {
+ DBG_MSG(("No such controller in the list!\n"));
+ return;
}
- } else
+ DBG_MSG(("Count of controllers: %d\n", mControllersList.size()));
+ }
+ removeSubscribersByDescriptor(fd);
+ }
+
+ void CMessageBrokerRegistry::removeControllersByDescriptor(const int fd) {
+ DBG_MSG(("CMessageBrokerRegistry::removeControllersByDescriptor(%d)\n",
+ fd));
{
- DBG_MSG(("No such controller in the list!\n"));
+ sync_primitives::AutoLock lock(mControllersListLock);
+ std::map <std::string, int>::iterator it = mControllersList.begin();
+ for (; it != mControllersList.end();) {
+ if (it->second == fd) {
+ mControllersList.erase(it);
+ } else {
+ ++it;
+ }
+ }
+ }
+ removeSubscribersByDescriptor(fd);
+ }
+
+ void CMessageBrokerRegistry::removeSubscribersByDescriptor(const int fd) {
+ DBG_MSG(("CMessageBrokerRegistry::removeSubscribersByDescriptor(%d)\n",
+ fd));
+ sync_primitives::AutoLock lock(mSubscribersListLock);
+ std::multimap <std::string, int>::iterator it_s = mSubscribersList.begin();
+ for (; it_s !=mSubscribersList.end(); ) {
+ if (it_s->second == fd) {
+ mSubscribersList.erase(it_s++);
+ } else {
+ ++it_s;
+ }
}
- DBG_MSG(("Count of controllers: %d\n", mControllersList.size()));
}
bool CMessageBrokerRegistry::addSubscriber(int fd, std::string name)
{
DBG_MSG(("CMessageBrokerRegistry::addSubscriber()\n"));
bool result = true;
+
+ sync_primitives::AutoLock lock(mSubscribersListLock);
std::pair<std::multimap <std::string, int>::iterator, std::multimap <std::string, int>::iterator> p = mSubscribersList.equal_range(name);
if (p.first != p.second)
{
@@ -90,6 +123,7 @@ namespace NsMessageBroker
{
mSubscribersList.insert(std::map <std::string, int>::value_type(name, fd));
}
+
DBG_MSG(("Count of subscribers: %d\n", mSubscribersList.size()));
return result;
}
@@ -97,6 +131,8 @@ namespace NsMessageBroker
void CMessageBrokerRegistry::deleteSubscriber(int fd, std::string name)
{
DBG_MSG(("CMessageBrokerRegistry::deleteSubscriber()\n"));
+
+ sync_primitives::AutoLock lock(mSubscribersListLock);
std::pair<std::multimap <std::string, int>::iterator, std::multimap <std::string, int>::iterator> p = mSubscribersList.equal_range(name);
if (p.first != p.second) {
std::multimap <std::string, int>::iterator itr;
@@ -109,6 +145,7 @@ namespace NsMessageBroker
}
}
}
+
DBG_MSG(("Count of subscribers: %d\n", mSubscribersList.size()));
}
@@ -117,11 +154,14 @@ namespace NsMessageBroker
DBG_MSG(("CMessageBrokerRegistry::getDestinationFd()\n"));
int result = -1;
std::map <std::string, int>::iterator it;
+
+ sync_primitives::AutoLock lock(mControllersListLock);
it = mControllersList.find(name);
if (it != mControllersList.end())
{
result = it->second;
}
+
DBG_MSG(("Controllers Fd: %d\n", result));
return result;
}
@@ -131,6 +171,8 @@ namespace NsMessageBroker
DBG_MSG(("CMessageBrokerRegistry::getSubscribersFd()\n"));
int res = 0;
std::map <std::string, int>::iterator it;
+
+ sync_primitives::AutoLock lock(mSubscribersListLock);
std::pair<std::multimap <std::string, int>::iterator, std::multimap <std::string, int>::iterator> p = mSubscribersList.equal_range(name);
if (p.first != p.second)
{
@@ -141,6 +183,7 @@ namespace NsMessageBroker
DBG_MSG(("Controllers Fd: %d\n", itr->second));
}
}
+
res = result.size();
DBG_MSG(("Result vector size: %d\n", res));
return res;
diff --git a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/websocket_handler.cpp b/src/3rd_party-static/MessageBroker/src/lib_messagebroker/websocket_handler.cpp
index 7713899b8..7d3890b7a 100644
--- a/src/3rd_party-static/MessageBroker/src/lib_messagebroker/websocket_handler.cpp
+++ b/src/3rd_party-static/MessageBroker/src/lib_messagebroker/websocket_handler.cpp
@@ -69,8 +69,7 @@ namespace NsMessageBroker
return length;
}
- int CWebSocketHandler::parseWebSocketData(char* Buffer, unsigned int& b_size)
- {
+ int CWebSocketHandler::parseWebSocketData(char* Buffer, unsigned int& b_size) {
// Please see RFC6455 standard protocol specification:
//http://tools.ietf.org/html/rfc6455
// Chapter 5.2
@@ -80,7 +79,8 @@ namespace NsMessageBroker
unsigned char position = 0; // current buffer position
unsigned int size = b_size;
- while (0 < size) {
+ static uint32_t minimum_heade_size = 4;
+ while (minimum_heade_size < size) {
bool fin = ((recBuffer[0] & 0x80) | (recBuffer[0] & 0x01)) == 0x81;
bool rsv1 = (recBuffer[0] & 0x40) == 0x40;
@@ -94,8 +94,8 @@ namespace NsMessageBroker
DBG_MSG(("CWebSocketHandler::fin = %d recBuffer[0] = 0x%02X\n"
" parsedlength = %d b_size= %d parsedBufferPosition = %d\n"
"rsv1 = %d, rsv2 = %d, rsv3 = %d, opCode = %u\n",
- fin, recBuffer[0], parsedBufferPosition + position,
- size, parsedBufferPosition, rsv1, rsv2, rsv3, opCode));
+ fin, recBuffer[0], parsedBufferPosition + position,
+ size, parsedBufferPosition, rsv1, rsv2, rsv3, opCode));
if ((rsv1)|(rsv2)|(rsv3)) {
DBG_MSG(("rsv1 or rsv2 or rsv3 is 0 \n"));
@@ -113,67 +113,61 @@ namespace NsMessageBroker
}
if (false == fin) {
- break;
+ break;
}
unsigned char payload = (unsigned char)
((recBuffer[1] & 0x40) | (recBuffer[1] & 0x20) | (recBuffer[1] & 0x10) |
- (recBuffer[1] & 0x08) | (recBuffer[1] & 0x04) | (recBuffer[1] & 0x02) |
- (recBuffer[1] & 0x01));
+ (recBuffer[1] & 0x08) | (recBuffer[1] & 0x04) | (recBuffer[1] & 0x02) |
+ (recBuffer[1] & 0x01));
unsigned long length = parseWebSocketDataLength(recBuffer, size);
position = 2;
if (length > size) {
- DBG_MSG_ERROR(("Incomplete message"));
- return b_size;
+ DBG_MSG_ERROR(("Incomplete message"));
+ break;
}
switch(payload) {
- case 126:
- {
- position +=2;
- break;
- }
- case 127:
- {
- position +=8;
- break;
- }
- default:
- {
- break;
- }
+ case 126: {
+ position +=2;
+ break;
+ }
+ case 127: {
+ position +=8;
+ break;
+ }
+ default: {
+ break;
+ }
}
- if (mask)
- {
- unsigned char maskKeys[4];
- maskKeys[0] = recBuffer[position++];
- maskKeys[1] = recBuffer[position++];
- maskKeys[2] = recBuffer[position++];
- maskKeys[3] = recBuffer[position++];
- DBG_MSG(("CWebSocketHandler::parseWebSocketData()maskKeys[0]:0x%02X;"
- " maskKeys[1]:0x%02X; maskKeys[2]:0x%02X; maskKeys[3]:0x%02X\n"
- , maskKeys[0], maskKeys[1], maskKeys[2], maskKeys[3]));
- for (unsigned long i = position; i < position+length; i++)
- {
- recBuffer[i] = recBuffer[i] ^ maskKeys[(i-position)%4];
- }
+ if (mask) {
+ unsigned char maskKeys[4];
+ maskKeys[0] = recBuffer[position++];
+ maskKeys[1] = recBuffer[position++];
+ maskKeys[2] = recBuffer[position++];
+ maskKeys[3] = recBuffer[position++];
+ DBG_MSG(("CWebSocketHandler::parseWebSocketData()maskKeys[0]:0x%02X;"
+ "maskKeys[1]:0x%02X; maskKeys[2]:0x%02X; maskKeys[3]:0x%02X\n"
+ , maskKeys[0], maskKeys[1], maskKeys[2], maskKeys[3]));
+ for (unsigned long i = position; i < position+length; i++)
+ {
+ recBuffer[i] = recBuffer[i] ^ maskKeys[(i-position)%4];
+ }
}
DBG_MSG(("CWebSocketHandler::parseWebSocketData()length:%d; size:%d;"
" position:%d\n", (int)length, size, position));
- for (unsigned long i = position; (i < size && i < position+length); i++)
- {
- Buffer[parsedBufferPosition++] = recBuffer[i];
+ for (unsigned long i = 0; (i < size); i++) {
+ Buffer[parsedBufferPosition + i] = recBuffer[i+position];
}
-
- recBuffer += length+position;
+ b_size -= position;
+ parsedBufferPosition += length;
+ recBuffer += length;
size -= length+position;
}
-
- b_size = parsedBufferPosition;
return b_size;
}
@@ -229,8 +223,9 @@ namespace NsMessageBroker
unsigned char hash[20] = {0xb3, 0x7a, 0x4f, 0x2c, 0xc0, 0x62, 0x4f, 0x16, 0x90, 0xf6, 0x46, 0x06, 0xcf, 0x38, 0x59, 0x45, 0xb2, 0xbe, 0xc4, 0xea};
int accept_len;
- strcpy(accept_buf, key.c_str());
- strcpy(accept_buf + key.length(), websocket_magic_guid_04);
+ strncpy(accept_buf, key.c_str(), MAX_WEBSOCKET_04_KEY_LEN + 37);
+ strncpy(accept_buf + key.length(), websocket_magic_guid_04,
+ MAX_WEBSOCKET_04_KEY_LEN + 37 - strlen(key.c_str()));
SHA1((unsigned char *)accept_buf, key.length() + strlen(websocket_magic_guid_04), hash);
diff --git a/src/3rd_party-static/MessageBroker/src/server/mb_tcpserver.cpp b/src/3rd_party-static/MessageBroker/src/server/mb_tcpserver.cpp
index 6d6041d1a..bdd7b2bfd 100644
--- a/src/3rd_party-static/MessageBroker/src/server/mb_tcpserver.cpp
+++ b/src/3rd_party-static/MessageBroker/src/server/mb_tcpserver.cpp
@@ -43,8 +43,11 @@ ssize_t TcpServer::Send(int fd, const std::string& data) {
int bytesToSend = rep.length();
const char* ptrBuffer = rep.c_str();
do {
- int retVal = send(fd, ptrBuffer, bytesToSend, 0);
+ int retVal = send(fd, ptrBuffer, bytesToSend, MSG_NOSIGNAL);
if (retVal == -1) {
+ if (EPIPE == errno) {
+ m_purge.push_back(fd);
+ }
return -1;
}
bytesToSend -= retVal;
@@ -54,65 +57,106 @@ ssize_t TcpServer::Send(int fd, const std::string& data) {
}
bool TcpServer::Recv(int fd) {
- DBG_MSG(("TcpServer::Recv(int fd)\n"));
- ssize_t nb = -1;
+ DBG_MSG(("TcpServer::Recv(%d)\n", fd));
std::string* pReceivingBuffer = getBufferFor(fd);
+ bool buffer_was_not_empty = pReceivingBuffer->size() > 0;
+
std::vector<char> buf;
buf.reserve(RECV_BUFFER_LENGTH + pReceivingBuffer->size());
- DBG_MSG(("Left in pReceivingBuffer: %d : %s\n",
- pReceivingBuffer->size(), pReceivingBuffer->c_str()));
+ DBG_MSG(("Left in pReceivingBuffer: %d \n",
+ pReceivingBuffer->size()));
buf.assign(pReceivingBuffer->c_str(),
pReceivingBuffer->c_str() + pReceivingBuffer->size());
buf.resize(RECV_BUFFER_LENGTH + pReceivingBuffer->size());
- nb = recv(fd, &buf[pReceivingBuffer->size()], MAX_RECV_DATA, 0);
+
+ int received_bytes = recv(fd, &buf[pReceivingBuffer->size()], MAX_RECV_DATA, 0);
+ if (received_bytes <= 0) {
+ DBG_MSG(("Received %d bytes from %d; error = %d\n",
+ received_bytes, fd, errno));
+ m_purge.push_back(fd);
+ return false;
+ }
+
+ unsigned int nb = received_bytes;
+ std::vector<char> last_msg_buf(buf.begin()+pReceivingBuffer->size(),
+ buf.begin()+pReceivingBuffer->size()+nb);
DBG_MSG(("Recieved %d from %d\n", nb, fd));
- nb += pReceivingBuffer->size();
+ nb += static_cast<unsigned int>(pReceivingBuffer->size());
DBG_MSG(("Recieved with buffer %d from %d\n", nb, fd));
- if (nb > 0) {
- unsigned int recieved_data = nb;
+ if (nb > 0) { // This is redundant
if (isWebSocket(fd)) {
const unsigned int data_length =
- mWebSocketHandler.parseWebSocketDataLength(&buf[0], recieved_data);
+ mWebSocketHandler.parseWebSocketDataLength(&buf[0], nb);
- DBG_MSG(("Received %d actual data length %d\n",
- recieved_data, data_length));
+ DBG_MSG(("Received %d actual data length %d\n", nb, data_length));
- if (data_length > recieved_data) {
- DBG_MSG_ERROR(("Received %d actual data length %d\n",
- recieved_data, data_length));
+ if (data_length > nb) {
+ DBG_MSG_ERROR(("Received %d actual data length %d\n", nb, data_length));
DBG_MSG_ERROR(("Incomplete message"));
*pReceivingBuffer = std::string(&buf[0], nb);
return false;
}
- unsigned int b_size = static_cast<unsigned int>(nb);
- mWebSocketHandler.parseWebSocketData(&buf[0], b_size);
- nb = b_size;
+ mWebSocketHandler.parseWebSocketData(&buf[0], nb);
}
*pReceivingBuffer = std::string(&buf[0], nb);
- DBG_MSG(("pReceivingBuffer before onMessageReceived:%d : %s",
+ DBG_MSG(("pReceivingBuffer before onMessageReceived:%d : %s\n",
pReceivingBuffer->size(), pReceivingBuffer->c_str()));
- // we need to check websocket clients here
+
+ // we need to check for websocket handshake
if (!checkWebSocketHandShake(fd, pReceivingBuffer))
{ //JSON MESSAGE received. Send data in CMessageBroker.
if (mpMessageBroker) {
- mpMessageBroker->onMessageReceived(fd, *pReceivingBuffer);
+ size_t buffer_size_before = pReceivingBuffer->size();
+ mpMessageBroker->onMessageReceived(fd, *pReceivingBuffer, true);
+
+ if (buffer_was_not_empty && (pReceivingBuffer->size() == buffer_size_before)) {
+ /* We couldn't parse the buffer (with the last message at the end)
+ * Try to parse ONLY the last message */
+ DBG_MSG_ERROR(("Couldn't parse the whole buffer! Try only the last message.\n"));
+
+ nb = static_cast<unsigned int>(last_msg_buf.size());
+ if (isWebSocket(fd)) {
+ const unsigned int data_length =
+ mWebSocketHandler.parseWebSocketDataLength(&last_msg_buf[0], nb);
+ if (data_length > nb) {
+ DBG_MSG_ERROR(("The last message may be incomplete. Don't do anything.\n"));
+ /* Should we replace the buffer with the last message?
+ * Probably not. It may not be a real websocket message.
+ * Wait for a full message. */
+ return false;
+ }
+ mWebSocketHandler.parseWebSocketData(&last_msg_buf[0], nb);
+ }
+
+ std::string last_message = std::string(&last_msg_buf[0], nb);
+ buffer_size_before = last_message.size();
+ mpMessageBroker->onMessageReceived(fd, last_message, false);
+ if ( last_message.size() < buffer_size_before ) {
+ /* Parsing last message successful! Discard the old data and
+ * keep only what is left from the last message */
+ DBG_MSG_ERROR(("Parsing last message successful! Discard the old data.\n"));
+ *pReceivingBuffer = last_message;
+ }
+ }
} else {
return false;
}
- } else { // client is a websocket
- std::string handshakeResponse =
- "HTTP/1.1 101 Switching Protocols\r\nUpgrade: WebSocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: ";
+ } else { // message is a websocket handshake
ssize_t webSocketKeyPos = pReceivingBuffer->find("Sec-WebSocket-Key: ");
if (-1 != webSocketKeyPos) {
+ std::string handshakeResponse =
+ "HTTP/1.1 101 Switching Protocols\r\nUpgrade: WebSocket\r\n"
+ "Connection: Upgrade\r\nSec-WebSocket-Accept: ";
std::string wsKey = pReceivingBuffer->substr(webSocketKeyPos + 19, 24);
mWebSocketHandler.handshake_0405(wsKey);
handshakeResponse += wsKey;
handshakeResponse += "\r\n\r\n";
pReceivingBuffer->clear();
- std::list<int>::iterator acceptedClientIt = find(m_AcceptedClients.begin(), m_AcceptedClients.end(), fd);
+ std::list<int>::iterator acceptedClientIt =
+ find(m_AcceptedClients.begin(), m_AcceptedClients.end(), fd);
if (m_AcceptedClients.end() != acceptedClientIt) {
m_AcceptedClients.erase(acceptedClientIt);
}
@@ -120,13 +164,8 @@ bool TcpServer::Recv(int fd) {
m_WebSocketClients.push_back(fd);
}
}
-
- return true;
- }
- else {
- m_purge.push_back(fd);
- return false;
}
+ return true;
}
bool TcpServer::checkWebSocketHandShake(int fd, std::string* pReceivingBuffer) {
@@ -220,7 +259,8 @@ void TcpServer::WaitMessage(uint32_t ms) {
itr = m_receivingBuffers.find((*it));
if (itr != m_receivingBuffers.end())
{ // delete receiving buffer of disconnected client
- delete(*itr).second;
+ mpMessageBroker->OnSocketClosed(itr->first);
+ delete itr->second;
m_receivingBuffers.erase(itr);
}
}
diff --git a/src/3rd_party-static/jsoncpp/src/lib_json/json_reader.cpp b/src/3rd_party-static/jsoncpp/src/lib_json/json_reader.cpp
index 9bc6f2327..d0abe3481 100644
--- a/src/3rd_party-static/jsoncpp/src/lib_json/json_reader.cpp
+++ b/src/3rd_party-static/jsoncpp/src/lib_json/json_reader.cpp
@@ -576,7 +576,7 @@ Reader::decodeNumber( Token &token )
: Value::maxLargestUInt;
Value::LargestUInt threshold = maxIntegerValue / 10;
Value::UInt lastDigitThreshold = Value::UInt( maxIntegerValue % 10 );
- assert( lastDigitThreshold >=0 && lastDigitThreshold <= 9 );
+ assert(lastDigitThreshold <= 9 );
Value::LargestUInt value = 0;
while ( current < token.end_ )
{
diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt
index 57c30a63c..c7965992f 100644
--- a/src/3rd_party/CMakeLists.txt
+++ b/src/3rd_party/CMakeLists.txt
@@ -44,7 +44,7 @@ if(ENABLE_LOG)
set(LOG4CXX_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE)
endif()
-if(ENABLE_LOG AND NOT (${is_logger_actual} EQUAL 0))
+if(ENABLE_LOG)
# --- libapr-1
add_subdirectory(apr-cmake)
@@ -64,7 +64,7 @@ if(HMI_DBUS_API)
set(DBUS_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE)
endif()
-if(HMI_DBUS_API AND NOT (${is_dbus_actual} EQUAL 0))
+if(HMI_DBUS_API)
add_subdirectory(dbus-cmake)
endif()
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp
index 32e4f1a33..095fffc54 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp
@@ -39,6 +39,12 @@ ServerSocket::ServerSocket(int port) : pool(), mutex(pool), socket(0), timeout(0
throw SocketException(status);
}
+ // AKirov: Added SO_REUSEADDR option to fix APPLINK-15273
+ status = apr_socket_opt_set(socket, APR_SO_REUSEADDR, 1);
+ if (status != APR_SUCCESS) {
+ throw SocketException(status);
+ }
+
// Create server socket address (including port number)
apr_sockaddr_t *server_addr;
status =
diff --git a/src/3rd_party/apache-log4cxx-cmake/CMakeLists.txt b/src/3rd_party/apache-log4cxx-cmake/CMakeLists.txt
index bac9aa6df..a3dd48d1f 100644
--- a/src/3rd_party/apache-log4cxx-cmake/CMakeLists.txt
+++ b/src/3rd_party/apache-log4cxx-cmake/CMakeLists.txt
@@ -65,7 +65,18 @@ add_custom_command(OUTPUT ${LOG4CXX_BUILD_DIRECTORY}/Makefile
)
add_custom_target(liblog4cxx ALL make
- COMMAND /bin/bash -c \"if [ ${is_git_folder} == 0 ]; then grep \\".commit_hash\\" ${LOG4CXX_LIBS_DIRECTORY}/liblog4cxx.so 1>/dev/null 2>&1\; if [ ! \\\$$? == 0 ]\; then cd ${CMAKE_CURRENT_SOURCE_DIR} && git log --pretty=\\"format:%H\\" -1 ${LOG4CXX_SOURCE_DIRECTORY} > /tmp/commit_hash 2>/dev/null && echo \\"Adding .commit_hash section\\" && ${objcopy} --add-section .commit_hash=/tmp/commit_hash ${LOG4CXX_LIBS_DIRECTORY}/liblog4cxx.so ${LOG4CXX_LIBS_DIRECTORY}/liblog4cxx.so 1>/dev/null 2>&1\; fi; fi\"
+ COMMAND /bin/bash -c \"
+ cd ${CMAKE_CURRENT_SOURCE_DIR}\;
+ git log . 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]; then
+ grep \\".commit_hash\\" ${LOG4CXX_LIBS_DIRECTORY}/liblog4cxx.so 1>/dev/null 2>&1\;
+ if [ ! \\\$$? == 0 ]\; then
+ cd ${CMAKE_CURRENT_SOURCE_DIR} &&
+ git log --pretty=\\"format:%H\\" -1 ${LOG4CXX_SOURCE_DIRECTORY} > /tmp/commit_hash 2>/dev/null &&
+ echo \\"Adding .commit_hash section\\" &&
+ ${objcopy} --add-section .commit_hash=/tmp/commit_hash ${LOG4CXX_LIBS_DIRECTORY}/liblog4cxx.so ${LOG4CXX_LIBS_DIRECTORY}/liblog4cxx.so 1>/dev/null 2>&1\;
+ fi;
+ fi\"
DEPENDS ${LOG4CXX_BUILD_DIRECTORY}/Makefile
WORKING_DIRECTORY ${LOG4CXX_BUILD_DIRECTORY}
)
diff --git a/src/3rd_party/apr-1.5.0/include/apr.h b/src/3rd_party/apr-1.5.0/include/apr.h
index acf69814a..c97da492d 100644
--- a/src/3rd_party/apr-1.5.0/include/apr.h
+++ b/src/3rd_party/apr-1.5.0/include/apr.h
@@ -80,7 +80,7 @@
#define APR_HAVE_LIMITS_H 1
#define APR_HAVE_NETDB_H 1
#define APR_HAVE_NETINET_IN_H 1
-#define APR_HAVE_NETINET_SCTP_H 1
+#define APR_HAVE_NETINET_SCTP_H 0
#define APR_HAVE_NETINET_SCTP_UIO_H 0
#define APR_HAVE_NETINET_TCP_H 1
#define APR_HAVE_PROCESS_H 0
@@ -260,7 +260,7 @@ extern "C" {
#define APR_HAVE_MEMCHR 1
#define APR_HAVE_STRUCT_RLIMIT 1
#define APR_HAVE_UNION_SEMUN 0
-#define APR_HAVE_SCTP 1
+#define APR_HAVE_SCTP 0
#define APR_HAVE_IOVEC 1
/* APR Feature Macros */
@@ -276,9 +276,9 @@ extern "C" {
#define APR_HAS_UNICODE_FS 0
#define APR_HAS_PROC_INVOKED 0
#define APR_HAS_USER 1
-#define APR_HAS_LARGE_FILES 1
+#define APR_HAS_LARGE_FILES 0
#define APR_HAS_XTHREAD_FILES 0
-#define APR_HAS_OS_UUID 1
+#define APR_HAS_OS_UUID 0
#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0
@@ -314,7 +314,7 @@ typedef unsigned short apr_uint16_t;
typedef int apr_int32_t;
typedef unsigned int apr_uint32_t;
-#define APR_SIZEOF_VOIDP 4
+#define APR_SIZEOF_VOIDP 8
/*
* Darwin 10's default compiler (gcc42) builds for both 64 and
@@ -349,15 +349,15 @@ typedef unsigned int apr_uint32_t;
#define UINT64_C(v) (v ## ULL)
#endif
#else
- typedef long long apr_int64_t;
- typedef unsigned long long apr_uint64_t;
+ typedef long apr_int64_t;
+ typedef unsigned long apr_uint64_t;
#endif
typedef size_t apr_size_t;
typedef ssize_t apr_ssize_t;
-typedef off64_t apr_off_t;
+typedef off_t apr_off_t;
typedef socklen_t apr_socklen_t;
-typedef unsigned long apr_ino_t;
+typedef ino_t apr_ino_t;
#if APR_SIZEOF_VOIDP == 8
typedef apr_uint64_t apr_uintptr_t;
@@ -530,25 +530,25 @@ typedef apr_uint32_t apr_uintptr_t;
* configure.in.
*/
-#define APR_SSIZE_T_FMT "d"
+#define APR_SSIZE_T_FMT "ld"
/* And APR_SIZE_T_FMT */
-#define APR_SIZE_T_FMT "u"
+#define APR_SIZE_T_FMT "lu"
/* And APR_OFF_T_FMT */
-#define APR_OFF_T_FMT APR_INT64_T_FMT
+#define APR_OFF_T_FMT "ld"
/* And APR_PID_T_FMT */
#define APR_PID_T_FMT "d"
/* And APR_INT64_T_FMT */
-#define APR_INT64_T_FMT "lld"
+#define APR_INT64_T_FMT "ld"
/* And APR_UINT64_T_FMT */
-#define APR_UINT64_T_FMT "llu"
+#define APR_UINT64_T_FMT "lu"
/* And APR_UINT64_T_HEX_FMT */
-#define APR_UINT64_T_HEX_FMT "llx"
+#define APR_UINT64_T_HEX_FMT "lx"
/*
* Ensure we work with universal binaries on Darwin
diff --git a/src/3rd_party/dbus-1.7.8/Makefile.in b/src/3rd_party/dbus-1.7.8/Makefile.in
index ef8eee1c2..77159082c 100644
--- a/src/3rd_party/dbus-1.7.8/Makefile.in
+++ b/src/3rd_party/dbus-1.7.8/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -38,6 +38,23 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -131,6 +148,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -547,8 +569,11 @@ distclean-libtool:
-rm -f libtool config.lt
install-pkgconfigDATA: $(pkgconfig_DATA)
@$(NORMAL_INSTALL)
- test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@@ -733,13 +758,10 @@ distdir: $(DISTFILES)
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
- test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
@@ -825,7 +847,7 @@ distcheck: dist
*.zip*) \
unzip $(distdir).zip ;;\
esac
- chmod -R a-w $(distdir); chmod a+w $(distdir)
+ chmod -R a-w $(distdir); chmod u+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
diff --git a/src/3rd_party/dbus-1.7.8/aclocal.m4 b/src/3rd_party/dbus-1.7.8/aclocal.m4
index 0794ee7f9..a34b9793f 100644
--- a/src/3rd_party/dbus-1.7.8/aclocal.m4
+++ b/src/3rd_party/dbus-1.7.8/aclocal.m4
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
@@ -14,8 +14,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
@@ -38,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.11'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11.3], [],
+m4_if([$1], [1.11.6], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -54,7 +54,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.3])dnl
+[AM_AUTOMAKE_VERSION([1.11.6])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
diff --git a/src/3rd_party/dbus-1.7.8/bus/Makefile.in b/src/3rd_party/dbus-1.7.8/bus/Makefile.in
index aacefc452..b9ea35615 100644
--- a/src/3rd_party/dbus-1.7.8/bus/Makefile.in
+++ b/src/3rd_party/dbus-1.7.8/bus/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -18,6 +18,23 @@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -238,6 +255,11 @@ DIST_SOURCES = $(am__bus_test_SOURCES_DIST) \
$(am__dbus_daemon_SOURCES_DIST) \
$(dbus_daemon_launch_helper_SOURCES) \
$(dbus_daemon_launch_helper_test_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
DATA = $(agent_DATA) $(config_DATA) $(systemdsystemunit_DATA)
ETAGS = etags
CTAGS = ctags
@@ -674,8 +696,11 @@ dbus.socket: $(top_builddir)/config.status $(srcdir)/dbus.socket.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-dbus_daemon_execPROGRAMS: $(dbus_daemon_exec_PROGRAMS)
@$(NORMAL_INSTALL)
- test -z "$(dbus_daemon_execdir)" || $(MKDIR_P) "$(DESTDIR)$(dbus_daemon_execdir)"
@list='$(dbus_daemon_exec_PROGRAMS)'; test -n "$(dbus_daemon_execdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(dbus_daemon_execdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(dbus_daemon_execdir)" || exit 1; \
+ fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p || test -f $$p1; \
@@ -717,8 +742,11 @@ clean-dbus_daemon_execPROGRAMS:
rm -f $$list
install-libexecPROGRAMS: $(libexec_PROGRAMS)
@$(NORMAL_INSTALL)
- test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
@list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \
+ fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p || test -f $$p1; \
@@ -787,8 +815,11 @@ dbus-daemon-launch-helper-test$(EXEEXT): $(dbus_daemon_launch_helper_test_OBJECT
$(AM_V_CCLD)$(LINK) $(dbus_daemon_launch_helper_test_OBJECTS) $(dbus_daemon_launch_helper_test_LDADD) $(LIBS)
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
@@ -819,8 +850,11 @@ uninstall-binSCRIPTS:
dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
install-initdSCRIPTS: $(initd_SCRIPTS)
@$(NORMAL_INSTALL)
- test -z "$(initddir)" || $(MKDIR_P) "$(DESTDIR)$(initddir)"
@list='$(initd_SCRIPTS)'; test -n "$(initddir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(initddir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(initddir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
@@ -1121,8 +1155,11 @@ clean-libtool:
-rm -rf .libs _libs
install-agentDATA: $(agent_DATA)
@$(NORMAL_INSTALL)
- test -z "$(agentdir)" || $(MKDIR_P) "$(DESTDIR)$(agentdir)"
@list='$(agent_DATA)'; test -n "$(agentdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(agentdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(agentdir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@@ -1139,8 +1176,11 @@ uninstall-agentDATA:
dir='$(DESTDIR)$(agentdir)'; $(am__uninstall_files_from_dir)
install-configDATA: $(config_DATA)
@$(NORMAL_INSTALL)
- test -z "$(configdir)" || $(MKDIR_P) "$(DESTDIR)$(configdir)"
@list='$(config_DATA)'; test -n "$(configdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(configdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(configdir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@@ -1157,8 +1197,11 @@ uninstall-configDATA:
dir='$(DESTDIR)$(configdir)'; $(am__uninstall_files_from_dir)
install-systemdsystemunitDATA: $(systemdsystemunit_DATA)
@$(NORMAL_INSTALL)
- test -z "$(systemdsystemunitdir)" || $(MKDIR_P) "$(DESTDIR)$(systemdsystemunitdir)"
@list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(systemdsystemunitdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(systemdsystemunitdir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
diff --git a/src/3rd_party/dbus-1.7.8/configure b/src/3rd_party/dbus-1.7.8/configure
index a42f1f8c2..05f148c90 100755
--- a/src/3rd_party/dbus-1.7.8/configure
+++ b/src/3rd_party/dbus-1.7.8/configure
@@ -1,13 +1,11 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for dbus 1.7.8.
+# Generated by GNU Autoconf 2.69 for dbus 1.7.8.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=dbus>.
#
#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -136,6 +134,31 @@ export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
@@ -169,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -222,21 +246,25 @@ IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
- # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
- case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
- esac
- exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
fi
if test x$as_have_required = xno; then :
@@ -340,6 +368,14 @@ $as_echo X"$as_dir" |
} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -461,6 +497,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
@@ -495,16 +535,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -516,28 +556,8 @@ else
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -1407,8 +1427,6 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1763,9 +1781,9 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
dbus configure 1.7.8
-generated by GNU Autoconf 2.68
+generated by GNU Autoconf 2.69
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -2080,7 +2098,7 @@ $as_echo "$ac_try_echo"; } >&5
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
- $as_test_x conftest$ac_exeext
+ test -x conftest$ac_exeext
}; then :
ac_retval=0
else
@@ -2230,7 +2248,7 @@ $as_echo "$ac_try_echo"; } >&5
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
- $as_test_x conftest$ac_exeext
+ test -x conftest$ac_exeext
}; then :
ac_retval=0
else
@@ -2266,7 +2284,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -2282,7 +2301,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -2308,7 +2328,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -2324,7 +2345,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -2358,7 +2380,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -2477,7 +2500,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by dbus $as_me 1.7.8, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2969,7 +2992,7 @@ case $as_dir/ in #((
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
@@ -3138,7 +3161,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3178,7 +3201,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3229,7 +3252,7 @@ do
test -z "$as_dir" && as_dir=.
for ac_prog in mkdir gmkdir; do
for ac_exec_ext in '' $ac_executable_extensions; do
- { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
'mkdir (GNU coreutils) '* | \
'mkdir (coreutils) '* | \
@@ -3282,7 +3305,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3623,7 +3646,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3663,7 +3686,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3716,7 +3739,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3757,7 +3780,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
@@ -3815,7 +3838,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3859,7 +3882,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4305,8 +4328,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -4736,7 +4758,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4780,7 +4802,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -5248,7 +5270,7 @@ do
for ac_prog in grep ggrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+ as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
@@ -5314,7 +5336,7 @@ do
for ac_prog in egrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+ as_fn_executable_p "$ac_path_EGREP" || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
@@ -5521,8 +5543,8 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-# define __EXTENSIONS__ 1
- $ac_includes_default
+# define __EXTENSIONS__ 1
+ $ac_includes_default
int
main ()
{
@@ -5878,7 +5900,7 @@ do
for ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+ as_fn_executable_p "$ac_path_SED" || continue
# Check for GNU ac_path_SED and select it if it is found.
# Check for GNU $ac_path_SED
case `"$ac_path_SED" --version 2>&1` in
@@ -5957,7 +5979,7 @@ do
for ac_prog in fgrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+ as_fn_executable_p "$ac_path_FGREP" || continue
# Check for GNU ac_path_FGREP and select it if it is found.
# Check for GNU $ac_path_FGREP
case `"$ac_path_FGREP" --version 2>&1` in
@@ -6213,7 +6235,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6257,7 +6279,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6682,7 +6704,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6722,7 +6744,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OBJDUMP="objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7024,7 +7046,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7064,7 +7086,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DLLTOOL="dlltool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7167,7 +7189,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7211,7 +7233,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_AR="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7336,7 +7358,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7376,7 +7398,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7435,7 +7457,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7475,7 +7497,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8131,7 +8153,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8171,7 +8193,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8251,7 +8273,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8291,7 +8313,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8343,7 +8365,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8383,7 +8405,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_NMEDIT="nmedit"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8435,7 +8457,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8475,7 +8497,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_LIPO="lipo"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8527,7 +8549,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8567,7 +8589,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL="otool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8619,7 +8641,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8659,7 +8681,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL64="otool64"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -16125,7 +16147,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -16168,7 +16190,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -16239,7 +16261,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_RC="${ac_tool_prefix}windres"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -16279,7 +16301,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RC="windres"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -16448,7 +16470,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -16488,7 +16510,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_WINDRES="windres"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -17131,7 +17153,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -17369,7 +17391,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -19250,7 +19272,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -19293,7 +19315,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -20097,7 +20119,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_LAUNCHCTL="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -21757,7 +21779,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -21833,7 +21855,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_XSLTPROC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -21886,7 +21908,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_XMLTO="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -23100,16 +23122,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -23169,28 +23191,16 @@ else
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -23212,7 +23222,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by dbus $as_me 1.7.8, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -23278,10 +23288,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
dbus config.status 1.7.8
-configured by $0, generated by GNU Autoconf 2.68,
+configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -23372,7 +23382,7 @@ fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
diff --git a/src/3rd_party/dbus-1.7.8/dbus/Makefile.in b/src/3rd_party/dbus-1.7.8/dbus/Makefile.in
index 3c011349b..43bc1ef4d 100644
--- a/src/3rd_party/dbus-1.7.8/dbus/Makefile.in
+++ b/src/3rd_party/dbus-1.7.8/dbus/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -18,6 +18,23 @@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -381,6 +398,11 @@ SOURCES = $(libdbus_1_la_SOURCES) $(libdbus_init_win_la_SOURCES) \
DIST_SOURCES = $(am__libdbus_1_la_SOURCES_DIST) \
$(am__libdbus_init_win_la_SOURCES_DIST) \
$(am__libdbus_internal_la_SOURCES_DIST) $(dbus_test_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
HEADERS = $(dbusinclude_HEADERS) $(nodist_dbusarchinclude_HEADERS)
ETAGS = etags
CTAGS = ctags
@@ -892,7 +914,6 @@ dbus-arch-deps.h: $(top_builddir)/config.status $(srcdir)/dbus-arch-deps.h.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
- test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
@@ -900,6 +921,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
else :; fi; \
done; \
test -z "$$list2" || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
@@ -2079,8 +2102,11 @@ clean-libtool:
-rm -rf .libs _libs
install-dbusincludeHEADERS: $(dbusinclude_HEADERS)
@$(NORMAL_INSTALL)
- test -z "$(dbusincludedir)" || $(MKDIR_P) "$(DESTDIR)$(dbusincludedir)"
@list='$(dbusinclude_HEADERS)'; test -n "$(dbusincludedir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(dbusincludedir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(dbusincludedir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@@ -2097,8 +2123,11 @@ uninstall-dbusincludeHEADERS:
dir='$(DESTDIR)$(dbusincludedir)'; $(am__uninstall_files_from_dir)
install-nodist_dbusarchincludeHEADERS: $(nodist_dbusarchinclude_HEADERS)
@$(NORMAL_INSTALL)
- test -z "$(dbusarchincludedir)" || $(MKDIR_P) "$(DESTDIR)$(dbusarchincludedir)"
@list='$(nodist_dbusarchinclude_HEADERS)'; test -n "$(dbusarchincludedir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(dbusarchincludedir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(dbusarchincludedir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
diff --git a/src/3rd_party/dbus-1.7.8/doc/Makefile.in b/src/3rd_party/dbus-1.7.8/doc/Makefile.in
index 2378508c7..e58e7693e 100644
--- a/src/3rd_party/dbus-1.7.8/doc/Makefile.in
+++ b/src/3rd_party/dbus-1.7.8/doc/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
@SET_MAKE@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -68,6 +85,11 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
SOURCES =
DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -433,9 +455,18 @@ clean-libtool:
-rm -rf .libs _libs
install-man1: $(man1_MANS)
@$(NORMAL_INSTALL)
- test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
- @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
- { for i in $$list; do echo "$$i"; done; \
+ @list1='$(man1_MANS)'; \
+ list2=''; \
+ test -n "$(man1dir)" \
+ && test -n "`echo $$list1$$list2`" \
+ || exit 0; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+ { for i in $$list1; do echo "$$i"; done; \
+ if test -n "$$list2"; then \
+ for i in $$list2; do echo "$$i"; done \
+ | sed -n '/\.1[a-z]*$$/p'; \
+ fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
@@ -465,8 +496,11 @@ uninstall-man1:
dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
install-dist_docDATA: $(dist_doc_DATA)
@$(NORMAL_INSTALL)
- test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@@ -483,8 +517,11 @@ uninstall-dist_docDATA:
dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
install-dist_htmlDATA: $(dist_html_DATA)
@$(NORMAL_INSTALL)
- test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
@list='$(dist_html_DATA)'; test -n "$(htmldir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@@ -501,8 +538,11 @@ uninstall-dist_htmlDATA:
dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir)
install-htmlDATA: $(html_DATA)
@$(NORMAL_INSTALL)
- test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
@list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
diff --git a/src/3rd_party/dbus-1.7.8/test/Makefile.in b/src/3rd_party/dbus-1.7.8/test/Makefile.in
index 2f4587b93..90ebd74dc 100644
--- a/src/3rd_party/dbus-1.7.8/test/Makefile.in
+++ b/src/3rd_party/dbus-1.7.8/test/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -18,6 +18,23 @@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -253,6 +270,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
DATA = $(noinst_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
@@ -808,8 +830,11 @@ clean-noinstPROGRAMS:
rm -f $$list
install-testexecPROGRAMS: $(testexec_PROGRAMS)
@$(NORMAL_INSTALL)
- test -z "$(testexecdir)" || $(MKDIR_P) "$(DESTDIR)$(testexecdir)"
@list='$(testexec_PROGRAMS)'; test -n "$(testexecdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(testexecdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(testexecdir)" || exit 1; \
+ fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p || test -f $$p1; \
@@ -1425,13 +1450,10 @@ distdir: $(DISTFILES)
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
- test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/Makefile.in b/src/3rd_party/dbus-1.7.8/test/name-test/Makefile.in
index 70f5955d0..089c7adbc 100644
--- a/src/3rd_party/dbus-1.7.8/test/name-test/Makefile.in
+++ b/src/3rd_party/dbus-1.7.8/test/name-test/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
@SET_MAKE@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -123,6 +140,11 @@ DIST_SOURCES = test-autolaunch.c test-ids.c \
test-pending-call-dispatch.c test-pending-call-timeout.c \
test-privserver.c test-privserver-client.c test-shutdown.c \
test-threads-init.c
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
ETAGS = etags
CTAGS = ctags
am__tty_colors = \
diff --git a/src/3rd_party/dbus-1.7.8/tools/Makefile.in b/src/3rd_party/dbus-1.7.8/tools/Makefile.in
index 39a51a154..db619be6f 100644
--- a/src/3rd_party/dbus-1.7.8/tools/Makefile.in
+++ b/src/3rd_party/dbus-1.7.8/tools/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
@SET_MAKE@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -128,6 +145,11 @@ DIST_SOURCES = $(dbus_cleanup_sockets_SOURCES) \
$(am__dbus_launch_SOURCES_DIST) $(dbus_monitor_SOURCES) \
$(am__dbus_run_session_SOURCES_DIST) $(dbus_send_SOURCES) \
$(dbus_uuidgen_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -437,8 +459,11 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p || test -f $$p1; \
diff --git a/src/3rd_party/dbus-cmake/CMakeLists.txt b/src/3rd_party/dbus-cmake/CMakeLists.txt
index baa23adc5..141335414 100644
--- a/src/3rd_party/dbus-cmake/CMakeLists.txt
+++ b/src/3rd_party/dbus-cmake/CMakeLists.txt
@@ -63,7 +63,18 @@ add_custom_command(OUTPUT ${DBUS_BUILD_DIRECTORY}/Makefile
)
add_custom_target(dbus ALL make
- COMMAND /bin/bash -c \"grep \\".commit_hash\\" ${DBUS_BUILD_DIRECTORY}/dbus/.libs/libdbus-1.so 1>/dev/null 2>&1\; if [ ! \\\$$? == 0 ]\; then cd ${CMAKE_CURRENT_SOURCE_DIR} && git log --pretty=\\"format:%H\\" -1 ${DBUS_SOURCE_DIRECTORY} > /tmp/commit_hash 2>/dev/null && echo \\"Adding .commit_hash section\\" && ${objcopy} --add-section .commit_hash=/tmp/commit_hash ${DBUS_BUILD_DIRECTORY}/dbus/.libs/libdbus-1.so ${DBUS_BUILD_DIRECTORY}/dbus/.libs/libdbus-1.so 1>/dev/null 2>&1\; fi\"
+ COMMAND /bin/bash -c \"
+ cd ${CMAKE_CURRENT_SOURCE_DIR}\;
+ git log . 1>/dev/null 2>&1\;
+ if [ \\$$? == 0 ]; then
+ grep \\".commit_hash\\" ${DBUS_BUILD_DIRECTORY}/dbus/.libs/libdbus-1.so 1>/dev/null 2>&1\;
+ if [ ! \\\$$? == 0 ]\; then
+ cd ${CMAKE_CURRENT_SOURCE_DIR} &&
+ git log --pretty=\\"format:%H\\" -1 ${DBUS_SOURCE_DIRECTORY} > /tmp/commit_hash 2>/dev/null &&
+ echo \\"Adding .commit_hash section\\" &&
+ ${objcopy} --add-section .commit_hash=/tmp/commit_hash ${DBUS_BUILD_DIRECTORY}/dbus/.libs/libdbus-1.so ${DBUS_BUILD_DIRECTORY}/dbus/.libs/libdbus-1.so 1>/dev/null 2>&1\;
+ fi;
+ fi\"
DEPENDS ${DBUS_BUILD_DIRECTORY}/Makefile
WORKING_DIRECTORY ${DBUS_BUILD_DIRECTORY}
)
diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt
index 7e23cdc6a..d27a282c2 100644
--- a/src/appMain/CMakeLists.txt
+++ b/src/appMain/CMakeLists.txt
@@ -55,7 +55,9 @@ if (TIME_TESTER)
set(TIME_TESTER_LIB
TimeTester)
endif()
+
set(LIBRARIES
+ MediaManager
ApplicationManager
HMI_API
MOBILE_API
@@ -74,7 +76,6 @@ set(LIBRARIES
Utils
jsoncpp
ConfigProfile
- MediaManager
Resumption
)
@@ -104,52 +105,43 @@ endif()
include_directories (
./
- ${CMAKE_SOURCE_DIR}/src/components/protocol_handler/include/
+ ${COMPONENTS_DIR}/protocol_handler/include/
${JSONCPP_INCLUDE_DIRECTORY}
- ${CMAKE_SOURCE_DIR}/src/components/application_manager/include
- ${CMAKE_SOURCE_DIR}/src/components/formatters/include
- ${CMAKE_SOURCE_DIR}/src/components/transport_manager/include
+ ${COMPONENTS_DIR}/application_manager/include
+ ${COMPONENTS_DIR}/formatters/include
+ ${COMPONENTS_DIR}/transport_manager/include
+ ${COMPONENTS_DIR}/security_manager/include
${SecurityManagerIncludeDir}
-
- ${CMAKE_SOURCE_DIR}/src/components/config_profile/include
- ${CMAKE_SOURCE_DIR}/src/components/utils/include/
- ${CMAKE_SOURCE_DIR}/src/components/connection_handler/include/
- ${CMAKE_SOURCE_DIR}/src/components/hmi_message_handler/include
- ${CMAKE_SOURCE_DIR}/src/components/request_watchdog/include
- ${CMAKE_SOURCE_DIR}/src/components/smart_objects/include/
- ${CMAKE_SOURCE_DIR}/src/components/media_manager/include/
- ${CMAKE_SOURCE_DIR}/src/components/time_tester/include
- ${CMAKE_SOURCE_DIR}/src/components/policy/src/policy/include/
- ${CMAKE_SOURCE_DIR}/src/components/resumption/include/
+ ${COMPONENTS_DIR}/security_manager/include
+ ${COMPONENTS_DIR}/config_profile/include
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/connection_handler/include/
+ ${COMPONENTS_DIR}/hmi_message_handler/include
+ ${COMPONENTS_DIR}/request_watchdog/include
+ ${COMPONENTS_DIR}/smart_objects/include/
+ ${COMPONENTS_DIR}/media_manager/include/
+ ${COMPONENTS_DIR}/time_tester/include
+ ${COMPONENTS_DIR}/policy/src/policy/include/
+ ${COMPONENTS_DIR}/resumption/include/
${MESSAGE_BROKER_INCLUDE_DIRECTORY}
${ENCRYPTION_INCLUDE_DIRECTORY}
- ${CMAKE_SOURCE_DIR}/src/components/
+ ${COMPONENTS_DIR}
${CMAKE_BINARY_DIR}/src/components/
- ${CMAKE_SOURCE_DIR}/src/components/dbus/include/
+ ${COMPONENTS_DIR}/dbus/include/
${CMAKE_BINARY_DIR}/src/components/policy/src/policy
${CMAKE_SOURCE_DIR}
${default_media_inc}
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${CMAKE_SOURCE_DIR}/src/3rd_party/dbus-1.7.8
+ ${CMAKE_SOURCE_DIR}/src/3rd_party/dbus-1.7.8/dbus/
)
-add_custom_target(gitversion
- COMMAND export GITVERSION=`git rev-parse HEAD` \;
- if ! grep -s \"\$\${GITVERSION}\" ${CMAKE_CURRENT_BINARY_DIR}/gitversion.cc > /dev/null \;
- then echo -n \"const char *gitVersion = \\\"Built against \$\${GITVERSION} revision\\\"\;\" > ${CMAKE_CURRENT_BINARY_DIR}/gitversion.cc\; fi
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-)
-add_custom_command(
- OUTPUT gitversion.cc
- DEPENDS gitversion
-)
set (SOURCES
main.cc
life_cycle.cc
signal_handlers.cc
- gitversion.cc
)
-
if( NOT CMAKE_BUILD_TYPE )
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build. Options are: None, Debug, Release, RelWithDebInfo, MinSizeRel." FORCE)
endif()
@@ -158,84 +150,6 @@ add_executable(${PROJECT} ${SOURCES})
target_link_libraries(${PROJECT} ${LIBRARIES})
-#======================= Unit-Test section =======================
-if(BUILD_TESTS)
- set (AM_TEST_DIR ${CMAKE_SOURCE_DIR}/src/components/application_manager/test)
- set (AM_MOCK_DIR ${CMAKE_SOURCE_DIR}/src/components/application_manager/test/mock)
-
- get_property(the_include_dirs DIRECTORY "" PROPERTY INCLUDE_DIRECTORIES)
- #replace include for mocking singltone
- set(class_to_mock ${CMAKE_SOURCE_DIR}/src/components/application_manager/include)
- list(FIND the_include_dirs ${class_to_mock} find_idx)
- if(find_idx GREATER -1)
- LIST_REPLACE(the_include_dirs ${find_idx} ${AM_MOCK_DIR}/include)
- endif()
- set_property(DIRECTORY "" PROPERTY INCLUDE_DIRECTORIES ${the_include_dirs})
-
-
-include_directories (
- ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/include
- ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/gtest/include
-)
-
- set(testSources
- ./main_test.cc
- ${CMAKE_SOURCE_DIR}/src/components/utils/test/date_time_test.cc
- ${CMAKE_SOURCE_DIR}/src/components/utils/test/file_system_test.cc
- ${CMAKE_SOURCE_DIR}/src/components/media_manager/test/media_adapter_impl_test.cc
- ${AM_TEST_DIR}/command_impl_test.cc
- )
-
- set(test_exec_libraries
- gmock
- gtest
- ConfigProfile
- SmartObjects
- gmock
- gtest
- gmock
- gmock_main
- ApplicationManagerTest #Mocked Singlton
- HMI_API
- MOBILE_API
- v4_protocol_v1_2_no_extra
- SmartObjects
- formatters
- ProtocolLibrary
- ProtocolHandler
- connectionHandler
- HMIMessageHandler
- Utils
- jsoncpp
- ConfigProfile
- MediaManager
- Resumption
- )
-
-if(ENABLE_LOG)
- list(APPEND test_exec_libraries log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
- list(APPEND test_exec_libraries apr-1 -L${APR_LIBS_DIRECTORY})
- list(APPEND test_exec_libraries aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
- list(APPEND test_exec_libraries expat -L${EXPAT_LIBS_DIRECTORY})
-endif()
-
- include(${CMAKE_SOURCE_DIR}/src/components/policy/test/include.cmake)
-
- IF(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
- list(REMOVE_ITEM test_exec_libraries dl)
- endif()
-
- add_executable(${PROJECT}_test ${testSources})
- target_link_libraries(${PROJECT}_test ${test_exec_libraries})
-
- file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx.properties DESTINATION ${CMAKE_BINARY_DIR}/test/)
- file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/smartDeviceLink.ini DESTINATION ${CMAKE_BINARY_DIR}/test/)
- file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/hmi_capabilities.json DESTINATION ${CMAKE_BINARY_DIR}/test/)
-
-endif()
-
-#=================================================================
-
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})
@@ -246,7 +160,27 @@ if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/init_policy.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endif ()
-
+# Replace commit in ini file
+set(GITCOMMIT "")
+if(EXISTS ${CMAKE_SOURCE_DIR}/.git)
+ find_package(Git)
+ if(GIT_FOUND)
+ execute_process(
+ COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
+ WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+ OUTPUT_VARIABLE GITCOMMIT ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(INI_FILE ${CMAKE_CURRENT_BINARY_DIR}/smartDeviceLink.ini)
+ if(EXISTS ${INI_FILE})
+ file(READ ${INI_FILE} FILE_CONTENT)
+ set(LINE SDLVersion)
+ set(SEARCH_REGEX "${LINE}([^/\r/\n]+)")
+ string(REGEX REPLACE "${SEARCH_REGEX}" "${LINE} = ${GITCOMMIT}"
+ MODIFIED_FILE_CONTENT "${FILE_CONTENT}")
+ file(WRITE "${INI_FILE}" "${MODIFIED_FILE_CONTENT}")
+ endif()
+ endif(GIT_FOUND)
+endif()
if (${QT_HMI})
set(main_qml "hmi/MainWindow.qml")
@@ -265,10 +199,6 @@ if (${QT_HMI})
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/start_hmi.sh
"#!/bin/sh\n${start_command} ${command_arguments}\n")
-elseif (${WEB_HMI})
- file(COPY ${CMAKE_HOME_DIRECTORY}/src/components/HMI/ DESTINATION ${CMAKE_BINARY_DIR}/src/components/HMI/)
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hmi_link
- "${CMAKE_BINARY_DIR}/src/components/HMI/index.html")
endif ()
# Install rules
@@ -279,9 +209,10 @@ install(
${CMAKE_SOURCE_DIR}/mycert.pem ${CMAKE_SOURCE_DIR}/mykey.pem
DESTINATION bin
)
+
if (${WEB_HMI})
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/hmi_link DESTINATION bin)
+ install( DIRECTORY ${CMAKE_HOME_DIRECTORY}/src/components/HMI/ DESTINATION bin/HMI)
endif ()
elseif (${QT_HMI})
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
diff --git a/src/appMain/life_cycle.cc b/src/appMain/life_cycle.cc
index 8d4926510..ca629e231 100644
--- a/src/appMain/life_cycle.cc
+++ b/src/appMain/life_cycle.cc
@@ -40,7 +40,9 @@
#include "security_manager/crypto_manager_impl.h"
#endif // ENABLE_SECURITY
-#include "utils/threads/thread_manager.h"
+#ifdef ENABLE_LOG
+#include "utils/log_message_loop_thread.h"
+#endif
using threads::Thread;
@@ -51,7 +53,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "appMain")
namespace {
void NameMessageBrokerThread(const System::Thread& thread,
const std::string& name) {
- Thread::SetNameForId(Thread::Id(thread.GetId()), name);
+ Thread::SetNameForId(thread.GetId(), name);
}
} // namespace
@@ -92,7 +94,12 @@ bool LifeCycle::StartComponents() {
DCHECK(transport_manager_ != NULL);
protocol_handler_ =
- new protocol_handler::ProtocolHandlerImpl(transport_manager_);
+ new protocol_handler::ProtocolHandlerImpl(transport_manager_,
+ profile::Profile::instance()->message_frequency_time(),
+ profile::Profile::instance()->message_frequency_count(),
+ profile::Profile::instance()->malformed_message_filtering(),
+ profile::Profile::instance()->malformed_frequency_time(),
+ profile::Profile::instance()->malformed_frequency_count());
DCHECK(protocol_handler_ != NULL);
connection_handler_ =
@@ -336,27 +343,35 @@ bool LifeCycle::InitMessageSystem() {
#endif // MQUEUE_HMIADAPTER
namespace {
+
void sig_handler(int sig) {
- MessageQueue<threads::ThreadManager::ThreadDesc>& threads = ::threads::ThreadManager::instance()->threads_to_terminate;
- threads.Shutdown();
+ // Do nothing
+ }
+
+ void agony(int sig) {
+// these actions are not signal safe
+// (in case logger is on)
+// but they cannot be moved to a separate thread
+// because the application most probably will crash as soon as this handler returns
+//
+// the application is anyway about to crash
+ LOG4CXX_FATAL(logger_, "Stopping application due to segmentation fault");
+#ifdef ENABLE_LOG
+ logger::LogMessageLoopThread::destroy();
+#endif
}
-}
+
+} // namespace
void LifeCycle::Run() {
- // First, register signal handler
+ // First, register signal handlers
::utils::SubscribeToTerminateSignal(&sig_handler);
- // Then run main loop until signal caught
- MessageQueue<threads::ThreadManager::ThreadDesc>& threads = ::threads::ThreadManager::instance()->threads_to_terminate;
- while(!threads.IsShuttingDown()) {
- while (!threads.empty()) {
- ::threads::ThreadManager::ThreadDesc desc = threads.pop();
- pthread_join(desc.handle, NULL);
- delete desc.delegate;
- }
- threads.wait();
- }
+ ::utils::SubscribeToFaultSignal(&agony);
+ // Now wait for any signal
+ pause();
}
+
void LifeCycle::StopComponents() {
if (!components_started_) {
LOG4CXX_TRACE(logger_, "exit");
@@ -368,15 +383,19 @@ void LifeCycle::StopComponents() {
protocol_handler_->RemoveProtocolObserver(app_manager_);
app_manager_->Stop();
- LOG4CXX_INFO(logger_, "Destroying Media Manager");
+ LOG4CXX_INFO(logger_, "Stopping Protocol Handler");
protocol_handler_->RemoveProtocolObserver(media_manager_);
#ifdef ENABLE_SECURITY
protocol_handler_->RemoveProtocolObserver(security_manager_);
#endif // ENABLE_SECURITY
+ protocol_handler_->Stop();
+
+ LOG4CXX_INFO(logger_, "Destroying Media Manager");
media_manager_->SetProtocolHandler(NULL);
media_manager::MediaManagerImpl::destroy();
LOG4CXX_INFO(logger_, "Destroying Transport Manager.");
+ transport_manager_->Visibility(false);
transport_manager_->Stop();
transport_manager::TransportManagerDefault::destroy();
@@ -421,13 +440,16 @@ void LifeCycle::StopComponents() {
#endif // DBUS_HMIADAPTER
#ifdef MESSAGEBROKER_HMIADAPTER
hmi_handler_->RemoveHMIMessageAdapter(mb_adapter_);
- hmi_message_handler::HMIMessageHandlerImpl::destroy();
if (mb_adapter_) {
mb_adapter_->unregisterController();
mb_adapter_->Close();
mb_adapter_->exitReceivingThread();
+ if (mb_adapter_thread_) {
+ mb_adapter_thread_->Join();
+ }
delete mb_adapter_;
}
+ hmi_message_handler::HMIMessageHandlerImpl::destroy();
if (mb_adapter_thread_) {
mb_adapter_thread_->Stop();
delete mb_adapter_thread_;
diff --git a/src/appMain/life_cycle.h b/src/appMain/life_cycle.h
index 349457568..d85678047 100644
--- a/src/appMain/life_cycle.h
+++ b/src/appMain/life_cycle.h
@@ -33,6 +33,7 @@
#ifndef SRC_APPMAIN_LIFE_CYCLE_H_
#define SRC_APPMAIN_LIFE_CYCLE_H_
#include "utils/macro.h"
+#include "unistd.h"
#include "hmi_message_handler/hmi_message_handler_impl.h"
#ifdef DBUS_HMIADAPTER
@@ -86,6 +87,7 @@ class LifeCycle : public utils::Singleton<LifeCycle> {
void Run();
void StopComponents();
+
private:
LifeCycle();
transport_manager::TransportManager* transport_manager_;
diff --git a/src/appMain/main.cc b/src/appMain/main.cc
index 331b0397e..2c14bfa3b 100644
--- a/src/appMain/main.cc
+++ b/src/appMain/main.cc
@@ -67,14 +67,12 @@
CREATE_LOGGERPTR_GLOBAL(logger_, "appMain")
-extern const char* gitVersion;
namespace {
const std::string kBrowser = "/usr/bin/chromium-browser";
const std::string kBrowserName = "chromium-browser";
const std::string kBrowserParams = "--auth-schemes=basic,digest,ntlm";
const std::string kLocalHostAddress = "127.0.0.1";
-const std::string kApplicationVersion = "Develop";
#ifdef WEB_HMI
/**
@@ -82,33 +80,12 @@ const std::string kApplicationVersion = "Develop";
* @return true if success otherwise false.
*/
bool InitHmi() {
-
-struct stat sb;
-if (stat("hmi_link", &sb) == -1) {
- LOG4CXX_FATAL(logger_, "File with HMI link doesn't exist!");
- return false;
-}
-
-std::ifstream file_str;
-file_str.open("hmi_link");
-
-if (!file_str.is_open()) {
- LOG4CXX_FATAL(logger_, "File with HMI link was not opened!");
- return false;
-}
-
-std::string hmi_link;
-std::getline(file_str, hmi_link);
-
-
-LOG4CXX_INFO(logger_,
- "Input string:" << hmi_link << " length = " << hmi_link.size());
-file_str.close();
-
-if (stat(hmi_link.c_str(), &sb) == -1) {
- LOG4CXX_FATAL(logger_, "HMI index.html doesn't exist!");
- return false;
-}
+ std::string hmi_link = profile::Profile::instance()->link_to_web_hmi();
+ struct stat sb;
+ if (stat(hmi_link.c_str(), &sb) == -1) {
+ LOG4CXX_FATAL(logger_, "HMI index.html doesn't exist!");
+ return false;
+ }
return utils::System(kBrowser, kBrowserName).Add(kBrowserParams).Add(hmi_link)
.Execute();
}
@@ -144,7 +121,6 @@ int32_t main(int32_t argc, char** argv) {
// --------------------------------------------------------------------------
// Logger initialization
INIT_LOGGER("log4cxx.properties");
- LOG4CXX_INFO(logger_, gitVersion);
#if defined(__QNXNTO__) and defined(GCOV_ENABLED)
LOG4CXX_WARN(logger_,
"Attention! This application was built with unsupported "
@@ -158,7 +134,8 @@ int32_t main(int32_t argc, char** argv) {
}
LOG4CXX_INFO(logger_, "Application started!");
- LOG4CXX_INFO(logger_, "Application version " << kApplicationVersion);
+ LOG4CXX_INFO(logger_, "SDL version: "
+ << profile::Profile::instance()->sdl_version());
// Initialize gstreamer. Needed to activate debug from the command line.
#if defined(EXTENDED_MEDIA_MODE)
@@ -176,10 +153,7 @@ int32_t main(int32_t argc, char** argv) {
#ifdef __QNX__
if (profile::Profile::instance()->enable_policy()) {
if (!utils::System("./init_policy.sh").Execute(true)) {
- LOG4CXX_ERROR(logger_, "Failed initialization of policy database");
-#ifdef ENABLE_LOG
- logger::LogMessageLoopThread::destroy();
-#endif
+ LOG4CXX_FATAL(logger_, "Failed to init policy database");
DEINIT_LOGGER();
exit(EXIT_FAILURE);
}
@@ -187,10 +161,8 @@ int32_t main(int32_t argc, char** argv) {
#endif // __QNX__
if (!main_namespace::LifeCycle::instance()->StartComponents()) {
+ LOG4CXX_FATAL(logger_, "Failed to start components");
main_namespace::LifeCycle::instance()->StopComponents();
-#ifdef ENABLE_LOG
- logger::LogMessageLoopThread::destroy();
-#endif
DEINIT_LOGGER();
exit(EXIT_FAILURE);
}
@@ -199,9 +171,10 @@ int32_t main(int32_t argc, char** argv) {
// Third-Party components initialization.
if (!main_namespace::LifeCycle::instance()->InitMessageSystem()) {
+ LOG4CXX_FATAL(logger_, "Failed to init message system");
main_namespace::LifeCycle::instance()->StopComponents();
DEINIT_LOGGER();
- exit(EXIT_FAILURE);
+ _exit(EXIT_FAILURE);
}
LOG4CXX_INFO(logger_, "InitMessageBroker successful");
@@ -211,14 +184,10 @@ int32_t main(int32_t argc, char** argv) {
#ifndef NO_HMI
if (!InitHmi()) {
- main_namespace::LifeCycle::instance()->StopComponents();
-#ifdef ENABLE_LOG
- logger::LogMessageLoopThread::destroy();
-#endif
- DEINIT_LOGGER();
- exit(EXIT_FAILURE);
+ LOG4CXX_INFO(logger_, "InitHmi successful");
+ } else {
+ LOG4CXX_WARN(logger_, "Failed to init HMI");
}
- LOG4CXX_INFO(logger_, "InitHmi successful");
#endif // #ifndef NO_HMI
}
}
@@ -230,9 +199,6 @@ int32_t main(int32_t argc, char** argv) {
main_namespace::LifeCycle::instance()->StopComponents();
LOG4CXX_INFO(logger_, "Application successfully stopped");
-#ifdef ENABLE_LOG
- logger::LogMessageLoopThread::destroy();
-#endif
DEINIT_LOGGER();
return EXIT_SUCCESS;
diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json
index 52b7684b0..6b20f51cd 100644
--- a/src/appMain/sdl_preloaded_pt.json
+++ b/src/appMain/sdl_preloaded_pt.json
@@ -1,1937 +1,2323 @@
-{
- "policy_table": {
- "module_config": {
- "preloaded_pt": true,
- "exchange_after_x_ignition_cycles": 100,
- "exchange_after_x_kilometers": 1800,
- "exchange_after_x_days": 30,
- "timeout_after_x_seconds": 60,
- "seconds_between_retries": [1,
- 5,
- 25,
- 125,
- 625],
- "endpoints": {
- "0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
- }
- },
- "notifications_per_minute_by_priority": {
- "EMERGENCY": 60,
- "NAVIGATION": 15,
- "COMMUNICATION": 6,
- "NORMAL": 4,
- "NONE": 0
- }
- },
- "functional_groupings": {
- "Base-4": {
- "rpcs": {
- "AddCommand": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "AddSubMenu": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "Alert": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "ChangeRegistration": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "CreateInteractionChoiceSet": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "DeleteCommand": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "DeleteFile": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "DeleteInteractionChoiceSet": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "DeleteSubMenu": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "EncodedSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "EndAudioPassThru": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "GenericResponse": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "ListFiles": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnAppInterfaceUnregistered": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnAudioPassThru": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "OnButtonEvent": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "OnButtonPress": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "OnCommand": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "OnDriverDistraction": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "OnEncodedSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnHashChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnHMIStatus": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnLanguageChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnPermissionsChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnSystemRequest": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "PerformAudioPassThru": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "PerformInteraction": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "PutFile": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "RegisterAppInterface": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "ResetGlobalProperties": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "ScrollableMessage": {
- "hmi_levels": ["FULL"]
- },
- "SetAppIcon": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetDisplayLayout": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetGlobalProperties": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "SetMediaClockTimer": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "Show": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "Slider": {
- "hmi_levels": ["FULL"]
- },
- "Speak": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "SubscribeButton": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "SystemRequest": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "UnregisterAppInterface": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "UnsubscribeButton": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "Location-1": {
- "user_consent_prompt": "Location",
- "rpcs": {
- "GetVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["gps",
- "speed"]
- },
- "OnVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["gps",
- "speed"]
- },
- "SubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["gps",
- "speed"]
- },
- "UnsubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["gps",
- "speed"]
- }
- }
- },
- "Notifications": {
- "user_consent_prompt": "Notifications",
- "rpcs": {
- "Alert": {
- "hmi_levels": ["BACKGROUND"]
- }
- }
- },
- "DrivingCharacteristics-3": {
- "user_consent_prompt": "DrivingCharacteristics",
- "rpcs": {
- "GetVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["accPedalPosition",
- "beltStatus",
- "driverBraking",
- "myKey",
- "prndl",
- "rpm",
- "steeringWheelAngle"]
- },
- "OnVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["accPedalPosition",
- "beltStatus",
- "driverBraking",
- "myKey",
- "prndl",
- "rpm",
- "steeringWheelAngle"]
- },
- "SubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["accPedalPosition",
- "beltStatus",
- "driverBraking",
- "myKey",
- "prndl",
- "rpm",
- "steeringWheelAngle"]
- },
- "UnsubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["accPedalPosition",
- "beltStatus",
- "driverBraking",
- "myKey",
- "prndl",
- "rpm",
- "steeringWheelAngle"]
- }
- }
- },
- "VehicleInfo-3": {
- "user_consent_prompt": "VehicleInfo",
- "rpcs": {
- "GetVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["bodyInformation",
- "deviceStatus",
- "engineTorque",
- "externalTemperature",
- "fuelLevel",
- "fuelLevel_State",
- "headLampStatus",
- "instantFuelConsumption",
- "odometer",
- "tirePressure",
- "vin",
- "wiperStatus"]
- },
- "OnVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["bodyInformation",
- "deviceStatus",
- "engineTorque",
- "externalTemperature",
- "fuelLevel",
- "fuelLevel_State",
- "headLampStatus",
- "instantFuelConsumption",
- "odometer",
- "tirePressure",
- "vin",
- "wiperStatus"]
- },
- "SubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["bodyInformation",
- "deviceStatus",
- "engineTorque",
- "externalTemperature",
- "fuelLevel",
- "fuelLevel_State",
- "headLampStatus",
- "instantFuelConsumption",
- "odometer",
- "tirePressure",
- "wiperStatus"]
- },
- "UnsubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["bodyInformation",
- "deviceStatus",
- "engineTorque",
- "externalTemperature",
- "fuelLevel",
- "fuelLevel_State",
- "headLampStatus",
- "instantFuelConsumption",
- "odometer",
- "tirePressure",
- "wiperStatus"]
- }
- }
- },
- "PropriataryData-1": {
- "rpcs": {
- "DiagnosticMessage": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "GetDTCs": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "ReadDID": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "Emergency-1": {
- "rpcs": {
- "GetVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["airbagStatus",
- "clusterModeStatus",
- "eCallInfo",
- "emergencyEvent"]
- },
- "OnVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["airbagStatus",
- "clusterModeStatus",
- "eCallInfo",
- "emergencyEvent"]
- },
- "SubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["airbagStatus",
- "clusterModeStatus",
- "eCallInfo",
- "emergencyEvent"]
- },
- "UnsubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["airbagStatus",
- "clusterModeStatus",
- "eCallInfo",
- "emergencyEvent"]
- }
- }
- },
- "Navigation-1": {
- "rpcs": {
- "AlertManeuver": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "ShowConstantTBT": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "UpdateTurnList": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "DataConsent-2": {
- "user_consent_prompt": "DataConsent",
- "rpcs": null
- },
- "BaseBeforeDataConsent": {
- "rpcs": {
- "ChangeRegistration": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "DeleteFile": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "EncodedSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "ListFiles": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnAppInterfaceUnregistered": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnEncodedSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnHashChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnHMIStatus": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnLanguageChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnPermissionsChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnSystemRequest": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "PutFile": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "RegisterAppInterface": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetAppIcon": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetDisplayLayout": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SystemRequest": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "UnregisterAppInterface": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- }
- }
- }
- },
- "consumer_friendly_messages": {
- "version": "001.001.019",
- "messages": {
- "AppPermissions": {
- "languages": {
- "de-de": {
- "tts": "%appName% benötigt die folgenden Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Wenn Sie Ja drücken, erklären Sie sich damit einverstanden, dass %vehicleMake% nicht für Schäden oder Verletzungen der Privatsphäre haftet, die im Zusammenhang mit der Nutzung Ihrer Benutzerdaten durch %appName% entstehen. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab.",
- "line1": "Zugriffsanfrage(n)",
- "line2": "erlauben?"
- },
- "en-au": {
- "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.",
- "line1": "Grant requested",
- "line2": "permission(s)?"
- },
- "en-gb": {
- "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. Please press Yes to allow or No to deny.",
- "line1": "Grant requested",
- "line2": "permission(s)?",
- "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu."
- },
- "en-ie": {
- "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.",
- "line1": "Grant requested",
- "line2": "permission(s)?"
- },
- "en-us": {
- "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. Please press yes to allow or no to deny.",
- "line1": "Grant Requested",
- "line2": "Permission(s)?",
- "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. \n\nIf you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu."
- },
- "es-en": {
- "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.",
- "line1": "¿Otorgar permiso(s)",
- "line2": "solicitado(s)?",
- "textBody": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar. \n\n Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles."
- },
- "es-es": {
- "tts": "%appName% está solicitando el uso de los siguientes permisos e información del vehículo: %functionalGroupLabels%. Si pulsa sí, acepta que %vehicleMake% no será responsable de los daños o la pérdida de privacidad relacionados con el uso de sus datos por parte de %appName%. Pulse sí para permitir o no para denegar.",
- "line1": "¿Conceder permisos",
- "line2": "solicitados?"
- },
- "es-mx": {
- "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.",
- "line1": "¿Otorgar permiso(s)",
- "line2": "solicitado(s)?"
- },
- "fr-ca": {
- "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.",
- "line1": "Accorder permission(s)",
- "line2": "demandée(s)",
- "textBody": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles."
- },
- "fr-fr": {
- "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.",
- "line1": "Accorder permission(s)",
- "line2": "demandée(s)"
- },
- "it-it": {
- "tts": "%appName% richiede l'uso delle seguenti informazioni e autorizzazioni sul veicolo: %functionalGroupLabels%. Se si preme Sì, si acconsente che %vehicleMake% non sarà responsabile per danni o perdita di privacy in relazione all'impiego dei dati da parte di %appName%. Premere Sì per consentire e No per negare.",
- "line1": "Concedi autorizzaz.",
- "line2": "richiesta(e)?"
- },
- "nl-nl": {
- "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. Als u op Ja drukt, gaat u ermee akkoord dat %vehicleMake% in geen geval aansprakelijk gesteld kan worden voor schade of verlies van privacy als gevolg van het feit dat %appName% gebruik maakt van uw gegevens. Druk op Ja om dit toe te staan of Nee om te weigeren.",
- "line1": "Aangevraagde",
- "line2": "permissie(s) verlenen?"
- },
- "pl-pl": {
- "tts": "%appName% wymaga następujących informacji o pojeździe oraz pozwoleń: %functionalGroupLabels%. Naciśnięcie TAK oznacza zgodę na fakt, iż %vehicleMake% nie będzie ponosić odpowiedzialności za szkody ani utratę prywatności w związku z wykorzystaniem przez %appName% danych, należących do użytkownika. Naciśnij TAK w celu udzielenia zgody lub NIE w celu odrzucenia żądania.",
- "line1": "Udzielić żądanych",
- "line2": "pozwoleń?"
- },
- "pt-br": {
- "tts": "%appName% está solicitando o uso das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se pressionar sim, você concorda que a %vehicleMake% não será responsável por danos ou perdas de privacidade relacionados ao uso dos seus dados por %appName%. Pressione sim para permitir ou não para negar.",
- "line1": "Conceder permissão",
- "line2": "solicitada?"
- },
- "pt-pt": {
- "tts": "%appName% está a solicitar a utilização das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se premir “Sim”, concorda que %vehicleMake% não será responsável por quaisquer danos ou perda de privacidade relacionada com a utilização dos seus dados por parte de %appName%. Prima “Sim” para permitir ou “Não” para recusar.",
- "line1": "Conceder permiss.",
- "line2": "solicitada(s)?"
- },
- "ru-ru": {
- "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны.",
- "line1": "Предост. заправш.",
- "line2": "разрешения?"
- },
- "sv-se": {
- "tts": "%appName% begär att få tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Om du trycker Ja godkänner du att %vehicleMake% ska hållas skadeslös för alla skador som kan uppstå eller eventuella integritetsintrång som uppstår när %appName% använder dina data. Tryck Ja för att godkänna eller Nej för att neka.",
- "line1": "Vill du ge",
- "line2": "tillstånd?"
- },
- "tr-tr": {
- "tts": "%appName%, şu araç bilgilerini ve izinleri kullanma isteğinde bulunuyor: %functionalGroupLabels%. Evet'e basarsanız, %appName%'in verilerinizi kullanması sonucunda oluşabilecek hasarlardan veya gizlilik kaybından %vehicleMake%'in sorumlu olmayacağını kabul etmiş olacaksınız. Lütfen kabul etmek için Evet'e veya reddetmek için Hayır'a basın.",
- "line1": "İstenen izinler",
- "line2": "verilsin mi?"
- },
- "zh-cn": {
- "tts": "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。",
- "line1": "是否允许请求的",
- "line2": "权限?"
- },
- "zh-tw": {
- "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。",
- "line1": "允許",
- "line2": "授權請求?"
- }
- }
- },
- "AppPermissionsHelp": {
- "languages": {
- "de-de": {
- "tts": "%appName% fordert folgende Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Im Einstellungsmenü der mobilen Apps können Sie diese Berechtigungen ändern und sich detaillierte Beschreibungen anhören. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab."
- },
- "en-au": {
- "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
- },
- "en-gb": {
- "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
- },
- "en-ie": {
- "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
- },
- "en-us": {
- "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press yes to grant permissions or no to deny."
- },
- "es-en": {
- "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
- },
- "es-es": {
- "tts": "%appName% está solicitando los siguientes permisos e información del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y escuchar descripciones detalladas en el menú de configuración de la aplicación móvil. Pulse sí para conceder el permiso o no para denegarlo."
- },
- "es-mx": {
- "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
- },
- "fr-ca": {
- "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
- },
- "fr-fr": {
- "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
- },
- "it-it": {
- "tts": "%appName% richiede le seguenti informazioni e autorizzazioni riguardo il veicolo: %functionalGroupLabels%. È possibile modificare tali autorizzazioni e ascoltare descrizioni dettagliate nel menu impostazioni delle app mobili. Premere Sì per concedere le autorizzazioni e No per negarle."
- },
- "nl-nl": {
- "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. U kunt deze toestemmingen wijzigen en gedetailleerde beschrijvingen beluisteren in het instellingenmenu voor mobiele apps. Druk op Ja om permissies te verlenen of op Nee om te weigeren."
- },
- "pl-pl": {
- "tts": "%appName% wymaga następujących informacji o pojeździe oraz zezwoleń: %functionalGroupLabels%. W menu ustawień aplikacji mobilnych można zmienić owe zezwolenia i usłyszeć ich szczegółowy opis. Naciśnij TAK, aby wyrazić zgodę lub NIE w celu odrzucenia żądania."
- },
- "pt-br": {
- "tts": "%appName% está solicitando as seguintes informações e permissões do veículo: %functionalGroupLabels%. Você pode alterar estas permissões e ouvir descrições detalhadas no menu de configurações de aplicativos móveis. Pressione sim para conceder as permissões ou não para negar."
- },
- "pt-pt": {
- "tts": "%appName% está a solicitar as seguintes informações e permissões do veículo: %functionalGroupLabels%. Pode alterar estas permissões e ouvir descrições detalhadas no menu de definições das aplicações móveis. Prima \"\"Sim\"\" para permitir ou \"\"Não\"\" para recusar."
- },
- "ru-ru": {
- "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Вы можете изменить эти разрешения и прослушать подробные их описания в меню настроек мобильного приложения. Нажмите \"\"да\"\", чтобы предоставить разрешения, или \"\"нет\"\", чтобы не предоставлять."
- },
- "sv-se": {
- "tts": "%appName% begär tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Du kan ändra tillstånden och höra detaljerade beskrivningar i menyn för mobilappsinställningar. Tryck Ja för att ge tillstånd eller Nej för att neka."
- },
- "tr-tr": {
- "tts": "%appName%, şu araç bilgilerini ve izinleri istiyor: %functionalGroupLabels%. Bu izinleri değiştirebilir ve mobil uygulamalar ayarlar menüsünden ayrıntılı açıklamaları dinleyebilirsiniz. Lütfen izin vermek için Evet'e veya reddetmek için Hayır'a basın."
- },
- "zh-cn": {
- "tts": "%appName% 正在请求下列车辆信息和权限: %functionalGroupLabels%。您可在移动应用程序设置菜单中更改这些权限,并听取详细说明。请按“是”允许权限或按“否”拒绝。"
- },
- "zh-tw": {
- "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。您可在行動應用程式設定清單中更改這些許可,並聆聽詳細說明。給予許可請按「是」,拒絕請按「否」。"
- }
- }
- },
- "AppPermissionsRevoked": {
- "languages": {
- "de-de": {
- "tts": "Die Autorisierungsdaten der App wurden geändert. %appName% hat keinen Zugriff auf %functionalGroupLabels% mehr. Installieren Sie die neueste Version der App auf Ihrem Gerät.."
- },
- "en-au": {
- "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
- },
- "en-gb": {
- "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
- },
- "en-ie": {
- "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
- },
- "en-us": {
- "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
- },
- "es-en": {
- "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
- },
- "es-es": {
- "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de que tiene la versión más reciente de la aplicación instalada en su dispositivo móvil."
- },
- "es-mx": {
- "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
- },
- "fr-ca": {
- "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
- },
- "fr-fr": {
- "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
- },
- "it-it": {
- "tts": "Le autorizzazioni dell'app sono cambiate. %appName% non è più in grado di accedere a %functionalGroupLabels%. Assicurarsi di avere la versione più recente dell'app installata sul dispositivo mobile."
- },
- "nl-nl": {
- "tts": "De app-autorisaties zijn gewijzigd. %appName% heeft geen toegang meer tot %functionalGroupLabels%. Zorg ervoor dat u de meest recente app-versie op uw mobiele apparaat geïnstalleerd hebt."
- },
- "pl-pl": {
- "tts": "Dane dostępu aplikacji zostały zmienione. %appName% nie ma już dostępu do %functionalGroupLabels%. Sprawdź, czy na telefonie komórkowym zainstalowano najnowszą wersję aplikacji."
- },
- "pt-br": {
- "tts": "As autorizações dos aplicativos foram alteradas. %appName% não pode mais acessar %functionalGroupLabels%. Certifique-se de que a versão mais recente do aplicativo está instalada no seu dispositivo móvel."
- },
- "pt-pt": {
- "tts": "As autorizações das aplicações mudaram. %appName% já não consegue aceder a %functionalGroupLabels%. Certifique-se de que tem a última versão da aplicação no seu dispositivo móvel."
- },
- "ru-ru": {
- "tts": "Авторизации приложения изменены. %appName% больше не имеет доступа к %functionalGroupLabels%. Убедитесь, что на вашем мобильном устройстве установлена самая новая версия приложения."
- },
- "sv-se": {
- "tts": "Appens behörigheter har ändrats. %appName% har inte längre åtkomst till %functionalGroupLabels%. Kontrollera att du har installerat den senaste versionen av appen på mobilenheten."
- },
- "tr-tr": {
- "tts": "Uygulama yetkileri değişti. %appName% artık %functionalGroupLabels%'e erişemeyecek. Lütfen mobil aygıtınızda en son uygulama sürümünün yüklü olduğundan emin olun."
- },
- "zh-cn": {
- "tts": "应用程序授权已变更。 %appName% 将不能再访问 %functionalGroupLabels%。 请确认您的移动设备上安装的应用程序是最新版本。"
- },
- "zh-tw": {
- "tts": "應用程式授權已改變。%appName% 已無法進入 %functionalGroupLabels%。請確認您的行動裝置上安裝了最新版應用程式。"
- }
- }
- },
- "AppUnauthorized": {
- "languages": {
- "de-de": {
- "tts": "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren.",
- "line1": "nicht autorisiert"
- },
- "en-au": {
- "tts": "This version of %appName% is not authorized and will not work with SYNC.",
- "line1": "not authorized"
- },
- "en-gb": {
- "tts": "This version of %appName% is not authorized and will not work with SYNC.",
- "line1": "not authorized",
- "textBody": "This version of %appName% is not authorized and will not work with SYNC."
- },
- "en-ie": {
- "tts": "This version of %appName% is not authorized and will not work with SYNC.",
- "line1": "not authorized"
- },
- "en-us": {
- "tts": "This version of %appName% is not authorized and will not work with SYNC.",
- "line1": "Not Authorized",
- "textBody": "This version of %appName% is no longer authorized to work with AppLink. Please update to the latest version of %appName%."
- },
- "es-en": {
- "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
- "line1": "no autorizada",
- "textBody": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
- },
- "es-es": {
- "tts": "Esta versión de %appName% no está autorizada y no funcionará con SYNC.",
- "line1": "No autorizada"
- },
- "es-mx": {
- "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
- "line1": "no autorizada"
- },
- "fr-ca": {
- "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
- "line1": "non autorisée",
- "textBody": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
- },
- "fr-fr": {
- "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
- "line1": "non autorisée"
- },
- "it-it": {
- "tts": "Questa versione di %appName% non è autorizzata e non funziona con il SYNC.",
- "line1": "non autorizzata"
- },
- "nl-nl": {
- "tts": "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC.",
- "line1": "niet geautoriseerd"
- },
- "pl-pl": {
- "tts": "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC.",
- "line1": "brak autoryzacji"
- },
- "pt-br": {
- "tts": "Esta versão do %appName% não tem autorização e não funcionará com o SYNC.",
- "line1": "não autorizado"
- },
- "pt-pt": {
- "tts": "Esta versão de %appName% não está autorizada e não funcionará com o SYNC.",
- "line1": "não autorizada"
- },
- "ru-ru": {
- "tts": "Эта версия %appName% не авторизирована и не будет работать с SYNC.",
- "line1": "не авторизировано"
- },
- "sv-se": {
- "tts": "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC.",
- "line1": "är ej godkänd"
- },
- "tr-tr": {
- "tts": "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz.",
- "line1": "için izin yok"
- },
- "zh-cn": {
- "tts": "此版本的%appName% 未得到授权,无法在SYNC上使用。",
- "line1": "未得到授权"
- },
- "zh-tw": {
- "tts": "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。",
- "line1": "無授權"
- }
- }
- },
- "AppUnsupported": {
- "languages": {
- "de-de": {
- "tts": "Diese Version von %appName% wird von SYNC nicht unterstützt.",
- "line1": "nicht unterstützt"
- },
- "en-au": {
- "tts": "This version of %appName% is not supported by SYNC.",
- "line1": "not supported"
- },
- "en-gb": {
- "tts": "This version of %appName% is not supported by SYNC.",
- "line1": "not supported",
- "textBody": "This version of %appName% is not supported by SYNC."
- },
- "en-ie": {
- "tts": "This version of %appName% is not supported by SYNC.",
- "line1": "not supported"
- },
- "en-us": {
- "tts": "This version of %appName% is not supported by SYNC.",
- "line1": "Not Supported",
- "textBody": "Your version of %appName% is not supported by SYNC."
- },
- "es-en": {
- "tts": "Esta versión de %appName% no es compatible con SYNC.",
- "line1": "no compatible",
- "textBody": "Esta versión de %appName% no es compatible con SYNC."
- },
- "es-es": {
- "tts": "Esta versión de %appName% no es compatible con SYNC.",
- "line1": "No compatible"
- },
- "es-mx": {
- "tts": "Esta versión de %appName% no es compatible con SYNC.",
- "line1": "no compatible"
- },
- "fr-ca": {
- "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.",
- "line1": "incompatible",
- "textBody": "Cette version de %appName% n’est pas prise en charge par SYNC."
- },
- "fr-fr": {
- "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.",
- "line1": "incompatible"
- },
- "it-it": {
- "tts": "Questa versione di %appName% non è supportata dal SYNC.",
- "line1": "non supportata"
- },
- "nl-nl": {
- "tts": "Deze versie van %appName% wordt niet ondersteund door SYNC.",
- "line1": "niet ondersteund"
- },
- "pl-pl": {
- "tts": "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC.",
- "line1": "aplikacja nie obsług."
- },
- "pt-br": {
- "tts": "Esta versão do %appName% não é suportada pelo SYNC.",
- "line1": "não suportado"
- },
- "pt-pt": {
- "tts": "Esta versão de %appName% não é suportado pelo SYNC.",
- "line1": "não suportada"
- },
- "ru-ru": {
- "tts": "Эта версия %appName% не поддерживается SYNC.",
- "line1": "не поддерживается"
- },
- "sv-se": {
- "tts": "SYNC har inte stöd för den här versionen av %appName%.",
- "line1": "stöds ej"
- },
- "tr-tr": {
- "tts": "Bu %appName% sürümü SYNC tarafından desteklenmiyor.",
- "line1": "desteklenmiyor"
- },
- "zh-cn": {
- "tts": "SYNC不支持此版本的%appName%。",
- "line1": "不受支持"
- },
- "zh-tw": {
- "tts": "SYNC 不支援此版本的%appName% 。",
- "line1": "不支援"
- }
- }
- },
- "DataConsent": {
- "languages": {
- "en-gb": {
- "textBody": "Would you like to enable Mobile Apps on SYNC? To use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S. Updates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information."
- },
- "en-us": {
- "line1": "Enable Mobile Apps",
- "line2": "on SYNC? (Uses Data)",
- "textBody": "Would you like to enable Mobile Apps on SYNC?\n\nTo use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S.\n\nUpdates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information."
- },
- "es-en": {
- "textBody": "Para usar aplicaciones móviles con SYNC, este debe comunicarse con Ford al menos una vez al mes a través del plan de datos de su dispositivo móvil. Pueden aplicar tarifas normales. SYNC enviará su VIN y el número de módulo de SYNC a Ford de Estados Unidos de América. Las actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario. /r Presione Sí para permitir y No para denegar."
- },
- "fr-ca": {
- "textBody": "Pour utiliser AppLink, SYNC devra communiquer avec Ford au moins une fois par mois en utilisant le forfait de données de votre appareil mobile. Les tarifs réguliers peuvent s’appliquer. SYNC enverra votre NIV et le numéro de votre module SYNC à Ford États-Unis. Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements. /r Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser."
- }
- }
- },
- "DataConsentHelp": {
- "languages": {
- "en-us": {
- "textBody": "Updates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. See your Owner Guide for more information."
- },
- "es-en": {
- "textBody": "Las actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario."
- },
- "fr-ca": {
- "textBody": "Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements."
- }
- }
- },
- "DisableApps": {
- "languages": {
- "de-de": {
- "tts": "Ausschalten der automatischen Updates führt zum Ausschalten von SYNC mobile Apps. Sie können Ihre mobilen Apps dann nicht mehr mit SYNC nutzen. Bitte drücken Sie Ja zur Bestätigung oder Nein, um abzubrechen.",
- "line1": "Auto-Update",
- "line2": "und Mobile Apps deaktivieren"
- },
- "en-au": {
- "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
- "line1": "Disable auto-updates",
- "line2": "and Mobile Apps?"
- },
- "en-gb": {
- "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
- "line1": "Disable auto-updates",
- "line2": "and Mobile Apps?",
- "textBody": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel."
- },
- "en-ie": {
- "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
- "line1": "Disable auto-updates",
- "line2": "and Mobile Apps?"
- },
- "en-us": {
- "tts": "Disabling automatic updates will also disable sync mobile apps. You will not be able to use any mobile apps with SYNC. Please press yes to confirm or no to cancel.",
- "line1": "Disable Auto-Updates",
- "line2": "and Mobile Apps?",
- "textBody": "Disabling automatic updates will also disable sync mobile apps. You will not be able to use any mobile apps with SYNC. Please press yes to confirm or no to cancel."
- },
- "es-en": {
- "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.",
- "line1": "¿Deshab. actualiz.",
- "line2": "autom. y aplic. móv.?",
- "textBody": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar."
- },
- "es-es": {
- "tts": "Si desactiva las actualizaciones automáticas, también se desactivará la sincronización de las aplicaciones móviles. No podrá utilizar ninguna aplicación móvil con SYNC. Pulse sí para confirmar o no para cancelar.",
- "line1": "¿Desact. actual. auto",
- "line2": "y apl. móviles?"
- },
- "es-mx": {
- "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.",
- "line1": "¿Deshab. actualiz.",
- "line2": "autom. y aplic. móv.?"
- },
- "fr-ca": {
- "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.",
- "line1": "Désactiver màj autom.",
- "line2": "et app. mobiles?",
- "textBody": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler."
- },
- "fr-fr": {
- "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.",
- "line1": "Désactiver màj autom.",
- "line2": "et app. mobiles?"
- },
- "it-it": {
- "tts": "Disabilitando gli aggiornamenti automatici si disattiva anche la sincronizzazione delle app mobili. Non sarà possibile usare app mobili con il SYNC. Premere Sì per confermare e No per cancellare.",
- "line1": "Disabilitare agg. aut.",
- "line2": "e app mobili?"
- },
- "nl-nl": {
- "tts": "Door automatische updates uit te schakelen, schakelt u ook SYNC-mobiele apps uit. U kunt dan geen mobiele apps meer gebruiken met SYNC. Druk op Ja om te bevestigen of op Nee om te annuleren.",
- "line1": "Auto-updates en mob.",
- "line2": "apps uitschakelen?"
- },
- "pl-pl": {
- "tts": "Wyłączenie automatycznych aktualizacji spowoduje także wyłączenie aplikacji mobilnych SYNC. Korzystanie z mobilnych aplikacji za pomocą SYNC będzie niemożliwe. Naciśnij TAK, by potwierdzić lub NIE, by anulować.",
- "line1": "Wył. automat. aktual.",
- "line2": "i aplikacje mobilne?"
- },
- "pt-br": {
- "tts": "Se as atualizações automáticas forem desativadas, os aplicativos também serão desativados. Você não poderá usar nenhum aplicativo com o SYNC. Pressione sim para confirmar ou não para cancelar.",
- "line1": "Desativar atualizações",
- "line2": "autom. e aplicativos?"
- },
- "pt-pt": {
- "tts": "A desactivação das actualizações automáticas desactiva igualmente as aplicações móveis do SYNC. Não poderá utilizar quaisquer aplicações móveis com o SYNC. Prima \"\"Sim\"\" para confirmar ou \"\"Não\"\" para cancelar.",
- "line1": "Desact. actual. autom.",
- "line2": "e aplicações móveis?"
- },
- "ru-ru": {
- "tts": "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены.",
- "line1": "Откл. автообновления",
- "line2": "и мобил. прилож.?"
- },
- "sv-se": {
- "tts": "Om du avaktiverar automatisk uppdatering avaktiverar du även synkning av mobilappar. Du kommer inte längre att kunna använda dina mobilappar med SYNC. Tryck Ja för att bekräfta eller Nej för att avbryta.",
- "line1": "Avaktiverar autouppdat.",
- "line2": "och mobilappar?"
- },
- "tr-tr": {
- "tts": "Otomatik güncellemeleri devre dışı bırakırsanız sync mobil uygulamalar da devre dışı kalır. SYNC ile mobil uygulama kullanmanız mümkün olmaz. Lütfen onaylamak için Evet'e veya iptal etmek için Hayır'a basın.",
- "line1": "Oto. güncelleme ve",
- "line2": "mobil uygul. kapat?"
- },
- "zh-cn": {
- "tts": "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。",
- "line1": "是否禁用自动更新和",
- "line2": "移动应用程序?"
- },
- "zh-tw": {
- "tts": "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。",
- "line1": "停用自動更新",
- "line2": "和行動應用程式?"
- }
- }
- },
- "DrivingCharacteristics": {
- "languages": {
- "de-de": {
- "tts": "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus.",
- "label": "Fahreigenschaften"
- },
- "en-au": {
- "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
- "label": "Driving characteristics"
- },
- "en-gb": {
- "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
- "label": "Driving characteristics",
- "textBody": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
- },
- "en-ie": {
- "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
- "label": "Driving characteristics"
- },
- "en-us": {
- "tts": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status.",
- "label": "Driving Characteristics",
- "textBody": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
- },
- "es-en": {
- "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.",
- "label": "Características del manejo",
- "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
- },
- "es-es": {
- "tts": "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad.",
- "label": "Características de conducción"
- },
- "es-mx": {
- "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.",
- "label": "Características del manejo"
- },
- "fr-ca": {
- "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.",
- "label": "Caractéristiques de conduite",
- "textBody": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
- },
- "fr-fr": {
- "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.",
- "label": "Caractéristiques de conduite"
- },
- "it-it": {
- "tts": "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza.",
- "label": "Caratteristiche di guida"
- },
- "nl-nl": {
- "tts": "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus.",
- "label": "Rijkenmerken"
- },
- "pl-pl": {
- "tts": "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa.",
- "label": "Informacje dotyczące stylu jazdy"
- },
- "pt-br": {
- "tts": "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança.",
- "label": "Características de condução"
- },
- "pt-pt": {
- "tts": "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança.",
- "label": "Características de condução"
- },
- "ru-ru": {
- "tts": "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности.",
- "label": "Характеристики движения"
- },
- "sv-se": {
- "tts": "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus.",
- "label": "Köregenskaper"
- },
- "tr-tr": {
- "tts": "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu.",
- "label": "Sürüş karakteristikleri"
- },
- "zh-cn": {
- "tts": "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态",
- "label": "行驶特性"
- },
- "zh-tw": {
- "tts": "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態",
- "label": "駕駛特性"
- }
- }
- },
- "Location": {
- "languages": {
- "de-de": {
- "tts": "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs.",
- "label": "GPS und Geschwindigkeit"
- },
- "en-au": {
- "tts": "An app can access vehicle GPS and speed.",
- "label": "GPS and speed"
- },
- "en-gb": {
- "tts": "An app can access vehicle GPS and speed.",
- "label": "GPS and speed",
- "textBody": "An app can access vehicle GPS and speed."
- },
- "en-ie": {
- "tts": "An app can access vehicle GPS and speed.",
- "label": "GPS and speed"
- },
- "en-us": {
- "tts": "An app can access vehicle GPS and speed.",
- "label": "GPS and speed",
- "textBody": "An app can access vehicle GPS and speed."
- },
- "es-en": {
- "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
- "label": "GPS y velocidad",
- "textBody": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
- },
- "es-es": {
- "tts": "Una aplicación puede acceder al GPS y la velocidad del vehículo.",
- "label": "GPS y velocidad"
- },
- "es-mx": {
- "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
- "label": "GPS y velocidad"
- },
- "fr-ca": {
- "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.",
- "label": "GPS et vitesse",
- "textBody": "Une application peut accéder au GPS et à la vitesse du véhicule."
- },
- "fr-fr": {
- "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.",
- "label": "GPS et vitesse"
- },
- "it-it": {
- "tts": "Un'app può avere accesso a GPS e velocità del veicolo.",
- "label": "GPS e velocità"
- },
- "nl-nl": {
- "tts": "Een app heeft toegang tot gps en de snelheid van het voertuig.",
- "label": "Gps en snelheid"
- },
- "pl-pl": {
- "tts": "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu.",
- "label": "GPS i prędkość"
- },
- "pt-br": {
- "tts": "Um aplicativo pode acessar o GPS e a velocidade do veículo.",
- "label": "GPS e velocidade"
- },
- "pt-pt": {
- "tts": "Uma aplicação consegue aceder ao GPS e à velocidade do veículo.",
- "label": "GPS e velocidade"
- },
- "ru-ru": {
- "tts": "Приложение имеет доступ к GPS и скорости автомобиля.",
- "label": "GPS и скорость"
- },
- "sv-se": {
- "tts": "Appen kan komma åt fordonets GPS och hastighetsmätare.",
- "label": "GPS och hastighet"
- },
- "tr-tr": {
- "tts": "Bu uygulama aracın GPS ve hız bilgilerine erişebilir.",
- "label": "GPS ve hız"
- },
- "zh-cn": {
- "tts": "移动应用程序可以访问车辆 GPS 和车速信息。",
- "label": "GPS 和车速"
- },
- "zh-tw": {
- "tts": "應用程式可存取車輛的GPS和速度。",
- "label": "GPS和車速"
- }
- }
- },
- "Notifications": {
- "languages": {
- "de-de": {
- "tts": "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden.",
- "label": "Push-Benachrichtigungen"
- },
- "en-au": {
- "tts": "An app can send notifications when running in the background.",
- "label": "Push notifications"
- },
- "en-gb": {
- "tts": "An app can send notifications when running in the background.",
- "label": "Push notifications",
- "textBody": "An app can send notifications when running in the background."
- },
- "en-ie": {
- "tts": "An app can send notifications when running in the background.",
- "label": "Push notifications"
- },
- "en-us": {
- "tts": "An app can send notifications when running in the background.",
- "label": "Push notifications",
- "textBody": "An app can send notifications when running in the background."
- },
- "es-en": {
- "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
- "label": "Notificaciones tipo Push",
- "textBody": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
- },
- "es-es": {
- "tts": "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano.",
- "label": "Notificaciones push"
- },
- "es-mx": {
- "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
- "label": "Notificaciones tipo Push"
- },
- "fr-ca": {
- "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
- "label": "Notifications instantanées",
- "textBody": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
- },
- "fr-fr": {
- "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
- "label": "Notifications push"
- },
- "it-it": {
- "tts": "Un'app può inviare notifiche se eseguita in background.",
- "label": "Notifiche push"
- },
- "nl-nl": {
- "tts": "Een app kan meldingen versturen als deze op de achtergrond actief is.",
- "label": "Push-meldingen"
- },
- "pl-pl": {
- "tts": "Aplikacja może wysyłać powiadomienia, działając w tle.",
- "label": "Powiadomienia Push"
- },
- "pt-br": {
- "tts": "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano.",
- "label": "Notificações Push"
- },
- "pt-pt": {
- "tts": "Uma aplicação consegue enviar notificações quando está activa em segundo plano.",
- "label": "Notificações push"
- },
- "ru-ru": {
- "tts": "Если приложение работает в фоновом режиме, оно может отправлять оповещения.",
- "label": "Оповещения о пересылке"
- },
- "sv-se": {
- "tts": "Appen kan skicka meddelanden när den körs i bakgrunden.",
- "label": "Push-notiser"
- },
- "tr-tr": {
- "tts": "Bir uygulama arka planda çalışırken bildirim gönderebilir.",
- "label": "Anlık bildirimleri"
- },
- "zh-cn": {
- "tts": "移动应用程序在后台运行时可推送通知。",
- "label": "推送通知"
- },
- "zh-tw": {
- "tts": "車輛行進時,應用程式可在背景中傳送通知。",
- "label": "傳送通知"
- }
- }
- },
- "SettingDisableUpdates": {
- "languages": {
- "de-de": {
- "line1": "Updates deakt."
- },
- "en-au": {
- "line1": "Disable updates"
- },
- "en-gb": {
- "line1": "Disable updates"
- },
- "en-ie": {
- "line1": "Disable updates"
- },
- "en-us": {
- "line1": "Disable Updates",
- "textBody": "Disable Updates"
- },
- "es-en": {
- "line1": "Deshab. actual.",
- "textBody": "Deshab. actual."
- },
- "es-es": {
- "line1": "Desact. actual."
- },
- "es-mx": {
- "line1": "Deshab. actual."
- },
- "fr-ca": {
- "line1": "Désactiver MAJ",
- "textBody": "Désactiver MAJ"
- },
- "fr-fr": {
- "line1": "Désactiver màj"
- },
- "it-it": {
- "line1": "Disabilita agg."
- },
- "nl-nl": {
- "line1": "Upd. uitschak."
- },
- "pl-pl": {
- "line1": "Wyłącz aktual."
- },
- "pt-br": {
- "line1": "Desat. atualiz."
- },
- "pt-pt": {
- "line1": "Desact. actualiz."
- },
- "ru-ru": {
- "line1": "Откл. обновл."
- },
- "sv-se": {
- "line1": "Inaktivera uppd."
- },
- "tr-tr": {
- "line1": "Güncell. Kapat"
- },
- "zh-cn": {
- "line1": "禁用更新"
- },
- "zh-tw": {
- "line1": "停用更新"
- }
- }
- },
- "SettingEnableUpdates": {
- "languages": {
- "de-de": {
- "line1": "Apps aktivieren"
- },
- "en-au": {
- "line1": "Enable Apps"
- },
- "en-gb": {
- "line1": "Enable Apps"
- },
- "en-ie": {
- "line1": "Enable Apps"
- },
- "en-us": {
- "line1": "Enable Apps"
- },
- "es-en": {
- "line1": "Hab. aplic."
- },
- "es-es": {
- "line1": "Activar apl."
- },
- "es-mx": {
- "line1": "Hab. aplic."
- },
- "fr-ca": {
- "line1": "Activer app.",
- "textBody": "Activer app."
- },
- "fr-fr": {
- "line1": "Activer app."
- },
- "it-it": {
- "line1": "Abilita app"
- },
- "nl-nl": {
- "line1": "Apps inschak."
- },
- "pl-pl": {
- "line1": "Włącz aplikacje"
- },
- "pt-br": {
- "line1": "Ativar aplic."
- },
- "pt-pt": {
- "line1": "Activar actualiz."
- },
- "ru-ru": {
- "line1": "Вкл. прилож."
- },
- "sv-se": {
- "line1": "Aktivera appar"
- },
- "tr-tr": {
- "line1": "Uygulamaları aç"
- },
- "zh-cn": {
- "line1": "启用应用程序"
- },
- "zh-tw": {
- "line1": "啟用應用程式"
- }
- }
- },
- "SettingUpdateAuto": {
- "languages": {
- "de-de": {
- "line1": "Update anford."
- },
- "en-au": {
- "line1": "Request update"
- },
- "en-gb": {
- "line1": "Request update"
- },
- "en-ie": {
- "line1": "Request update"
- },
- "en-us": {
- "line1": "Request Update",
- "textBody": "Select `Update now` to receive app authorization information for your SYNC-enabled mobile apps. This may enable additional functionality depending on the app and your settings. If your phone has a working data connection, an update should complete in less than 1 minute."
- },
- "es-en": {
- "line1": "Solicit. actualiz.",
- "textBody": "Solicit. actualiz."
- },
- "es-es": {
- "line1": "Solicitar actual."
- },
- "es-mx": {
- "line1": "Solicit. actualiz."
- },
- "fr-ca": {
- "line1": "Demander MAJ",
- "textBody": "Demander MAJ"
- },
- "fr-fr": {
- "line1": "Demander màj"
- },
- "it-it": {
- "line1": "Rich. aggiorn."
- },
- "nl-nl": {
- "line1": "Upd. aanvragen"
- },
- "pl-pl": {
- "line1": "Zażądaj aktual."
- },
- "pt-br": {
- "line1": "Solicitar atualiz."
- },
- "pt-pt": {
- "line1": "Solicit. actualiz."
- },
- "ru-ru": {
- "line1": "Запрос на обн."
- },
- "sv-se": {
- "line1": "Begär uppdat."
- },
- "tr-tr": {
- "line1": "Güncelleme iste"
- },
- "zh-cn": {
- "line1": "请求更新"
- },
- "zh-tw": {
- "line1": "請求更新"
- }
- }
- },
- "StatusNeeded": {
- "languages": {
- "de-de": {
- "line1": "Update benötigt"
- },
- "en-au": {
- "line1": "Update needed"
- },
- "en-gb": {
- "line1": "Update needed",
- "textBody": "Update needed"
- },
- "en-ie": {
- "line1": "Update needed"
- },
- "en-us": {
- "line1": "Update Needed",
- "textBody": "Update Needed"
- },
- "es-en": {
- "line1": "Actualiz. neces.",
- "textBody": "Actualiz. neces."
- },
- "es-es": {
- "line1": "Actu. necesaria"
- },
- "es-mx": {
- "line1": "Actualiz. neces."
- },
- "fr-ca": {
- "line1": "Màj requise",
- "textBody": "Màj requise"
- },
- "fr-fr": {
- "line1": "Mise à jour requise"
- },
- "it-it": {
- "line1": "Necess. aggiorn."
- },
- "nl-nl": {
- "line1": "Update nodig"
- },
- "pl-pl": {
- "line1": "Potrzeba aktual."
- },
- "pt-br": {
- "line1": "Atualiz. necess."
- },
- "pt-pt": {
- "line1": "Actual. necess."
- },
- "ru-ru": {
- "line1": "Необх. обновл."
- },
- "sv-se": {
- "line1": "Uppdat. krävs"
- },
- "tr-tr": {
- "line1": "Güncellenmeli"
- },
- "zh-cn": {
- "line1": "需要进行更新"
- },
- "zh-tw": {
- "line1": "需更新"
- }
- }
- },
- "StatusPending": {
- "languages": {
- "de-de": {
- "line1": "Aktualisieren..."
- },
- "en-au": {
- "line1": "Updating..."
- },
- "en-gb": {
- "line1": "Updating...",
- "textBody": "Updating..."
- },
- "en-ie": {
- "line1": "Updating..."
- },
- "en-us": {
- "line1": "Updating...",
- "textBody": "Updating..."
- },
- "es-en": {
- "line1": "Actualizando...",
- "textBody": "Actualizando..."
- },
- "es-es": {
- "line1": "Actualizando..."
- },
- "es-mx": {
- "line1": "Actualizando..."
- },
- "fr-ca": {
- "line1": "MAJ en cours...",
- "textBody": "MAJ en cours..."
- },
- "fr-fr": {
- "line1": "Màj en cours..."
- },
- "it-it": {
- "line1": "Aggiornamento"
- },
- "nl-nl": {
- "line1": "Updaten..."
- },
- "pl-pl": {
- "line1": "Aktualizowanie"
- },
- "pt-br": {
- "line1": "Atualizando..."
- },
- "pt-pt": {
- "line1": "A actualizar..."
- },
- "ru-ru": {
- "line1": "Обновление..."
- },
- "sv-se": {
- "line1": "Uppdaterar..."
- },
- "tr-tr": {
- "line1": "Güncelleniyor..."
- },
- "zh-cn": {
- "line1": "正在更新......"
- },
- "zh-tw": {
- "line1": "更新中..."
- }
- }
- },
- "StatusUpToDate": {
- "languages": {
- "de-de": {
- "line1": "Aktuelle Version"
- },
- "en-au": {
- "line1": "Up-to-date"
- },
- "en-gb": {
- "line1": "Up-to-date",
- "textBody": "Up-to-date"
- },
- "en-ie": {
- "line1": "Up-to-date"
- },
- "en-us": {
- "line1": "Up-To-Date",
- "textBody": "Up-To-Date"
- },
- "es-en": {
- "line1": "Actualizado",
- "textBody": "Actualizado"
- },
- "es-es": {
- "line1": "Actualizada"
- },
- "es-mx": {
- "line1": "Actualizado"
- },
- "fr-ca": {
- "line1": "Déjà à jour",
- "textBody": "Déjà à jour"
- },
- "fr-fr": {
- "line1": "Déjà à jour"
- },
- "it-it": {
- "line1": "più recente"
- },
- "nl-nl": {
- "line1": "Up-to-date"
- },
- "pl-pl": {
- "line1": "Aktualne"
- },
- "pt-br": {
- "line1": "Atualizado"
- },
- "pt-pt": {
- "line1": "Actualizado"
- },
- "ru-ru": {
- "line1": "Обновлено"
- },
- "sv-se": {
- "line1": "Uppdat. krävs ej"
- },
- "tr-tr": {
- "line1": "Güncel"
- },
- "zh-cn": {
- "line1": "最新更新"
- },
- "zh-tw": {
- "line1": "更新最新"
- }
- }
- },
- "VehicleInfo": {
- "languages": {
- "de-de": {
- "tts": "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck.",
- "label": "Fahrzeuginformationen"
- },
- "en-au": {
- "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.",
- "label": "Vehicle information"
- },
- "en-gb": {
- "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure.",
- "label": "Vehicle information",
- "textBody": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure."
- },
- "en-ie": {
- "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.",
- "label": "Vehicle information"
- },
- "en-us": {
- "tts": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure.",
- "label": "Vehicle information",
- "textBody": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
- },
- "es-en": {
- "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.",
- "label": "Información del vehículo",
- "textBody": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos."
- },
- "es-es": {
- "tts": "Una aplicación puede acceder a la siguiente información del vehículo: Nivel de combustible, Ahorro de combustible, RPM del motor, Cuentakilómetros, VIN, Temperatura aire exterior, Marcha engranada, Presión de neumáticos.",
- "label": "Información del vehículo"
- },
- "es-mx": {
- "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.",
- "label": "Información del vehículo"
- },
- "fr-ca": {
- "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus.",
- "label": "Renseignements du véhicule",
- "textBody": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus."
- },
- "fr-fr": {
- "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Vitesse de moteur, Compteur kilométrique, NIV, Température extérieure, Position de vitesse, Pression des pneus.",
- "label": "Renseignements du véhicule"
- },
- "it-it": {
- "tts": "Un'app può avere accesso alle seguenti informazioni del veicolo: Livello carburante, Consumi carburante, Numero giri motore, Contachilometri, VIN, Temperatura esterna, Posizione marcia, Pressione pneumatici.",
- "label": "Informazioni sul veicolo"
- },
- "nl-nl": {
- "tts": "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning.",
- "label": "Voertuiginformatie"
- },
- "pl-pl": {
- "tts": "Aplikacja może uzyskać dostęp do następujących informacji o pojeździe: Poziom paliwa, Zużycie paliwa, Obroty silnika, Licznik przebiegu, Numer VIN, Temperatura zewnętrzna, Aktualny bieg, Ciśnienie opon.",
- "label": "Informacje o pojeździe"
- },
- "pt-br": {
- "tts": "Um aplicativo pode acessar as seguintes informações sobre o veículo: Nível de combustível, Economia de combustível, RPM do motor, Hodômetro, VIN, Temperatura externa, Posição das marchas, Pressão dos pneus.",
- "label": "Informações sobre o veículo"
- },
- "pt-pt": {
- "tts": "Uma aplicação consegue aceder às seguintes informações do veículo: Nível de combustível, Poupança de combustível, RPM do motor, Conta-quilómetros, VIN, Temperatura exterior, Posição da mudança de velocidade, Pressão dos pneus.",
- "label": "Informações do veículo"
- },
- "ru-ru": {
- "tts": "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин.",
- "label": "Информация об автомобиле"
- },
- "sv-se": {
- "tts": "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck.",
- "label": "Fordonsinformation"
- },
- "tr-tr": {
- "tts": "Bir uygulama şu araç bilgilerine erişebilir: Yakıt seviyesi, Yakıt ekonomisi, Motor devirleri, Kilometre sayacı, VIN, Dış sıcaklık, Vites konumu, Lastik basıncı.",
- "label": "Araç bilgisi"
- },
- "zh-cn": {
- "tts": "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压.",
- "label": "车辆信息"
- },
- "zh-tw": {
- "tts": "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓.",
- "label": "車輛資訊"
- }
- }
- }
- }
- },
- "app_policies": {
- "default": {
- "keep_context": false,
- "steal_focus": false,
- "priority": "NONE",
- "default_hmi": "NONE",
- "groups": ["Base-4"]
- },
- "device": {
- "keep_context": false,
- "steal_focus": false,
- "priority": "NONE",
- "default_hmi": "NONE",
- "groups": ["DataConsent-2"]
- },
- "pre_DataConsent": {
- "keep_context": false,
- "steal_focus": false,
- "priority": "NONE",
- "default_hmi": "NONE",
- "groups": ["BaseBeforeDataConsent"]
- }
- }
- }
-} \ No newline at end of file
+{
+ "policy_table": {
+ "module_config": {
+ "preloaded_pt": true,
+ "exchange_after_x_ignition_cycles": 100,
+ "exchange_after_x_kilometers": 1800,
+ "exchange_after_x_days": 20,
+ "timeout_after_x_seconds": 60,
+ "seconds_between_retries": [
+ 1,
+ 5,
+ 25,
+ 125,
+ 625
+ ],
+ "endpoints": {
+ "0x07": {
+ "default": ["http://policies.telematics.ford.com/api/policies"]
+ },
+ "0x04": {
+ "default": ["http://ivsu.software.ford.com/api/getsoftwareupdates"]
+ },
+ "queryAppsUrl": {
+ "default": ["http://sdl.shaid.server"]
+ },
+ "lock_screen_icon_url": {
+ "default": ["http://i.imgur.com/QwZ9uKG.png"]
+ }
+ },
+ "notifications_per_minute_by_priority": {
+ "EMERGENCY": 60,
+ "NAVIGATION": 15,
+ "VOICECOM": 20,
+ "COMMUNICATION": 6,
+ "NORMAL": 4,
+ "NONE": 0
+ }
+ },
+ "functional_groupings": {
+ "Base-4": {
+ "rpcs": {
+ "AddCommand": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "AddSubMenu": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "Alert": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "ChangeRegistration": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "CreateInteractionChoiceSet": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "DeleteCommand": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "DeleteFile": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "DeleteInteractionChoiceSet": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "DeleteSubMenu": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "EncodedSyncPData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "EndAudioPassThru": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "GenericResponse": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "ListFiles": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnAppInterfaceUnregistered": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnAudioPassThru": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "OnButtonEvent": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "OnButtonPress": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "OnCommand": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "OnDriverDistraction": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "OnEncodedSyncPData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnHashChange": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnHMIStatus": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnLanguageChange": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnPermissionsChange": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnSystemRequest": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "PerformAudioPassThru": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "PerformInteraction": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "PutFile": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "RegisterAppInterface": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "ResetGlobalProperties": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "ScrollableMessage": {
+ "hmi_levels": [
+ "FULL"
+ ]
+ },
+ "SetAppIcon": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "SetDisplayLayout": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "SetGlobalProperties": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "SetMediaClockTimer": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "Show": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "Slider": {
+ "hmi_levels": [
+ "FULL"
+ ]
+ },
+ "Speak": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "SubscribeButton": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "SystemRequest": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "UnregisterAppInterface": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "UnsubscribeButton": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ }
+ }
+ },
+ "Location-1": {
+ "user_consent_prompt": "Location",
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "gps",
+ "speed"
+ ]
+ },
+ "OnVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "gps",
+ "speed"
+ ]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "gps",
+ "speed"
+ ]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "gps",
+ "speed"
+ ]
+ }
+ }
+ },
+ "Notifications": {
+ "user_consent_prompt": "Notifications",
+ "rpcs": {
+ "Alert": {
+ "hmi_levels": [
+ "BACKGROUND"
+ ]
+ }
+ }
+ },
+ "DrivingCharacteristics-3": {
+ "user_consent_prompt": "DrivingCharacteristics",
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"
+ ]
+ },
+ "OnVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"
+ ]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"
+ ]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"
+ ]
+ }
+ }
+ },
+ "VehicleInfo-3": {
+ "user_consent_prompt": "VehicleInfo",
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "bodyInformation",
+ "deviceStatus",
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "OnVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "bodyInformation",
+ "deviceStatus",
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "bodyInformation",
+ "deviceStatus",
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "bodyInformation",
+ "deviceStatus",
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ }
+ }
+ },
+ "Emergency-1": {
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ],
+ "parameters": [
+ "airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "Navigation-1": {
+ "rpcs": {
+ "AlertManeuver": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "ShowConstantTBT": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "UpdateTurnList": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ }
+ }
+ },
+ "PropriataryData-1": {
+ "rpcs": {
+ "DiagnosticMessage": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "GetDTCs": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "ReadDID": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ }
+ }
+ },
+ "ProprietaryData-3": {
+ "rpcs": {
+ "GetDTCs": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "ReadDID": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ }
+ }
+ },
+ "DataConsent-2": {
+ "user_consent_prompt": "DataConsent",
+ "rpcs": null
+ },
+ "PropriataryData-2": {
+ "rpcs": {
+ "DiagnosticMessage": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "GetDTCs": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "ReadDID": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ }
+ }
+ },
+ "DiagnosticMessageOnly": {
+ "rpcs": {
+ "DiagnosticMessage": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ }
+ }
+ },
+ "OnKeyboardInputOnlyGroup": {
+ "rpcs": {
+ "OnKeyboardInput": {
+ "hmi_levels": [
+ "FULL"
+ ]
+ }
+ }
+ },
+ "OnTouchEventOnlyGroup": {
+ "rpcs": {
+ "OnTouchEvent": {
+ "hmi_levels": [
+ "FULL"
+ ]
+ }
+ }
+ },
+ "BaseBeforeDataConsent": {
+ "rpcs": {
+ "ChangeRegistration": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "DeleteFile": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "EncodedSyncPData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "ListFiles": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnAppInterfaceUnregistered": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnEncodedSyncPData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnHashChange": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnHMIStatus": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnLanguageChange": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnPermissionsChange": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnSystemRequest": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "PutFile": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "RegisterAppInterface": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "ResetGlobalProperties": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "SetAppIcon": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "SetDisplayLayout": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "SetGlobalProperties": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "SystemRequest": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "UnregisterAppInterface": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ }
+ }
+ },
+ "SendLocation": {
+ "rpcs": {
+ "SendLocation": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ }
+ }
+ },
+ "BackgroundAPT": {
+ "rpcs": {
+ "EndAudioPassThru": {
+ "hmi_levels": [
+ "BACKGROUND"
+ ]
+ },
+ "OnAudioPassThru": {
+ "hmi_levels": [
+ "BACKGROUND"
+ ]
+ },
+ "PerformAudioPassThru": {
+ "hmi_levels": [
+ "BACKGROUND"
+ ]
+ }
+ }
+ },
+ "DialNumberOnly": {
+ "rpcs": {
+ "DialNumber": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED"
+ ]
+ }
+ }
+ },
+ "SendLocationOnly": {
+ "rpcs": {
+ "SendLocation": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED"
+ ]
+ }
+ }
+ }
+ },
+ "consumer_friendly_messages": {
+ "version": "001.001.023",
+ "messages": {
+ "AppPermissions": {
+ "languages": {
+ "de-de": {
+ "tts": "%appName% benötigt die folgenden Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Wenn Sie Ja drücken, erklären Sie sich damit einverstanden, dass %vehicleMake% nicht für Schäden oder Verletzungen der Privatsphäre haftet, die im Zusammenhang mit der Nutzung Ihrer Benutzerdaten durch %appName% entstehen. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab.",
+ "line1": "Zugriffsanfrage(n)",
+ "line2": "erlauben?"
+ },
+ "en-au": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.",
+ "line1": "Grant requested",
+ "line2": "permission(s)?"
+ },
+ "en-gb": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. Please press Yes to allow or No to deny.",
+ "line1": "Grant requested",
+ "line2": "permission(s)?",
+ "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu."
+ },
+ "en-ie": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.",
+ "line1": "Grant requested",
+ "line2": "permission(s)?"
+ },
+ "en-us": {
+ "tts": "%appName% is requesting permission to use the following: %functionalGroupLabels%.\r\nTo disable or change these settings at any time visit the SYNC mobile apps settings menu. See App terms of service and privacy policies. Ford is not responsible for App functionality. Avoid distractions and use voice controls where available. Please press yes to allow or no to deny.",
+ "line1": "Grant Requested",
+ "line2": "Permission(s)?",
+ "textBody": "The %appName% App is requesting permission to use the following: %functionalGroupLabels%.\r\n\r\nTo disable or change these settings at any time visit the SYNC mobile apps settings menu. See App terms of service and privacy policies. Ford is not responsible for App functionality. Avoid distractions and use voice controls where available. I agree and consent."
+ },
+ "es-en": {
+ "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.",
+ "line1": "¿Otorgar permiso(s)",
+ "line2": "solicitado(s)?",
+ "textBody": "La App %appName% solicita permiso para usar: %functionalGroupLabels%. \r\n\r\nPara desactivar o cambiar la configuración, acceda al menú de SYNC® de configuración de apps. Consulte términos de servicio y políticas de privacidad de la App. Ford no es responsable de la funcionalidad de la App. Evite distracciones y use los controles de voz cuando estén disponibles. Estoy de acuerdo y acepto lo anterior."
+ },
+ "es-es": {
+ "tts": "%appName% está solicitando el uso de los siguientes permisos e información del vehículo: %functionalGroupLabels%. Si pulsa sí, acepta que %vehicleMake% no será responsable de los daños o la pérdida de privacidad relacionados con el uso de sus datos por parte de %appName%. Pulse sí para permitir o no para denegar.",
+ "line1": "¿Conceder permisos",
+ "line2": "solicitados?"
+ },
+ "es-mx": {
+ "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.",
+ "line1": "¿Otorgar permiso(s)",
+ "line2": "solicitado(s)?",
+ "textBody": "La App %appName% solicita permiso para usar: %functionalGroupLabels%. \r\n\r\nPara desactivar o cambiar la configuración, acceda al menú de SYNC® de configuración de apps. Consulte términos de servicio y políticas de privacidad de la App. Ford no es responsable de la funcionalidad de la App. Evite distracciones y use los controles de voz cuando estén disponibles. Estoy de acuerdo y acepto lo anterior."
+ },
+ "fr-ca": {
+ "tts": "L’application %appName% demande la permission d’utiliser : %functionalGroupLabels%. \r\nPour désactiver ou modifier ces réglages de données à tout moment, consultez le menu de réglages des applications mobiles SYNC. Reportez-vous aux modalités de service et à la politique de confidentialité de l’application. Ford n’est pas responsable de la fonctionnalité de l’application. Évitez les distractions et utilisez les commandes vocales lorsqu’elles sont disponibles. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.",
+ "line1": "Accorder permission(s)",
+ "line2": "demandée(s)",
+ "textBody": "L’application %appName% demande la permission d’utiliser : %functionalGroupLabels%. \r\n\r\nPour désactiver ou modifier ces réglages de données à tout moment, consultez le menu de réglages des applications mobiles SYNC. Reportez-vous aux modalités de service et à la politique de confidentialité de l’application. Ford n’est pas responsable de la fonctionnalité de l’application. Évitez les distractions et utilisez les commandes vocales lorsqu’elles sont disponibles. J’accepte et je consens."
+ },
+ "fr-fr": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.",
+ "line1": "Accorder permission(s)",
+ "line2": "demandée(s)"
+ },
+ "it-it": {
+ "tts": "%appName% richiede l'uso delle seguenti informazioni e autorizzazioni sul veicolo: %functionalGroupLabels%. Se si preme Sì, si acconsente che %vehicleMake% non sarà responsabile per danni o perdita di privacy in relazione all'impiego dei dati da parte di %appName%. Premere Sì per consentire e No per negare.",
+ "line1": "Concedi autorizzaz.",
+ "line2": "richiesta(e)?"
+ },
+ "nl-nl": {
+ "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. Als u op Ja drukt, gaat u ermee akkoord dat %vehicleMake% in geen geval aansprakelijk gesteld kan worden voor schade of verlies van privacy als gevolg van het feit dat %appName% gebruik maakt van uw gegevens. Druk op Ja om dit toe te staan of Nee om te weigeren.",
+ "line1": "Aangevraagde",
+ "line2": "permissie(s) verlenen?"
+ },
+ "pl-pl": {
+ "tts": "%appName% wymaga następujących informacji o pojeździe oraz pozwoleń: %functionalGroupLabels%. Naciśnięcie TAK oznacza zgodę na fakt, iż %vehicleMake% nie będzie ponosić odpowiedzialności za szkody ani utratę prywatności w związku z wykorzystaniem przez %appName% danych, należących do użytkownika. Naciśnij TAK w celu udzielenia zgody lub NIE w celu odrzucenia żądania.",
+ "line1": "Udzielić żądanych",
+ "line2": "pozwoleń?"
+ },
+ "pt-br": {
+ "tts": "%appName% está solicitando o uso das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se pressionar sim, você concorda que a %vehicleMake% não será responsável por danos ou perdas de privacidade relacionados ao uso dos seus dados por %appName%. Pressione sim para permitir ou não para negar.",
+ "line1": "Conceder permissão",
+ "line2": "solicitada?"
+ },
+ "pt-pt": {
+ "tts": "%appName% está a solicitar a utilização das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se premir “Sim”, concorda que %vehicleMake% não será responsável por quaisquer danos ou perda de privacidade relacionada com a utilização dos seus dados por parte de %appName%. Prima “Sim” para permitir ou “Não” para recusar.",
+ "line1": "Conceder permiss.",
+ "line2": "solicitada(s)?"
+ },
+ "ru-ru": {
+ "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны.",
+ "line1": "Предост. заправш.",
+ "line2": "разрешения?"
+ },
+ "sv-se": {
+ "tts": "%appName% begär att få tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Om du trycker Ja godkänner du att %vehicleMake% ska hållas skadeslös för alla skador som kan uppstå eller eventuella integritetsintrång som uppstår när %appName% använder dina data. Tryck Ja för att godkänna eller Nej för att neka.",
+ "line1": "Vill du ge",
+ "line2": "tillstånd?"
+ },
+ "tr-tr": {
+ "tts": "%appName%, şu araç bilgilerini ve izinleri kullanma isteğinde bulunuyor: %functionalGroupLabels%. Evet'e basarsanız, %appName%'in verilerinizi kullanması sonucunda oluşabilecek hasarlardan veya gizlilik kaybından %vehicleMake%'in sorumlu olmayacağını kabul etmiş olacaksınız. Lütfen kabul etmek için Evet'e veya reddetmek için Hayır'a basın.",
+ "line1": "İstenen izinler",
+ "line2": "verilsin mi?"
+ },
+ "zh-cn": {
+ "tts": "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。",
+ "line1": "是否允许请求的",
+ "line2": "权限?"
+ },
+ "zh-tw": {
+ "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。",
+ "line1": "允許",
+ "line2": "授權請求?"
+ }
+ }
+ },
+ "AppPermissionsHelp": {
+ "languages": {
+ "de-de": {
+ "tts": "%appName% fordert folgende Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Im Einstellungsmenü der mobilen Apps können Sie diese Berechtigungen ändern und sich detaillierte Beschreibungen anhören. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab."
+ },
+ "en-au": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-gb": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-ie": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-us": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press yes to grant permissions or no to deny."
+ },
+ "es-en": {
+ "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
+ },
+ "es-es": {
+ "tts": "%appName% está solicitando los siguientes permisos e información del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y escuchar descripciones detalladas en el menú de configuración de la aplicación móvil. Pulse sí para conceder el permiso o no para denegarlo."
+ },
+ "es-mx": {
+ "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
+ },
+ "fr-ca": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
+ },
+ "fr-fr": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
+ },
+ "it-it": {
+ "tts": "%appName% richiede le seguenti informazioni e autorizzazioni riguardo il veicolo: %functionalGroupLabels%. È possibile modificare tali autorizzazioni e ascoltare descrizioni dettagliate nel menu impostazioni delle app mobili. Premere Sì per concedere le autorizzazioni e No per negarle."
+ },
+ "nl-nl": {
+ "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. U kunt deze toestemmingen wijzigen en gedetailleerde beschrijvingen beluisteren in het instellingenmenu voor mobiele apps. Druk op Ja om permissies te verlenen of op Nee om te weigeren."
+ },
+ "pl-pl": {
+ "tts": "%appName% wymaga następujących informacji o pojeździe oraz zezwoleń: %functionalGroupLabels%. W menu ustawień aplikacji mobilnych można zmienić owe zezwolenia i usłyszeć ich szczegółowy opis. Naciśnij TAK, aby wyrazić zgodę lub NIE w celu odrzucenia żądania."
+ },
+ "pt-br": {
+ "tts": "%appName% está solicitando as seguintes informações e permissões do veículo: %functionalGroupLabels%. Você pode alterar estas permissões e ouvir descrições detalhadas no menu de configurações de aplicativos móveis. Pressione sim para conceder as permissões ou não para negar."
+ },
+ "pt-pt": {
+ "tts": "%appName% está a solicitar as seguintes informações e permissões do veículo: %functionalGroupLabels%. Pode alterar estas permissões e ouvir descrições detalhadas no menu de definições das aplicações móveis. Prima \"\"Sim\"\" para permitir ou \"\"Não\"\" para recusar."
+ },
+ "ru-ru": {
+ "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Вы можете изменить эти разрешения и прослушать подробные их описания в меню настроек мобильного приложения. Нажмите \"\"да\"\", чтобы предоставить разрешения, или \"\"нет\"\", чтобы не предоставлять."
+ },
+ "sv-se": {
+ "tts": "%appName% begär tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Du kan ändra tillstånden och höra detaljerade beskrivningar i menyn för mobilappsinställningar. Tryck Ja för att ge tillstånd eller Nej för att neka."
+ },
+ "tr-tr": {
+ "tts": "%appName%, şu araç bilgilerini ve izinleri istiyor: %functionalGroupLabels%. Bu izinleri değiştirebilir ve mobil uygulamalar ayarlar menüsünden ayrıntılı açıklamaları dinleyebilirsiniz. Lütfen izin vermek için Evet'e veya reddetmek için Hayır'a basın."
+ },
+ "zh-cn": {
+ "tts": "%appName% 正在请求下列车辆信息和权限: %functionalGroupLabels%。您可在移动应用程序设置菜单中更改这些权限,并听取详细说明。请按“是”允许权限或按“否”拒绝。"
+ },
+ "zh-tw": {
+ "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。您可在行動應用程式設定清單中更改這些許可,並聆聽詳細說明。給予許可請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "AppPermissionsRevoked": {
+ "languages": {
+ "de-de": {
+ "tts": "Die Autorisierungsdaten der App wurden geändert. %appName% hat keinen Zugriff auf %functionalGroupLabels% mehr. Installieren Sie die neueste Version der App auf Ihrem Gerät.."
+ },
+ "en-au": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-gb": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-ie": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-us": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "es-en": {
+ "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
+ },
+ "es-es": {
+ "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de que tiene la versión más reciente de la aplicación instalada en su dispositivo móvil."
+ },
+ "es-mx": {
+ "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
+ },
+ "fr-ca": {
+ "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
+ },
+ "fr-fr": {
+ "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
+ },
+ "it-it": {
+ "tts": "Le autorizzazioni dell'app sono cambiate. %appName% non è più in grado di accedere a %functionalGroupLabels%. Assicurarsi di avere la versione più recente dell'app installata sul dispositivo mobile."
+ },
+ "nl-nl": {
+ "tts": "De app-autorisaties zijn gewijzigd. %appName% heeft geen toegang meer tot %functionalGroupLabels%. Zorg ervoor dat u de meest recente app-versie op uw mobiele apparaat geïnstalleerd hebt."
+ },
+ "pl-pl": {
+ "tts": "Dane dostępu aplikacji zostały zmienione. %appName% nie ma już dostępu do %functionalGroupLabels%. Sprawdź, czy na telefonie komórkowym zainstalowano najnowszą wersję aplikacji."
+ },
+ "pt-br": {
+ "tts": "As autorizações dos aplicativos foram alteradas. %appName% não pode mais acessar %functionalGroupLabels%. Certifique-se de que a versão mais recente do aplicativo está instalada no seu dispositivo móvel."
+ },
+ "pt-pt": {
+ "tts": "As autorizações das aplicações mudaram. %appName% já não consegue aceder a %functionalGroupLabels%. Certifique-se de que tem a última versão da aplicação no seu dispositivo móvel."
+ },
+ "ru-ru": {
+ "tts": "Авторизации приложения изменены. %appName% больше не имеет доступа к %functionalGroupLabels%. Убедитесь, что на вашем мобильном устройстве установлена самая новая версия приложения."
+ },
+ "sv-se": {
+ "tts": "Appens behörigheter har ändrats. %appName% har inte längre åtkomst till %functionalGroupLabels%. Kontrollera att du har installerat den senaste versionen av appen på mobilenheten."
+ },
+ "tr-tr": {
+ "tts": "Uygulama yetkileri değişti. %appName% artık %functionalGroupLabels%'e erişemeyecek. Lütfen mobil aygıtınızda en son uygulama sürümünün yüklü olduğundan emin olun."
+ },
+ "zh-cn": {
+ "tts": "应用程序授权已变更。 %appName% 将不能再访问 %functionalGroupLabels%。 请确认您的移动设备上安装的应用程序是最新版本。"
+ },
+ "zh-tw": {
+ "tts": "應用程式授權已改變。%appName% 已無法進入 %functionalGroupLabels%。請確認您的行動裝置上安裝了最新版應用程式。"
+ }
+ }
+ },
+ "AppUnauthorized": {
+ "languages": {
+ "de-de": {
+ "tts": "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren.",
+ "line1": "nicht autorisiert"
+ },
+ "en-au": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "not authorized"
+ },
+ "en-gb": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "not authorized",
+ "textBody": "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-ie": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "not authorized"
+ },
+ "en-us": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "Not Authorized",
+ "textBody": "This version of %appName% is no longer authorized to work with Mobile Apps. Please update to the latest version of %appName%."
+ },
+ "es-en": {
+ "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
+ "line1": "no autorizada",
+ "textBody": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "es-es": {
+ "tts": "Esta versión de %appName% no está autorizada y no funcionará con SYNC.",
+ "line1": "No autorizada"
+ },
+ "es-mx": {
+ "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
+ "line1": "no autorizada",
+ "textBody": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "fr-ca": {
+ "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
+ "line1": "non autorisée",
+ "textBody": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "fr-fr": {
+ "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
+ "line1": "non autorisée"
+ },
+ "it-it": {
+ "tts": "Questa versione di %appName% non è autorizzata e non funziona con il SYNC.",
+ "line1": "non autorizzata"
+ },
+ "nl-nl": {
+ "tts": "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC.",
+ "line1": "niet geautoriseerd"
+ },
+ "pl-pl": {
+ "tts": "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC.",
+ "line1": "brak autoryzacji"
+ },
+ "pt-br": {
+ "tts": "Esta versão do %appName% não tem autorização e não funcionará com o SYNC.",
+ "line1": "não autorizado"
+ },
+ "pt-pt": {
+ "tts": "Esta versão de %appName% não está autorizada e não funcionará com o SYNC.",
+ "line1": "não autorizada"
+ },
+ "ru-ru": {
+ "tts": "Эта версия %appName% не авторизирована и не будет работать с SYNC.",
+ "line1": "не авторизировано"
+ },
+ "sv-se": {
+ "tts": "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC.",
+ "line1": "är ej godkänd"
+ },
+ "tr-tr": {
+ "tts": "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz.",
+ "line1": "için izin yok"
+ },
+ "zh-cn": {
+ "tts": "此版本的%appName% 未得到授权,无法在SYNC上使用。",
+ "line1": "未得到授权"
+ },
+ "zh-tw": {
+ "tts": "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。",
+ "line1": "無授權"
+ }
+ }
+ },
+ "AppUnsupported": {
+ "languages": {
+ "de-de": {
+ "tts": "Diese Version von %appName% wird von SYNC nicht unterstützt.",
+ "line1": "nicht unterstützt"
+ },
+ "en-au": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "not supported"
+ },
+ "en-gb": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "not supported",
+ "textBody": "This version of %appName% is not supported by SYNC."
+ },
+ "en-ie": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "not supported"
+ },
+ "en-us": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "Not Supported",
+ "textBody": "Your version of %appName% is not supported by SYNC."
+ },
+ "es-en": {
+ "tts": "Esta versión de %appName% no es compatible con SYNC.",
+ "line1": "no compatible",
+ "textBody": "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-es": {
+ "tts": "Esta versión de %appName% no es compatible con SYNC.",
+ "line1": "No compatible"
+ },
+ "es-mx": {
+ "tts": "Esta versión de %appName% no es compatible con SYNC.",
+ "line1": "no compatible",
+ "textBody": "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "fr-ca": {
+ "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.",
+ "line1": "incompatible",
+ "textBody": "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "fr-fr": {
+ "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.",
+ "line1": "incompatible"
+ },
+ "it-it": {
+ "tts": "Questa versione di %appName% non è supportata dal SYNC.",
+ "line1": "non supportata"
+ },
+ "nl-nl": {
+ "tts": "Deze versie van %appName% wordt niet ondersteund door SYNC.",
+ "line1": "niet ondersteund"
+ },
+ "pl-pl": {
+ "tts": "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC.",
+ "line1": "aplikacja nie obsług."
+ },
+ "pt-br": {
+ "tts": "Esta versão do %appName% não é suportada pelo SYNC.",
+ "line1": "não suportado"
+ },
+ "pt-pt": {
+ "tts": "Esta versão de %appName% não é suportado pelo SYNC.",
+ "line1": "não suportada"
+ },
+ "ru-ru": {
+ "tts": "Эта версия %appName% не поддерживается SYNC.",
+ "line1": "не поддерживается"
+ },
+ "sv-se": {
+ "tts": "SYNC har inte stöd för den här versionen av %appName%.",
+ "line1": "stöds ej"
+ },
+ "tr-tr": {
+ "tts": "Bu %appName% sürümü SYNC tarafından desteklenmiyor.",
+ "line1": "desteklenmiyor"
+ },
+ "zh-cn": {
+ "tts": "SYNC不支持此版本的%appName%。",
+ "line1": "不受支持"
+ },
+ "zh-tw": {
+ "tts": "SYNC 不支援此版本的%appName% 。",
+ "line1": "不支援"
+ }
+ }
+ },
+ "DataConsent": {
+ "languages": {
+ "en-gb": {
+ "textBody": "Would you like to enable Mobile Apps on SYNC? To use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S. \r\n\r\nUpdates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information."
+ },
+ "en-us": {
+ "line1": "Enable Mobile Apps",
+ "line2": "on SYNC? (Uses Data)",
+ "textBody": "Would you like to enable Mobile Apps on SYNC?\r\n\r\nIf you enable the use of mobile apps from your mobile device on SYNC, you agree that SYNC can periodically use your device’s data plan to send and receive data that keeps your settings current and enables app functionality. Data sent to Ford U.S. includes your VIN and SYNC module number. Standard rates may apply.\r\n\r\nTo change settings or turn off later, visit the SYNC mobile apps settings menu. See Owner Guide for more information. I agree and consent."
+ },
+ "es-mx": {
+ "textBody": "Si permite el uso de apps de su móvil vía SYNC®, acepta que SYNC® puede utilizar el plan de datos de su equipo para enviar y recibir info para actualizar su configuración y permitir la funcionalidad de la app. Datos enviados a Ford US incluyen VIN y # de módulo de SYNC®. Cargos a su plan de datos pueden aplicar. \r\n\r\nPara cambiar la config. de SYNC® o apagarlo, acceda a Menú de configuración de apps. Vea la Guía del Propietario para más info. Estoy de acuerdo y acepto lo anterior."
+ },
+ "fr-ca": {
+ "textBody": "Si vous activez les applications mobiles sur SYNC, vous acceptez que SYNC utilise votre forfait de données afin de maintenir vos réglages à jour et assurer la pleine fonctionnalité. Parmi les données envoyées à Ford US, notons le NIV et le numéro de module SYNC. Des frais de base peuvent s’appliquer. \r\n\r\nPour modifier les réglages ou désactiver les applications, consultez le menu des réglages des applications de SYNC. Voir le Manuel du propriétaire. J’accepte et je consens."
+ }
+ }
+ },
+ "DataConsentHelp": {
+ "languages": {
+ "en-us": {
+ "textBody": "By enabling mobile apps, you consent to allowing SYNC to communicate with Ford at least once per month using your mobile device’s data plan. Disabling will stop all data usage, but you will not be able to use mobile apps on SYNC. See your Owner Guide for more information."
+ },
+ "es-mx": {
+ "textBody": "Las actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario."
+ },
+ "fr-ca": {
+ "textBody": "Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements."
+ }
+ }
+ },
+ "DisableApps": {
+ "languages": {
+ "de-de": {
+ "tts": "Ausschalten der automatischen Updates führt zum Ausschalten von SYNC mobile Apps. Sie können Ihre mobilen Apps dann nicht mehr mit SYNC nutzen. Bitte drücken Sie Ja zur Bestätigung oder Nein, um abzubrechen.",
+ "line1": "Auto-Update",
+ "line2": "und Mobile Apps deaktivieren"
+ },
+ "en-au": {
+ "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
+ "line1": "Disable auto-updates",
+ "line2": "and Mobile Apps?"
+ },
+ "en-gb": {
+ "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
+ "line1": "Disable auto-updates",
+ "line2": "and Mobile Apps?",
+ "textBody": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel."
+ },
+ "en-ie": {
+ "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
+ "line1": "Disable auto-updates",
+ "line2": "and Mobile Apps?"
+ },
+ "en-us": {
+ "tts": "Disabling automatic updates will also disable sync mobile apps. You will not be able to use any mobile apps with SYNC. Please press yes to confirm or no to cancel.",
+ "line1": "Disable Auto-Updates",
+ "line2": "and Mobile Apps?",
+ "textBody": "If you disable, you will not be able to use any mobile apps with SYNC and your vehicle will stop receiving mobile app permission updates via your device`s data plan. Please press yes to disable mobile apps or no to cancel."
+ },
+ "es-en": {
+ "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.",
+ "line1": "¿Deshab. actualiz.",
+ "line2": "autom. y aplic. móv.?",
+ "textBody": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar."
+ },
+ "es-es": {
+ "tts": "Si desactiva las actualizaciones automáticas, también se desactivará la sincronización de las aplicaciones móviles. No podrá utilizar ninguna aplicación móvil con SYNC. Pulse sí para confirmar o no para cancelar.",
+ "line1": "¿Desact. actual. auto",
+ "line2": "y apl. móviles?"
+ },
+ "es-mx": {
+ "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.",
+ "line1": "¿Deshab. actualiz.",
+ "line2": "autom. y aplic. móv.?",
+ "textBody": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar."
+ },
+ "fr-ca": {
+ "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.",
+ "line1": "Désactiver màj autom.",
+ "line2": "et app. mobiles?",
+ "textBody": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler."
+ },
+ "fr-fr": {
+ "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.",
+ "line1": "Désactiver màj autom.",
+ "line2": "et app. mobiles?"
+ },
+ "it-it": {
+ "tts": "Disabilitando gli aggiornamenti automatici si disattiva anche la sincronizzazione delle app mobili. Non sarà possibile usare app mobili con il SYNC. Premere Sì per confermare e No per cancellare.",
+ "line1": "Disabilitare agg. aut.",
+ "line2": "e app mobili?"
+ },
+ "nl-nl": {
+ "tts": "Door automatische updates uit te schakelen, schakelt u ook SYNC-mobiele apps uit. U kunt dan geen mobiele apps meer gebruiken met SYNC. Druk op Ja om te bevestigen of op Nee om te annuleren.",
+ "line1": "Auto-updates en mob.",
+ "line2": "apps uitschakelen?"
+ },
+ "pl-pl": {
+ "tts": "Wyłączenie automatycznych aktualizacji spowoduje także wyłączenie aplikacji mobilnych SYNC. Korzystanie z mobilnych aplikacji za pomocą SYNC będzie niemożliwe. Naciśnij TAK, by potwierdzić lub NIE, by anulować.",
+ "line1": "Wył. automat. aktual.",
+ "line2": "i aplikacje mobilne?"
+ },
+ "pt-br": {
+ "tts": "Se as atualizações automáticas forem desativadas, os aplicativos também serão desativados. Você não poderá usar nenhum aplicativo com o SYNC. Pressione sim para confirmar ou não para cancelar.",
+ "line1": "Desativar atualizações",
+ "line2": "autom. e aplicativos?"
+ },
+ "pt-pt": {
+ "tts": "A desactivação das actualizações automáticas desactiva igualmente as aplicações móveis do SYNC. Não poderá utilizar quaisquer aplicações móveis com o SYNC. Prima \"\"Sim\"\" para confirmar ou \"\"Não\"\" para cancelar.",
+ "line1": "Desact. actual. autom.",
+ "line2": "e aplicações móveis?"
+ },
+ "ru-ru": {
+ "tts": "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены.",
+ "line1": "Откл. автообновления",
+ "line2": "и мобил. прилож.?"
+ },
+ "sv-se": {
+ "tts": "Om du avaktiverar automatisk uppdatering avaktiverar du även synkning av mobilappar. Du kommer inte längre att kunna använda dina mobilappar med SYNC. Tryck Ja för att bekräfta eller Nej för att avbryta.",
+ "line1": "Avaktiverar autouppdat.",
+ "line2": "och mobilappar?"
+ },
+ "tr-tr": {
+ "tts": "Otomatik güncellemeleri devre dışı bırakırsanız sync mobil uygulamalar da devre dışı kalır. SYNC ile mobil uygulama kullanmanız mümkün olmaz. Lütfen onaylamak için Evet'e veya iptal etmek için Hayır'a basın.",
+ "line1": "Oto. güncelleme ve",
+ "line2": "mobil uygul. kapat?"
+ },
+ "zh-cn": {
+ "tts": "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。",
+ "line1": "是否禁用自动更新和",
+ "line2": "移动应用程序?"
+ },
+ "zh-tw": {
+ "tts": "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。",
+ "line1": "停用自動更新",
+ "line2": "和行動應用程式?"
+ }
+ }
+ },
+ "DrivingCharacteristics": {
+ "languages": {
+ "de-de": {
+ "tts": "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus.",
+ "label": "Fahreigenschaften"
+ },
+ "en-au": {
+ "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
+ "label": "Driving characteristics"
+ },
+ "en-gb": {
+ "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
+ "label": "Driving characteristics",
+ "textBody": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-ie": {
+ "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
+ "label": "Driving characteristics"
+ },
+ "en-us": {
+ "tts": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status, Gear Position, RPM.",
+ "label": "Driving Characteristics",
+ "textBody": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status, Gear Position, RPM."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.",
+ "label": "Características del manejo",
+ "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad.",
+ "label": "Características de conducción"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad, RPM del motor, y Posición del cambio.",
+ "label": "Características del manejo",
+ "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad, RPM del motor, y Posición del cambio."
+ },
+ "fr-ca": {
+ "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité, régime du moteur, et Position d’embrayage.",
+ "label": "Caractéristiques de conduite",
+ "textBody": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité, régime du moteur, et Position d’embrayage."
+ },
+ "fr-fr": {
+ "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.",
+ "label": "Caractéristiques de conduite"
+ },
+ "it-it": {
+ "tts": "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza.",
+ "label": "Caratteristiche di guida"
+ },
+ "nl-nl": {
+ "tts": "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus.",
+ "label": "Rijkenmerken"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa.",
+ "label": "Informacje dotyczące stylu jazdy"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança.",
+ "label": "Características de condução",
+ "line1": "Caract. Condução"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança.",
+ "label": "Características de condução"
+ },
+ "ru-ru": {
+ "tts": "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности.",
+ "label": "Характеристики движения"
+ },
+ "sv-se": {
+ "tts": "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus.",
+ "label": "Köregenskaper"
+ },
+ "tr-tr": {
+ "tts": "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu.",
+ "label": "Sürüş karakteristikleri"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态",
+ "label": "行驶特性"
+ },
+ "zh-tw": {
+ "tts": "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態",
+ "label": "駕駛特性"
+ }
+ }
+ },
+ "Location": {
+ "languages": {
+ "de-de": {
+ "tts": "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs.",
+ "label": "GPS und Geschwindigkeit"
+ },
+ "en-au": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed"
+ },
+ "en-gb": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed",
+ "textBody": "An app can access vehicle GPS and speed."
+ },
+ "en-ie": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed"
+ },
+ "en-us": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and Speed",
+ "textBody": "An app can access vehicle GPS and speed."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
+ "label": "GPS y velocidad",
+ "textBody": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede acceder al GPS y la velocidad del vehículo.",
+ "label": "GPS y velocidad"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
+ "label": "GPS y velocidad",
+ "textBody": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "fr-ca": {
+ "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.",
+ "label": "GPS et Vitesse",
+ "textBody": "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "fr-fr": {
+ "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.",
+ "label": "GPS et vitesse"
+ },
+ "it-it": {
+ "tts": "Un'app può avere accesso a GPS e velocità del veicolo.",
+ "label": "GPS e velocità"
+ },
+ "nl-nl": {
+ "tts": "Een app heeft toegang tot gps en de snelheid van het voertuig.",
+ "label": "Gps en snelheid"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu.",
+ "label": "GPS i prędkość"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode acessar o GPS e a velocidade do veículo.",
+ "label": "GPS e velocidade"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue aceder ao GPS e à velocidade do veículo.",
+ "label": "GPS e velocidade"
+ },
+ "ru-ru": {
+ "tts": "Приложение имеет доступ к GPS и скорости автомобиля.",
+ "label": "GPS и скорость"
+ },
+ "sv-se": {
+ "tts": "Appen kan komma åt fordonets GPS och hastighetsmätare.",
+ "label": "GPS och hastighet"
+ },
+ "tr-tr": {
+ "tts": "Bu uygulama aracın GPS ve hız bilgilerine erişebilir.",
+ "label": "GPS ve hız"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序可以访问车辆 GPS 和车速信息。",
+ "label": "GPS 和车速"
+ },
+ "zh-tw": {
+ "tts": "應用程式可存取車輛的GPS和速度。",
+ "label": "GPS和車速"
+ }
+ }
+ },
+ "Notifications": {
+ "languages": {
+ "de-de": {
+ "tts": "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden.",
+ "label": "Push-Benachrichtigungen"
+ },
+ "en-au": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications"
+ },
+ "en-gb": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications",
+ "textBody": "An app can send notifications when running in the background."
+ },
+ "en-ie": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications"
+ },
+ "en-us": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push Notifications",
+ "textBody": "An app can send notifications when running in the background."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
+ "label": "Notificaciones tipo Push",
+ "textBody": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano.",
+ "label": "Notificaciones push"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
+ "label": "Notificaciones tipo Push",
+ "textBody": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "fr-ca": {
+ "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
+ "label": "Notifications Instantanées",
+ "textBody": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "fr-fr": {
+ "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
+ "label": "Notifications push"
+ },
+ "it-it": {
+ "tts": "Un'app può inviare notifiche se eseguita in background.",
+ "label": "Notifiche push"
+ },
+ "nl-nl": {
+ "tts": "Een app kan meldingen versturen als deze op de achtergrond actief is.",
+ "label": "Push-meldingen"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może wysyłać powiadomienia, działając w tle.",
+ "label": "Powiadomienia Push"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano.",
+ "label": "Notificações Push",
+ "line1": "Notificações"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue enviar notificações quando está activa em segundo plano.",
+ "label": "Notificações push"
+ },
+ "ru-ru": {
+ "tts": "Если приложение работает в фоновом режиме, оно может отправлять оповещения.",
+ "label": "Оповещения о пересылке"
+ },
+ "sv-se": {
+ "tts": "Appen kan skicka meddelanden när den körs i bakgrunden.",
+ "label": "Push-notiser"
+ },
+ "tr-tr": {
+ "tts": "Bir uygulama arka planda çalışırken bildirim gönderebilir.",
+ "label": "Anlık bildirimleri"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序在后台运行时可推送通知。",
+ "label": "推送通知"
+ },
+ "zh-tw": {
+ "tts": "車輛行進時,應用程式可在背景中傳送通知。",
+ "label": "傳送通知"
+ }
+ }
+ },
+ "SettingAppPermissions": {
+ "languages": {
+ "en-us": {
+ "textBody": "Change %AppName%’s functionality and use of data as described below. See App terms of service and privacy policies."
+ },
+ "es-mx": {
+ "textBody": "Para cambiar la funcionalidad de %appName% y usar los datos como se describe más adelante. Consulte los términos de servicio y políticas de privacidad de la App."
+ },
+ "fr-ca": {
+ "textBody": "Pour modifier la fonctionnalité de %appName% et l’usage des données comme décrit ci-dessous. Reportez-vous aux modalités de service et à la politique de confidentialité de l’application."
+ }
+ }
+ },
+ "SettingDisableUpdates": {
+ "languages": {
+ "de-de": {
+ "line1": "Updates deakt."
+ },
+ "en-au": {
+ "line1": "Disable updates"
+ },
+ "en-gb": {
+ "line1": "Disable updates"
+ },
+ "en-ie": {
+ "line1": "Disable updates"
+ },
+ "en-us": {
+ "line1": "Disable Updates",
+ "textBody": "Disable Updates"
+ },
+ "es-en": {
+ "line1": "Deshab. actual.",
+ "textBody": "Deshab. actual."
+ },
+ "es-es": {
+ "line1": "Desact. actual."
+ },
+ "es-mx": {
+ "line1": "Deshab. actual.",
+ "textBody": "Deshab. actual."
+ },
+ "fr-ca": {
+ "line1": "Désactiver MAJ",
+ "textBody": "Désactiver MAJ"
+ },
+ "fr-fr": {
+ "line1": "Désactiver màj"
+ },
+ "it-it": {
+ "line1": "Disabilita agg."
+ },
+ "nl-nl": {
+ "line1": "Upd. uitschak."
+ },
+ "pl-pl": {
+ "line1": "Wyłącz aktual."
+ },
+ "pt-br": {
+ "line1": "Desat. atualiz."
+ },
+ "pt-pt": {
+ "line1": "Desact. actualiz."
+ },
+ "ru-ru": {
+ "line1": "Откл. обновл."
+ },
+ "sv-se": {
+ "line1": "Inaktivera uppd."
+ },
+ "tr-tr": {
+ "line1": "Güncell. Kapat"
+ },
+ "zh-cn": {
+ "line1": "禁用更新"
+ },
+ "zh-tw": {
+ "line1": "停用更新"
+ }
+ }
+ },
+ "SettingEnableUpdates": {
+ "languages": {
+ "de-de": {
+ "line1": "Apps aktivieren"
+ },
+ "en-au": {
+ "line1": "Enable Apps"
+ },
+ "en-gb": {
+ "line1": "Enable Apps"
+ },
+ "en-ie": {
+ "line1": "Enable Apps"
+ },
+ "en-us": {
+ "line1": "Enable Apps"
+ },
+ "es-en": {
+ "line1": "Hab. aplic."
+ },
+ "es-es": {
+ "line1": "Activar apl."
+ },
+ "es-mx": {
+ "line1": "Hab. aplic."
+ },
+ "fr-ca": {
+ "line1": "Activer app.",
+ "textBody": "Activer app."
+ },
+ "fr-fr": {
+ "line1": "Activer app."
+ },
+ "it-it": {
+ "line1": "Abilita app"
+ },
+ "nl-nl": {
+ "line1": "Apps inschak."
+ },
+ "pl-pl": {
+ "line1": "Włącz aplikacje"
+ },
+ "pt-br": {
+ "line1": "Ativar aplic."
+ },
+ "pt-pt": {
+ "line1": "Activar actualiz."
+ },
+ "ru-ru": {
+ "line1": "Вкл. прилож."
+ },
+ "sv-se": {
+ "line1": "Aktivera appar"
+ },
+ "tr-tr": {
+ "line1": "Uygulamaları aç"
+ },
+ "zh-cn": {
+ "line1": "启用应用程序"
+ },
+ "zh-tw": {
+ "line1": "啟用應用程式"
+ }
+ }
+ },
+ "SettingUpdateAuto": {
+ "languages": {
+ "de-de": {
+ "line1": "Update anford."
+ },
+ "en-au": {
+ "line1": "Request update"
+ },
+ "en-gb": {
+ "line1": "Request update"
+ },
+ "en-ie": {
+ "line1": "Request update"
+ },
+ "en-us": {
+ "line1": "Request Update",
+ "textBody": "Select `Update now` to receive app permissions for your SYNC-enabled mobile apps. This may enable additional functionality depending on the app and your settings. If your phone has a working data connection, an update should complete in less than 1 minute."
+ },
+ "es-en": {
+ "line1": "Solicit. actualiz.",
+ "textBody": "Solicit. actualiz."
+ },
+ "es-es": {
+ "line1": "Solicitar actual."
+ },
+ "es-mx": {
+ "line1": "Solicit. actualiz.",
+ "textBody": "Solicit. actualiz."
+ },
+ "fr-ca": {
+ "line1": "Demander MAJ",
+ "textBody": "Demander MAJ"
+ },
+ "fr-fr": {
+ "line1": "Demander màj"
+ },
+ "it-it": {
+ "line1": "Rich. aggiorn."
+ },
+ "nl-nl": {
+ "line1": "Upd. aanvragen"
+ },
+ "pl-pl": {
+ "line1": "Zażądaj aktual."
+ },
+ "pt-br": {
+ "line1": "Solicitar atualiz."
+ },
+ "pt-pt": {
+ "line1": "Solicit. actualiz."
+ },
+ "ru-ru": {
+ "line1": "Запрос на обн."
+ },
+ "sv-se": {
+ "line1": "Begär uppdat."
+ },
+ "tr-tr": {
+ "line1": "Güncelleme iste"
+ },
+ "zh-cn": {
+ "line1": "请求更新"
+ },
+ "zh-tw": {
+ "line1": "請求更新"
+ }
+ }
+ },
+ "StatusNeeded": {
+ "languages": {
+ "de-de": {
+ "line1": "Update benötigt"
+ },
+ "en-au": {
+ "line1": "Update needed"
+ },
+ "en-gb": {
+ "line1": "Update needed",
+ "textBody": "Update needed"
+ },
+ "en-ie": {
+ "line1": "Update needed"
+ },
+ "en-us": {
+ "line1": "Update Needed",
+ "textBody": "Update Needed"
+ },
+ "es-en": {
+ "line1": "Actualiz. neces.",
+ "textBody": "Actualiz. neces."
+ },
+ "es-es": {
+ "line1": "Actu. necesaria"
+ },
+ "es-mx": {
+ "line1": "Actualiz. neces.",
+ "textBody": "Actualiz. neces."
+ },
+ "fr-ca": {
+ "line1": "Màj requise",
+ "textBody": "Màj requise"
+ },
+ "fr-fr": {
+ "line1": "Mise à jour requise"
+ },
+ "it-it": {
+ "line1": "Necess. aggiorn."
+ },
+ "nl-nl": {
+ "line1": "Update nodig"
+ },
+ "pl-pl": {
+ "line1": "Potrzeba aktual."
+ },
+ "pt-br": {
+ "line1": "Atualiz. necess."
+ },
+ "pt-pt": {
+ "line1": "Actual. necess."
+ },
+ "ru-ru": {
+ "line1": "Необх. обновл."
+ },
+ "sv-se": {
+ "line1": "Uppdat. krävs"
+ },
+ "tr-tr": {
+ "line1": "Güncellenmeli"
+ },
+ "zh-cn": {
+ "line1": "需要进行更新"
+ },
+ "zh-tw": {
+ "line1": "需更新"
+ }
+ }
+ },
+ "StatusPending": {
+ "languages": {
+ "de-de": {
+ "line1": "Aktualisieren..."
+ },
+ "en-au": {
+ "line1": "Updating..."
+ },
+ "en-gb": {
+ "line1": "Updating...",
+ "textBody": "Updating..."
+ },
+ "en-ie": {
+ "line1": "Updating..."
+ },
+ "en-us": {
+ "line1": "Updating...",
+ "textBody": "Updating..."
+ },
+ "es-en": {
+ "line1": "Actualizando...",
+ "textBody": "Actualizando..."
+ },
+ "es-es": {
+ "line1": "Actualizando..."
+ },
+ "es-mx": {
+ "line1": "Actualizando...",
+ "textBody": "Actualizando..."
+ },
+ "fr-ca": {
+ "line1": "MAJ en cours...",
+ "textBody": "MAJ en cours..."
+ },
+ "fr-fr": {
+ "line1": "Màj en cours..."
+ },
+ "it-it": {
+ "line1": "Aggiornamento"
+ },
+ "nl-nl": {
+ "line1": "Updaten..."
+ },
+ "pl-pl": {
+ "line1": "Aktualizowanie"
+ },
+ "pt-br": {
+ "line1": "Atualizando..."
+ },
+ "pt-pt": {
+ "line1": "A actualizar..."
+ },
+ "ru-ru": {
+ "line1": "Обновление..."
+ },
+ "sv-se": {
+ "line1": "Uppdaterar..."
+ },
+ "tr-tr": {
+ "line1": "Güncelleniyor..."
+ },
+ "zh-cn": {
+ "line1": "正在更新......"
+ },
+ "zh-tw": {
+ "line1": "更新中..."
+ }
+ }
+ },
+ "StatusUpToDate": {
+ "languages": {
+ "de-de": {
+ "line1": "Aktuelle Version"
+ },
+ "en-au": {
+ "line1": "Up-to-date"
+ },
+ "en-gb": {
+ "line1": "Up-to-date",
+ "textBody": "Up-to-date"
+ },
+ "en-ie": {
+ "line1": "Up-to-date"
+ },
+ "en-us": {
+ "line1": "Up-To-Date",
+ "textBody": "Up-To-Date"
+ },
+ "es-en": {
+ "line1": "Actualizado",
+ "textBody": "Actualizado"
+ },
+ "es-es": {
+ "line1": "Actualizada"
+ },
+ "es-mx": {
+ "line1": "Actualizado",
+ "textBody": "Actualizado"
+ },
+ "fr-ca": {
+ "line1": "Déjà à jour",
+ "textBody": "Déjà à jour"
+ },
+ "fr-fr": {
+ "line1": "Déjà à jour"
+ },
+ "it-it": {
+ "line1": "più recente"
+ },
+ "nl-nl": {
+ "line1": "Up-to-date"
+ },
+ "pl-pl": {
+ "line1": "Aktualne"
+ },
+ "pt-br": {
+ "line1": "Atualizado"
+ },
+ "pt-pt": {
+ "line1": "Actualizado"
+ },
+ "ru-ru": {
+ "line1": "Обновлено"
+ },
+ "sv-se": {
+ "line1": "Uppdat. krävs ej"
+ },
+ "tr-tr": {
+ "line1": "Güncel"
+ },
+ "zh-cn": {
+ "line1": "最新更新"
+ },
+ "zh-tw": {
+ "line1": "更新最新"
+ }
+ }
+ },
+ "VehicleInfo": {
+ "languages": {
+ "de-de": {
+ "tts": "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck.",
+ "label": "Fahrzeuginformationen"
+ },
+ "en-au": {
+ "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.",
+ "label": "Vehicle information"
+ },
+ "en-gb": {
+ "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure.",
+ "label": "Vehicle information",
+ "textBody": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure."
+ },
+ "en-ie": {
+ "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.",
+ "label": "Vehicle information"
+ },
+ "en-us": {
+ "tts": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Odometer, VIN, External Temperature, Tire Pressure.",
+ "label": "Vehicle Information",
+ "textBody": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Odometer, VIN, External Temperature, Tire Pressure."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.",
+ "label": "Información del vehículo",
+ "textBody": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede acceder a la siguiente información del vehículo: Nivel de combustible, Ahorro de combustible, RPM del motor, Cuentakilómetros, VIN, Temperatura aire exterior, Marcha engranada, Presión de neumáticos.",
+ "label": "Información del vehículo"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Presión de los neumáticos.",
+ "label": "Información del Vehículo",
+ "textBody": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Presión de los neumáticos."
+ },
+ "fr-ca": {
+ "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Odomètre, NIV, Température extérieure, et Pression des pneus.",
+ "label": "Renseignements du Véhicule",
+ "textBody": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Odomètre, NIV, Température extérieure, et Pression des pneus."
+ },
+ "fr-fr": {
+ "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Vitesse de moteur, Compteur kilométrique, NIV, Température extérieure, Position de vitesse, Pression des pneus.",
+ "label": "Renseignements du véhicule"
+ },
+ "it-it": {
+ "tts": "Un'app può avere accesso alle seguenti informazioni del veicolo: Livello carburante, Consumi carburante, Numero giri motore, Contachilometri, VIN, Temperatura esterna, Posizione marcia, Pressione pneumatici.",
+ "label": "Informazioni sul veicolo"
+ },
+ "nl-nl": {
+ "tts": "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning.",
+ "label": "Voertuiginformatie"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może uzyskać dostęp do następujących informacji o pojeździe: Poziom paliwa, Zużycie paliwa, Obroty silnika, Licznik przebiegu, Numer VIN, Temperatura zewnętrzna, Aktualny bieg, Ciśnienie opon.",
+ "label": "Informacje o pojeździe"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode acessar as seguintes informações sobre o veículo: Nível de combustível, Economia de combustível, RPM do motor, Hodômetro, VIN, Temperatura externa, Posição das marchas, Pressão dos pneus.",
+ "label": "Informações sobre o veículo",
+ "line1": "Inform. Veículo"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue aceder às seguintes informações do veículo: Nível de combustível, Poupança de combustível, RPM do motor, Conta-quilómetros, VIN, Temperatura exterior, Posição da mudança de velocidade, Pressão dos pneus.",
+ "label": "Informações do veículo"
+ },
+ "ru-ru": {
+ "tts": "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин.",
+ "label": "Информация об автомобиле"
+ },
+ "sv-se": {
+ "tts": "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck.",
+ "label": "Fordonsinformation"
+ },
+ "tr-tr": {
+ "tts": "Bir uygulama şu araç bilgilerine erişebilir: Yakıt seviyesi, Yakıt ekonomisi, Motor devirleri, Kilometre sayacı, VIN, Dış sıcaklık, Vites konumu, Lastik basıncı.",
+ "label": "Araç bilgisi"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压.",
+ "label": "车辆信息"
+ },
+ "zh-tw": {
+ "tts": "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓.",
+ "label": "車輛資訊"
+ }
+ }
+ }
+ }
+ },
+ "app_policies": {
+ "default": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": [
+ "Base-4"
+ ]
+ },
+ "device": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": [
+ "DataConsent-2"
+ ]
+ },
+ "pre_DataConsent": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": [
+ "BaseBeforeDataConsent"
+ ]
+ }
+ }
+ }
+}
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index c30255da4..7626b035e 100644
--- a/src/appMain/smartDeviceLink.ini
+++ b/src/appMain/smartDeviceLink.ini
@@ -15,16 +15,19 @@
[HMI]
LaunchHMI = true
+LinkToWebHMI = HMI/index.html
ServerAddress = 127.0.0.1
ServerPort = 8087
VideoStreamingPort = 5050
AudioStreamingPort = 5080
[MAIN]
+SDLVersion =
+LogsEnabled = true
; Contains .json/.ini files
AppConfigFolder =
; Contains output files, e.g. .wav
-AppStorageFolder =
+AppStorageFolder = storage
; Contains resourses, e.g. audio8bit.wav
AppResourceFolder =
; Standard min stack size
@@ -32,19 +35,23 @@ AppResourceFolder =
; in QNX : PTHREAD_STACK_MIN = 256
;The value of a variable ThreadStackSize used only if its realy needed, other way stack size will be PTHREAD_STACK_MIN
;
-AppConfigFolder =
-AppStorageFolder =
-ThreadStackSize = 16384
+ThreadStackSize = 20480
MixingAudioSupported = true
HMICapabilities = hmi_capabilities.json
MaxCmdID = 2000000000
; Default request timeout in milliseconds
DefaultTimeout = 10000
+
AppDirectoryQuota = 104857600
+; Allowed requests amount in HMI level NONE during time scale.
+; If value is 0 check will be skipped
AppHMILevelNoneTimeScaleMaxRequests = 100
AppHMILevelNoneRequestsTimeScale = 10
+; Allowed requests amount during time scale.
+; If value is 0 check will be skipped
AppTimeScaleMaxRequests = 1000
AppRequestsTimeScale = 10
+; Allowed pending requests amount. If value is 0 check will be skipped
PendingRequestsAmount = 5000
HeartBeatTimeout = 7
SupportedDiagModes = 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x09, 0x0A, 0x18, 0x19, 0x22, 0x3E
@@ -55,8 +62,8 @@ ReadDIDRequest = 5, 1
GetVehicleDataRequest = 5, 1
[MEDIA MANAGER]
-; where 3 is a number of retries and 1 is a timeout in seconds for request frequency
-StartStreamRetry = 3, 1
+; where 3 is a number of retries and 1000 is a timeout in milliseconds for request frequency
+StartStreamRetry = 3, 1000
EnableRedecoding = false
VideoStreamConsumer = socket
AudioStreamConsumer = socket
@@ -75,6 +82,12 @@ AudioStreamFile = audio_stream_file
RecordingFileSource = audio.8bit.wav
; Recording file for audio pass thru
RecordingFileName = audio.wav
+; The timeout in seconds for mobile to stop streaming or end up sessions.
+StopStreamingTimeout = 1
+; The timeout in miliseconds to suspend audio data streaming if no data received from mobile
+AudioDataStoppedTimeout = 1000
+; The timeout in miliseconds to suspend video data streaming if no data received from mobile
+VideoDataStoppedTimeout = 1000
; HelpPromt and TimeOutPrompt is a vector of strings separated by comma
[GLOBAL PROPERTIES]
@@ -132,6 +145,10 @@ ForceUnprotectedService = Non
EnablePolicy = true
PreloadedPT = sdl_preloaded_pt.json
PathToSnapshot = sdl_snapshot.json
+; Number of attempts to open policy DB
+AttemptsToOpenPolicyDB = 5
+; Timeout between attempts during opening DB in milliseconds
+OpenAttemptTimeoutMs = 500
[TransportManager]
TCPAdapterPort = 12345
@@ -147,7 +164,53 @@ IAPSystemConfig = /fs/mp/etc/mm/ipod.cfg
IAP2SystemConfig = /fs/mp/etc/mm/iap2.cfg
IAP2HubConnectAttempts = 3
+[ProtocolHandler]
+; Packet with payload bigger than next value will be marked as a malformed
+; for protocol v3 or higher
+; For v2 protocol MaximumPayloadSize is 1488
+MaximumPayloadSize = 131072
+; Application shall send less #FrequencyCount messages per #FrequencyTime mSecs
+; Frequency check could be disabled by setting #FrequencyTime or
+; #FrequencyCount to Zero
+FrequencyCount = 1000
+FrequencyTime = 1000
+; Enable filtering transport data stream
+; On #MalformedMessageFiltering disable SDl disconnect with the first
+; malformed message detection
+MalformedMessageFiltering = true
+; Boundary values of malformed message detection for connection close
+; Can be disabled by setting #MalformedFrequencyTime or
+; #MalformedFrequencyCount to Zero
+MalformedFrequencyCount = 10
+MalformedFrequencyTime = 1000
+
[ApplicationManager]
ApplicationListUpdateTimeout = 2
; Max allowed threads for handling mobile requests. Currently max allowed is 2
ThreadPoolSize = 1
+HashStringSize = 32
+
+[SDL4]
+; Enables SDL 4.0 support
+EnableProtocol4 = true
+; Path where apps icons must be stored
+AppIconsFolder = storage
+; Max size of the folder in bytes
+AppIconsFolderMaxSize = 104857600
+; Amount of oldest icons to remove in case of max folder size was reached
+AppIconsAmountToRemove = 1
+
+[Resumption]
+
+# Timeout in seconds for resumption Application HMILevel
+# and resolving conflicts in case if multiple applications initiate resumption
+ApplicationResumingTimeout = 3
+
+# Timeout in seconds for pereodical saving resumption persisten data
+AppSavePersistentDataTimeout = 10 #seconds
+
+# Timeout in seconds to store hmi_level for media app before ign_off
+ResumptionDelayBeforeIgn = 30;
+
+# Timeout in seconds to restore hmi_level for media app after sdl run
+ResumptionDelayAfterIgn = 30;
diff --git a/src/components/CMakeLists.txt b/src/components/CMakeLists.txt
index fc1f0c63c..b6b61d6bd 100644
--- a/src/components/CMakeLists.txt
+++ b/src/components/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2013, Ford Motor Company
+# Copyright (c) 2014, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,6 +28,8 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+set(COMPONENTS_DIR ${CMAKE_SOURCE_DIR}/src/components)
+
# --- HMI_API interfaces
add_subdirectory(./interfaces)
diff --git a/src/components/HMI/IVSU/PROPRIETARY_REQUEST b/src/components/HMI/IVSU/PROPRIETARY_REQUEST
index ab0a27b55..e9009f722 100644
--- a/src/components/HMI/IVSU/PROPRIETARY_REQUEST
+++ b/src/components/HMI/IVSU/PROPRIETARY_REQUEST
@@ -1,2 +1 @@
-4Ezay^ק<yi'*';(*'-N)z:nx:Rǂi^^笴ǭO9$ySgږ爞ZDžYhږǜzۭקoj[nruZL
-w>^7k͆
+{"Content-Type":"application/json"} \ No newline at end of file
diff --git a/src/components/HMI/app/AppViews.js b/src/components/HMI/app/AppViews.js
index 19f1b4879..ec31c1339 100644
--- a/src/components/HMI/app/AppViews.js
+++ b/src/components/HMI/app/AppViews.js
@@ -37,9 +37,15 @@ SDL.AppViews = Em.ContainerView.extend( {
elementId: 'app',
childViews: [
+ SDL.HomeView,
SDL.MediaView,
+ SDL.NavigationAppView,
SDL.InfoView,
+ SDL.PhoneView,
+ SDL.ClimateView,
+ SDL.NavigationView,
SDL.ControlButtons,
+ SDL.SettingsView,
SDL.TurnByTurnView,
SDL.TBTTurnList,
SDL.OptionsView,
@@ -48,7 +54,12 @@ SDL.AppViews = Em.ContainerView.extend( {
SDL.VRHelpListView,
SDL.ScrollableMessage,
SDL.SliderView,
+ SDL.StatusClimateView,
+ SDL.StatusMediaView,
+ SDL.StatusNavigationView,
SDL.StatusInfoView,
+ SDL.StatusPhoneView,
+ SDL.TopControls,
SDL.BottomControls,
SDL.TTSPopUp,
SDL.AlertPopUp,
diff --git a/src/components/HMI/app/SDLApp.js b/src/components/HMI/app/SDLApp.js
index c1f40ad58..bbe464400 100644
--- a/src/components/HMI/app/SDLApp.js
+++ b/src/components/HMI/app/SDLApp.js
@@ -48,7 +48,7 @@ SDL = Em.Application.create( {
helpMode: false,
// determine home view {string}
- homeView: 'info_view',
+ homeView: 'home',
/** Set language for localization */
localization: 'eng',
@@ -77,4 +77,4 @@ SDL = Em.Application.create( {
/** container for all views */
SDL.views = SDL.AppViews.create().appendTo('body');
}
-});
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/controller/SettingsController.js b/src/components/HMI/app/controller/SettingsController.js
index a9a5d1a00..32f4e4762 100644
--- a/src/components/HMI/app/controller/SettingsController.js
+++ b/src/components/HMI/app/controller/SettingsController.js
@@ -206,9 +206,13 @@ SDL.SettingsController = Em.Object.create( {
* @param {Object} message
*
*/
- permissionsFriendlyMessageUpdate: function(message, appID) {
+ permissionsFriendlyMessageUpdate: function(message) {
+
+
+ SDL.SettingsController.simpleParseUserFriendlyMessageData(message);
SDL.States.goToStates('settings.policies.appPermissions');
+
},
updateSDL: function() {
@@ -216,39 +220,28 @@ SDL.SettingsController = Em.Object.create( {
},
getURLS: function() {
- FFW.BasicCommunication.GetURLS();
+ FFW.BasicCommunication.GetURLS(7);
},
AllowSDLFunctionality: function(messages) {
- var str = '';
-
- if (messages[0].line1) {
- str += messages[0].line1;
- }
-
- if (messages[0].line2) {
- str += messages[0].line2;
- }
-
- if (messages[0].textBody) {
- str += messages[0].textBody;
- }
-
- if (str) {
- SDL.PopUp.create().appendTo('body').popupActivate(messages[0].textBody, SDL.SettingsController.OnAllowSDLFunctionality);
+ if (messages.length > 0) {
+ SDL.SettingsController.simpleParseUserFriendlyMessageData(messages, SDL.SettingsController.OnAllowSDLFunctionality);
} else {
- SDL.PopUp.create().appendTo('body').popupActivate('WARNING!!!!!!!!!!!!!! There is no text from SDL in GetUserFriendlyMessage for DataConsent parameter!!! Please allow the device...', SDL.SettingsController.OnAllowSDLFunctionality);
+ SDL.PopUp.create().appendTo('body').popupActivate(
+ 'WARNING!!!!!!!!!!!!!! '
+ + 'There is no text from SDL in GetUserFriendlyMessage for DataConsent parameter!!! Please allow the device...',
+ SDL.SettingsController.OnAllowSDLFunctionality);
}
},
userFriendlyMessagePopUp: function(appId, messageCode) {
- FFW.BasicCommunication.GetUserFriendlyMessage(function(message){SDL.PopUp.create().appendTo('body').popupActivate(message)}, appId, messageCode);
+ FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, appId, messageCode);
},
- simpleParseUserFriendlyMessageData: function (messages) {
+ simpleParseUserFriendlyMessageData: function (messages, func) {
var tts = "",
text = "";
@@ -273,7 +266,7 @@ SDL.SettingsController = Em.Object.create( {
if (text) {
- SDL.PopUp.create().appendTo('body').popupActivate(text);
+ SDL.PopUp.create().appendTo('body').popupActivate(text, func);
}
},
diff --git a/src/components/HMI/app/controller/sdl/AppController.js b/src/components/HMI/app/controller/sdl/AppController.js
index 784e7e8d1..9cf5d1f15 100644
--- a/src/components/HMI/app/controller/sdl/AppController.js
+++ b/src/components/HMI/app/controller/sdl/AppController.js
@@ -51,7 +51,6 @@ SDL.SDLAppController = Em.Object.create({
*/
showAppList: function() {
- SDL.InfoAppsView.showAppList();
SDL.AppPermissionsListView.showAppList();
}.observes('SDL.SDLModel.registeredApps.@each'),
@@ -144,6 +143,9 @@ SDL.SDLAppController = Em.Object.create({
*/
onVRCommand: function (element) {
+ if (SDL.SDLModel.VRActive) {
+ SDL.SDLModel.toggleProperty('VRActive');
+ }
FFW.VR.onCommand(element.commandID, element.appID);
},
diff --git a/src/components/HMI/app/controller/sdl/Controller.js b/src/components/HMI/app/controller/sdl/Controller.js
index 76fbb7e05..e33656ecf 100644
--- a/src/components/HMI/app/controller/sdl/Controller.js
+++ b/src/components/HMI/app/controller/sdl/Controller.js
@@ -55,7 +55,7 @@ SDL.SDLController = Em.Object
*/
sysContext: function() {
- if (SDL.VRPopUp.VRActive) {
+ if (SDL.SDLModel.VRActive) {
return 'VRSESSION';
}
if (SDL.AlertPopUp.active) {
@@ -78,7 +78,7 @@ SDL.SDLController = Em.Object
}.property('SDL.OptionsView.active',
'SDL.SliderView.active',
'SDL.SDLModel.AudioPassThruState',
- 'SDL.VRPopUp.VRActive',
+ 'SDL.SDLModel.VRActive',
'SDL.AlertPopUp.active',
'SDL.States.info.nonMedia.active',
'SDL.States.media.sdlmedia.active',
@@ -200,6 +200,8 @@ SDL.SDLController = Em.Object
SDL.VRHelpListView.deactivate();
}
}
+ } else if (SDL.VRHelpListView.active) {
+ SDL.VRHelpListView.deactivate();
}
}.observes('SDL.SDLModel.VRActive', 'SDL.SDLModel.interactionData.vrHelp'),
@@ -287,7 +289,15 @@ SDL.SDLController = Em.Object
*/
activateVRPopUp: function() {
+ if (FFW.TTS.requestId) {
+ FFW.TTS.aborted = true;
+ SDL.TTSPopUp.DeactivateTTS();
+ }
+ if (SDL.AlertPopUp.active) {
+ SDL.AlertPopUp.deactivate('ABORTED');
+ }
SDL.SDLModel.toggleProperty('VRActive');
+
},
/**
* Action for SoftButtons that closes popUp or window and opens
@@ -414,6 +424,15 @@ SDL.SDLController = Em.Object
FFW.BasicCommunication.ExitAllApplications(state);
},
/**
+ * OnAwakeSDL from HMI returns SDL to normal operation
+ * after OnExitAllApplications(SUSPEND)
+ *
+ */
+ onAwakeSDLNotificationSend: function() {
+ FFW.BasicCommunication.OnAwakeSDL();
+ },
+
+ /**
* Method to sent notification with selected reason of OnSystemRequest
*
* @param {String}
@@ -458,6 +477,8 @@ SDL.SDLController = Em.Object
if (choiceID && SDL.TTSPopUp.active && FFW.TTS.requestId == null) {
SDL.TTSPopUp.DeactivateTTS();
}
+
+ SDL.SDLModel.interactionData.helpPrompt = null;
},
/**
* Method to sent notification for Alert
@@ -582,13 +603,28 @@ SDL.SDLController = Em.Object
*/
registerApplication: function(params, applicationType) {
- SDL.SDLModel.get('registeredApps').pushObject(this.applicationModels[applicationType].create( {
- appID: params.appID,
- appName: params.appName,
- deviceName: params.deviceName,
- appType: params.appType
- }));
-/*Uncomment to show useless add command buttons
+ if (applicationType === undefined || applicationType === null) {
+
+ SDL.SDLModel.get('registeredApps').pushObject(this.applicationModels[0].create( { //Magic number 0 - Default media model for not initialized applications
+ appID: params.appID,
+ appName: params.appName,
+ deviceName: params.deviceName,
+ isMedia: 0,
+ disabledToActivate: params.disabled ? true : false
+ }));
+ } else {
+
+ SDL.SDLModel.get('registeredApps').pushObject(this.applicationModels[applicationType].create( {
+ appID: params.appID,
+ appName: params.appName,
+ deviceName: params.deviceName,
+ appType: params.appType,
+ isMedia: applicationType == 0 ? true : false,
+ initialized: true,
+ disabledToActivate: params.disabled ? true : false
+ }));
+ }
+
var exitCommand = {
"id": -10,
"params": {
@@ -601,7 +637,7 @@ SDL.SDLController = Em.Object
}
};
- SDL.SDLController.getApplicationModel(params.appID).addCommand(exitCommand);
+ SDL.SDLController.getApplicationModel(params.appID).addCommand(exitCommand);
exitCommand = {
"id": -10,
@@ -616,7 +652,6 @@ SDL.SDLController = Em.Object
};
SDL.SDLController.getApplicationModel(params.appID).addCommand(exitCommand);
-*/
},
/**
* Unregister application
@@ -641,6 +676,10 @@ SDL.SDLController = Em.Object
if (SDL.SDLModel.stateLimited == appID) {
SDL.SDLModel.set('stateLimited', null);
}
+
+ if (SDL.VRHelpListView.active) {
+ this.showVRHelpItems();
+ }
},
/**
* SDL Driver Distraction ON/OFF switcher
@@ -735,6 +774,9 @@ SDL.SDLController = Em.Object
*/
onActivateSDLApp: function(element) {
+ if (SDL.SDLModel.VRActive) {
+ SDL.SDLModel.toggleProperty('VRActive');
+ }
FFW.BasicCommunication.ActivateApp(element.appID);
},
/**
@@ -834,6 +876,16 @@ SDL.SDLController = Em.Object
}
},
/**
+ * Method to send OnEmergencyEvent to SDL
+ *
+ * @param {String}
+ */
+ OnEmergencyEventNotificationSend: function(element) {
+
+ FFW.BasicCommunication.OnEmergencyEvent(element.enabled);
+ element.set('enabled', !element.enabled);
+ },
+ /**
* Method sent softButtons pressed and event status to RPC
*
* @param {String}
@@ -859,21 +911,23 @@ SDL.SDLController = Em.Object
if ((appID && SDL.SDLController.getApplicationModel(appID) != SDL.SDLAppController.model)
|| this.backgroundAlertAppID){
- if (SDL.SDLAppController.model
- && SDL.SDLAppController.model.appID != appID
- && this.backgroundAlertAppID == null) {
+ if (SDL.SDLAppController.model == null
+ || (SDL.SDLAppController.model.appID != appID
+ && this.backgroundAlertAppID == null)) {
this.backgroundAlertAppID = appID;
FFW.UI.OnSystemContext(sysContextValue, appID);
- FFW.UI.OnSystemContext('HMI_OBSCURED', SDL.SDLAppController.model.appID);
+ if (SDL.SDLAppController.model) {
+ FFW.UI.OnSystemContext('HMI_OBSCURED', SDL.SDLAppController.model.appID);
+ }
- } else if (SDL.SDLAppController.model
+ } else if (SDL.SDLAppController.model != null
&& SDL.SDLAppController.model.appID != appID
&& this.backgroundAlertAppID != null
&& SDL.SDLAppController.model.appID != this.backgroundAlertAppID) {
FFW.UI.OnSystemContext('MAIN', this.backgroundAlertAppID);
- FFW.UI.OnSystemContext(sysContextValue, SDL.SDLAppController.model.appID);
+ FFW.UI.OnSystemContext(sysContextValue, appID);
}
} else {
if (SDL.SDLAppController.model) {
diff --git a/src/components/HMI/app/controller/sdl/MediaController.js b/src/components/HMI/app/controller/sdl/MediaController.js
index e4e445ffc..b09d26b76 100644
--- a/src/components/HMI/app/controller/sdl/MediaController.js
+++ b/src/components/HMI/app/controller/sdl/MediaController.js
@@ -136,5 +136,7 @@ SDL.SDLMediaController = Em.Object.create( {
SDL.SDLModel.stopStream(appID);
SDL.SDLModel.get('registeredApps').removeObjects(SDL.SDLModel.get('registeredApps').filterProperty('appID', appID));
+ SDL.SDLModel.get('updatedAppsList').removeObjects(SDL.SDLModel.get('updatedAppsList').filterProperty('appID', appID));
+ SDL.InfoAppsView.showAppList();
}
}); \ No newline at end of file
diff --git a/src/components/HMI/app/controller/sdl/NonMediaController.js b/src/components/HMI/app/controller/sdl/NonMediaController.js
index a87221b67..fc4ff0371 100644
--- a/src/components/HMI/app/controller/sdl/NonMediaController.js
+++ b/src/components/HMI/app/controller/sdl/NonMediaController.js
@@ -108,5 +108,7 @@ SDL.NonMediaController = Em.Object.create( {
this.set('currentAppId', 0);
}
SDL.SDLModel.get('registeredApps').removeObjects(SDL.SDLModel.get('registeredApps').filterProperty('appID', appID));
+ SDL.SDLModel.get('updatedAppsList').removeObjects(SDL.SDLModel.get('updatedAppsList').filterProperty('appID', appID));
+ SDL.InfoAppsView.showAppList();
}
}); \ No newline at end of file
diff --git a/src/components/HMI/app/controller/sdl/RPCController.js b/src/components/HMI/app/controller/sdl/RPCController.js
index d7ab4b2d0..27dd2ec08 100644
--- a/src/components/HMI/app/controller/sdl/RPCController.js
+++ b/src/components/HMI/app/controller/sdl/RPCController.js
@@ -72,41 +72,21 @@ SDL.RPCController = Em.Object
capabilitiesCheck: function(key, value) {
if (key == "imageType" && value == "STATIC") {
- SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE';
+ SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value};
}
if (key == "type" && value == "PRE_RECORDED") {
- SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE';
+ SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value};
}
if (key == "type" && value == "SAPI_PHONEMES") {
- SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE';
+ SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value};
}
if (key == "type" && value == "LHPLUS_PHONEMES") {
- SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE';
+ SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value};
}
if (key == "type" && value == "SILENCE") {
- SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE';
+ SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value};
}
- },
-
- /**
- * Method to check supported image type in request
- *
- * @param {Object}
- * array
- */
- checkImagesArray: function(array) {
-
- var error = false;
- if (array instanceof Array) {
- for ( var i = 0; i < array.length; i++) {
- if (array[i].image &&
- ((array[i].image.imageType !== "DYNAMIC") &&
- (array[i].image.imageType !== "STATIC"))) {
-
- }
- }
- }
- return error;
+ return value;
},
/**
@@ -1093,17 +1073,6 @@ SDL.RPCController = Em.Object
return this.resultStruct;
}
- if ("softButtons" in params) {
- if (SDL.RPCController
- .checkImagesArray(params.softButtons)) {
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Unsupported image type!"
- };
-
- return this.resultStruct;
- }
- }
if ("turnIcon" in params
&& ((params.turnIcon.imageType !== "DYNAMIC") && (params.turnIcon.imageType !== "STATIC"))) {
this.resultStruct = {
@@ -1183,17 +1152,6 @@ SDL.RPCController = Em.Object
return this.resultStruct;
}
- if ("softButtons" in params) {
- if (SDL.RPCController
- .checkImagesArray(params.softButtons)) {
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Unsupported image type!"
- };
-
- return this.resultStruct;
- }
- }
if ("turnList" in params) {
for ( var i = 0; i < params.turnList.length; i++) {
@@ -1277,17 +1235,6 @@ SDL.RPCController = Em.Object
return this.resultStruct;
}
- if ("softButtons" in params) {
- if (SDL.RPCController
- .checkImagesArray(params.softButtons)) {
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Unsupported image type!"
- };
-
- return this.resultStruct;
- }
- }
if (params.alertStrings == null) {
this.resultStruct = {
@@ -1422,17 +1369,6 @@ SDL.RPCController = Em.Object
return this.resultStruct;
}
- if ("softButtons" in params) {
- if (SDL.RPCController
- .checkImagesArray(params.softButtons)) {
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Unsupported image type!"
- };
-
- return this.resultStruct;
- }
- }
if ("graphic" in params
&& ((params.graphic.imageType !== "DYNAMIC") && (params.graphic.imageType !== "STATIC"))) {
this.resultStruct = {
@@ -1934,16 +1870,6 @@ SDL.RPCController = Em.Object
return this.resultStruct;
}
- if ("vrHelp" in params) {
- if (SDL.RPCController.checkImagesArray(params.vrHelp)) {
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Unsupported image type!"
- };
-
- return this.resultStruct;
- }
- }
if (params.appID == null) {
this.resultStruct = {
@@ -2278,17 +2204,6 @@ SDL.RPCController = Em.Object
return this.resultStruct;
}
- if ("softButtons" in params) {
- if (SDL.RPCController
- .checkImagesArray(params.softButtons)) {
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Unsupported image type!"
- };
-
- return this.resultStruct;
- }
- }
if (params.messageText == null) {
this.resultStruct = {
@@ -2434,17 +2349,6 @@ SDL.RPCController = Em.Object
ShowVrHelp: function(params) {
if (params) {
- if ("vrHelp" in params) {
- if (SDL.RPCController
- .checkImagesArray(params.vrHelp)) {
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Unsupported image type!"
- };
-
- return this.resultStruct;
- }
- }
if ("appID" in params) {
if (typeof params.appID != 'number') {
diff --git a/src/components/HMI/app/model/media/CDModel.js b/src/components/HMI/app/model/media/CDModel.js
index 43836cb6d..9ded512c5 100644
--- a/src/components/HMI/app/model/media/CDModel.js
+++ b/src/components/HMI/app/model/media/CDModel.js
@@ -40,4 +40,4 @@ SDL.CDModel = Em.Object.create( {
this.set('active', true);
}
-});
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/model/sdl/AppModel.js b/src/components/HMI/app/model/sdl/AppModel.js
index 6f93e2d66..682eee592 100644
--- a/src/components/HMI/app/model/sdl/AppModel.js
+++ b/src/components/HMI/app/model/sdl/AppModel.js
@@ -62,6 +62,37 @@ SDL.SDLAppModel = Em.Object.extend({
appName: '',
/**
+ * Flag to define if application was initialized (registered) correctly
+ * Has correct application type
+ *
+ * @type {Boolean}
+ */
+ initialized: false,
+
+ /**
+ * Media application flag
+ * If application was successfully initialized this flag it set into correct value
+ *
+ * @type {Boolean}
+ */
+ isMedia: null,
+
+ /**
+ * Flag to determine if app in application list can not be activated from HMI
+ *
+ * @type {Boolean}
+ */
+ disabledToActivate: false,
+
+ /**
+ * Application type
+ * If application was successfully initialized this parameter it set into correct value
+ *
+ * @type {String}
+ */
+ appType: "",
+
+ /**
* Navigation streaming url
*/
navigationStream: null,
diff --git a/src/components/HMI/app/model/sdl/MediaModel.js b/src/components/HMI/app/model/sdl/MediaModel.js
index fa8d8e2a8..0feceb211 100644
--- a/src/components/HMI/app/model/sdl/MediaModel.js
+++ b/src/components/HMI/app/model/sdl/MediaModel.js
@@ -333,13 +333,15 @@ SDL.SDLMediaModel = SDL.SDLAppModel.extend({
}
} else {
- //this.appInfo.set('alignment', "text-align:center");
+ this.appInfo.set('alignment', "text-align:center");
}
- if (params.graphic && params.graphic.value != '') {
- this.appInfo.set('trackIcon', params.graphic.value);
- } else {
- this.appInfo.set('trackIcon', 'images/sdl/audio_icon.jpg');
+ if (params.graphic != null) {
+ if (params.graphic.value != "") {
+ this.appInfo.set('trackIcon', params.graphic.value);
+ } else {
+ this.appInfo.set('trackIcon', 'images/sdl/audio_icon.jpg');
+ }
}
if ("softButtons" in params) {
diff --git a/src/components/HMI/app/model/sdl/Model.js b/src/components/HMI/app/model/sdl/Model.js
index a902e649e..0dfcf0394 100644
--- a/src/components/HMI/app/model/sdl/Model.js
+++ b/src/components/HMI/app/model/sdl/Model.js
@@ -448,6 +448,13 @@ SDL.SDLModel = Em.Object.create({
unRegisteredApps: [],
/**
+ * List of applications to show on appList view came in BC.UpdateAppList
+ *
+ * @type object
+ */
+ updatedAppsList: [],
+
+ /**
* List of objects with params for connected devices
*
* @type object
@@ -593,7 +600,7 @@ SDL.SDLModel = Em.Object.create({
messageCodes.push("AppPermissionsRevoked");
- FFW.BasicCommunication.GetUserFriendlyMessage(function(message){SDL.SettingsController.simpleParseUserFriendlyMessageData(message)}, appID, messageCodes);
+ FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, appID, messageCodes);
},
@@ -826,10 +833,33 @@ SDL.SDLModel = Em.Object.create({
*
* @param {Object}
*/
- startStream: function(params) {
+ startStream: function(request) {
+
+ var text = "Would you like to start Video stream?";
+
+ SDL.PopUp.create().appendTo('body').popupActivate(text, function(result){
+ if (result) {
+
+ SDL.SDLController.getApplicationModel(request.params.appID).set('navigationStream', request.params.url);
+ SDL.SDLModel.playVideo(request.params.appID);
+
+ FFW.Navigation.sendNavigationResult(
+ SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method
+ );
+
+ } else if (result === false) {
+
+ FFW.Navigation.sendError(
+ SDL.SDLModel.resultCode["REJECTED"],
+ request.id,
+ request.method,
+ "Ignored by USER!"
+ );
+ }
+ });
- SDL.SDLController.getApplicationModel(params.appID).set('navigationStream', params.url);
- SDL.SDLModel.playVideo(params.appID);
},
/**
@@ -866,8 +896,30 @@ SDL.SDLModel = Em.Object.create({
*/
startAudioStream: function(params) {
- SDL.SDLController.getApplicationModel(params.appID).set('navigationAudioStream', params.url);
- SDL.StreamAudio.play(params.url);
+ var text = "Would you like to start Audio stream?";
+
+ SDL.PopUp.create().appendTo('body').popupActivate(text, function(result){
+ if (result) {
+
+ SDL.SDLController.getApplicationModel(params.appID).set('navigationAudioStream', params.url);
+ SDL.StreamAudio.play(params.url);
+
+ FFW.Navigation.sendNavigationResult(
+ SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method
+ );
+
+ } else if (result === false) {
+
+ FFW.Navigation.sendError(
+ SDL.SDLModel.resultCode["REJECTED"],
+ request.id,
+ request.method,
+ "Ignored by USER!"
+ );
+ }
+ });
},
/**
@@ -947,11 +999,17 @@ SDL.SDLModel = Em.Object.create({
*
* @type {String} lang
*/
- changeRegistrationUI: function (lang, appID) {
+ changeRegistrationUI: function (lang, appID, appName) {
if (SDL.SDLController.getApplicationModel(appID)) {
SDL.SDLController.getApplicationModel(appID).set('UILanguage', lang);
}
+
+ if (appName) {
+ SDL.SDLMediaController.currentAppId = 0;
+ SDL.SDLController.getApplicationModel(appID).appName = appName;
+ SDL.SDLMediaController.set('currentAppId', appID);
+ }
},
/**
@@ -975,31 +1033,55 @@ SDL.SDLModel = Em.Object.create({
*/
onAppRegistered: function (params) {
- var applicationType = 1;
+ var applicationType = null,//Default value - NonMediaModel see SDL.SDLController.applicationModels
+ app = SDL.SDLController.getApplicationModel(params.appID);
+
+ if (app != undefined && app.initialized == false) {
- if (SDL.SDLController.getApplicationModel(params.application.appID)) {
+ if (app.isMedia != params.isMediaApplication) { // If current not initialized model doe not matches the registered application type
+ this.convertModel(params); // then model should be changed
+ } else {
+ app.disabledToActivate = params.disabled;
+ }
return;
+ } else if (app != undefined && app.initialized == true) {
+ console.error("Application with appID " + params.appID + " already registered!");
+ return; // if application already registered and correctly initialized and BC.UpdateAppList came from SDL than nothing shoul happend
}
if (params.vrSynonyms) {
- var message = {"cmdID": 0, "vrCommands": params.vrSynonyms, "appID": params.application.appID, "type": "Application"};
+ var message = {"cmdID": 0, "vrCommands": params.vrSynonyms, "appID": params.appID, "type": "Application"};
this.addCommandVR(message);
}
- if (params.application.isMediaApplication) {
+ if (params.isMediaApplication === true) {
+
applicationType = 0;
+ } else if (params.isMediaApplication === false) {
+
+ applicationType = 1;
}
- SDL.SDLController.registerApplication(params.application, applicationType);
+ SDL.SDLController.registerApplication(params, applicationType);
- if (SDL.SDLModel.unRegisteredApps.indexOf(params.application.appID) >= 0) {
- setTimeout(function(){ SDL.PopUp.create().appendTo('body').popupActivate("Connection with " + params.application.appName + " is re-established.")}, 1000);
- this.unRegisteredApps.pop(params.application.appID);
+ if (SDL.SDLModel.unRegisteredApps.indexOf(params.appID) >= 0) {
+ setTimeout(function(){ SDL.PopUp.create().appendTo('body').popupActivate("Connection with " + params.appName + " is re-established.")}, 1000);
+ this.unRegisteredApps.pop(params.appID);
}
},
/**
+ * Method to convert existed model to registered type
+ */
+ convertModel: function(params) {
+
+ SDL.SDLModel.get('registeredApps').removeObjects(SDL.SDLModel.get('registeredApps').filterProperty('appID', params.appID));
+
+ this.onAppRegistered(params);
+ },
+
+ /**
* Method to delete activation button from VR commands and delete device
* parameters from model
*
@@ -1224,7 +1306,6 @@ SDL.SDLModel = Em.Object.create({
setTimeout(function(){
if (SDL.SDLModel.vrActiveRequests.vrPerformInteraction) {
SDL.SDLModel.onPrompt(message.params.timeoutPrompt);
- SDL.SDLModel.interactionData.helpPrompt = null;
}
}, message.params.timeout - 2000); //Magic numer is a platform depended HMI behavior: -2 seconds for timeout prompt
diff --git a/src/components/HMI/app/model/sdl/NonMediaModel.js b/src/components/HMI/app/model/sdl/NonMediaModel.js
index d9a14b32f..42ac14bc0 100644
--- a/src/components/HMI/app/model/sdl/NonMediaModel.js
+++ b/src/components/HMI/app/model/sdl/NonMediaModel.js
@@ -198,10 +198,12 @@ SDL.SDLNonMediaModel = SDL.SDLAppModel.extend({
this.appInfo.set('alignment', "text-align:center");
}
- if (params.graphic) {
- this.appInfo.set('mainImage', params.graphic.value);
- } else {
- this.appInfo.set('mainImage', 'images/sdl/audio_icon.jpg');
+ if (params.graphic != null) {
+ if (params.graphic.value != "") {
+ this.appInfo.set('mainImage', params.graphic.value);
+ } else {
+ this.appInfo.set('mainImage', 'images/sdl/audio_icon.jpg');
+ }
}
// Magic number is a count of Preset Buttons on HMI = 8
diff --git a/src/components/HMI/app/model/sdl/VehicleInfoModel.js b/src/components/HMI/app/model/sdl/VehicleInfoModel.js
index f2b896190..f9fe33d97 100644
--- a/src/components/HMI/app/model/sdl/VehicleInfoModel.js
+++ b/src/components/HMI/app/model/sdl/VehicleInfoModel.js
@@ -132,10 +132,10 @@ SDL.SDLVehicleInfoModel = Em.Object
'width': 800,
'height': 480
},
- 'speed': 80.0,
- 'fuelLevel': 0.2,
+ 'speed': 80.08E0,
+ 'fuelLevel': 0.2E0,
'fuelLevel_State': "UNKNOWN",
- 'instantFuelConsumption': 2.2,
+ 'instantFuelConsumption': 2.2E0,
'tirePressure': {
'pressureTelltale': 'OFF',
'leftFront': {
@@ -203,9 +203,9 @@ SDL.SDLVehicleInfoModel = Em.Object
"highBeamsOn": false,
"ambientLightSensorStatus": "NIGHT"
},
- 'engineTorque': 2.5,
- 'accPedalPosition': 10.5,
- 'steeringWheelAngle': 1.2,
+ 'engineTorque': 2.5E0,
+ 'accPedalPosition': 10.5E0,
+ 'steeringWheelAngle': 1.2E0,
'myKey': {
"e911Override": "NO_DATA_EXISTS"
},
@@ -222,8 +222,8 @@ SDL.SDLVehicleInfoModel = Em.Object
'satRadioESN': "165165650",
'rainSensor': 165165650,
'gps': {
- 'longitudeDegrees': 42,
- 'latitudeDegrees': -83,
+ 'longitudeDegrees': 42.5E0,
+ 'latitudeDegrees': -83.3E0,
'utcYear': 2013,
'utcMonth': 2,
'utcDay': 14,
@@ -231,15 +231,15 @@ SDL.SDLVehicleInfoModel = Em.Object
'utcMinutes': 16,
'utcSeconds': 54,
'compassDirection': 'SOUTHWEST',
- 'pdop': 8,
- 'hdop': 5,
- 'vdop': 3,
+ 'pdop': 8.4E0,
+ 'hdop': 5.9E0,
+ 'vdop': 3.2E0,
'actual': false,
'satellites': 8,
'dimension': '2D',
- 'altitude': 7,
- 'heading': 173,
- 'speed': 2
+ 'altitude': 7.7E0,
+ 'heading': 173.99E0,
+ 'speed': 2.78E0
},
'eCallInfo': {
'eCallNotificationStatus': 'NORMAL',
diff --git a/src/components/HMI/app/view/WarningView.js b/src/components/HMI/app/view/WarningView.js
index 1db0b6f6c..8fa40b454 100644
--- a/src/components/HMI/app/view/WarningView.js
+++ b/src/components/HMI/app/view/WarningView.js
@@ -88,7 +88,11 @@ SDL.warningView = Em.ContainerView
appLoaded: function() {
var self = this;
- self.set('isReady', true);
+ /** Show OK Button after 2 second delay */
+ setTimeout(function() {
+
+ self.set('isReady', true);
+ }, 2000);
var components = Em.ContainerView.create({
@@ -317,8 +321,15 @@ SDL.warningView = Em.ContainerView
var self = this;
- self._parentView.set('hide', true);
+ this._parentView.set('fade', this
+ .checkForCCS3AnimationSupport());
+
+ setTimeout(function() {
+
+ self._parentView.set('hide', true);
+ }, 1000);
+
SDL.RPCController.ConnectToSDL();
}
})
- });
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/home/controlButtons.js b/src/components/HMI/app/view/home/controlButtons.js
index cb3ff44ed..3b32d4736 100644
--- a/src/components/HMI/app/view/home/controlButtons.js
+++ b/src/components/HMI/app/view/home/controlButtons.js
@@ -52,7 +52,8 @@ SDL.ControlButtons = Em.ContainerView
'appUILanguagesLabel',
'appTTSVRLanguagesLabel',
'appUILang',
- 'appTTSVRLang'
+ 'appTTSVRLang',
+ 'phoneCall'
],
/**
@@ -575,4 +576,4 @@ SDL.ControlButtons = Em.ContainerView
templateName: 'text'
})
})
- });
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/home/statusMediaView.js b/src/components/HMI/app/view/home/statusMediaView.js
index 4996b4ce1..bc94c9e22 100644
--- a/src/components/HMI/app/view/home/statusMediaView.js
+++ b/src/components/HMI/app/view/home/statusMediaView.js
@@ -96,4 +96,4 @@ SDL.StatusMediaView = Em.ContainerView
SDL.States.goToStates(SDL.MediaController.activeState);
}
}
- });
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/info/appsView.js b/src/components/HMI/app/view/info/appsView.js
index c1d123c0b..81d1ce510 100644
--- a/src/components/HMI/app/view/info/appsView.js
+++ b/src/components/HMI/app/view/info/appsView.js
@@ -58,23 +58,30 @@ SDL.InfoAppsView = Em.ContainerView
this.listOfApplications.list.refresh();
- var i, apps = SDL.SDLModel.registeredApps, appIndex;
+ var i, apps = SDL.SDLModel.updatedAppsList, btn, appIndex;
for (i = 0; i < apps.length; i++) {
- appIndex = SDL.SDLModel.registeredApps.indexOf(apps[i]);
-
- this.get('listOfApplications.list.childViews')
- .pushObject(SDL.Button.create( {
- action: 'onActivateSDLApp',
- target: 'SDL.SDLController',
- text: apps[i].appName + " - " + apps[i].deviceName,
- appName: apps[i].appName,
- appID: apps[i].appID,
- classNames: 'list-item button',
- iconBinding: 'SDL.SDLModel.registeredApps.' + appIndex
- + '.appIcon'
- }));
+ btn = {
+ action: 'onActivateSDLApp',
+ target: 'SDL.SDLController',
+ text: apps[i].appName + " - " + apps[i].deviceName,
+ appName: apps[i].appName,
+ appID: apps[i].appID,
+ classNames: 'list-item button',
+ disabled: apps[i].greyOut
+ };
+
+ if (SDL.SDLController.getApplicationModel(apps[i].appID)) {
+ var index = SDL.SDLModel.registeredApps.indexOf(
+ SDL.SDLController.getApplicationModel(apps[i].appID)
+ );
+ btn.iconBinding = 'SDL.SDLModel.registeredApps.' + index + '.appIcon';
+ } else {
+ btn.icon = apps[i].icon ? apps[i].icon : SDL.SDLModel.defaultListOfIcons.app;
+ }
+
+ this.get('listOfApplications.list.childViews').pushObject(SDL.Button.create(btn));
}
},
@@ -145,4 +152,4 @@ SDL.InfoAppsView = Em.ContainerView
/** Items */
items: new Array()
})
- }); \ No newline at end of file
+ });
diff --git a/src/components/HMI/app/view/infoView.js b/src/components/HMI/app/view/infoView.js
index 8740bf455..397553d9f 100644
--- a/src/components/HMI/app/view/infoView.js
+++ b/src/components/HMI/app/view/infoView.js
@@ -47,9 +47,13 @@ SDL.InfoView = Em.ContainerView.create( {
/** Settings components */
childViews:
[
+ 'leftMenu',
+ SDL.InfoServicesView,
+ SDL.InfoTravelLinkView,
+ SDL.InfoCalendarView,
SDL.InfoAppsView,
- SDL.DeviceListView,
- SDL.InfoNonMedia
+ SDL.InfoNonMedia,
+ SDL.DeviceListView
],
/** Left menu */
@@ -78,8 +82,12 @@ SDL.InfoView = Em.ContainerView.create( {
childViews:
[
+ 'servicesButton',
+ 'travelLinkButton',
+ 'calendarButton',
'appsButton',
- 'sdlButton'
+ 'sdlButton',
+ 'goToCD'
],
servicesButton: SDL.Button.extend( {
@@ -179,4 +187,4 @@ SDL.InfoView = Em.ContainerView.create( {
} )
} )
} )
-} );
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/media/common/LeftMenuView.js b/src/components/HMI/app/view/media/common/LeftMenuView.js
index ce44d8a85..ba4495681 100644
--- a/src/components/HMI/app/view/media/common/LeftMenuView.js
+++ b/src/components/HMI/app/view/media/common/LeftMenuView.js
@@ -40,6 +40,7 @@ SDL.LeftMenuView = Em.ContainerView.extend( {
childViews:
[
'border',
+ 'cdButton',
'sdlButton'
],
/** Border decoration */
diff --git a/src/components/HMI/app/view/media/sdl/controllsView.js b/src/components/HMI/app/view/media/sdl/controllsView.js
index b7b8f59d7..8e73f0ba0 100644
--- a/src/components/HMI/app/view/media/sdl/controllsView.js
+++ b/src/components/HMI/app/view/media/sdl/controllsView.js
@@ -38,7 +38,7 @@ SDL.SDLMediaControlls = Em.ContainerView.create( {
[
'info',
'Controls',
- 'tuneButtons' // Uncomment to see preset buttons on sdl screen
+ 'tuneButtons'
],
/**
@@ -235,4 +235,4 @@ SDL.SDLMediaControlls = Em.ContainerView.create( {
} )
} )
} )
-} );
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/media/sdlmediaView.js b/src/components/HMI/app/view/media/sdlmediaView.js
index a880de8a3..78371e7ea 100644
--- a/src/components/HMI/app/view/media/sdlmediaView.js
+++ b/src/components/HMI/app/view/media/sdlmediaView.js
@@ -98,7 +98,7 @@ SDL.sdlView = Em.ContainerView
],
optionsButton: SDL.Button.extend( {
- text: 'Menu',
+ text: 'Options',
templateName: 'arrow',
@@ -107,4 +107,4 @@ SDL.sdlView = Em.ContainerView
})
})
})
- });
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/mediaView.js b/src/components/HMI/app/view/mediaView.js
index c647f999f..647b59306 100644
--- a/src/components/HMI/app/view/mediaView.js
+++ b/src/components/HMI/app/view/mediaView.js
@@ -46,4 +46,4 @@ SDL.MediaView = Em.ContainerView.create( {
],
/** Left Menu view component */
leftMenu: SDL.LeftMenuView
-} );
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/AlertPopUp.js b/src/components/HMI/app/view/sdl/AlertPopUp.js
index 20ba5c4fb..0589da364 100644
--- a/src/components/HMI/app/view/sdl/AlertPopUp.js
+++ b/src/components/HMI/app/view/sdl/AlertPopUp.js
@@ -140,7 +140,7 @@ SDL.AlertPopUp = Em.ContainerView.create({
this.set('content2', '');
this.set('content3', '');
- if (reason == 'timeout' && this.softbuttons.buttons._childViews.length > 0) {
+ if (reason == 'timeout' && this.softbuttons.buttons._childViews.length > 0 && reason === 'ABORTED') {
SDL.SDLController.alertResponse(SDL.SDLModel.resultCode['ABORTED'], this.alertRequestId);
} else {
SDL.SDLController.alertResponse(SDL.SDLModel.resultCode['SUCCESS'], this.alertRequestId);
diff --git a/src/components/HMI/app/view/sdl/ExitAppView.js b/src/components/HMI/app/view/sdl/ExitAppView.js
index 4f423f06a..81e9c7ad5 100644
--- a/src/components/HMI/app/view/sdl/ExitAppView.js
+++ b/src/components/HMI/app/view/sdl/ExitAppView.js
@@ -47,7 +47,9 @@ SDL.ExitApp = Em.ContainerView.create( {
[
'exitAppViewLabel',
'exitAppViewTitle',
- 'exitAppViewSelect'
+ 'exitAppViewSelect',
+ 'onAwakeSDLLabel',
+ 'onAwakeSDLButton'
],
/**
@@ -104,6 +106,24 @@ SDL.ExitApp = Em.ContainerView.create( {
}
} ),
+ onAwakeSDLLabel: SDL.Label.extend( {
+
+ elementId: 'onAwakeSDLLabel',
+
+ classNames: 'onAwakeSDLLabel',
+
+ content: 'onAwakeSDL notification send'
+ } ),
+
+ onAwakeSDLButton: SDL.Button.extend( {
+ classNames: 'button onAwakeSDLButton',
+ text: 'Send onAwakeSDL',
+ action: 'onAwakeSDLNotificationSend',
+ target: 'SDL.SDLController',
+ buttonAction: true,
+ onDown: false
+ }),
+
/**
* Trigger function that activates and deactivates tbtClientStateView
*/
diff --git a/src/components/HMI/app/view/sdl/PopUp.js b/src/components/HMI/app/view/sdl/PopUp.js
index b4b429df2..6da36feb4 100644
--- a/src/components/HMI/app/view/sdl/PopUp.js
+++ b/src/components/HMI/app/view/sdl/PopUp.js
@@ -114,16 +114,31 @@ SDL.PopUp = Em.ContainerView.extend({
}
this.set('callback', null);
+ this.set('content', '');
this.remove();
},
- popupActivate: function(message, callback) {
+ /**
+ * HMI modal window popUp Activation method
+ * @param textBody - main text to be displayes on PopUp
+ * @param callback - Callback function handled result parameter made by user action, if null - popUp will be closed by timer
+ * @param indicator - popUp will not be closed by timer and
+ * should be deactivated manually by developer in code using method's returned parameter this.
+ * callback shuld be null if indicator is true
+ * @param label
+ * @param line1
+ * @param line2
+ * @returns {SDL.PopUp} - returns current instance of PopUp
+ */
+ popupActivate: function(textBody, callback, indicator, label, line1, line2) {
this.set('active', true);
clearTimeout(this.timer);
this.timer = null;
- if (callback) {
+ if (indicator) {
+ this.set('buttons', true);
+ } else if (callback) {
this.set('callback', callback);
this.set('buttons', false);
} else {
@@ -135,8 +150,11 @@ SDL.PopUp = Em.ContainerView.extend({
5000);
}
- this.set('content', message);
+ this.set('content', textBody);
+ this.set('label', label);
+ this.set('line1', line1);
+ this.set('line2', line2);
- return ++this.popUpId;
+ return this;
}
}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/TTSPopUp.js b/src/components/HMI/app/view/sdl/TTSPopUp.js
index 4fc0c7669..ae45786f5 100644
--- a/src/components/HMI/app/view/sdl/TTSPopUp.js
+++ b/src/components/HMI/app/view/sdl/TTSPopUp.js
@@ -45,7 +45,9 @@ SDL.TTSPopUp = Em.ContainerView.create( {
'popUp',
'message',
'okButton',
- 'timerText'
+ 'timerText',
+ 'checkBoxLabel',
+ 'checkBox'
],
requestId: null,
@@ -86,6 +88,25 @@ SDL.TTSPopUp = Em.ContainerView.create( {
disabledBinding: 'parentView.buttons'
}),
+ checkBoxLabel: SDL.Label.extend({
+
+ elementId: 'checkBoxLabel',
+
+ classNames: 'checkBoxLabel',
+
+ content: 'Send response'
+ }),
+
+ checkBox: Em.Checkbox.extend( {
+
+ elementId: 'checkBoxTTS',
+
+ classNames: 'checkBoxTTS',
+
+ checked: true
+
+ }),
+
timerText: SDL.Label.extend({
elementId: 'timerText',
@@ -95,10 +116,11 @@ SDL.TTSPopUp = Em.ContainerView.create( {
contentBinding: 'parentView.timerSeconds'
}),
+
+
resetTimeout: function () {
this.set('timerSeconds', 10);
FFW.TTS.OnResetTimeout(this.appID, "TTS.Speak");
- this.appID = null;
},
ActivateTTS: function(msg, appID) {
@@ -126,9 +148,14 @@ SDL.TTSPopUp = Em.ContainerView.create( {
DeactivateTTS: function() {
clearInterval(this.timer);
this.set('active', false);
- this.set('timerSeconds', 10);
- SDL.SDLController.TTSResponseHandler();
- FFW.TTS.Stopped();
+ this.appID = null;
+ this.set('timerSeconds', 5);
+ this.checkBox.set('checked', true);
+
+ if (this.checkBox.checked) {
+ SDL.SDLController.TTSResponseHandler();
+ FFW.TTS.Stopped();
+ }
},
/**
diff --git a/src/components/HMI/app/view/sdl/VehicleInfoView.js b/src/components/HMI/app/view/sdl/VehicleInfoView.js
index a42efac4d..915d416d7 100644
--- a/src/components/HMI/app/view/sdl/VehicleInfoView.js
+++ b/src/components/HMI/app/view/sdl/VehicleInfoView.js
@@ -54,7 +54,8 @@ SDL.VehicleInfo = Em.ContainerView.create( {
'ecu1Data',
'ecu2Data',
'odometrTitle',
- 'odometrInput'
+ 'odometrInput',
+ 'onAwakeSDLButton'
],
/**
@@ -187,6 +188,21 @@ SDL.VehicleInfo = Em.ContainerView.create( {
} ),
/**
+ * Button to send OnEmergencyEvent to SDL
+ */
+ onAwakeSDLButton: SDL.Button.extend( {
+ classNames: 'button onEmergencyEvent',
+ textBinding: 'this.displayText',
+ action: 'OnEmergencyEventNotificationSend',
+ target: 'SDL.SDLController',
+ enabled: false,
+ onDown: false,
+ displayText: function () {
+ return this.enabled ? 'Send OnEmergencyEvent On' : 'Send OnEmergencyEvent Off';
+ }.property('this.enabled')
+ }),
+
+ /**
* Trigger function that activates and deactivates VehicleInfo PopUp
*/
toggleActivity: function() {
diff --git a/src/components/HMI/app/view/sdl/shared/interactionChoicesView.js b/src/components/HMI/app/view/sdl/shared/interactionChoicesView.js
index d01165dd1..288031ab1 100644
--- a/src/components/HMI/app/view/sdl/shared/interactionChoicesView.js
+++ b/src/components/HMI/app/view/sdl/shared/interactionChoicesView.js
@@ -86,8 +86,10 @@ SDL.InteractionChoicesView = SDL.SDLAbstractView.create({
],
click: function() {
- SDL.InteractionChoicesView.timerUpdate();
- SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction");
+ if (this._parentView.active) {
+ SDL.InteractionChoicesView.timerUpdate();
+ SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction");
+ }
},
naviChoises: Em.ContainerView.extend({
@@ -119,8 +121,10 @@ SDL.InteractionChoicesView = SDL.SDLAbstractView.create({
itemsOnPage: 5,
items: [],
click: function() {
- SDL.InteractionChoicesView.timerUpdate();
- SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction");
+ if (this._parentView.active) {
+ SDL.InteractionChoicesView.timerUpdate();
+ SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction");
+ }
}
}),
@@ -143,7 +147,7 @@ SDL.InteractionChoicesView = SDL.SDLAbstractView.create({
* Method updates popup timer when data changes through keyboard
*/
timerUpdate: function (){
- if (this.timeout && this.input.value !== null) {
+ if (this.timeout) {
clearTimeout(this.timer);
var self = this;
this.timer = setTimeout(function () {
diff --git a/src/components/HMI/app/view/sdl/shared/turnByTurnView.js b/src/components/HMI/app/view/sdl/shared/turnByTurnView.js
index 21d51ca6b..1cb7ddfad 100644
--- a/src/components/HMI/app/view/sdl/shared/turnByTurnView.js
+++ b/src/components/HMI/app/view/sdl/shared/turnByTurnView.js
@@ -79,29 +79,29 @@ SDL.TurnByTurnView = SDL.SDLAbstractView.create( {
for ( var i = 0; i < naviParams.navigationTexts.length; i++) {
switch (naviParams.navigationTexts[i].fieldName) {
- case 'navigationText1': {
- this.set('captionText.content',
- naviParams.navigationTexts[i].fieldText);
- break;
- }
- case 'navigationText2': {
- this.set('navigationText2',
- naviParams.navigationTexts[i].fieldText);
- break;
- }
- case 'ETA': {
- this.set('eta', naviParams.navigationTexts[i].fieldText);
- break;
- }
- case 'totalDistance': {
- this.set('totalDistance',
- naviParams.navigationTexts[i].fieldText);
- break;
- }
+ case 'navigationText1': {
+ this.set('captionText.content',
+ naviParams.navigationTexts[i].fieldText);
+ break;
+ }
+ case 'navigationText2': {
+ this.set('navigationText2',
+ naviParams.navigationTexts[i].fieldText);
+ break;
+ }
+ case 'ETA': {
+ this.set('eta', naviParams.navigationTexts[i].fieldText);
+ break;
+ }
+ case 'totalDistance': {
+ this.set('totalDistance',
+ naviParams.navigationTexts[i].fieldText);
+ break;
+ }
}
}
- this.softButtons.addItems(naviParams.softButtons);
+ this.softButtons.addItems(naviParams.softButtons, appID);
if (naviParams.maneuverComplete) {
this.set('maneuverComplete', naviParams.maneuverComplete);
diff --git a/src/components/HMI/css/buttonControls.css b/src/components/HMI/css/buttonControls.css
index b9d314646..39ef85285 100644
--- a/src/components/HMI/css/buttonControls.css
+++ b/src/components/HMI/css/buttonControls.css
@@ -281,7 +281,9 @@
#buttonControls .ContainerControlls {
left: 34px;
- background: black no-repeat;
+ background:
+ url(../images/home/controlButtons/backGroundControllButtons.png)
+ no-repeat;
width: 200px;
height: 200px;
}
@@ -404,8 +406,8 @@
-webkit-transition: 0.2s;
border-radius: 8px;
background-color: #1D1D1D;
-/* border: 1px solid #383737;
- box-shadow: inset 5px 5px 10px #383737, inset -3px -3px 10px black;*/
+ border: 1px solid #383737;
+ box-shadow: inset 5px 5px 10px #383737, inset -3px -3px 10px black;
-webkit-transition: 0.2s;
font-size: 38px;
line-height: 42px;
@@ -541,4 +543,4 @@
#app_controlButtons .phone_call_button.expand{
left: 156px;
-}
+} \ No newline at end of file
diff --git a/src/components/HMI/css/general.css b/src/components/HMI/css/general.css
index f09c98c0d..1eab49e6e 100644
--- a/src/components/HMI/css/general.css
+++ b/src/components/HMI/css/general.css
@@ -16,7 +16,7 @@ html, body {
body {
/*FONT FAMILY*/
- font-family: helvetica-neue;
+ font-family: sans-serif;
/*Defaul font size*/
font-size: 16px;
background-color: #000;
@@ -43,7 +43,7 @@ div {
.ffw-button {
cursor: pointer;
- background: black;
+ background: url(../images/common/button.png) repeat-x;
}
.ffw-button.pressed {
@@ -131,7 +131,7 @@ div {
height: 100px;
z-index: 1;
border-radius: 10 PX;
- top: 330px;
+ top: 8px;
-webkit-transition: opacity 1s ease-in-out;
display: none;
}
@@ -162,6 +162,24 @@ div {
font-size: 30px;
}
+#TTSPopUp .checkBoxLabel {
+ color: white;
+ top: 106px;
+ width: 72px;
+ height: 35px;
+ left: 25px;
+ background-color: rgb(90, 90, 90);
+ border-radius: 3px;
+ border: 1px solid rgb(255,255,255);
+ padding: 2px;
+}
+
+#TTSPopUp .checkBoxTTS {
+ top: 118px;
+ position: absolute;
+ left: 8px;
+}
+
#TTSPopUp .okButton {
right: 52px;
width: 113px;
@@ -174,6 +192,7 @@ div {
#TTSPopUp.active {
opacity: 1;
display: block;
+ z-index: 10000;
}
/* Diver Distraction PopUp */
@@ -577,6 +596,7 @@ div {
#media {
width: 800px;
height: 480px;
+ background: url(../images/media/bg.png) no-repeat;
}
/****************************** FOR MEDIA VIEW************************************************/
@@ -792,7 +812,7 @@ margin-top: 90px;
/* List item background */
.list-item.notpressed {
- background: rgb(29, 6, 6);
+ background-image: url(../images/list/list_item_bg.png);
}
.list-item .highLighted {
@@ -882,12 +902,12 @@ margin-top: 90px;
/* List item button background */
.list-item.pressed {
- background: DarkGray;
+ background-image: url(../images/list/list_item_pressed.png);
}
/** Background for pressed button */
.button.pressed {
- background: DarkGray;
+ background-image: url(../images/list/list_item_pressed.png);
}
/* Hide function */
@@ -984,7 +1004,7 @@ margin-top: 90px;
}
.button {
- background: rgb(29, 6, 6);
+ background-image: url(../images/list/list_item_bg.png);
cursor: pointer;
}
@@ -1089,7 +1109,7 @@ margin-top: 90px;
width: 800px;
height: 480px;
z-index: 12001;
- background: black;
+ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(218, 218, 218)), color-stop(0.3, rgb(0, 0, 0)));
}
#warning_view.fr .text {
@@ -1111,6 +1131,7 @@ margin-top: 90px;
font-size: 42px;
font-weight: bold;
top: 20px;
+ text-shadow: 1px 1px 3px white;
color: #CC2A2A;
}
@@ -1136,7 +1157,6 @@ margin-top: 90px;
}
#warning_view .components{
- display: none;
margin-top: 20px;
width: 420px;
}
@@ -1288,7 +1308,7 @@ to {
#wo_popup_denypopup_ok_button {
width: 238px;
height: 48px;
- background: gray;
+ background: url(../images/common/bt_bg.png) repeat-x;
cursor: pointer;
position: relative;
float: left;
@@ -1328,7 +1348,7 @@ to {
}
#wo_popup_yes_button.pressed, #wo_popup_no_button.pressed, #wo_popup_denypopup_ok_button.pressed {
- background: gray !important;
+ background: url(../images/common/bt_bg_pressed.png) repeat-x !important;
}
/* END Welcome Orientation View*/
diff --git a/src/components/HMI/css/info.css b/src/components/HMI/css/info.css
index e212142cd..34776e6cb 100644
--- a/src/components/HMI/css/info.css
+++ b/src/components/HMI/css/info.css
@@ -6,7 +6,7 @@
width: 324px;
height: 48px;
cursor: pointer;
- background: gray;
+ background: url(../images/common/nav-status-bg.png) no-repeat;
z-index: 1;
}
@@ -668,4 +668,4 @@
border-radius: 2px;
top: 269px;
left: 303px;
-}
+} \ No newline at end of file
diff --git a/src/components/HMI/css/media.css b/src/components/HMI/css/media.css
index e8d980479..85688d5e6 100644
--- a/src/components/HMI/css/media.css
+++ b/src/components/HMI/css/media.css
@@ -1,7 +1,7 @@
#media_leftmenu {
z-index: 301;
position: absolute;
- top: 0px;
+ top: 90px;
left: 0px;
width: 150px;
height: 300px;
@@ -55,7 +55,7 @@
left: 0px;
width: 153px;
height: 306px;
- background: black no-repeat;
+ background: url(../images/common/ls_border.png) no-repeat;
}
.media-ls-items {
@@ -73,7 +73,7 @@
}
.media-ls-item.active_state {
- background: black no-repeat !important;
+ background: url(../images/media/ls-item_bg_act.png) no-repeat !important;
}
.media-ls-item>.bg {
@@ -124,19 +124,19 @@
.main-preset-buttons-wraper {
position: relative;
- width: 800px;
+ width: 468px;
height: 100px;
float: left;
-/* left: 165px;*/
- top: 350px;
+ left: 165px;
+ top: 290px;
z-index: 503;
}
.main-preset-buttons-wraper .preset-items {
position: relative;
-/* width: 467px;
+ width: 467px;
height: 99px;
- border: 1px solid #393939;*/
+ border: 1px solid #393939;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
z-index: 1;
@@ -148,8 +148,7 @@
vertical-align: top;
border-right: 1px solid #393939;
border-bottom: 1px solid #393939;
- border-top: 1px solid #393939;
- width: 79px;
+ width: 92.6px;
height: 49px;
cursor: pointer;
}
@@ -315,20 +314,22 @@
{
width: 155px;
height: 98px;
+ border-right: 1px solid #393939;
cursor: pointer;
- background: black no-repeat;
+ background: url(../images/media/cd-prev-btn.png) no-repeat;
}
.bc-item-big.prevcd.pressed,.bc-item-big.prevusb.pressed,.bc-item-big.prevsd.pressed,.bc-item-big.prevblue.pressed
{
- background: gray no-repeat;
+ background: url(../images/media/cd-prev-btn_pressed.png) no-repeat;
}
.bc-item-big.playcd {
width: 157px;
height: 98px;
+ border-right: 1px solid #393939;
cursor: pointer;
- background: black no-repeat;
+ background: url(../images/media/cd_play_btn.png) no-repeat;
}
.playIcon {
@@ -346,7 +347,7 @@
.bc-item-big.playcd.pressed,.bc-item-big.playusb.pressed,.bc-item-big.playsd.pressed,.bc-item-big.playblue.pressed
{
- background: DarkGray no-repeat;
+ background: url(../images/media/cd_play_btn_pressed.png) no-repeat;
}
.bc-item-big.nextcd,.bc-item-big.nextusb,.bc-item-big.nextsd,.bc-item-big.nextblue
@@ -354,12 +355,12 @@
width: 154px;
height: 98px;
cursor: pointer;
- background: black no-repeat;
+ background: url(../images/media/cd-next-btn.png) no-repeat;
}
.bc-item-big.nextcd.pressed,.bc-item-big.nextusb.pressed,.bc-item-big.nextsd.pressed,.bc-item-big.nextblue.pressed
{
- background: DarkGray no-repeat;
+ background: url(../images/media/cd-next-btn_pressed.png) no-repeat;
}
#bt-bg {
@@ -395,12 +396,14 @@
left: 13px;
width: 468px;
height: 99px;
+ background: url("../images/media/btn_bg.png") repeat;
+ border: 1px solid #393939;
-webkit-border-radius: 3px;
}
#sdl_view_container .track-info {
left: 165px;
-/* top: 55px;*/
+ top: 55px;
}
#sdl_view_container .list-content {
@@ -458,7 +461,6 @@
}
.track-info>.device {
- display: none;
position: absolute;
top: 30px;
left: 10px;
@@ -469,7 +471,6 @@
}
.divider_o {
- display: none;
position: absolute;
top: 120px;
left: 0px;
@@ -521,7 +522,7 @@
}
#sdl_view_container .ffw_list_menu {
- /*top: 90px;*/
+ top: 90px;
left: 650px;
width: 140px;
-}
+} \ No newline at end of file
diff --git a/src/components/HMI/css/sdl.css b/src/components/HMI/css/sdl.css
index 303ec2b01..e6bf64151 100644
--- a/src/components/HMI/css/sdl.css
+++ b/src/components/HMI/css/sdl.css
@@ -4,6 +4,7 @@
.ffw_list_menu {
left: 440px;
width: 158px;
+ border: 1px solid #393939;
overflow: hidden;
}
@@ -14,7 +15,6 @@
.ffw_list_menu .ffw-button {
position: relative;
- z-index: 300;
height: 49px;
border-bottom: 1px solid #393939;
line-height: 50px;
@@ -70,7 +70,7 @@
}
.sdl-window .back-button {
- /*top: 80px;*/
+ top: 80px;
left: 5px;
width: 48px;
height: 48px;
@@ -84,10 +84,10 @@
}
#info_apps_deviceList_view .deviceListLabel,.sdl-window .caption-text {
- /*top: 80px;*/
+ top: 80px;
left: 75px;
width: 620px;
- background: rgb(29, 6, 6);
+ background: #393939;
overflow: hidden;
text-overflow: ellipsis;
line-height: 50px;
@@ -183,7 +183,7 @@
height: 251px;
border-radius: 2px;
left: 75px;
- top: 51px;
+ top: 150px;
}
/*#sdl_view_container .list-content,*/
@@ -228,7 +228,7 @@
left: 10px;
width: 84px;
height: 50px;
- font-size: 12px;
+ font-size: 20px;
line-height: 50px;
overflow: hidden;
text-overflow: ellipsis;
@@ -236,7 +236,7 @@
}
#sdl_view_container .preset-items {
-/* width: 468px; */
+ width: 468px;
}
#sdl_view_container .main-preset-buttons-wraper .preset-item.a3,#sdl_view_container .main-preset-buttons-wraper .preset-item.a6
@@ -245,17 +245,16 @@
}
#sdl_view_container .player_controllsV2 {
-
- top: 200px !important;
+ top: 241px !important;
height: 48px;
}
#sdl_view_container .player_controllsV2 .ffw-button {
-/* height: 48px;*/
+ height: 48px;
}
#sdl_view_container .player_controllsV2 img {
-/* margin-top: -26px; */
+ margin-top: -26px;
}
/* ScrollableMessage */
@@ -481,6 +480,7 @@
position: absolute;
top: 90px;
right: 10px;
+ border: 1px solid #393939;
-webkit-border-radius: 2px;
width: 109px;
height: 109px;
@@ -490,6 +490,7 @@
position: absolute;
top: 70px;
right: 10px;
+ border: 1px solid #393939;
-webkit-border-radius: 2px;
width: 109px;
height: 109px;
@@ -600,6 +601,25 @@
background: #393939;
}
+#exitAppView .onAwakeSDLLabel{
+ top: 200px;
+ width: 600px;
+ left: 40px;
+ height: 20px;
+ padding: 10px;
+ background: #535353;
+}
+
+#exitAppView .onAwakeSDLButton{
+ right: 268px;
+ top: 250px;
+ width: 150px;
+ height: 19px;
+ padding: 10px;
+ border-radius: 4px;
+ border: 1px solid white;
+}
+
#VehicleInfo .odometrTitle{
top: 180px;
width: 290px;
@@ -625,6 +645,22 @@
padding-right: 10px;
}
+#VehicleInfo .onEmergencyEvent{
+ width: 265px;
+ position: absolute;
+ top: 301px;
+ left: 207px;
+ height: 28px;
+ border: 1px solid #333;
+ border-radius: 2px;
+ cursor: pointer;
+ font-size: 18px;
+ color: #FFF;
+ padding-left: 10px;
+ padding-right: 10px;
+ line-height: 28px;
+}
+
#VehicleInfo .ecu1Title {
top: 180px;
width: 290px;
@@ -1215,4 +1251,4 @@
#media_app_options_view .list-content {
width: 578px;
-}
+} \ No newline at end of file
diff --git a/src/components/HMI/ffw/BasicCommunicationRPC.js b/src/components/HMI/ffw/BasicCommunicationRPC.js
index 0fd63b0fc..ed33daef1 100644
--- a/src/components/HMI/ffw/BasicCommunicationRPC.js
+++ b/src/components/HMI/ffw/BasicCommunicationRPC.js
@@ -202,93 +202,134 @@ FFW.BasicCommunication = FFW.RPCObserver
Em.Logger.log("FFW.BasicCommunicationRPC.onRPCResult");
this._super();
- if (response.result.method == "SDL.GetUserFriendlyMessage") {
+ if ("result" in response
+ && response.result.code === SDL.SDLModel.resultCode["SUCCESS"]) {
- Em.Logger.log("SDL.GetUserFriendlyMessage: Response from SDL!");
+ if (response.result.method == "SDL.GetUserFriendlyMessage") {
- if (response.id in SDL.SDLModel.userFriendlyMessagePull) {
- var callbackObj = SDL.SDLModel.userFriendlyMessagePull[response.id];
- callbackObj.callbackFunc(response.result.messages, callbackObj.appID);
- delete SDL.SDLModel.userFriendlyMessagePull[response.id];
- }
- }
+ Em.Logger.log("SDL.GetUserFriendlyMessage: Response from SDL!");
- if (response.result.method == "SDL.ActivateApp") {
+ if (response.id in SDL.SDLModel.userFriendlyMessagePull) {
+ var callbackObj = SDL.SDLModel.userFriendlyMessagePull[response.id];
+ callbackObj.callbackFunc(response.result.messages);
+ delete SDL.SDLModel.userFriendlyMessagePull[response.id];
+ }
+ }
- Em.Logger.log("SDL.ActivateApp: Response from SDL!");
+ if (response.result.method == "SDL.ActivateApp") {
- if (response.id in SDL.SDLModel.activateAppRequestsList) {
+ Em.Logger.log("SDL.ActivateApp: Response from SDL!");
- var appID = SDL.SDLModel.activateAppRequestsList[response.id];
+ if (response.id in SDL.SDLModel.activateAppRequestsList) {
- if (!response.result.isSDLAllowed) {
+ var appID = SDL.SDLModel.activateAppRequestsList[response.id].appID,
+ popUp = SDL.SDLModel.activateAppRequestsList[response.id].popUp;
- SDL.SettingsController.currentDeviceAllowance = response.result.device;
+ popUp.deactivate();
- FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.AllowSDLFunctionality, appID, ["DataConsent"]);
- }
+ if (response.error && response.error.code === SDL.SDLModel.resultCode["APPLICATION_NOT_REGISTERED"]) {
- if (response.result.isPermissionsConsentNeeded) {
+ SDL.PopUp.create().appendTo('body').popupActivate("Activation FAILED!");
+ return;
+ }
- this.GetListOfPermissions(appID);
- }
+ if (!response.result.isSDLAllowed) {
- if (response.result.isAppPermissionsRevoked) {
+ SDL.SettingsController.currentDeviceAllowance = response.result.device;
- SDL.SDLModel.setAppPermissions(appID, response.result.appRevokedPermissions);
- }
+ FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.AllowSDLFunctionality, appID, ["DataConsent"]);
+ }
- if (response.result.isAppRevoked) {
+ if (response.result.isPermissionsConsentNeeded) {
- FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, appID, ["AppUnsupported"]);
- } else {
+ this.GetListOfPermissions(appID);
+ }
- SDL.SDLController.getApplicationModel(appID).deviceID = response.result.device ? response.result.device.id : null;
+ if (response.result.isAppPermissionsRevoked) {
- if ( SDL.SDLAppController.model && SDL.SDLAppController.model.appID != appID) {
- SDL.States.goToStates('info.apps');
+ SDL.SDLModel.setAppPermissions(appID, response.result.appRevokedPermissions);
}
- if (SDL.SDLModel.stateLimited == appID) {
- SDL.SDLModel.stateLimited = null;
- SDL.SDLModel.set('limitedExist', false);
- }
+ if (response.result.isAppRevoked) {
- if (response.result.isSDLAllowed) {
- SDL.SDLController.getApplicationModel(appID).turnOnSDL(appID);
+ FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, appID, ["AppUnsupported"]);
+ } else {
+
+ SDL.SDLController.getApplicationModel(appID).deviceID = response.result.device ? response.result.device.id : null;
+
+ if (SDL.SDLAppController.model && SDL.SDLAppController.model.appID != appID) {
+ SDL.States.goToStates('info.apps');
+ }
+
+ if (SDL.SDLModel.stateLimited == appID) {
+ SDL.SDLModel.stateLimited = null;
+ SDL.SDLModel.set('limitedExist', false);
+ }
+
+ if (response.result.isSDLAllowed) {
+ SDL.SDLController.getApplicationModel(appID).turnOnSDL(appID);
+ }
}
- }
- delete SDL.SDLModel.activateAppRequestsList[response.id];
+ delete SDL.SDLModel.activateAppRequestsList[response.id];
+ }
+ } else if (response.result.method == "SDL.ActivateApp" && response.result.code != 0) {
+ Em.Logger.error("SDL.ActivateApp: Wrong Response from SDL!");
}
- }
- if (response.result.method == "SDL.GetListOfPermissions") {
+ if (response.result.method == "SDL.GetListOfPermissions") {
- Em.Logger.log("SDL.GetListOfPermissions: Response from SDL!");
+ Em.Logger.log("SDL.GetListOfPermissions: Response from SDL!");
- SDL.SettingsController.GetListOfPermissionsResponse(response);
- }
+ SDL.SettingsController.GetListOfPermissionsResponse(response);
+ }
- if (response.result.method == "SDL.GetStatusUpdate") {
+ if (response.result.method == "SDL.GetStatusUpdate") {
- Em.Logger.log("SDL.GetStatusUpdate: Response from SDL!");
+ Em.Logger.log("SDL.GetStatusUpdate: Response from SDL!");
- SDL.PopUp.create().appendTo('body').popupActivate(response.result);
- }
+ SDL.PopUp.create().appendTo('body').popupActivate(response.result);
+ }
- if (response.result.method == "SDL.GetURLS") {
+ if (response.result.method == "SDL.GetURLS") {
- SDL.SDLModel.set('policyURLs', response.result.urls);
+ SDL.SDLModel.set('policyURLs', response.result.urls);
+
+ if (response.result.urls.length) {
+ this.OnSystemRequest("PROPRIETARY", response.result.urls[0].policyAppId, SDL.SettingsController.policyUpdateFile, response.result.urls[0].url);
+ } else {
+ this.OnSystemRequest("PROPRIETARY");
+ }
+
+ SDL.SettingsController.policyUpdateRetry();
- if (response.result.urls.length) {
- this.OnSystemRequest("PROPRIETARY", response.result.urls[0].policyAppId, SDL.SettingsController.policyUpdateFile, response.result.urls[0].url);
- } else {
- this.OnSystemRequest("PROPRIETARY");
}
+ } else if ("error" in response
+ && "code" in response.error
+ && response.error.code !== SDL.SDLModel.resultCode["SUCCESS"]) {
+
+
+ if ("data" in response.error && "method" in response.error.data) {
+ //&& response.error.data.method == "SDL.ActivateApp" && response.error.code === 15) {
+
+ if (response.error.data.method == "SDL.ActivateApp") {
+
+ var appID = SDL.SDLModel.activateAppRequestsList[response.id].appID,
+ popUp = SDL.SDLModel.activateAppRequestsList[response.id].popUp;
- SDL.SettingsController.policyUpdateRetry();
+ popUp.deactivate();
+ if (SDL.SDLModel.resultCode["APPLICATION_NOT_REGISTERED"]) {
+ SDL.PopUp.create().appendTo('body').popupActivate("Activation FAILED! Application not registered!");
+ }
+
+ delete SDL.SDLModel.activateAppRequestsList[response.id];
+ }
+ } else {
+ console.error("Wrong JSON response structure!");
+ }
+ } else {
+ console.error("Wrong JSON response structure!");
}
},
@@ -345,7 +386,7 @@ FFW.BasicCommunication = FFW.RPCObserver
if (notification.params.isAppPermissionsRevoked) {
- SDL.SDLModel.setAppPermissions(notification.params.appID, response.result.appRevokedPermissions);
+ SDL.SDLModel.setAppPermissions(notification.params.appID, notification.params.appRevokedPermissions);
}
if (notification.params.appRevoked) {
@@ -360,7 +401,7 @@ FFW.BasicCommunication = FFW.RPCObserver
}
if (notification.method == this.onAppRegisteredNotification) {
- SDL.SDLModel.onAppRegistered(notification.params);
+ SDL.SDLModel.onAppRegistered(notification.params.application);
this.OnFindApplications();
}
@@ -418,9 +459,19 @@ FFW.BasicCommunication = FFW.RPCObserver
}
if (request.method == "BasicCommunication.UpdateAppList") {
+ var message = "Was found " + request.params.applications.length + " apps";
+
+ SDL.PopUp.create().appendTo('body').popupActivate(message);
+
+ SDL.SDLModel.set('updatedAppsList', request.params.applications);
+
+ SDL.InfoAppsView.showAppList();
+
this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"],
request.id,
request.method);
+
+ SDL.InfoAppsView.showAppList();
}
if (request.method == "BasicCommunication.SystemRequest") {
@@ -494,7 +545,10 @@ FFW.BasicCommunication = FFW.RPCObserver
var itemIndex = this.client.generateId();
- SDL.SDLModel.activateAppRequestsList[itemIndex] = appID;
+ SDL.SDLModel.activateAppRequestsList[itemIndex] = {
+ "appID": appID,
+ "popUp": SDL.PopUp.create().appendTo('body').popupActivate("Activation in progress...", null, true)
+ };
Em.Logger.log("FFW.SDL.OnAppActivated: Request from HMI!");
@@ -508,6 +562,17 @@ FFW.BasicCommunication = FFW.RPCObserver
}
};
this.client.send(JSONMessage);
+
+ setTimeout(function(){
+ if (itemIndex in SDL.SDLModel.activateAppRequestsList) {
+
+ SDL.SDLModel.activateAppRequestsList[itemIndex].popUp.deactivate();
+
+ SDL.PopUp.create().appendTo('body').popupActivate("Activation FAILED! Application not registered!");
+
+ delete SDL.SDLModel.activateAppRequestsList[itemIndex];
+ }
+ }, 20000);
},
/**
@@ -1000,6 +1065,24 @@ FFW.BasicCommunication = FFW.RPCObserver
},
/**
+ * OnAwakeSDL from HMI returns SDL to normal operation
+ * after OnExitAllApplications(SUSPEND)
+ */
+ OnAwakeSDL: function() {
+
+ Em.Logger.log("FFW.BasicCommunication.OnAwakeSDL");
+
+ // send request
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.OnAwakeSDL"
+ };
+ this.client.send(JSONMessage);
+ },
+
+
+
+ /**
* Used by HMI when User chooses to exit application.
*
* @params {Number}
@@ -1151,6 +1234,25 @@ FFW.BasicCommunication = FFW.RPCObserver
},
/**
+ * Notifies if audio state was changed
+ *
+ * @param {Boolean} enabled
+ */
+ OnEmergencyEvent: function(enabled) {
+
+ Em.Logger.log("FFW.BasicCommunication.OnEmergencyEvent");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.OnEmergencyEvent",
+ "params": {
+ "enabled": enabled
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+ /**
* Send error response from onRPCRequest
*
* @param {Number}
diff --git a/src/components/HMI/ffw/NavigationRPC.js b/src/components/HMI/ffw/NavigationRPC.js
index 5f594079a..463dbfe97 100644
--- a/src/components/HMI/ffw/NavigationRPC.js
+++ b/src/components/HMI/ffw/NavigationRPC.js
@@ -172,6 +172,24 @@ FFW.Navigation = FFW.RPCObserver.create( {
}
case "Navigation.AlertManeuver": {
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
+
+ //Check if there is any available data to process the request
+ if ("softButtons" in request.params) {
+
+ this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"];
+ } else {
+ //If no available data sent error response and stop process current request
+
+ this.sendError(this.errorResponsePull[request.id].code, request.id, request.method,
+ "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed.");
+ this.errorResponsePull[request.id] = null;
+
+ return;
+ }
+ }
+
this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
request.id,
request.method);
@@ -180,6 +198,12 @@ FFW.Navigation = FFW.RPCObserver.create( {
}
case "Navigation.ShowConstantTBT": {
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
+
+ this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"];
+ }
+
SDL.SDLModel.tbtActivate(request.params);
this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
request.id,
@@ -189,6 +213,24 @@ FFW.Navigation = FFW.RPCObserver.create( {
}
case "Navigation.UpdateTurnList": {
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
+
+ //Check if there is any available data to process the request
+ if ("turnList" in request.params || "softButtons" in request.params) {
+
+ this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"];
+ } else {
+ //If no available data sent error response and stop process current request
+
+ this.sendError(this.errorResponsePull[request.id].code, request.id, request.method,
+ "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed.");
+ this.errorResponsePull[request.id] = null;
+
+ return;
+ }
+ }
+
SDL.SDLModel.tbtTurnListUpdate(request.params);
this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
request.id,
@@ -198,11 +240,7 @@ FFW.Navigation = FFW.RPCObserver.create( {
}
case "Navigation.StartAudioStream": {
- SDL.SDLModel.startAudioStream(request.params);
-
- this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
- request.id,
- request.method);
+ SDL.SDLModel.startAudioStream(request);
break;
}
@@ -218,11 +256,7 @@ FFW.Navigation = FFW.RPCObserver.create( {
}
case "Navigation.StartStream": {
- SDL.SDLModel.startStream(request.params);
-
- this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
- request.id,
- request.method);
+ SDL.SDLModel.startStream(request);
break;
}
@@ -238,6 +272,12 @@ FFW.Navigation = FFW.RPCObserver.create( {
}
case "Navigation.SendLocation": {
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
+
+ this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"];
+ }
+
this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
request.id,
request.method);
@@ -292,6 +332,14 @@ FFW.Navigation = FFW.RPCObserver.create( {
*/
sendNavigationResult: function(resultCode, id, method) {
+ if (this.errorResponsePull[id]) {
+
+ this.sendError(this.errorResponsePull[id].code, id, method,
+ "Unsupported " + this.errorResponsePull[id].type + " type. Available data in request was processed.");
+ this.errorResponsePull[id] = null;
+ return;
+ }
+
Em.Logger.log("FFW.UI." + method + "Response");
if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
diff --git a/src/components/HMI/ffw/RPCClient.js b/src/components/HMI/ffw/RPCClient.js
index 954dfbe17..5df06334d 100644
--- a/src/components/HMI/ffw/RPCClient.js
+++ b/src/components/HMI/ffw/RPCClient.js
@@ -129,34 +129,19 @@ FFW.RPCClient = Em.Object
Em.Logger.log("Message received: " + evt.data);
- var jsonObj = JSON.parse(evt.data);
-
- JSON.parse(evt.data, SDL.RPCController.capabilitiesCheck);
-
- if (jsonObj.method == 'UI.Show' && SDL.RPCController.capabilityCheckResult == 'UNSUPPORTED_RESOURCE' && Object.size(jsonObj.params) != 3 && jsonObj.params.showStrings.length != 0) {
-
- this.observer.errorResponsePull[jsonObj.id] = SDL.SDLModel.resultCode["WARNINGS"];
-
- Em.Logger.error('Image of STATIC type is not supported on HMI. Other information was successfully displayed');
+ var jsonObj = JSON.parse(evt.data, SDL.RPCController.capabilitiesCheck);
+ if (SDL.RPCController.capabilityCheckResult != null) {
+ this.observer.errorResponsePull[jsonObj.id] = SDL.RPCController.capabilityCheckResult;
SDL.RPCController.capabilityCheckResult = null;
- } else {
-
- switch (SDL.RPCController.capabilityCheckResult) {
- case 'UNSUPPORTED_RESOURCE': {
-
- this.observer.errorResponsePull[jsonObj.id] = SDL.SDLModel.resultCode["UNSUPPORTED_RESOURCE"];
-
- Em.Logger.error('Unsupported incoming resource! In method ' + jsonObj.method);
-
- SDL.RPCController.capabilityCheckResult = null;
-
- break;
- }
- }
+ this.observer.checkImage(jsonObj.params);
+ this.observer.checkSoftButtons(jsonObj.params);
+ this.observer.checkChoice(jsonObj.params);
+ this.observer.checkChunk(jsonObj.params);
+ this.observer.checkHelpItems(jsonObj.params);
+ this.observer.checkTurnList(jsonObj.params);
}
-
// handle component registration
if (jsonObj.id == this.registerRequestId && jsonObj.method == null && typeof jsonObj.result == 'number') {
if (jsonObj.error == null) {
@@ -289,22 +274,6 @@ FFW.RPCClient = Em.Object
if (this.socket.readyState == this.socket.OPEN) {
- if (this.observer.errorResponsePull[obj.id] && this.observer.errorResponsePull[obj.id] !== 0 && obj.result) {
- var method = obj.result.method;
-
- delete obj.result;
-
- obj.error = {
- "code": this.observer.errorResponsePull[obj.id],
- "message": this.observer.errorResponsePull[obj.id] == 21 ? "Image of STATIC type is not supported on HMI. Other information was successfully displayed" : "Unsupported incoming resource!",
- "data": {
- "method": method
- }
- }
-
- delete this.observer.errorResponsePull[obj.id];
- }
-
var strJson = JSON.stringify(obj);
Em.Logger.log(strJson);
diff --git a/src/components/HMI/ffw/RPCObserver.js b/src/components/HMI/ffw/RPCObserver.js
index 6f598cbeb..76b002aa8 100644
--- a/src/components/HMI/ffw/RPCObserver.js
+++ b/src/components/HMI/ffw/RPCObserver.js
@@ -71,11 +71,244 @@ FFW.RPCObserver = Em.Object
// parse JSON string and set necessary properties
},
- onRPCRequest: function(request) {
+ onRPCRequest: function(request, error) {
// parse JSON string and send back necessary data
},
+ /**
+ * Check for unsupported image type
+ * Return false if unsupported image type was found and delete unsupported resource
+ * @param params
+ * @returns {boolean}
+ */
+ checkImage: function(params){
+ if ("graphic" in params) {
+ if (params.graphic.imageType === "STATIC") {
+ delete params.graphic;
+ return false;
+ }
+ }
+ if ("secondaryGraphic" in params) {
+ if (params.secondaryGraphic.imageType === "STATIC") {
+ delete params.secondaryGraphic;
+ return false;
+ }
+ }
+ if ("image" in params) {
+ if (params.image.imageType === "STATIC") {
+ delete params.image;
+ return false;
+ }
+ }
+ if ("secondaryImage" in params) {
+ if (params.image.imageType === "STATIC") {
+ delete params.image;
+ return false;
+ }
+ }
+ if ("turnIcon" in params) {
+ if (params.turnIcon.imageType === "STATIC") {
+ delete params.turnIcon;
+ return false;
+ }
+ }
+ if ("nextTurnIcon" in params) {
+ if (params.nextTurnIcon.imageType === "STATIC") {
+ delete params.nextTurnIcon;
+ return false;
+ }
+ }
+ if ("cmdIcon" in params) {
+ if (params.cmdIcon.imageType === "STATIC") {
+ delete params.cmdIcon;
+ return false;
+ }
+ }
+ if ("menuIcon" in params) {
+ if (params.menuIcon.imageType === "STATIC") {
+ delete params.menuIcon;
+ return false;
+ }
+ }
+ if ("syncFileName" in params) {
+ if (params.syncFileName.imageType === "STATIC") {
+ delete params.syncFileName;
+ return false;
+ }
+ }
+ if ("locationImage" in params) {
+ if (params.locationImage.imageType === "STATIC") {
+ delete params.locationImage;
+ return false;
+ }
+ }
+ return true;
+ },
+
+ /**
+ * Check for unsupported image type
+ * If unsupported image type was found delete unsupported resource
+ * @param params
+ */
+ checkSoftButtons: function(params){
+
+ if ("softButtons" in params) {
+ for (var i = params.softButtons.length-1; i >= 0 ; i--) {
+ if (!this.checkImage(params.softButtons[i])) {
+ if (!("text" in params.softButtons[i])) {
+
+ params.softButtons.splice(i, 1);
+ }
+ }
+ }
+
+ if (params.softButtons.length == 0) {
+ delete params.softButtons;
+ }
+ }
+ },
+
+ /**
+ * Check for unsupported image type
+ * If unsupported image type was found delete unsupported resource
+ * @param params
+ */
+ checkTurnList: function(params){
+
+ if ("turnList" in params) {
+ for (var i = params.turnList.length-1; i >= 0 ; i--) {
+ if (!this.checkImage(params.turnList[i])) {
+ if (!("navigationText" in params.turnList[i])) {
+
+ params.turnList.splice(i, 1);
+ }
+ }
+ }
+
+ if (params.turnList.length == 0) {
+ delete params.turnList;
+ }
+ }
+ },
+
+ /**
+ * Check for unsupported tts type
+ * If unsupported tts type was found delete unsupported resource
+ * @param params
+ */
+ checkChunk: function(params){
+
+ if ("ttsName" in params) {
+ for (var i = params.ttsName.length-1; i >= 0 ; i--) {
+ if (params.ttsName[i].type != "TEXT") {
+
+ params.ttsName.splice(i, 1);
+ }
+ }
+
+ if (params.ttsName.length == 0) {
+ delete params.ttsName;
+ }
+ }
+ if ("helpPrompt" in params) {
+ for (var i = params.helpPrompt.length-1; i >= 0 ; i--) {
+ if (params.helpPrompt[i].type != "TEXT") {
+
+ params.helpPrompt.splice(i, 1);
+ }
+ }
+
+ if (params.helpPrompt.length == 0) {
+ delete params.helpPrompt;
+ }
+ }
+ if ("initialPrompt" in params) {
+ for (var i = params.initialPrompt.length-1; i >= 0 ; i--) {
+ if (params.initialPrompt[i].type != "TEXT") {
+
+ params.initialPrompt.splice(i, 1);
+ }
+ }
+
+ if (params.initialPrompt.length == 0) {
+ delete params.initialPrompt;
+ }
+ }
+ if ("timeoutPrompt" in params) {
+ for (var i = params.timeoutPrompt.length-1; i >= 0 ; i--) {
+ if (params.timeoutPrompt[i].type != "TEXT") {
+
+ params.timeoutPrompt.splice(i, 1);
+ }
+ }
+
+ if (params.timeoutPrompt.length == 0) {
+ delete params.timeoutPrompt;
+ }
+ }
+ if ("ttsChunks" in params) {
+ for (var i = params.ttsChunks.length-1; i >= 0 ; i--) {
+ if (params.ttsChunks[i].type != "TEXT") {
+
+ params.ttsChunks.splice(i, 1);
+ }
+ }
+
+ if (params.ttsChunks.length == 0) {
+ delete params.ttsChunks;
+ }
+ }
+ },
+
+ /**
+ * Check for unsupported choiceSet type
+ * If unsupported choiceSet type was found delete unsupported resource
+ * @param params
+ */
+ checkChoice: function(params){
+
+ if ("choiceSet" in params) {
+ for (var i = params.choiceSet.length-1; i >= 0 ; i--) {
+ if (this.checkImage(params.choiceSet[i])) {
+ if (!("menuName" in params.choiceSet[i])
+ || !("secondaryText" in params.choiceSet[i])
+ || !("tertiaryText" in params.choiceSet[i])) {
+
+ params.choiceSet.splice(i, 1);
+ }
+ }
+ }
+
+ if (params.choiceSet.length == 0) {
+ delete params.choiceSet;
+ }
+ }
+ },
+
+ /**
+ * Check for unsupported vrHelp type
+ * If unsupported vrHelp type was found delete unsupported resource
+ * @param params
+ */
+ checkHelpItems: function(params){
+
+ if ("vrHelp" in params) {
+ for (var i = params.vrHelp.length-1; i >= 0 ; i--) {
+ if (this.checkImage(params.vrHelp[i])) {
+ if (!("text" in params.vrHelp[i])) {
+
+ params.vrHelp.splice(i, 1);
+ }
+ }
+ }
+
+ if (params.vrHelp.length == 0) {
+ delete params.vrHelp;
+ }
+ }
+ },
+
validationCheck: function(request) {
if (request && request.method) {
diff --git a/src/components/HMI/ffw/TTSRPC.js b/src/components/HMI/ffw/TTSRPC.js
index 6939aa493..0e0b92acd 100644
--- a/src/components/HMI/ffw/TTSRPC.js
+++ b/src/components/HMI/ffw/TTSRPC.js
@@ -151,6 +151,24 @@ FFW.TTS = FFW.RPCObserver.create( {
switch (request.method) {
case "TTS.Speak": {
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
+
+ //Check if there is any available data to process the request
+ if ("ttsChunks" in request.params) {
+
+ this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"];
+ } else {
+ //If no available data sent error response and stop process current request
+
+ this.sendError(this.errorResponsePull[request.id].code, request.id, request.method,
+ "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed.");
+ this.errorResponsePull[request.id] = null;
+
+ return;
+ }
+ }
+
if (SDL.TTSPopUp.active) {
FFW.TTS.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, "TTS.Speak", "TTS in progress. Rejected.");
} else {
@@ -162,6 +180,25 @@ FFW.TTS = FFW.RPCObserver.create( {
}
case "TTS.SetGlobalProperties": {
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
+
+ //Check if there is any available data to process the request
+ if ("helpPrompt" in request.params
+ || "timeoutPrompt" in request.params) {
+
+ this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"];
+ } else {
+ //If no available data sent error response and stop process current request
+
+ this.sendError(this.errorResponsePull[request.id].code, request.id, request.method,
+ "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed.");
+ this.errorResponsePull[request.id] = null;
+
+ return;
+ }
+ }
+
SDL.SDLModel.setProperties(request.params);
this.sendTTSResult(SDL.SDLModel.resultCode["SUCCESS"],
@@ -248,6 +285,25 @@ FFW.TTS = FFW.RPCObserver.create( {
}
case "TTS.ChangeRegistration": {
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
+
+ //Check if there is any available data to process the request
+ if ("ttsName" in request.params
+ || "language" in request.params) {
+
+ this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"];
+ } else {
+ //If no available data sent error response and stop process current request
+
+ this.sendError(this.errorResponsePull[request.id].code, request.id, request.method,
+ "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed.");
+ this.errorResponsePull[request.id] = null;
+
+ return;
+ }
+ }
+
SDL.SDLModel.changeRegistrationTTSVR(request.params.language, request.params.appID);
this.sendTTSResult(SDL.SDLModel.resultCode["SUCCESS"],
@@ -328,6 +384,14 @@ FFW.TTS = FFW.RPCObserver.create( {
*/
sendTTSResult: function(resultCode, id, method) {
+ if (this.errorResponsePull[id]) {
+
+ this.sendError(this.errorResponsePull[id].code, id, method,
+ "Unsupported " + this.errorResponsePull[id].type + " type. Available data in request was processed.");
+ this.errorResponsePull[id] = null;
+ return;
+ }
+
Em.Logger.log("FFW." + method + "Response");
if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
diff --git a/src/components/HMI/ffw/UIRPC.js b/src/components/HMI/ffw/UIRPC.js
index 43ee73a85..5feb304d2 100644
--- a/src/components/HMI/ffw/UIRPC.js
+++ b/src/components/HMI/ffw/UIRPC.js
@@ -168,6 +168,25 @@ FFW.UI = FFW.RPCObserver.create({
case "UI.Alert":
{
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
+
+ //Check if there is any available data to process the request
+ if (request.params.alertStrings.length > 0
+ || "softButtons" in request.params) {
+
+ this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"];
+ } else {
+ //If no available data sent error response and stop process current request
+
+ this.sendError(this.errorResponsePull[request.id].code, request.id, request.method,
+ "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed.");
+ this.errorResponsePull[request.id] = null;
+
+ return;
+ }
+ }
+
if (SDL.SDLModel.onUIAlert(request.params, request.id)) {
SDL.SDLController.onSystemContextChange(request.params.appID);
}
@@ -177,6 +196,28 @@ FFW.UI = FFW.RPCObserver.create({
case "UI.Show":
{
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
+
+ //Check if there is any available data to process the request
+ if (request.params.showStrings.length > 0
+ || "graphic" in request.params
+ || "secondaryGraphic" in request.params
+ || "softButtons" in request.params
+ || "customPresets" in request.params) {
+
+ this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"];
+ } else {
+ //If no available data sent error response and stop process current request
+
+ this.sendError(this.errorResponsePull[request.id].code, request.id, request.method,
+ "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed.");
+ this.errorResponsePull[request.id] = null;
+
+ return;
+ }
+ }
+
SDL.TurnByTurnView.deactivate();
SDL.SDLController.getApplicationModel(request.params.appID).onSDLUIShow(request.params);
this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
@@ -185,14 +226,29 @@ FFW.UI = FFW.RPCObserver.create({
}
case "UI.SetGlobalProperties":
{
- SDL.SDLModel.setProperties(request.params);
- this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
- break;
- }
- case "UI.ResetGlobalProperties":
- {
+ //Check if there is any available data to process the request
+ if ("menuTitle" in request.params
+ || "keyboardProperties" in request.params
+ || "vrHelp" in request.params
+ || "menuIcon" in request.params) {
+
+ this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"];
+ } else {
+ //If no available data sent error response and stop process current request
+
+ this.sendError(this.errorResponsePull[request.id].code, request.id, request.method,
+ "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed.");
+ this.errorResponsePull[request.id] = null;
+
+ return;
+ }
+ }
+
+ SDL.SDLModel.setProperties(request.params);
this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
@@ -201,6 +257,25 @@ FFW.UI = FFW.RPCObserver.create({
case "UI.AddCommand":
{
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
+
+ //Check if there is any available data to process the request
+ if ("cmdIcon" in request.params
+ || "menuParams" in request.params) {
+
+ this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"];
+ } else {
+ //If no available data sent error response and stop process current request
+
+ this.sendError(this.errorResponsePull[request.id].code, request.id, request.method,
+ "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed.");
+ this.errorResponsePull[request.id] = null;
+
+ return;
+ }
+ }
+
SDL.SDLController.getApplicationModel(request.params.appID).addCommand(request);
break;
@@ -230,6 +305,28 @@ FFW.UI = FFW.RPCObserver.create({
case "UI.PerformInteraction":
{
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
+
+ //Check if there is any available data to process the request
+ if ("choiceSet" in request.params
+ && request.params
+ && request.params.interactionLayout != "KEYBOARD") {
+
+ this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"];
+ } else {
+ //If no available data sent error response and stop process current request
+
+ this.sendError(this.errorResponsePull[request.id].code,
+ request.id,
+ request.method,
+ "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed.");
+ this.errorResponsePull[request.id] = null;
+
+ return;
+ }
+ }
+
if (SDL.SDLModel.uiPerformInteraction(request)) {
SDL.SDLController.onSystemContextChange();
}
@@ -243,7 +340,10 @@ FFW.UI = FFW.RPCObserver.create({
if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
this.sendUIResult(resultCode, request.id, request.method);
} else {
- this.sendError(resultCode, request.id, request.method, 'Request is ignored, because the intended result is already in effect.');
+ this.sendError(resultCode,
+ request.id,
+ request.method,
+ 'Request is ignored, because the intended result is already in effect.');
}
break;
@@ -270,10 +370,13 @@ FFW.UI = FFW.RPCObserver.create({
{
if (request.params.appName) {
- SDL.SDLController.getApplicationModel(request.params.appID).set('appName', request.params.appName);
+ SDL.SDLController.getApplicationModel(request.params.appID).set('appName',
+ request.params.appName);
}
- SDL.SDLModel.changeRegistrationUI(request.params.language, request.params.appID);
+ SDL.SDLModel.changeRegistrationUI(request.params.language,
+ request.params.appID,
+ request.params.appName);
this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
break;
@@ -492,6 +595,30 @@ FFW.UI = FFW.RPCObserver.create({
"characterSet": "TYPE2SET",
"width": 500,
"rows": 1
+ },
+ {
+ "name": "locationName",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "locationDescription",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "addressLines",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "phoneNumber",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
}
],
"imageFields": [
@@ -772,6 +899,20 @@ FFW.UI = FFW.RPCObserver.create({
case "UI.SetAppIcon":
{
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
+
+ //Check if there is any available data to process the request
+ if (!("syncFileName" in request.params)) {
+
+ this.sendError(this.errorResponsePull[request.id].code, request.id, request.method,
+ "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed.");
+ this.errorResponsePull[request.id] = null;
+
+ return;
+ }
+ }
+
SDL.SDLModel.onSDLSetAppIcon(request.params, request.id, request.method);
break;
@@ -780,7 +921,11 @@ FFW.UI = FFW.RPCObserver.create({
{
if (this.performAudioPassThruRequestID > 0) {
- this.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, request.method, 'PerformAudioPassThru request aborted!');
+ this.sendError(
+ SDL.SDLModel.resultCode["REJECTED"],
+ request.id,
+ request.method,
+ 'PerformAudioPassThru request aborted!');
} else {
this.performAudioPassThruRequestID = request.id;
@@ -1020,6 +1165,30 @@ FFW.UI = FFW.RPCObserver.create({
"characterSet": "TYPE2SET",
"width": 500,
"rows": 1
+ },
+ {
+ "name": "locationName",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "locationDescription",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "addressLines",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "phoneNumber",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
}
],
"imageFields": [
@@ -1320,6 +1489,14 @@ FFW.UI = FFW.RPCObserver.create({
*/
sendUIResult: function (resultCode, id, method) {
+ if (this.errorResponsePull[id]) {
+
+ this.sendError(this.errorResponsePull[id].code, id, method,
+ "Unsupported " + this.errorResponsePull[id].type + " type. Available data in request was processed.");
+ this.errorResponsePull[id] = null;
+ return;
+ }
+
Em.Logger.log("FFW." + method + "Response");
if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
@@ -1351,16 +1528,8 @@ FFW.UI = FFW.RPCObserver.create({
switch (resultCode) {
case SDL.SDLModel.resultCode["SUCCESS"]: {
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "result": {
- "code": resultCode, // type (enum) from SDL protocol
- "method": 'UI.Alert'
- }
- };
- this.client.send(JSONMessage);
+
+ this.sendUIResult(resultCode, id, 'UI.Alert');
break;
}
@@ -1394,6 +1563,7 @@ FFW.UI = FFW.RPCObserver.create({
if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+ this.sendUIResult(resultCode, id, 'UI.Alert');
// send repsonse
var JSONMessage = {
"jsonrpc": "2.0",
@@ -1530,6 +1700,35 @@ FFW.UI = FFW.RPCObserver.create({
Em.Logger.log("FFW.UI.PerformInteractionResponse");
+ if (this.errorResponsePull[requestID]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": requestID,
+ "error": {
+ "code": this.errorResponsePull[requestID].code,
+ "message": "Unsupported " + this.errorResponsePull[requestID].type
+ + " type. Available data in request was processed.",
+ "data": {
+ "method": "UI.PerformInteraction"
+ }
+ }
+ };
+
+ if (commandID) {
+ JSONMessage.error.data.choiceID = commandID;
+ }
+
+ if (manualTextEntry != null) {
+ JSONMessage.error.data.manualTextEntry = manualTextEntry;
+ }
+
+ this.client.send(JSONMessage);
+ this.errorResponsePull[requestID] = null;
+ return;
+ }
+
if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
// send repsonse
var JSONMessage = {
diff --git a/src/components/HMI/ffw/VRRPC.js b/src/components/HMI/ffw/VRRPC.js
index 680c9a87d..ce8188b6c 100644
--- a/src/components/HMI/ffw/VRRPC.js
+++ b/src/components/HMI/ffw/VRRPC.js
@@ -247,6 +247,27 @@ FFW.VR = FFW.RPCObserver.create( {
case "VR.PerformInteraction":
{
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
+
+ //Check if there is any available data to process the request
+ if ("helpPrompt" in request.params
+ || "initialPrompt" in request.params
+ || "timeoutPrompt" in request.params
+ || "grammarID" in request.params) {
+
+ this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"];
+ } else {
+ //If no available data sent error response and stop process current request
+
+ this.sendError(this.errorResponsePull[request.id].code, request.id, request.method,
+ "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed.");
+ this.errorResponsePull[request.id] = null;
+
+ return;
+ }
+ }
+
SDL.SDLModel.vrPerformInteraction(request);
break;
@@ -320,6 +341,30 @@ FFW.VR = FFW.RPCObserver.create( {
Em.Logger.log("FFW.VR.PerformInteractionResponse");
+ if (this.errorResponsePull[requestID]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": requestID,
+ "error": {
+ "code": this.errorResponsePull[requestID].code,
+ "message": "Unsupported " + this.errorResponsePull[requestID].type + " type. Available data in request was processed.",
+ "data": {
+ "method": "VR.PerformInteraction"
+ }
+ }
+ };
+
+ if (commandID) {
+ JSONMessage.error.data.choiceID = commandID;
+ }
+
+ this.client.send(JSONMessage);
+ this.errorResponsePull[requestID] = null;
+ return;
+ }
+
if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
// send repsonse
var JSONMessage = {
@@ -366,6 +411,14 @@ FFW.VR = FFW.RPCObserver.create( {
*/
sendVRResult: function(resultCode, id, method) {
+ if (this.errorResponsePull[id]) {
+
+ this.sendError(this.errorResponsePull[id].code, id, method,
+ "Unsupported " + this.errorResponsePull[id].type + " type. Available data in request was processed.");
+ this.errorResponsePull[id] = null;
+ return;
+ }
+
Em.Logger.log("FFW." + method + "Response");
if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt
index 07d8de458..bef3cdd8f 100644
--- a/src/components/application_manager/CMakeLists.txt
+++ b/src/components/application_manager/CMakeLists.txt
@@ -1,10 +1,39 @@
-set (COMPONENTS_DIR ${CMAKE_SOURCE_DIR}/src/components)
+# 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.
+
+
set (AM_SOURCE_DIR ${COMPONENTS_DIR}/application_manager)
set (AM_TEST_DIR ${AM_SOURCE_DIR}/test)
set (AM_MOCK_DIR ${AM_TEST_DIR}/mock)
-
include_directories (
include/
${COMPONENTS_DIR}/utils/include/
@@ -18,6 +47,7 @@ include_directories (
${COMPONENTS_DIR}/request_watchdog/include/
${COMPONENTS_DIR}/resumption/include/
${COMPONENTS_DIR}/rpc_base/include/
+ ${COMPONENTS_DIR}/interfaces
${CMAKE_BINARY_DIR}/src/components/
${COMPONENTS_DIR}/include/
${COMPONENTS_DIR}/policy/src/policy/include/
@@ -35,15 +65,13 @@ file (GLOB SOURCES
set (POLICIES_MANAGER
${AM_SOURCE_DIR}/src/policies/policy_handler.cc
${AM_SOURCE_DIR}/src/policies/policy_event_observer.cc
+${AM_SOURCE_DIR}/src/policies/delegates/app_permission_delegate.cc
+${AM_SOURCE_DIR}/src/policies/delegates/statistics_delegate.cc
)
include_directories(
${COMPONENTS_DIR}/policy/src/policy/policy_table/table_struct
)
- list(APPEND POLICIES_MANAGER
- ${AM_SOURCE_DIR}/src/policies/pt_exchange_handler_impl.cc
- ${AM_SOURCE_DIR}/src/policies/policy_retry_sequence.cc
- )
file (GLOB EVENT_ENGINE
${AM_SOURCE_DIR}/src/event_engine/*
@@ -87,11 +115,14 @@ file (GLOB MOBILE_COMMANDS_SOURCES
${AM_SOURCE_DIR}/src/commands/hmi/on_update_device_list.cc
${AM_SOURCE_DIR}/src/commands/hmi/update_device_list_request.cc
${AM_SOURCE_DIR}/src/commands/hmi/update_device_list_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_audio_data_streaming_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_video_data_streaming_notification.cc
${AM_SOURCE_DIR}/src/commands/hmi/on_sdl_consent_needed_notification.cc
${AM_SOURCE_DIR}/src/commands/hmi/on_sdl_persistence_complete_notification.cc
${AM_SOURCE_DIR}/src/commands/hmi/on_exit_all_applications_notification.cc
${AM_SOURCE_DIR}/src/commands/hmi/on_exit_application_notification.cc
${AM_SOURCE_DIR}/src/commands/hmi/on_start_device_discovery.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_emergency_event_notification.cc
${AM_SOURCE_DIR}/src/commands/hmi/close_popup_request.cc
${AM_SOURCE_DIR}/src/commands/hmi/close_popup_response.cc
${AM_SOURCE_DIR}/src/commands/hmi/on_app_activated_notification.cc
@@ -163,8 +194,8 @@ file (GLOB MOBILE_COMMANDS_SOURCES
${AM_SOURCE_DIR}/src/commands/hmi/ui_end_audio_pass_thru_response.cc
${AM_SOURCE_DIR}/src/commands/hmi/ui_perform_interaction_request.cc
${AM_SOURCE_DIR}/src/commands/hmi/ui_perform_interaction_response.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_icon_request.cc
- ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_icon_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_app_icon_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_app_icon_response.cc
${AM_SOURCE_DIR}/src/commands/hmi/ui_set_media_clock_timer_request.cc
${AM_SOURCE_DIR}/src/commands/hmi/ui_set_media_clock_timer_response.cc
${AM_SOURCE_DIR}/src/commands/hmi/ui_show_request.cc
@@ -215,6 +246,7 @@ file (GLOB MOBILE_COMMANDS_SOURCES
${AM_SOURCE_DIR}/src/commands/hmi/on_ui_language_change_notification.cc
${AM_SOURCE_DIR}/src/commands/hmi/on_button_event_notification.cc
${AM_SOURCE_DIR}/src/commands/hmi/on_button_press_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_button_subscription_notification.cc
${AM_SOURCE_DIR}/src/commands/hmi/on_find_applications.cc
${AM_SOURCE_DIR}/src/commands/hmi/on_ui_keyboard_input_notification.cc
${AM_SOURCE_DIR}/src/commands/hmi/on_ui_touch_event_notification.cc
@@ -291,9 +323,14 @@ if (${HMI_DBUS_API})
endif (${HMI_DBUS_API})
SET (LIBRARIES
+ HMI_API
+ MOBILE_API
+ v4_protocol_v1_2_no_extra
+ ProtocolLibrary
+ SmartObjects
UsageStatistics
dl
- ProtocolLibrary
+ formatters
)
IF(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
index 5f1f59885..1197bbb81 100644
--- a/src/components/application_manager/include/application_manager/application.h
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,14 +35,19 @@
#include <string>
#include <map>
+#include <set>
+#include <list>
#include "utils/shared_ptr.h"
+#include "utils/data_accessor.h"
#include "interfaces/MOBILE_API.h"
#include "connection_handler/device.h"
#include "application_manager/message.h"
-#include <set>
+#include "application_manager/hmi_state.h"
+#include "protocol_handler/protocol_handler.h"
namespace NsSmartDeviceLink {
namespace NsSmartObjects {
+
class SmartObject;
}
}
@@ -61,7 +66,8 @@ enum APIVersion {
kAPIV0 = 0,
kAPIV1 = 1,
kAPIV2 = 2,
- kAPIV3 = 3
+ kAPIV3 = 3,
+ kAPIV4 = 4
};
enum TLimitSource {
@@ -104,7 +110,7 @@ class InitialApplicationData {
virtual const smart_objects::SmartObject* app_types() const = 0;
virtual const smart_objects::SmartObject* vr_synonyms() const = 0;
- virtual const smart_objects::SmartObject* mobile_app_id() const = 0;
+ virtual std::string mobile_app_id() const = 0;
virtual const smart_objects::SmartObject* tts_name() const = 0;
virtual const smart_objects::SmartObject* ngn_media_screen_name() const = 0;
virtual const mobile_api::Language::eType& language() const = 0;
@@ -112,8 +118,7 @@ class InitialApplicationData {
virtual void set_app_types(const smart_objects::SmartObject& app_types) = 0;
virtual void set_vr_synonyms(
const smart_objects::SmartObject& vr_synonyms) = 0;
- virtual void set_mobile_app_id(
- const smart_objects::SmartObject& mobile_app_id) = 0;
+ virtual void set_mobile_app_id(const std::string& mobile_app_id) = 0;
virtual void set_tts_name(const smart_objects::SmartObject& tts_name) = 0;
virtual void set_ngn_media_screen_name(
const smart_objects::SmartObject& ngn_name) = 0;
@@ -138,9 +143,18 @@ typedef std::map<uint32_t, smart_objects::SmartObject*> SubMenuMap;
typedef std::map<uint32_t, smart_objects::SmartObject*> ChoiceSetMap;
/*
+ * @brief Typedef for perform interaction choice
+ * @param choice id
+ * @param SmartObject choice
+ */
+typedef std::map<uint32_t, smart_objects::SmartObject*> PerformChoice;
+
+/*
* @brief Typedef for perform interaction choice set
+ * @param request corellation id
+ * @param map of choices
*/
-typedef std::map<uint32_t, smart_objects::SmartObject*> PerformChoiceSetMap;
+typedef std::map<uint32_t, PerformChoice> PerformChoiceSetMap;
/**
* @brief Defines id of SoftButton
@@ -164,6 +178,7 @@ class DynamicApplicationData {
virtual const smart_objects::SmartObject* menu_title() const = 0;
virtual const smart_objects::SmartObject* menu_icon() const = 0;
+ virtual void load_global_properties(const smart_objects::SmartObject& so) = 0;
virtual void set_help_prompt(
const smart_objects::SmartObject& help_prompt) = 0;
virtual void set_timeout_prompt(
@@ -184,6 +199,17 @@ class DynamicApplicationData {
const smart_objects::SmartObject& menu_title) = 0;
virtual void set_menu_icon(
const smart_objects::SmartObject& menu_icon) = 0;
+
+ virtual uint32_t audio_stream_retry_number() const = 0;
+
+ virtual void set_audio_stream_retry_number(
+ const uint32_t& audio_stream_retry_number) = 0;
+
+ virtual uint32_t video_stream_retry_number() const = 0;
+
+ virtual void set_video_stream_retry_number(
+ const uint32_t& video_stream_retry_number) = 0;
+
/*
* @brief Adds a command to the in application menu
*/
@@ -250,52 +276,43 @@ class DynamicApplicationData {
/*
* @brief Adds perform interaction choice set to the application
*
- * @param choice_set_id Unique ID used for this interaction choice set
+ * @param correlation_id Unique ID of the request that added this choice set
+ * @param choice_set_id Unique ID used for this interaction choice set
* @param choice_set SmartObject that represents choice set
*/
virtual void AddPerformInteractionChoiceSet(
- uint32_t choice_set_id,
+ uint32_t correlation_id, uint32_t choice_set_id,
const smart_objects::SmartObject& choice_set) = 0;
/*
- * @brief Deletes entirely perform interaction choice set map
+ * @brief Deletes entirely perform interaction choice set for request
+ * @param correlation_id Unique ID of the request that added this choice set
*
*/
- virtual void DeletePerformInteractionChoiceSetMap() = 0;
+ virtual void DeletePerformInteractionChoiceSet(uint32_t correlation_id) = 0;
/*
* @brief Retrieves entirely ChoiceSet - VR commands map
*
* @return ChoiceSet map that is currently in use
*/
- virtual const PerformChoiceSetMap&
+ virtual DataAccessor<PerformChoiceSetMap>
performinteraction_choice_set_map() const = 0;
/*
- * @brief Retrieves choice set that is currently in use by perform
- * interaction
- *
- * @param choice_set_id Unique ID of the interaction choice set
- *
- * @return SmartObject that represents choice set
- */
- virtual smart_objects::SmartObject* FindPerformInteractionChoiceSet(
- uint32_t choice_set_id) const = 0;
-
- /*
* @brief Retrieve application commands
*/
- virtual const CommandsMap& commands_map() const = 0;
+ virtual DataAccessor<CommandsMap> commands_map() const = 0;
/*
* @brief Retrieve application sub menus
*/
- virtual const SubMenuMap& sub_menu_map() const = 0;
+ virtual DataAccessor<SubMenuMap> sub_menu_map() const = 0;
/*
* @brief Retrieve application choice set map
*/
- virtual const ChoiceSetMap& choice_set_map() const = 0;
+ virtual DataAccessor<ChoiceSetMap> choice_set_map() const = 0;
/*
* @brief Sets perform interaction state
@@ -312,22 +329,6 @@ class DynamicApplicationData {
virtual uint32_t is_perform_interaction_active() const = 0;
/*
- * @brief Sets the choice that was selected in
- * response to PerformInteraction
- *
- * @param choice Choice that was selected
- */
- virtual void set_perform_interaction_ui_corrid(uint32_t choice) = 0;
-
- /*
- * @brief Retrieve the choice that was selected in
- * response to PerformInteraction
- *
- * @return Choice that was selected in response to PerformInteraction
- */
- virtual uint32_t perform_interaction_ui_corrid() const = 0;
-
- /*
* @brief Sets the mode for perform interaction: UI/VR/BOTH
*
* @param mode Mode that was selected (MENU; VR; BOTH)
@@ -358,7 +359,18 @@ class DynamicApplicationData {
class Application : public virtual InitialApplicationData,
public virtual DynamicApplicationData {
+
+ public:
+ enum ApplicationState {
+ kRegistered = 0,
+ kWaitingForRegistration
+ };
+
public:
+ Application() :
+ is_greyed_out_(false) {
+ }
+
virtual ~Application() {
}
@@ -370,41 +382,69 @@ class Application : public virtual InitialApplicationData,
virtual const smart_objects::SmartObject* active_message() const = 0;
/**
- * @brief Change Hash value and return it
- * @return next Hash value
- */
- virtual uint32_t nextHash() = 0;
-
- /**
- * @brief returns cuurent hash value
- * @return current Hash value
+ * @brief returns current hash value
+ * @return current hash value
*/
- virtual uint32_t curHash() const = 0;
+ virtual const std::string& curHash() const = 0;
/**
* @brief Change Hash for current application
* and send notification to mobile
* @return updated_hash
*/
- virtual uint32_t UpdateHash() = 0;
+ virtual void UpdateHash() = 0;
virtual void CloseActiveMessage() = 0;
virtual bool IsFullscreen() const = 0;
- virtual bool MakeFullscreen() = 0;
- virtual bool IsAudible() const = 0;
- virtual void MakeNotAudible() = 0;
- virtual bool allowed_support_navigation() const = 0;
- virtual void set_allowed_support_navigation(bool allow) = 0;
- virtual bool hmi_supports_navi_video_streaming() const = 0;
- virtual void set_hmi_supports_navi_video_streaming(bool supports) = 0;
- virtual bool hmi_supports_navi_audio_streaming() const = 0;
- virtual void set_hmi_supports_navi_audio_streaming(bool supports) = 0;
+ virtual void ChangeSupportingAppHMIType() = 0;
+
+ virtual bool is_navi() const = 0;
+ virtual void set_is_navi(bool allow) = 0;
+
+ virtual bool video_streaming_approved() const = 0;
+ virtual void set_video_streaming_approved(bool state) = 0;
+ virtual bool audio_streaming_approved() const = 0;
+ virtual void set_audio_streaming_approved(bool state) = 0;
+
+ virtual bool video_streaming_allowed() const = 0;
+ virtual void set_video_streaming_allowed(bool state) = 0;
+ virtual bool audio_streaming_allowed() const = 0;
+ virtual void set_audio_streaming_allowed(bool state) = 0;
+
+ /**
+ * @brief Starts streaming service for application
+ * @param service_type Type of streaming service
+ */
+ virtual void StartStreaming(
+ protocol_handler::ServiceType service_type) = 0;
+
+ /**
+ * @brief Stops streaming service for application
+ * @param service_type Type of streaming service
+ */
+ virtual void StopStreaming(
+ protocol_handler::ServiceType service_type) = 0;
+
+ /**
+ * @brief Suspends streaming process for application
+ * @param service_type Type of streaming service
+ */
+ virtual void SuspendStreaming(
+ protocol_handler::ServiceType service_type) = 0;
+
+ /**
+ * @brief Wakes up streaming process for application
+ * @param service_type Type of streaming service
+ */
+ virtual void WakeUpStreaming(
+ protocol_handler::ServiceType service_type) = 0;
virtual bool is_voice_communication_supported() const = 0;
virtual void set_voice_communication_supported(
bool is_voice_communication_supported) = 0;
virtual bool app_allowed() const = 0;
virtual bool has_been_activated() const = 0;
+ virtual bool set_activated(bool is_active) = 0;
virtual const Version& version() const = 0;
virtual void set_hmi_application_id(uint32_t hmi_app_id) = 0;
@@ -413,25 +453,47 @@ class Application : public virtual InitialApplicationData,
virtual const std::string& name() const = 0;
virtual const std::string folder_name() const = 0;
virtual bool is_media_application() const = 0;
- virtual const mobile_api::HMILevel::eType& hmi_level() const = 0;
+ virtual bool is_foreground() const = 0;
+ virtual void set_foreground(bool is_foreground) = 0;
+ virtual const mobile_api::HMILevel::eType hmi_level() const = 0;
virtual const uint32_t put_file_in_none_count() const = 0;
virtual const uint32_t delete_file_in_none_count() const = 0;
virtual const uint32_t list_files_in_none_count() const = 0;
- virtual const mobile_api::SystemContext::eType& system_context() const = 0;
- virtual const mobile_api::AudioStreamingState::eType&
+ virtual const mobile_api::SystemContext::eType system_context() const = 0;
+ virtual const mobile_api::AudioStreamingState::eType
audio_streaming_state() const = 0;
virtual const std::string& app_icon_path() const = 0;
virtual connection_handler::DeviceHandle device() const = 0;
- virtual void set_tts_speak_state(bool state_tts_speak) = 0;
virtual bool tts_speak_state() = 0;
+
+ /**
+ * @brief Active states of application
+ */
+ DataAccessor<HmiStateList> GetHmiStateListAccessor() {
+ DataAccessor<HmiStateList> hmi_states_da =
+ DataAccessor<HmiStateList>(hmi_states_, hmi_states_lock_);
+ return hmi_states_da;
+ }
+
+ /**
+ * @brief Current hmi state
+ */
+ virtual const HmiStatePtr CurrentHmiState() const = 0;
+
+
+ /**
+ * @brief RegularHmiState of application without active events VR, TTS etc ...
+ * @return HmiState of application
+ */
+ virtual const HmiStatePtr RegularHmiState() const = 0;
+
/**
* @brief sets true if application has sent TTS GlobalProperties
* request with empty array help_prompt to HMI with level
* NONE BACKGROUND
* @param active contains state of sending TTS GlobalProperties
*/
- virtual void set_tts_properties_in_none(
- bool active) = 0;
+ virtual void set_tts_properties_in_none(bool active) = 0;
/**
* @brief returns true if application has sent TTS GlobalProperties
* otherwise return false
@@ -455,14 +517,9 @@ class Application : public virtual InitialApplicationData,
virtual void set_version(const Version& version) = 0;
virtual void set_name(const std::string& name) = 0;
virtual void set_is_media_application(bool is_media) = 0;
- virtual void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) = 0;
virtual void increment_put_file_in_none_count() = 0;
virtual void increment_delete_file_in_none_count() = 0;
virtual void increment_list_files_in_none_count() = 0;
- virtual void set_system_context(
- const mobile_api::SystemContext::eType& system_context) = 0;
- virtual void set_audio_streaming_state(
- const mobile_api::AudioStreamingState::eType& state) = 0;
virtual bool set_app_icon_path(const std::string& file_name) = 0;
virtual void set_app_allowed(const bool& allowed) = 0;
virtual void set_device(connection_handler::DeviceHandle device) = 0;
@@ -496,6 +553,11 @@ class Application : public virtual InitialApplicationData,
virtual bool UnsubscribeFromIVI(uint32_t vehicle_info_type_) = 0;
/**
+ * @brief ResetDataInNone reset data counters in NONE
+ */
+ virtual void ResetDataInNone() = 0;
+
+ /**
* @brief Check, if limits for command number per time is exceeded
* @param cmd_id Unique command id from mobile API
* @param source Limits source, e.g. policy table, config file etc.
@@ -511,6 +573,32 @@ class Application : public virtual InitialApplicationData,
virtual UsageStatistics& usage_report() = 0;
/**
+ * @brief SetRegularState set permanent state of application
+ * @param state state to setup
+ */
+ virtual void SetRegularState(HmiStatePtr state) = 0;
+
+ /**
+ * @brief AddHMIState the function that will change application's
+ * hmi state.
+ *
+ * @param app_id id of the application whose hmi level should be changed.
+ *
+ * @param state new hmi state for certain application.
+ */
+ virtual void AddHMIState(HmiStatePtr state) = 0;
+
+ /**
+ * @brief RemoveHMIState the function that will turn back hmi_level after end
+ * of some event
+ *
+ * @param app_id id of the application whose hmi level should be changed.
+ *
+ * @param state_id that should be removed
+ */
+ virtual void RemoveHMIState(HmiState::StateID state_id) = 0;
+
+ /**
* @brief Keeps id of softbuttons which is created in commands:
* Alert, Show, ScrollableMessage, ShowConstantTBT, AlertManeuver, UpdateTurnList
* @param cmd_id Unique command id from mobile API
@@ -539,15 +627,88 @@ class Application : public virtual InitialApplicationData,
*/
virtual bool IsAudioApplication() const = 0;
+ /**
+ * @brief IsRegistered allows to distinguish if this
+ * application has been registered.
+ *
+ * @return true if registered, false otherwise.
+ */
+ bool IsRegistered() const { return app_state_ == kRegistered;}
+
+ /**
+ * @brief MarkRegistered allows to mark application as registered.
+ */
+ void MarkRegistered() {app_state_ = kRegistered;}
+
+ /**
+ * @brief MarkUnregistered allows to mark application as unregistered.
+ */
+ void MarkUnregistered() {app_state_ = kWaitingForRegistration;}
+
+ /**
+ * @brief schemaUrl contains application's url (for 4th protocol version)
+ *
+ * @return application's url.
+ */
+ std::string SchemaUrl() const {return url_;}
+
+ /**
+ * @brief SetShemaUrl allows to store schema url for application.
+ *
+ * @param url url to store.
+ */
+ void SetShemaUrl(const std::string& url) {url_ = url;}
+
+ /**
+ * @brief packagName allows to obtain application's package name.
+ *
+ * @return pakage name.
+ */
+ std::string PackageName() const {return package_name_;}
+
+ /**
+ * @brief SetPackageName allows to store package name for application.
+ *
+ * @param packageName package name to store.
+ */
+ void SetPackageName(const std::string& packageName) {
+ package_name_ = packageName;
+ }
+
+ /**
+ * @brief GetDeviceId allows to obtain device id which posseses
+ * by this application.
+ *
+ * @return device the device id.
+ */
+ std::string GetDeviceId() const {return device_id_;}
+
+ /**
+ * @brief Returns is application should be greyed out on HMI
+ */
+ bool is_greyed_out() const {return is_greyed_out_;}
+
+ /**
+ * @brief Sets application as should be greyed out on HMI
+ * @param is_greyed_out True, if should be greyed out on HMI,
+ * otherwise - false
+ */
+ void set_greyed_out(bool is_greyed_out) {is_greyed_out_ = is_greyed_out;}
+
protected:
- // interfaces for NAVI retry sequence
- virtual bool video_stream_retry_active() const = 0;
- virtual void set_video_stream_retry_active(bool active) = 0;
- virtual bool audio_stream_retry_active() const = 0;
- virtual void set_audio_stream_retry_active(bool active) = 0;
- virtual void OnVideoStreamRetry() = 0;
- virtual void OnAudioStreamRetry() = 0;
+ /**
+ * @brief Active states of application
+ */
+ HmiStateList hmi_states_;
+ mutable sync_primitives::Lock hmi_states_lock_;
+
+ ApplicationState app_state_;
+ std::string url_;
+ std::string package_name_;
+ std::string device_id_;
+ ssize_t connection_id_;
+ bool is_greyed_out_;
};
typedef utils::SharedPtr<Application> ApplicationSharedPtr;
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 556eee434..62d3d1c8c 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -34,6 +34,7 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_DATA_IMPL_H_
#include <string>
+#include "utils/lock.h"
#include "smart_objects/smart_object.h"
#include "application_manager/application.h"
#include "interfaces/MOBILE_API.h"
@@ -49,14 +50,14 @@ class InitialApplicationDataImpl : public virtual Application {
const smart_objects::SmartObject* app_types() const;
const smart_objects::SmartObject* vr_synonyms() const;
- const smart_objects::SmartObject* mobile_app_id() const;
+ virtual std::string mobile_app_id() const;
const smart_objects::SmartObject* tts_name() const;
const smart_objects::SmartObject* ngn_media_screen_name() const;
const mobile_api::Language::eType& language() const;
const mobile_api::Language::eType& ui_language() 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 smart_objects::SmartObject& mobile_app_id);
+ void set_mobile_app_id(const std::string& mobile_app_id);
void set_tts_name(const smart_objects::SmartObject& tts_name);
void set_ngn_media_screen_name(const smart_objects::SmartObject& ngn_name);
void set_language(const mobile_api::Language::eType& language);
@@ -65,7 +66,7 @@ class InitialApplicationDataImpl : public virtual Application {
protected:
smart_objects::SmartObject* app_types_;
smart_objects::SmartObject* vr_synonyms_;
- smart_objects::SmartObject* mobile_app_id_;
+ std::string mobile_app_id_;
smart_objects::SmartObject* tts_name_;
smart_objects::SmartObject* ngn_media_screen_name_;
mobile_api::Language::eType language_;
@@ -89,6 +90,7 @@ class DynamicApplicationDataImpl : public virtual Application {
const smart_objects::SmartObject* menu_title() const;
const smart_objects::SmartObject* menu_icon() const;
+ void load_global_properties(const smart_objects::SmartObject& properties_so);
void set_help_prompt(const smart_objects::SmartObject& help_prompt);
void set_timeout_prompt(const smart_objects::SmartObject& timeout_prompt);
void set_vr_help_title(const smart_objects::SmartObject& vr_help_title);
@@ -163,50 +165,41 @@ class DynamicApplicationDataImpl : public virtual Application {
/*
* @brief Adds perform interaction choice set to the application
*
+ * @param correlation_id Unique ID of the request that added this choice set
* @param choice_set_id Unique ID used for this interaction choice set
* @param choice_set SmartObject that represents choice set
*/
- void AddPerformInteractionChoiceSet(
+ void AddPerformInteractionChoiceSet(uint32_t correlation_id,
uint32_t choice_set_id, const smart_objects::SmartObject& choice_set);
/*
* @brief Deletes entirely perform interaction choice set map
+ * @param correlation_id Unique ID of the request that added this choice set
*
*/
- void DeletePerformInteractionChoiceSetMap();
+ void DeletePerformInteractionChoiceSet(uint32_t correlation_id);
/*
* @brief Retrieves entirely ChoiceSet - VR commands map
*
* @return ChoiceSet map that is currently in use
*/
- inline const PerformChoiceSetMap& performinteraction_choice_set_map() const;
-
- /*
- * @brief Retrieves choice set that is currently in use by perform
- * interaction
- *
- * @param choice_set_id Unique ID of the interaction choice set
- *
- * @return SmartObject that represents choice set
- */
- smart_objects::SmartObject* FindPerformInteractionChoiceSet(
- uint32_t choice_set_id) const;
+ inline DataAccessor<PerformChoiceSetMap> performinteraction_choice_set_map() const;
/*
* @brief Retrieve application commands
*/
- inline const CommandsMap& commands_map() const;
+ inline DataAccessor<CommandsMap> commands_map() const;
/*
* @brief Retrieve application sub menus
*/
- inline const SubMenuMap& sub_menu_map() const;
+ inline DataAccessor<SubMenuMap> sub_menu_map() const;
/*
* @brief Retrieve application choice set map
*/
- inline const ChoiceSetMap& choice_set_map() const;
+ inline DataAccessor<ChoiceSetMap> choice_set_map() const;
/*
* @brief Sets perform interaction state
@@ -223,21 +216,6 @@ class DynamicApplicationDataImpl : public virtual Application {
inline uint32_t is_perform_interaction_active() const;
/*
- * @brief Sets the choice that was selected in
- * response to PerformInteraction
- *
- * @param choice Choice that was selected
- */
- void set_perform_interaction_ui_corrid(uint32_t corr_id);
-
- /*
- * @brief Retrieve the choice that was selected in
- * response to PerformInteraction
- *
- * @return Choice that was selected in response to PerformInteraction
- */
- inline uint32_t perform_interaction_ui_corrid() const;
- /*
* @brief Sets the mode for perform interaction: UI/VR/BOTH
*
* @param mode Mode that was selected (MENU; VR; BOTH)
@@ -265,7 +243,7 @@ class DynamicApplicationDataImpl : public virtual Application {
*/
inline bool is_reset_global_properties_active() const;
- protected:
+protected:
smart_objects::SmartObject* help_prompt_;
smart_objects::SmartObject* timeout_prompt_;
smart_objects::SmartObject* vr_help_title_;
@@ -279,46 +257,51 @@ class DynamicApplicationDataImpl : public virtual Application {
CommandsMap commands_;
+ mutable sync_primitives::Lock commands_lock_;
SubMenuMap sub_menu_;
+ mutable sync_primitives::Lock sub_menu_lock_;
ChoiceSetMap choice_set_map_;
+ mutable sync_primitives::Lock choice_set_map_lock_;
PerformChoiceSetMap performinteraction_choice_set_map_;
+ mutable sync_primitives::Lock performinteraction_choice_set_lock_;
uint32_t is_perform_interaction_active_;
- uint32_t perform_interaction_ui_corrid_;
bool is_reset_global_properties_active_;
int32_t perform_interaction_mode_;
- private:
+
+private:
+ void SetGlobalProperties(const smart_objects::SmartObject& param,
+ void (DynamicApplicationData::*callback)(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject&));
DISALLOW_COPY_AND_ASSIGN(DynamicApplicationDataImpl);
};
-const CommandsMap& DynamicApplicationDataImpl::commands_map() const {
- return commands_;
+DataAccessor<CommandsMap> DynamicApplicationDataImpl::commands_map() const {
+ return DataAccessor<CommandsMap>(commands_, commands_lock_);
}
-const SubMenuMap& DynamicApplicationDataImpl::sub_menu_map() const {
- return sub_menu_;
+DataAccessor<SubMenuMap> DynamicApplicationDataImpl::sub_menu_map() const {
+ return DataAccessor<SubMenuMap>(sub_menu_, sub_menu_lock_);
}
-const ChoiceSetMap& DynamicApplicationDataImpl::choice_set_map() const {
- return choice_set_map_;
+DataAccessor<ChoiceSetMap> DynamicApplicationDataImpl::choice_set_map() const {
+ return DataAccessor<ChoiceSetMap>(choice_set_map_, choice_set_map_lock_);
}
-uint32_t DynamicApplicationDataImpl::is_perform_interaction_active() const {
- return is_perform_interaction_active_;
+DataAccessor<PerformChoiceSetMap>
+DynamicApplicationDataImpl::performinteraction_choice_set_map() const {
+ return DataAccessor<PerformChoiceSetMap>(
+ performinteraction_choice_set_map_,
+ performinteraction_choice_set_lock_);
}
-uint32_t DynamicApplicationDataImpl::perform_interaction_ui_corrid() const {
- return perform_interaction_ui_corrid_;
+uint32_t DynamicApplicationDataImpl::is_perform_interaction_active() const {
+ return is_perform_interaction_active_;
}
bool DynamicApplicationDataImpl::is_reset_global_properties_active() const {
return is_reset_global_properties_active_;
}
-const PerformChoiceSetMap&
-DynamicApplicationDataImpl::performinteraction_choice_set_map() const {
- return performinteraction_choice_set_map_;
-}
-
inline int32_t DynamicApplicationDataImpl::perform_interaction_mode() const {
return perform_interaction_mode_;
}
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 dadfce092..f23b53632 100644
--- a/src/components/application_manager/include/application_manager/application_impl.h
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,19 +37,27 @@
#include <set>
#include <vector>
#include <utility>
+#include <list>
#include "utils/date_time.h"
#include "application_manager/application_data_impl.h"
#include "application_manager/usage_statistics.h"
+#include "application_manager/hmi_state.h"
+#include "protocol_handler/protocol_handler.h"
+
#include "connection_handler/device.h"
#include "utils/timer_thread.h"
#include "utils/lock.h"
namespace usage_statistics {
+
class StatisticsManager;
} // namespace usage_statistics
namespace application_manager {
+using namespace utils;
+using namespace timer;
+
namespace mobile_api = mobile_apis;
class ApplicationImpl : public virtual InitialApplicationDataImpl,
@@ -70,23 +78,41 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
const smart_objects::SmartObject* active_message() const;
void CloseActiveMessage();
bool IsFullscreen() const;
- bool MakeFullscreen();
- bool IsAudible() const;
- void MakeNotAudible();
-
- // navi
- bool allowed_support_navigation() const;
- void set_allowed_support_navigation(bool allow);
- bool hmi_supports_navi_video_streaming() const;
- void set_hmi_supports_navi_video_streaming(bool supports);
- bool hmi_supports_navi_audio_streaming() const;
- void set_hmi_supports_navi_audio_streaming(bool supports);
+
+ /**
+ * @brief change supporting COMMUNICATION NAVIGATION
+ */
+ virtual void ChangeSupportingAppHMIType();
+
+ inline bool is_navi() const { return is_navi_; }
+ void set_is_navi(bool allow);
+
+ bool video_streaming_approved() const;
+ void set_video_streaming_approved(bool state);
+ bool audio_streaming_approved() const;
+ void set_audio_streaming_approved(bool state);
+
+ bool video_streaming_allowed() const;
+ void set_video_streaming_allowed(bool state);
+ bool audio_streaming_allowed() const;
+ void set_audio_streaming_allowed(bool state);
+
+ void StartStreaming(
+ protocol_handler::ServiceType service_type);
+ void StopStreaming(
+ protocol_handler::ServiceType service_type);
+
+ void SuspendStreaming(
+ protocol_handler::ServiceType service_type);
+ void WakeUpStreaming(
+ protocol_handler::ServiceType service_type);
virtual bool is_voice_communication_supported() const;
virtual void set_voice_communication_supported(
bool is_voice_communication_supported);
inline bool app_allowed() const;
bool has_been_activated() const;
+ bool set_activated(bool is_active);
const Version& version() const;
void set_hmi_application_id(uint32_t hmi_app_id);
@@ -95,16 +121,16 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
const std::string& name() const;
const std::string folder_name() const;
bool is_media_application() const;
- const mobile_api::HMILevel::eType& hmi_level() const;
+ virtual bool is_foreground() const;
+ virtual void set_foreground(bool is_foreground);
+ virtual const mobile_api::HMILevel::eType hmi_level() const;
const uint32_t put_file_in_none_count() const;
const uint32_t delete_file_in_none_count() const;
const uint32_t list_files_in_none_count() const;
- const mobile_api::SystemContext::eType& system_context() const;
- inline const mobile_api::AudioStreamingState::eType&
- audio_streaming_state() const;
+ const mobile_api::SystemContext::eType system_context() const;
+ inline const mobile_apis::AudioStreamingState::eType audio_streaming_state() const;
const std::string& app_icon_path() const;
connection_handler::DeviceHandle device() const;
- void set_tts_speak_state(bool state_tts_speak);
bool tts_speak_state();
void set_tts_properties_in_none(bool active);
bool tts_properties_in_none();
@@ -113,20 +139,16 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
void set_version(const Version& ver);
void set_name(const std::string& name);
void set_is_media_application(bool is_media);
- void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level);
void increment_put_file_in_none_count();
void increment_delete_file_in_none_count();
void increment_list_files_in_none_count();
- void set_system_context(
- const mobile_api::SystemContext::eType& system_context);
- void set_audio_streaming_state(
- const mobile_api::AudioStreamingState::eType& state);
bool set_app_icon_path(const std::string& path);
void set_app_allowed(const bool& allowed);
void set_device(connection_handler::DeviceHandle device);
virtual uint32_t get_grammar_id() const;
virtual void set_grammar_id(uint32_t value);
+
virtual void set_protocol_version(const ProtocolVersion& protocol_version);
virtual ProtocolVersion protocol_version() const;
@@ -146,18 +168,21 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
bool IsSubscribedToIVI(uint32_t vehicle_info_type_);
bool UnsubscribeFromIVI(uint32_t vehicle_info_type_);
+ /**
+ * @brief ResetDataInNone reset data counters in NONE
+ */
+ virtual void ResetDataInNone();
+
virtual const std::set<mobile_apis::ButtonName::eType>& SubscribedButtons() const;
virtual const std::set<uint32_t>& SubscribesIVI() const;
- virtual uint32_t nextHash();
- virtual uint32_t curHash() const;
-
+ virtual const std::string& curHash() const;
/**
* @brief Change Hash for current application
* and send notification to mobile
* @return updated_hash
*/
- virtual uint32_t UpdateHash();
+ virtual void UpdateHash();
UsageStatistics& usage_report();
@@ -176,7 +201,53 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
*/
virtual bool IsAudioApplication() const;
- protected:
+ /*
+ * @brief SetRegularState set permanent state of application
+ * @param state state to setup
+ */
+ virtual void SetRegularState(HmiStatePtr state);
+
+ /**
+ * @brief AddHMIState the function that will change application's
+ * hmi state.
+ *
+ * @param app_id id of the application whose hmi level should be changed.
+ *
+ * @param state new hmi state for certain application.
+ */
+ virtual void AddHMIState(HmiStatePtr state);
+
+ /**
+ * @brief RemoveHMIState the function that will turn back hmi_level after end
+ * of some event
+ *
+ * @param app_id id of the application whose hmi level should be changed.
+ *
+ * @param state_id that should be removed
+ */
+ virtual void RemoveHMIState(HmiState::StateID state_id);
+
+ /**
+ * @brief HmiState of application within active events PhoneCall, TTS< etc ...
+ * @return Active HmiState of application
+ */
+ virtual const HmiStatePtr CurrentHmiState() const;
+
+ /**
+ * @brief RegularHmiState of application without active events VR, TTS etc ...
+ * @return HmiState of application
+ */
+ virtual const HmiStatePtr RegularHmiState() const;
+
+ uint32_t audio_stream_retry_number() const;
+
+ void set_audio_stream_retry_number(const uint32_t& audio_stream_retry_number);
+
+ uint32_t video_stream_retry_number() const;
+
+ void set_video_stream_retry_number(const uint32_t& video_stream_retry_number);
+
+ protected:
/**
* @brief Clean up application folder. Persistent files will stay
@@ -189,18 +260,22 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
void LoadPersistentFiles();
private:
+ typedef SharedPtr<TimerThread<ApplicationImpl>> ApplicationTimerPtr;
- // interfaces for NAVI retry sequence
- bool video_stream_retry_active() const;
- void set_video_stream_retry_active(bool active);
- bool audio_stream_retry_active() const;
- void set_audio_stream_retry_active(bool active);
- void OnVideoStreamRetry();
- void OnAudioStreamRetry();
+ /**
+ * @brief Callback for video streaming suspend timer.
+ * Suspends video streaming process for application
+ */
+ void OnVideoStreamSuspend();
- uint32_t hash_val_;
- uint32_t grammar_id_;
+ /**
+ * @brief Callback for audio streaming suspend timer.
+ * Suspends audio streaming process for application
+ */
+ void OnAudioStreamSuspend();
+ std::string hash_val_;
+ uint32_t grammar_id_;
Version version_;
std::string app_name_;
@@ -208,20 +283,25 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
uint32_t app_id_;
smart_objects::SmartObject* active_message_;
bool is_media_;
- bool allowed_support_navigation_;
- bool hmi_supports_navi_video_streaming_;
- bool hmi_supports_navi_audio_streaming_;
+ bool is_navi_;
+
+ bool video_streaming_approved_;
+ bool audio_streaming_approved_;
+ bool video_streaming_allowed_;
+ bool audio_streaming_allowed_;
+ bool video_streaming_suspended_;
+ bool audio_streaming_suspended_;
+ sync_primitives::Lock video_streaming_suspended_lock_;
+ sync_primitives::Lock audio_streaming_suspended_lock_;
+
bool is_app_allowed_;
bool has_been_activated_;
- bool tts_speak_state_;
bool tts_properties_in_none_;
bool tts_properties_in_full_;
- mobile_api::HMILevel::eType hmi_level_;
+ bool is_foreground_;
uint32_t put_file_in_none_count_;
uint32_t delete_file_in_none_count_;
uint32_t list_files_in_none_count_;
- mobile_api::SystemContext::eType system_context_;
- mobile_api::AudioStreamingState::eType audio_streaming_state_;
std::string app_icon_path_;
connection_handler::DeviceHandle device_;
@@ -232,14 +312,12 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
ProtocolVersion protocol_version_;
bool is_voice_communication_application_;
- // NAVI retry stream
- volatile bool is_video_stream_retry_active_;
- volatile bool is_audio_stream_retry_active_;
uint32_t video_stream_retry_number_;
uint32_t audio_stream_retry_number_;
- utils::SharedPtr<timer::TimerThread<ApplicationImpl>> video_stream_retry_timer_;
- utils::SharedPtr<timer::TimerThread<ApplicationImpl>> audio_stream_retry_timer_;
-
+ uint32_t video_stream_suspend_timeout_;
+ uint32_t audio_stream_suspend_timeout_;
+ ApplicationTimerPtr video_stream_suspend_timer_;
+ ApplicationTimerPtr audio_stream_suspend_timer_;
/**
* @brief Defines number per time in seconds limits
@@ -272,9 +350,12 @@ uint32_t ApplicationImpl::app_id() const {
return app_id_;
}
-const mobile_api::AudioStreamingState::eType&
+const mobile_api::AudioStreamingState::eType
ApplicationImpl::audio_streaming_state() const {
- return audio_streaming_state_;
+ using namespace mobile_apis;
+ const HmiStatePtr hmi_state = CurrentHmiState();
+ return hmi_state ? hmi_state->audio_streaming_state() :
+ AudioStreamingState::INVALID_ENUM;
}
bool ApplicationImpl::app_allowed() const {
diff --git a/src/components/application_manager/include/application_manager/application_manager.h b/src/components/application_manager/include/application_manager/application_manager.h
index 6ca85a5d3..c5a040268 100644
--- a/src/components/application_manager/include/application_manager/application_manager.h
+++ b/src/components/application_manager/include/application_manager/application_manager.h
@@ -47,7 +47,6 @@ namespace connection_handler {
namespace application_manager {
class Application;
-class HMIMatrix;
class ApplicationManager {
public:
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 dacac9e01..2961202bd 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
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -37,22 +37,27 @@
#include <vector>
#include <map>
#include <set>
+#include <deque>
+#include <algorithm>
+
#include "application_manager/hmi_command_factory.h"
#include "application_manager/application_manager.h"
#include "application_manager/hmi_capabilities.h"
#include "application_manager/message.h"
+#include "application_manager/message_helper.h"
#include "application_manager/request_controller.h"
#include "application_manager/resume_ctrl.h"
#include "application_manager/vehicle_info_data.h"
+#include "application_manager/state_controller.h"
#include "protocol_handler/protocol_observer.h"
+#include "protocol_handler/protocol_handler.h"
#include "hmi_message_handler/hmi_message_observer.h"
#include "hmi_message_handler/hmi_message_sender.h"
-
+#include "application_manager/policies/policy_handler_observer.h"
#include "media_manager/media_manager_impl.h"
-
+#include "connection_handler/connection_handler.h"
#include "connection_handler/connection_handler_observer.h"
#include "connection_handler/device.h"
-
#include "formatters/CSmartFactory.hpp"
#include "interfaces/HMI_API.h"
@@ -73,10 +78,7 @@
#include "utils/threads/message_loop_thread.h"
#include "utils/lock.h"
#include "utils/singleton.h"
-
-namespace policy {
-class PolicyManager;
-}
+#include "utils/data_accessor.h"
namespace NsSmartDeviceLink {
namespace NsSmartObjects {
@@ -92,12 +94,14 @@ class CommandNotificationImpl;
namespace application_manager {
namespace mobile_api = mobile_apis;
+using namespace utils;
+using namespace timer;
class ApplicationManagerImpl;
enum VRTTSSessionChanging {
kVRSessionChanging = 0,
- kTTSSessionChanging = 1
+ kTTSSessionChanging
};
struct CommandParametersPermissions;
@@ -163,15 +167,26 @@ typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromMobile> >
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;
}
+
typedef std::vector<std::string> RPCParams;
class ApplicationManagerImpl : public ApplicationManager,
public hmi_message_handler::HMIMessageObserver,
public protocol_handler::ProtocolObserver,
public connection_handler::ConnectionHandlerObserver,
+ public policy::PolicyHandlerObserver,
public impl::FromMobileQueue::Handler, public impl::ToMobileQueue::Handler,
public impl::FromHmiQueue::Handler, public impl::ToHmiQueue::Handler,
+ public impl::AudioPassThruQueue::Handler,
public utils::Singleton<ApplicationManagerImpl> {
friend class ResumeCtrl;
@@ -227,15 +242,15 @@ class ApplicationManagerImpl : public ApplicationManager,
ApplicationSharedPtr get_limited_voice_application() const;
/**
- * @brief Check's if there are audio(media, voice communication or navi) applications
- * exist in HMI_FULL or HMI_LIMITED level with same audible HMI type.
- * Used for resumption.
+ * @brief Checks if application with the same HMI type
+ * (media, voice communication or navi) exists
+ * in HMI_FULL or HMI_LIMITED level.
*
* @param app Pointer to application to compare with
*
* @return true if exist otherwise false
*/
- bool DoesAudioAppWithSameHMITypeExistInFullOrLimited(ApplicationSharedPtr app) const;
+ bool IsAppTypeExistsInFullOrLimited(ApplicationSharedPtr app) const;
/**
* @brief Notifies all components interested in Vehicle Data update
@@ -244,13 +259,23 @@ class ApplicationManagerImpl : public ApplicationManager,
* @param vehicle_info Enum value of type of vehicle data
* @param new value (for integer values currently) of vehicle data
*/
- std::vector<utils::SharedPtr<Application>> IviInfoUpdated(
+ std::vector<ApplicationSharedPtr> IviInfoUpdated(
VehicleDataType vehicle_info, int value);
/////////////////////////////////////////////////////
HMICapabilities& hmi_capabilities();
+ /**
+ * @brief ProcessQueryApp executes logic related to QUERY_APP system request.
+ *
+ * @param sm_object smart object wich is actually parsed json obtained within
+ * system request.
+ * @param connection_key connection key for app, which sent system request
+ */
+ void ProcessQueryApp(const smart_objects::SmartObject& sm_object,
+ const uint32_t connection_key);
+
#ifdef TIME_TESTER
/**
* @brief Setup observer for time metric.
@@ -278,12 +303,10 @@ class ApplicationManagerImpl : public ApplicationManager,
bool is_unexpected_disconnect = false);
/**
- * @brief Unregister application revoked by Policy
+ * @brief Handle sequence for unauthorized application
* @param app_id Application id
- * @param reason Reason of unregistering application
*/
- void UnregisterRevokedApplication(const uint32_t& app_id,
- mobile_apis::Result::eType reason);
+ void OnAppUnauthorized(const uint32_t& app_id);
/*
* @brief Sets unregister reason for closing all registered applications
@@ -303,15 +326,9 @@ class ApplicationManagerImpl : public ApplicationManager,
mobile_api::AppInterfaceUnregisteredReason::eType reason);
/*
- * @brief Called by HMI on SUSPEND.
- * SDL must save all persistence data(Resume, Policy)
- */
- void HeadUnitSuspend();
-
- /*
* @brief Closes all registered applications
*/
- void UnregisterAllApplications(bool generated_by_hmi = false);
+ void UnregisterAllApplications();
bool RemoveAppDataFromHMI(ApplicationSharedPtr app);
bool LoadAppDataToHMI(ApplicationSharedPtr app);
@@ -324,9 +341,9 @@ class ApplicationManagerImpl : public ApplicationManager,
* @param app, application, that need to be puted in FULL
* @return seted HMI Level
*/
- mobile_api::HMILevel::eType PutApplicationInFull(ApplicationSharedPtr app);
+ mobile_api::HMILevel::eType IsHmiLevelFullAllowed(ApplicationSharedPtr app);
- void ConnectToDevice(uint32_t id);
+ void ConnectToDevice(const std::string& device_mac);
void OnHMIStartedCooperation();
/*
@@ -391,6 +408,134 @@ class ApplicationManagerImpl : public ApplicationManager,
*/
void set_all_apps_allowed(const bool& allowed);
+ /**
+ * @brief CreateRegularState create regular HMI state for application
+ * @param app_id
+ * @param hmi_level of returned state
+ * @param audio_state of returned state
+ * @param system_context of returned state
+ * @return new regular HMI state
+ */
+ 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;
+
+ /**
+ * @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, tha 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<SendActivateApp>(app, new_state);
+ }
+
+ /**
+ * @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<SendActivateApp>(app, hmi_level);
+ }
+
+ /**
+ * @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<SendActivateApp>(app, hmi_level, audio_state);
+ }
+
+ /**
+ * @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<SendActivateApp>(app, hmi_level,
+ audio_state, system_context);
+ }
+
+ /**
+ * @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 Notification from PolicyHandler about PTU.
+ * Compares AppHMIType between saved in app and received from PTU. If they are different method sends:
+ * UI_ChangeRegistration with list new AppHMIType;
+ * ActivateApp with HMI level BACKGROUND;
+ * OnHMIStatus notification;
+ * for app with HMI level FULL or LIMITED.
+ * method sends:
+ * UI_ChangeRegistration with list new AppHMIType
+ * for app with HMI level BACKGROUND.
+ */
+ virtual void OnUpdateHMIAppType(std::map<std::string, std::vector<std::string> > app_hmi_types);
+
/*
* @brief Starts audio pass thru thread
*
@@ -412,11 +557,31 @@ class ApplicationManagerImpl : public ApplicationManager,
*/
void StopAudioPassThru(int32_t application_key);
+ /*
+ * @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> binaryData);
+ std::vector<uint8_t>& binary_data);
std::string GetDeviceName(connection_handler::DeviceHandle handle);
+ /*
+ * @brief Converts connection string transport type representation
+ * to HMI Common_TransportType
+ *
+ * @param transport_type String representing connection type
+ *
+ * @return Corresponding HMI TransporType value
+ */
+ hmi_apis::Common_TransportType::eType GetDeviceTransportType(
+ const std::string& transport_type);
+
/////////////////////////////////////////////////////
void set_hmi_message_handler(hmi_message_handler::HMIMessageHandler* handler);
@@ -430,41 +595,46 @@ class ApplicationManagerImpl : public ApplicationManager,
// 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 utils::SharedPtr<smart_objects::SmartObject> message,
- bool final_message = false);
+ void SendMessageToMobile(const commands::MessageSharedPtr message,
+ bool final_message = false);
+
+ /**
+ * @brief TerminateRequest forces termination of request
+ * @param connection_key - application id of request
+ * @param corr_id correlation id of request
+ */
+ void TerminateRequest(uint32_t connection_key, uint32_t corr_id);
+
bool ManageMobileCommand(
- const utils::SharedPtr<smart_objects::SmartObject> message);
- void SendMessageToHMI(
- const utils::SharedPtr<smart_objects::SmartObject> message);
- bool ManageHMICommand(
- const utils::SharedPtr<smart_objects::SmartObject> message);
+ const commands::MessageSharedPtr message,
+ commands::Command::CommandOrigin origin =
+ commands::Command::ORIGIN_SDL);
+ void SendMessageToHMI(const commands::MessageSharedPtr message);
+ bool ManageHMICommand(const commands::MessageSharedPtr message);
/////////////////////////////////////////////////////////
- /*
- * @brief Overriden ProtocolObserver method
- */
+ // Overriden ProtocolObserver method
virtual void OnMessageReceived(
- const ::protocol_handler::RawMessagePtr message);
-
- /*
- * @brief Overriden ProtocolObserver method
- */
+ const ::protocol_handler::RawMessagePtr message) OVERRIDE;
virtual void OnMobileMessageSent(
- const ::protocol_handler::RawMessagePtr message);
+ const ::protocol_handler::RawMessagePtr message) OVERRIDE;
- void OnMessageReceived(hmi_message_handler::MessageSharedPointer message);
- void OnErrorSending(hmi_message_handler::MessageSharedPointer message);
+ // Overriden HMIMessageObserver method
+ void OnMessageReceived(hmi_message_handler::MessageSharedPointer message) OVERRIDE;
+ void OnErrorSending(hmi_message_handler::MessageSharedPointer message) OVERRIDE;
- void OnDeviceListUpdated(const connection_handler::DeviceMap& device_list);
+ // Overriden ConnectionHandlerObserver method
+ void OnDeviceListUpdated(const connection_handler::DeviceMap& device_list) OVERRIDE;
//TODO (EZamakhov): fix all indentations in this file
- virtual void OnFindNewApplicationsRequest();
- void RemoveDevice(const connection_handler::DeviceHandle& device_handle);
+ void OnFindNewApplicationsRequest() OVERRIDE;
+ void RemoveDevice(const connection_handler::DeviceHandle& device_handle) OVERRIDE;
bool OnServiceStartedCallback(
- const connection_handler::DeviceHandle& device_handle,
- const int32_t& session_key, const protocol_handler::ServiceType& type);
- void OnServiceEndedCallback(const int32_t& session_key,
- const protocol_handler::ServiceType& type);
+ const connection_handler::DeviceHandle& device_handle,
+ const int32_t& session_key, const protocol_handler::ServiceType& type) OVERRIDE;
+ void OnServiceEndedCallback(
+ const int32_t& session_key,
+ const protocol_handler::ServiceType& type,
+ const connection_handler::CloseSessionReason& close_reason) OVERRIDE;
/**
* @ Add notification to collection
@@ -508,34 +678,76 @@ class ApplicationManagerImpl : public ApplicationManager,
*/
void set_application_id(const int32_t correlation_id, const uint32_t app_id);
- /*
- * @brief Change AudioStreamingState for all application according to
- * system audio-mixing capabilities (NOT_AUDIBLE/ATTENUATED) and
- * send notification for this changes
- * @param If changing_state == kVRSessionChanging function is used by
- * on_vr_started_notification, if changing_state == kTTSSessionChanging
- * function is used by on_tts_started_notification
+ /**
+ * @brief AddPolicyObserver allows to subscribe needed component to events
+ * from policy.
+ *
+ * @param listener the component to subscribe.
*/
- void Mute(VRTTSSessionChanging changing_state);
+ void AddPolicyObserver(PolicyHandlerObserver* listener);
- /*
- * @brief Change AudioStreamingState for all application to AUDIBLE and
- * send notification for this changes
- * @param If changing_state == kVRSessionChanging function is used by
- * on_vr_stopped_notification, if changing_state == kTTSSessionChanging
- * function is used by on_tts_stopped_notification
+ /**
+ * @brief RemovePolicyObserver allows to remove observer from collection.
+ *
+ * @param listener observer to remove.
*/
- void Unmute(VRTTSSessionChanging changing_state);
+ void RemovePolicyObserver(PolicyHandlerObserver* listener);
- /*
- * @brief Checks HMI level and returns true if audio streaming is allowed
+ /**
+ * @brief Checks HMI level and returns true if streaming is allowed
+ * @param app_id Application id
+ * @param service_type Service type to check
+ * @return True if streaming is allowed, false in other case
*/
- bool IsAudioStreamingAllowed(uint32_t connection_key) const;
+ bool HMILevelAllowsStreaming(
+ uint32_t app_id, protocol_handler::ServiceType service_type) const;
- /*
- * @brief Checks HMI level and returns true if video streaming is allowed
+ /**
+ * @brief Checks if application can stream (streaming service is started and
+ * streaming is enabled in application)
+ * @param app_id Application id
+ * @param service_type Service type to check
+ * @return True if streaming is allowed, false in other case
+ */
+ bool CanAppStream(
+ uint32_t app_id, protocol_handler::ServiceType service_type) const;
+
+ /**
+ * @brief Ends opened navi services (audio/video) for application
+ * @param app_id Application id
+ */
+ void EndNaviServices(uint32_t app_id);
+
+ /**
+ * @brief ForbidStreaming forbid the stream over the certain application.
+ * @param app_id the application's id which should stop streaming.
+ */
+ void ForbidStreaming(uint32_t app_id);
+
+ /**
+ * @brief Callback calls when application starts/stops data streaming
+ * @param app_id Streaming application id
+ * @param service_type Streaming service type
+ * @param state Shows if streaming started or stopped
+ */
+ void OnAppStreaming(
+ uint32_t app_id, protocol_handler::ServiceType service_type, bool state);
+
+ /**
+ * @brief OnHMILevelChanged the callback that allows SDL to react when
+ * application's HMILeval has been changed.
+ *
+ * @param app_id application identifier for which HMILevel has been chaned.
+ *
+ * @param from previous HMILevel.
+ * @param to current HMILevel.
*/
- bool IsVideoStreamingAllowed(uint32_t connection_key) const;
+ void OnHMILevelChanged(uint32_t app_id,
+ mobile_apis::HMILevel::eType from,
+ mobile_apis::HMILevel::eType to);
+
+ mobile_api::HMILevel::eType GetDefaultHmiLevel(
+ ApplicationSharedPtr application) const;
/**
* Getter for resume_controller
@@ -667,45 +879,113 @@ class ApplicationManagerImpl : public ApplicationManager,
mobile_apis::FunctionID::eType function_id,
const RPCParams& rpc_params,
CommandParametersPermissions* params_permissions = NULL);
+ /*
+ * @brief Function Should be called when Low Voltage is occured
+ */
+ void OnLowVoltage();
+
+ /*
+ * @brief Function Should be called when WakeUp occures after Low Voltage
+ */
+ void OnWakeUp();
+
+ struct ApplicationsAppIdSorter {
+ bool operator() (const ApplicationSharedPtr lhs,
+ const ApplicationSharedPtr rhs) {
+ return lhs->app_id() < rhs->app_id();
+ }
+ };
+
+ struct ApplicationsMobileAppIdSorter {
+ bool operator() (const ApplicationSharedPtr lhs,
+ const ApplicationSharedPtr rhs) {
+
+ if (lhs->mobile_app_id() == rhs->mobile_app_id()) {
+ return lhs->device() < rhs->device();
+ }
+ return lhs->mobile_app_id() < rhs->mobile_app_id();
+ }
+ };
// typedef for Applications list
- typedef const std::set<ApplicationSharedPtr> TAppList;
+ typedef std::set<ApplicationSharedPtr,
+ ApplicationsAppIdSorter> ApplictionSet;
+
+ typedef std::multiset<ApplicationSharedPtr,
+ ApplicationsMobileAppIdSorter> AppsWaitRegistrationSet;
// typedef for Applications list iterator
- typedef std::set<ApplicationSharedPtr>::iterator TAppListIt;
+ typedef ApplictionSet::iterator ApplictionSetIt;
// typedef for Applications list const iterator
- typedef std::set<ApplicationSharedPtr>::const_iterator TAppListConstIt;
+ typedef ApplictionSet::const_iterator ApplictionSetConstIt;
+
+ DataAccessor<AppsWaitRegistrationSet> apps_waiting_for_registration() const;
+ ApplicationConstSharedPtr waiting_app(const uint32_t hmi_id) const;
/**
* Class for thread-safe access to applications list
*/
- class ApplicationListAccessor {
+ class ApplicationListAccessor: public DataAccessor<ApplictionSet> {
public:
/**
* @brief ApplicationListAccessor class constructor
*/
- ApplicationListAccessor() {
- ApplicationManagerImpl::instance()->applications_list_lock_.Acquire();
+ ApplicationListAccessor() :
+ DataAccessor<ApplictionSet>(ApplicationManagerImpl::instance()->applications_,
+ ApplicationManagerImpl::instance()->applications_list_lock_) {
}
- /**
- * @brief ApplicationListAccessor class destructor
- */
- ~ApplicationListAccessor() {
- ApplicationManagerImpl::instance()->applications_list_lock_.Release();
- }
+ ~ApplicationListAccessor();
- // TODO(VS): Now we have return application list by value, because we have
- // situations, when our process is killed without Stop method called.
- // This problem must be discussed and fixed.
/**
* @brief thread-safe getter for applications
* @return applications list
*/
- TAppList applications() {
- return ApplicationManagerImpl::instance()->application_list_;
+ const ApplictionSet& applications() const {
+ return GetData();
+ }
+
+ ApplictionSetConstIt begin() {
+ return applications().begin();
+ }
+
+ ApplictionSetConstIt end() {
+ return applications().end();
+ }
+
+ template<class UnaryPredicate>
+ ApplicationSharedPtr Find(UnaryPredicate finder) {
+ ApplicationSharedPtr result;
+ ApplictionSetConstIt it = std::find_if(begin(), end(), finder);
+ if (it != end()) {
+ result = *it;
+ }
+ return result;
+ }
+
+ template<class UnaryPredicate>
+ std::vector<ApplicationSharedPtr> FindAll(UnaryPredicate finder) {
+ std::vector<ApplicationSharedPtr> result;
+ ApplictionSetConstIt it = std::find_if(begin(), end(), finder);
+ while (it != end()) {
+ result.push_back(*it);
+ it = std::find_if(++it, end(), finder);
+ }
+ return result;
+ }
+
+ void Erase(ApplicationSharedPtr app_to_remove) {
+ ApplicationManagerImpl::instance()->applications_.erase(app_to_remove);
+ }
+
+ void Insert(ApplicationSharedPtr app_to_insert) {
+ ApplicationManagerImpl::instance()->applications_.insert(app_to_insert);
+ }
+
+ bool Empty() {
+ return ApplicationManagerImpl::instance()->applications_.empty();
}
private:
@@ -714,9 +994,124 @@ class ApplicationManagerImpl : public ApplicationManager,
friend class ApplicationListAccessor;
+ struct AppIdPredicate {
+ uint32_t app_id_;
+ AppIdPredicate(uint32_t app_id): app_id_(app_id) {}
+ bool operator () (const ApplicationSharedPtr app) const {
+ return app ? app_id_ == app->app_id() : false;
+ }
+ };
+
+ struct HmiAppIdPredicate {
+ uint32_t hmi_app_id_;
+ HmiAppIdPredicate(uint32_t hmi_app_id): hmi_app_id_(hmi_app_id) {}
+ bool operator () (const ApplicationSharedPtr app) const {
+ return app ? hmi_app_id_ == app->hmi_app_id() : false;
+ }
+ };
+
+ struct MobileAppIdPredicate {
+ std::string policy_app_id_;
+ MobileAppIdPredicate(const std::string& policy_app_id):
+ policy_app_id_(policy_app_id) {}
+ bool operator () (const ApplicationSharedPtr app) const {
+ return app ? policy_app_id_ == app->mobile_app_id() : false;
+ }
+ };
+
+ struct SubscribedToButtonPredicate {
+ mobile_apis::ButtonName::eType button_;
+ SubscribedToButtonPredicate(mobile_apis::ButtonName::eType button)
+ : button_(button) {}
+ bool operator () (const ApplicationSharedPtr app) const {
+ return app ? app->IsSubscribedToButton(button_) : false;
+ }
+ };
+
+ struct AppV4DevicePredicate {
+ connection_handler::DeviceHandle handle_;
+ AppV4DevicePredicate(const connection_handler::DeviceHandle handle):
+ handle_(handle) {}
+ bool operator () (const ApplicationSharedPtr app) const {
+ return app ? handle_ == app->device() &&
+ ProtocolVersion::kV4 == app->protocol_version() : false;
+ }
+ };
+
+ struct DevicePredicate {
+ connection_handler::DeviceHandle handle_;
+ DevicePredicate(const connection_handler::DeviceHandle handle):
+ handle_(handle) {}
+ bool operator () (const ApplicationSharedPtr app) const {
+ return handle_ == app->device() ? true : false;
+ }
+ };
+
+ 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;
+ }
+ };
+
+ /**
+ * @brief Sends UpdateAppList notification to HMI
+ */
+ void SendUpdateAppList();
+
+ /**
+ * @brief Marks applications received through QueryApps as should be
+ * greyed out on HMI
+ * @param is_greyed_out, true, if should be greyed out, otherwise - false
+ * @param handle, device handle
+ */
+ void MarkAppsGreyOut(const connection_handler::DeviceHandle handle,
+ bool is_greyed_out);
+
+ /**
+ * @brief Checks, if apps list had been queried already from certain device
+ * @param handle, Device handle
+ * @return true, if list had been queried already, otherwise - false
+ */
+ bool IsAppsQueriedFrom(const connection_handler::DeviceHandle handle) const;
+
+ bool IsStopping() const {
+ return is_stopping_;
+ }
+
private:
+ /**
+ * @brief PullLanguagesInfo allows to pull information about languages.
+ *
+ * @param app_data entry to parse
+ *
+ * @param ttsName tts name that should be filled.
+ * @param vrSynonym vr synonymus that should be filled.
+ */
+ void PullLanguagesInfo(const smart_objects::SmartObject& app_data,
+ smart_objects::SmartObject& ttsName,
+ smart_objects::SmartObject& vrSynonym);
+
ApplicationManagerImpl();
+ /**
+ * @brief Method transforms string to AppHMIType
+ * @param str contains string AppHMIType
+ * @return enum AppHMIType
+ */
+ mobile_apis::AppHMIType::eType StringToAppHMIType(std::string str);
+
+ /**
+ * @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
+ * @return return TRUE if arrays of appHMIType equal, otherwise return FALSE
+ */
+ bool CompareAppHMIType (const smart_objects::SmartObject& from_policy,
+ const smart_objects::SmartObject& from_application);
+
hmi_apis::HMI_API& hmi_so_factory();
mobile_apis::MOBILE_API& mobile_so_factory();
@@ -747,26 +1142,179 @@ class ApplicationManagerImpl : public ApplicationManager,
// CALLED ON messages_to_hmi_ thread!
virtual void Handle(const impl::MessageToHmi message) OVERRIDE;
- void SendUpdateAppList(const std::list<uint32_t>& applications_ids);
+ // CALLED ON audio_pass_thru_messages_ thread!
+ virtual void Handle(const impl::AudioData message) OVERRIDE;
+
+ template<typename ApplicationList>
+ void PrepareApplicationListSO(ApplicationList app_list,
+ smart_objects::SmartObject& applications) {
+ CREATE_LOGGERPTR_LOCAL(logger_, "ApplicatinManagerImpl");
+
+ smart_objects::SmartArray* app_array = applications.asArray();
+ 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()) {
+ LOG4CXX_ERROR(logger_, "Application not found ");
+ continue;
+ }
+
+ smart_objects::SmartObject hmi_application(smart_objects::SmartType_Map);;
+ if (MessageHelper::CreateHMIApplicationStruct(*it, hmi_application)) {
+ applications[app_count++] = hmi_application;
+ } else {
+ LOG4CXX_DEBUG(logger_, "Can't CreateHMIApplicationStruct ");
+ }
+ }
+
+ if (0 == app_count) {
+ LOG4CXX_WARN(logger_, "Empty applications list");
+ }
+ }
+
void OnApplicationListUpdateTimer();
+ /**
+ * @brief CreateApplications creates aplpication adds it to application list
+ * and prepare data for sending AppIcon request.
+ *
+ * @param obj_array applications array.
+ *
+ * @param connection_key connection key of app, which provided app list to
+ * be created
+ */
+ void CreateApplications(smart_objects::SmartArray& obj_array,
+ const uint32_t connection_key);
+
/*
* @brief Function is called on IGN_OFF, Master_reset or Factory_defaults
* to notify HMI that SDL is shutting down.
*/
void SendOnSDLClose();
+ /*
+ * @brief returns true if low voltage state is active
+ */
+ bool IsLowVoltage();
+
private:
+ /*
+ * NaviServiceStatusMap shows which navi service (audio/video) is opened
+ * for specified application. Two bool values in std::pair mean:
+ * 1st value - is video service opened or not
+ * 2nd value - is audio service opened or not
+ */
+ typedef std::map<uint32_t, std::pair<bool, bool> > NaviServiceStatusMap;
+
+ typedef SharedPtr<TimerThread<ApplicationManagerImpl> > ApplicationManagerTimerPtr;
+
+ /**
+ * @brief Removes suspended and stopped timers from timer pool
+ */
+ void ClearTimerPool();
+
+ /**
+ * @brief CloseNaviApp allows to unregister application in case the EndServiceEndedAck
+ * didn't come for at least one of services(audio or video)
+ */
+ void CloseNaviApp();
+
+ /**
+ * @brief Suspends streaming ability of application in case application's HMI level
+ * has been changed to not allowed for streaming
+ */
+ void EndNaviStreaming();
+
+ /**
+ * @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
+ */
+ bool StartNaviService(
+ uint32_t app_id, protocol_handler::ServiceType service_type);
+
+ /**
+ * @brief Stops specified navi service for application
+ * @param app_id Application to proceed
+ * @param service_type Type of service to stop
+ */
+ void StopNaviService(
+ uint32_t app_id, protocol_handler::ServiceType service_type);
+
+ /**
+ * @brief Allows streaming for application if it was disallowed by
+ * DisallowStreaming()
+ * @param app_id Application to proceed
+ */
+ void AllowStreaming(uint32_t app_id);
+
+ /**
+ * @brief Disallows streaming for application, but doesn't close
+ * opened services. Streaming ability could be restored by AllowStreaming();
+ * @param app_id Application to proceed
+ */
+ void DisallowStreaming(uint32_t app_id);
+
+ /**
+ * @brief Function returns supported SDL Protocol Version
+ * @return protocol version depends on parameters from smartDeviceLink.ini.
+ */
+ ProtocolVersion SupportedSDLVersion() const;
- // members
+ /**
+ * @brief Types of directories used by Application Manager
+ */
+ enum DirectoryType {
+ TYPE_STORAGE,
+ TYPE_SYSTEM,
+ TYPE_ICONS
+ };
+
+ typedef std::map<DirectoryType, std::string> DirectoryTypeMap;
+ DirectoryTypeMap dir_type_to_string_map_;
+
+ /**
+ * @brief Converts directory type to string
+ * @param type Directory type
+ * @return Stringified type
+ */
+ const std::string DirectoryTypeToString(DirectoryType type) const;
+
+ /**
+ * @brief Creates directory path, if necessary
+ * @param path Directory path
+ * @param type Directory type
+ * @return true, if succedeed, otherwise - false
+ */
+ bool InitDirectory(const std::string& path, DirectoryType type) const;
+
+ /**
+ * @brief Checks, whether r/w permissions are present for particular path
+ * @param path Directory path
+ * @param type Directory type
+ * @return true, if allowed, otherwise - false
+ */
+ bool IsReadWriteAllowed(const std::string& path, DirectoryType type) const;
+
+ /**
+ * @brief Removes apps, waiting for registration related to
+ * certain device handle
+ * @param handle, Device handle
+ */
+ void RemoveAppsWaitingForRegistration(
+ const connection_handler::DeviceHandle handle);
+ private:
/**
* @brief List of applications
*/
- std::set<ApplicationSharedPtr> application_list_;
+ ApplictionSet applications_;
+ AppsWaitRegistrationSet apps_to_register_;
// Lock for applications list
mutable sync_primitives::Lock applications_list_lock_;
+ mutable sync_primitives::Lock apps_to_register_list_lock_;
/**
* @brief Map of correlation id and associated application id.
@@ -779,27 +1327,6 @@ class ApplicationManagerImpl : public ApplicationManager,
*/
std::map<uint32_t, TimevalStruct> tts_global_properties_app_list_;
-
- struct AppState {
- AppState(const mobile_apis::HMILevel::eType& level,
- const mobile_apis::AudioStreamingState::eType& streaming_state,
- const mobile_apis::SystemContext::eType& context)
- : hmi_level(level),
- audio_streaming_state(streaming_state),
- system_context(context) { }
-
- mobile_apis::HMILevel::eType hmi_level;
- mobile_apis::AudioStreamingState::eType audio_streaming_state;
- mobile_apis::SystemContext::eType system_context;
- };
-
- /**
- * @brief Map contains apps with HMI state before incoming call
- * After incoming call ends previous HMI state must restore
- *
- */
- std::map<uint32_t, AppState> on_phone_call_app_list_;
-
bool audio_pass_thru_active_;
sync_primitives::Lock audio_pass_thru_lock_;
sync_primitives::Lock tts_global_properties_app_list_lock_;
@@ -831,6 +1358,8 @@ class ApplicationManagerImpl : public ApplicationManager,
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_;
HMICapabilities hmi_capabilities_;
@@ -844,6 +1373,17 @@ class ApplicationManagerImpl : public ApplicationManager,
*/
ResumeCtrl resume_ctrl_;
+ NaviServiceStatusMap navi_service_status_;
+ std::deque<uint32_t> navi_app_to_stop_;
+ std::deque<uint32_t> navi_app_to_end_stream_;
+ uint32_t navi_close_app_timeout_;
+ uint32_t navi_end_stream_timeout_;
+
+ std::vector<ApplicationManagerTimerPtr> timer_pool_;
+ sync_primitives::Lock timer_pool_lock_;
+
+ StateController state_ctrl_;
+
#ifdef TIME_TESTER
AMMetricObserver* metric_observer_;
#endif // TIME_TESTER
@@ -860,6 +1400,10 @@ class ApplicationManagerImpl : public ApplicationManager,
timer::TimerThread<ApplicationManagerImpl> tts_global_properties_timer_;
+ bool is_low_voltage_;
+
+ bool is_stopping_;
+
DISALLOW_COPY_AND_ASSIGN(ApplicationManagerImpl);
FRIEND_BASE_SINGLETON_CLASS(ApplicationManagerImpl);
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 587c3d834..238e0b71c 100644
--- a/src/components/application_manager/include/application_manager/commands/command.h
+++ b/src/components/application_manager/include/application_manager/commands/command.h
@@ -1,4 +1,4 @@
-/**
+/*
Copyright (c) 2014, Ford Motor Company
All rights reserved.
@@ -44,7 +44,6 @@ namespace application_manager {
**/
namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-typedef utils::SharedPtr<smart_objects::SmartObject> MessageSharedPtr;
namespace commands {
@@ -108,8 +107,28 @@ class Command {
*/
virtual void onTimeOut() = 0;
+ /**
+ * @brief AllowedToTerminate tells if request controller is allowed
+ * to terminate this command
+ * @return
+ */
+ virtual bool AllowedToTerminate() = 0;
+
+ /**
+ * @brief SetAllowedToTerminate set up allowed to terminate flag.
+ * If true, request controller will terminate request on response
+ */
+ virtual void SetAllowedToTerminate(bool allowed) = 0;
+
+
+ enum CommandOrigin {
+ ORIGIN_SDL,
+ ORIGIN_MOBILE
+ };
};
+typedef smart_objects::SmartObjectSPtr MessageSharedPtr;
+
} // namespace commands
} // namespace application_manager
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 a34716bd6..6cc8f8233 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
@@ -1,4 +1,4 @@
-/**
+/*
Copyright (c) 2014, Ford Motor Company
All rights reserved.
@@ -118,15 +118,34 @@ class CommandImpl : public Command {
*/
virtual void onTimeOut();
+ /**
+ * @brief AllowedToTerminate tells request Controller if it can terminate this
+ * request by response.
+ * By default, RequestCtrl should terminate all requests by their responses.
+ * If request need to terminate itself, it should override this function false
+ * @return allowed_to_terminate_ value
+ */
+ virtual bool AllowedToTerminate() {
+ return allowed_to_terminate_;
+ }
+
+ /**
+ * @brief SetAllowedToTerminate set up allowed to terminate flag.
+ * If true, request controller will terminate request on response
+ */
+ virtual void SetAllowedToTerminate(bool allowed) {
+ allowed_to_terminate_ = allowed;
+ }
+
// members
static const int32_t hmi_protocol_type_;
static const int32_t mobile_protocol_type_;
- static const int32_t protocol_version_;
+ static const int32_t protocol_version_;
protected:
MessageSharedPtr message_;
uint32_t default_timeout_;
-
+ bool allowed_to_terminate_;
#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
#endif // ENABLE_LOG
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
new file mode 100644
index 000000000..9f95a5285
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_NOTIFICATION_FROM_MOBILE_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_NOTIFICATION_FROM_MOBILE_IMPL_H_
+
+#include "application_manager/commands/command_impl.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+
+namespace commands {
+
+class CommandNotificationFromMobileImpl : public CommandImpl {
+ public:
+ explicit CommandNotificationFromMobileImpl(const MessageSharedPtr& message);
+ virtual ~CommandNotificationFromMobileImpl();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendNotification();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CommandNotificationFromMobileImpl);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_NOTIFICATION_FROM_MOBILE_IMPL_H_
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 1bbba5aa0..0401a3bf4 100644
--- a/src/components/application_manager/include/application_manager/commands/command_request_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_request_impl.h
@@ -1,4 +1,4 @@
-/**
+/*
Copyright (c) 2014, Ford Motor Company
All rights reserved.
@@ -91,7 +91,7 @@ class CommandRequestImpl : public CommandImpl,
void SendResponse(const bool success,
const mobile_apis::Result::eType& result_code,
const char* info = NULL,
- const NsSmart::SmartObject* response_params = NULL);
+ const smart_objects::SmartObject* response_params = NULL);
/**
* @brief Check syntax of string from mobile
@@ -107,10 +107,10 @@ class CommandRequestImpl : public CommandImpl,
* @param function_id HMI request ID
* @param msg_params HMI request msg params
* @param use_events true if we need subscribe on event(HMI request)
- *
+ * @return hmi correlation id
*/
- void SendHMIRequest(const hmi_apis::FunctionID::eType& function_id,
- const NsSmart::SmartObject* msg_params = NULL,
+ uint32_t SendHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject* msg_params = NULL,
bool use_events = false);
/*
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
index 3495ce137..5122a0856 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -42,7 +42,7 @@ namespace commands {
/**
* @brief ActivateAppRequest command class
**/
-class ActivateAppRequest : public RequestToHMI, event_engine::EventObserver {
+class ActivateAppRequest : public RequestToHMI {
public:
/**
* @brief ActivateAppRequest class constructor
@@ -52,13 +52,6 @@ class ActivateAppRequest : public RequestToHMI, event_engine::EventObserver {
explicit ActivateAppRequest(const MessageSharedPtr& message);
/**
- * @brief Calback for response
- *
- * @param event - event response
- **/
- virtual void on_event(const event_engine::Event& event);
-
- /**
* @brief ActivateAppRequest class destructor
**/
virtual ~ActivateAppRequest();
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
index 1df9bc095..a15d31707 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 1569af434..1aa3b7a51 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
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
index 6c2db489c..3d42b6d5a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 0eb8184fa..ccc8d5ae7 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 91228440a..e90576a7d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 5a24ac1a7..6bedf30a3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index d066df813..867596f18 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 1948211c4..5c174eac8 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 3c9fbac68..639800a04 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 067954537..7cd174477 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 72ff8a2c5..34722bc4f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 05318e3cb..ce3a6d293 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 8cb34718a..8262dbb6f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index f10c07c52..70983d3ce 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 924144667..551ab2043 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 6b025142e..956e5a788 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 905b5b383..2957693c9 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index c8bfe4e15..e2b5affe3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 1e2a39df9..58f85f829 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 41e0f623f..11f46d5da 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index a321d32dd..3e95c6b16 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -42,7 +42,8 @@ namespace commands {
/**
* @brief AudioStartStreamRequest command class
**/
-class AudioStartStreamRequest : public RequestToHMI {
+class AudioStartStreamRequest : public RequestToHMI,
+ public event_engine::EventObserver {
public:
/**
* @brief AudioStartStreamRequest class constructor
@@ -56,12 +57,30 @@ class AudioStartStreamRequest : public RequestToHMI {
**/
virtual ~AudioStartStreamRequest();
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ virtual void onTimeOut();
+
+
/**
* @brief Execute command
**/
virtual void Run();
- private:
+ /**
+ * @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);
};
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
index a31efc7fe..e779ecb69 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 0fbad3515..3da6933bc 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 9c91df648..45474b532 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 029d90319..ef9a605c3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 5da47e580..b866ce3e1 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 4a26b26b0..3f212985f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index f43b99221..0e8cd39cc 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -42,27 +42,46 @@ namespace commands {
/**
* @brief NaviStartStreamRequest command class
**/
-class NaviStartStreamRequest : public RequestToHMI {
- public:
- /**
+class NaviStartStreamRequest : public RequestToHMI,
+ public event_engine::EventObserver {
+ public:
+ /**
* @brief NaviStartStreamRequest class constructor
*
* @param message Incoming SmartObject message
**/
- explicit NaviStartStreamRequest(const MessageSharedPtr& message);
+ explicit NaviStartStreamRequest(const MessageSharedPtr& message);
- /**
- * @brief OnNaviStartStreamRequest class destructor
- **/
- virtual ~NaviStartStreamRequest();
+ /**
+ * @brief OnNaviStartStreamRequest class destructor
+ **/
+ virtual ~NaviStartStreamRequest();
- /**
- * @brief Execute command
- **/
- virtual void Run();
+ /**
+ * @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:
- DISALLOW_COPY_AND_ASSIGN(NaviStartStreamRequest);
+ private:
+ uint32_t retry_number_;
+ DISALLOW_COPY_AND_ASSIGN(NaviStartStreamRequest);
};
} // namespace commands
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
index 61beef1b3..a5e2f8bf3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 9e711b8be..0e15a9175 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 219306d37..1dcae4366 100644
--- 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
@@ -46,7 +46,7 @@ namespace application_manager {
namespace commands {
-namespace NsSmartObj = NsSmartDeviceLink::NsSmartObjects;
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
class NotificationFromHMI : public CommandImpl {
public:
@@ -57,7 +57,7 @@ class NotificationFromHMI : public CommandImpl {
virtual void Run();
void SendNotificationToMobile(const MessageSharedPtr& message);
void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
- const NsSmartObj::SmartObject& msg_params) const;
+ const smart_objects::SmartObject& msg_params) const;
private:
DISALLOW_COPY_AND_ASSIGN(NotificationFromHMI);
};
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
index aa549638e..6ec14e35b 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index a8bdeb6c9..011df3832 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 4c56dc415..8731fc43f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 034efb7a8..c6ea82a15 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index a5037820c..ea36d55b3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
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
index 4364aa9a3..1ebbfcd48 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index d8470af39..96fd19e9b 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
new file mode 100644
index 000000000..97a979065
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_audio_data_streaming_notification.h
@@ -0,0 +1,73 @@
+/*
+ * 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
+ **/
+ explicit OnAudioDataStreamingNotification(const MessageSharedPtr& message);
+
+ /**
+ * @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
index a4657ea24..0a56d7d92 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 065cdc4a7..ce5f1de8f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
new file mode 100644
index 000000000..c046380cd
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_button_subscription_notification.h
@@ -0,0 +1,76 @@
+/*
+ * 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
+ **/
+ explicit OnButtonSubscriptionNotification(const MessageSharedPtr& message);
+
+ /**
+ * @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
index e980bfe41..17ba26b7f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 5c12bdfd9..b87a6e2d9 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
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
index 77da5cf3b..01a87aae0 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_emergency_event_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_emergency_event_notification.h
new file mode 100644
index 000000000..aa82de4d8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_emergency_event_notification.h
@@ -0,0 +1,72 @@
+/*
+ * 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_EMERGENCY_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EMERGENCY_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnEmergencyEventNotification command class
+ **/
+class OnEmergencyEventNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnEmergencyEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnEmergencyEventNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnEmergencyEventNotification class destructor
+ **/
+ virtual ~OnEmergencyEventNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnEmergencyEventNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EMERGENCY_EVENT_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
index c913509e5..65d78f60c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index b78c0e2af..479dd3a09 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index b6b46041f..cc47705c8 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 2499129b2..f9fb9cdb2 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index ed0638f3c..f8fccdc38 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 6e42e1a0c..a657ffcc6 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_play_tone_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_play_tone_notification.h
index 8e463c327..ceba0528f 100644
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_play_tone_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_play_tone_notification.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index f71de540e..81278fb75 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
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
index 839af785b..bc6028430 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index a3e2dd731..24fc52dea 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 38a4470d2..0eeb28218 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 81f0b5bdd..67cccdd81 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index c27e2e5ee..03f84d090 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
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
index e6b4418d6..5b9ac04e8 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index c9b93a4dc..4f30873e4 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 5da06ef34..6f8f3a6e1 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 3e4dc1daf..bfa14f67f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index ae85d1371..c12382688 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index b16df6069..35d6f49da 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index cb3fc1201..ee7df7acd 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
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
index d0bcadfaa..9b6c62782 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 6e3a0eea7..f1d25e24a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index d9b55ac0c..79ae9b496 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 3bafc920b..11cb75554 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 8cb625607..c7e88ac55 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 31fb6fb31..bf5dc7fb9 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 1d0aaf307..b4a0228c7 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index bb0a6a72d..77b771065 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 85b8f60c4..bcb661c89 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 511606d07..f97c8768b 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 3231d1ca2..6d8005e12 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index c0d355c92..f56d01a5c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 04bb3e54b..d591ab2be 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 3cfb048cd..f901462fd 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index b9ecf5a34..a0bc31778 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 925989e8c..0e24616f3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 7baea9065..029038875 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 33dd824c6..8307e5359 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 207302a37..be5b08685 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 535758db2..83e6f845e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 92dffd89b..42a6b8e0d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index d8f2a768f..01c2cf60b 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 47802e97e..dc80b33dd 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index fe3841298..c4e5accea 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index d636b6e77..e2d9d91ae 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 1cf4c2587..7c1c691ac 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 5a3a13637..bf2ca83f8 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 80dea2a6e..ebcfe3a86 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 19bffabf4..37bf66e4d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 0826cb6c6..bf01b2bf7 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index ba8eceefc..1c1e00d89 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 30ad9d6ac..59da271a0 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 0cb5fb17d..06b73c508 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index c7a1a6bd6..399b38112 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
new file mode 100644
index 000000000..38749ba8f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h
@@ -0,0 +1,73 @@
+/*
+ * 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
+ **/
+ explicit OnVideoDataStreamingNotification(const MessageSharedPtr& message);
+
+ /**
+ * @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
index 677bc2672..37bc2556f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 24c60c32d..be408f0aa 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index cc78f010b..5ae5ace27 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 2ee8ad429..311ee8acd 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 39ebd9581..9cb5a9f99 100644
--- 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
@@ -1,4 +1,4 @@
- /**
+ /*
Copyright (c) 2014, Ford Motor Company
All rights reserved.
@@ -48,14 +48,23 @@
namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
- class RequestFromHMI : public CommandImpl {
+ class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
public:
explicit RequestFromHMI(const MessageSharedPtr& message);
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(uint32_t correlation_id,
+ hmi_apis::FunctionID::eType function_id,
+ hmi_apis::Common_Result::eType result_code);
private:
DISALLOW_COPY_AND_ASSIGN(RequestFromHMI);
};
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
index 3a9de4b7b..fe359182d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
Copyright (c) 2014, Ford Motor Company
All rights reserved.
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
index 21497a133..7769caa0a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
Copyright (c) 2014, Ford Motor Company
All rights reserved.
@@ -46,7 +46,7 @@ namespace application_manager {
namespace commands {
-namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
class ResponseFromHMI : public CommandImpl {
public:
@@ -64,7 +64,7 @@ class ResponseFromHMI : public CommandImpl {
* @param msg_params HMI request msg params
*/
void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
- const NsSmart::SmartObject& msg_params) const;
+ const smart_objects::SmartObject& msg_params) const;
private:
DISALLOW_COPY_AND_ASSIGN(ResponseFromHMI);
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
index db4a93b0b..58a7e9ecd 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -34,11 +34,13 @@
#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_impl.h"
namespace application_manager {
namespace commands {
+ typedef std::pair<ApplicationSharedPtr, std::vector<ApplicationSharedPtr> > DevicesApps;
/**
* @brief SDLActivateAppRequest command class
**/
@@ -61,7 +63,24 @@ class SDLActivateAppRequest : public RequestFromHMI {
**/
virtual void Run();
+ /**
+ * @brief onTimeOut allows to process case when timeout has appeared
+ * during request execution.
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief on_event allows to handle events
+ *
+ * @param event event type that current request subscribed on.
+ */
+ virtual void on_event(const event_engine::Event& event);
private:
+ uint32_t app_id() const;
+ uint32_t hmi_app_id(const smart_objects::SmartObject& so) const;
+
+ DevicesApps FindAllAppOnParticularDevice(
+ const connection_handler::DeviceHandle handle);
DISALLOW_COPY_AND_ASSIGN(SDLActivateAppRequest);
};
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
index 63adc6c0d..bf0789e60 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 5da473b1a..7c8f10529 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 5de9fc0ea..452784d92 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index a098e0a11..cb7d37d33 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 6299cde63..a3fc0862b 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index b729a1617..96f46cfa3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index bb7a7f8e2..4cf7be56c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index ee2b9865c..481f37a25 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index b6ab925fd..d3f710552 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index a587af950..a25309e5d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 3a9e9fda5..73ad18028 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 73edd9de7..543945e8e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 71f85d68e..2fc16d1a4 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 94e38ec47..e0ae0da0c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index bd67d64f3..0d9df07ae 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index ff80dd238..136edbb5f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 244f22346..38e3c673b 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index dc58d852e..676faabc0 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 375e5a5d1..12bb3bb87 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index b398e0b2d..92a260d77 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index adf0b7027..0766decf9 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 326c638f4..f5555f649 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index e22c54987..541ea0d2a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 0d82121fd..46c464425 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index b9055bfbe..aab8ca8c5 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index ffd6eeeef..6b857818e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index f84b71d0f..c6a02fdd0 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 1227de046..bba9a4c47 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 1b3a10729..0c4afc2fa 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 7395eb19e..72cd733eb 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 1d17d9809..97eb2ba94 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 51276b7b0..8e68dee2e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index edb7574e8..50b092639 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 398f78c28..9eceb2eb6 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index bb1981190..c4d7ab6ca 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 1b3747234..24bf5878f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 8bbab9946..05d77c82d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 9e8e11c1a..06637fc8d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 740fc5501..6d5594f69 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 2d0469d6a..ad9a56607 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index dc6052e04..ce6ad6f7e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 4fca4826b..7371cd103 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index ea43e3856..f6536452c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index cc0e70fea..d0975e68d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 15e400687..c888c7b20 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 5e2cb7ef9..7cb428724 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index bc7210f2a..64106654e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 94bc4827a..69566324f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 04afedfba..c3283101f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 0d6313943..d8e2f6c68 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 32a87c73c..04286897a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 6f23d3b21..06bfadbae 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 7bf15a051..6d6d09c31 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
new file mode 100644
index 000000000..96f91d0f8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT 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 UISetAppIconRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UISetIconRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISetAppIconRequest(const MessageSharedPtr& message);
+
+ /**
+ * @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_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
new file mode 100644
index 000000000..b323a91c3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT 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 UISetAppIconResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UISetIconResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISetAppIconResponse(const MessageSharedPtr& message);
+
+ /**
+ * @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_ICON_RESPONSE_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
index 74df2030e..3e7a898af 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index f3f7d0e73..8b54e8533 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index bc00397e3..b3cb38d49 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 44cbbbfcf..443fc8d1a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index dd46f128d..935870711 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 6f22263e6..136a99622 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index a6391fa6c..4a9b49253 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 5cb31b4a9..8a3b37bfe 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index aae5408e2..2384f248a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index d2307232e..b60613440 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 3e6a1d78a..135481cb0 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index e9a32e9fc..f645d312c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index d4191c8be..6ea2c1e52 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 506c13786..f84f93f2e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 729483cfa..b0d370ecf 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 90e1e145c..c60533d2e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index f332a3281..027e007e4 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 93f046d7d..170eb895f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 9ee7fac44..3ba4656d5 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 9cb964981..7413b6bf3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 951bf0c33..af991186f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 952b0fb4d..1f9736b56 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index ecd465365..156664cac 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 876f7d2e5..67d8ae046 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 8b632182f..b36b19341 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index e905cf4c0..061681029 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index e13e368b3..52e00f85d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 336ad4443..6520db5e7 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index af6650517..0855be454 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index ef14a05f2..1eb06c621 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index bcfa2f6f1..fc9b7dd2e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 057fd52e1..b5e2788f3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 740d8c386..64f3c51cb 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 18d118fad..1320ae477 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index d604d4d53..9aa529d40 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index b71b8241f..8818709af 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 8730cc036..3dfcc763c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 3675cfb15..9fdc3f776 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 328e8a205..7418ed586 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 5e69b4c18..53584ee97 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index f79da4459..d71a14da3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index b843f498f..91a5dc7d9 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 11a681bd5..ad8c82e38 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 7771bdd14..676967083 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index ced60c9d6..8b88eb4e3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 955355d06..9dd9133ff 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 2bd59b8be..d9c4fc212 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 79105978b..0a010cdfe 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 38f505622..dbbe57ba3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index ac734638b..e66c9c36a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 4f4f86d84..a9b1a6845 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index b71b31baf..b819fdb92 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index fbf5b87cb..ffbbd613e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index fc683988b..2c36d8425 100644
--- 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
@@ -131,6 +131,8 @@ class AddCommandRequest : public CommandRequestImpl {
*/
bool IsWhiteSpaceExist();
+ inline bool BothSend() const;
+
bool send_ui_;
bool send_vr_;
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
index 3de3e8fc2..d36f16a97 100644
--- 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
@@ -105,9 +105,9 @@ class ChangeRegistrationRequest : public CommandRequestImpl {
/*
* @brief Checks result codes
*
- * @return true if one of result codes is success
+ * @return true if all of result codes is success
*/
- static bool WasAnySuccess(const hmi_apis::Common_Result::eType ui,
+ bool AllHmiResponsesSuccess(const hmi_apis::Common_Result::eType ui,
const hmi_apis::Common_Result::eType vr,
const hmi_apis::Common_Result::eType tts);
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
index 1936c9678..615416fac 100644
--- 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
@@ -31,11 +31,14 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
+#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"
@@ -50,130 +53,189 @@ namespace commands {
**/
class CreateInteractionChoiceSetRequest : public CommandRequestImpl {
public:
- /**
- * @brief CreateInteractionChoiceSetRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit CreateInteractionChoiceSetRequest(const MessageSharedPtr& message);
-
- /**
- * @brief CreateInteractionChoiceSetRequest class destructor
- **/
- virtual ~CreateInteractionChoiceSetRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
+ /**
+ * @brief CreateInteractionChoiceSetRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit CreateInteractionChoiceSetRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief CreateInteractionChoiceSetRequest class destructor
+ **/
+ virtual ~CreateInteractionChoiceSetRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
private:
+ /**
+ * @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();
+ /**
+ * @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() {}
+ explicit 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 SendVRAddCommandRequest(application_manager::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 {
- explicit 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 {
- explicit CoincidencePredicateMenuName(const std::string& newItem)
- :newItem_(newItem)
- {};
-
- bool operator()(smart_objects::SmartObject obj) {
- return obj[strings::menu_name].asString() == newItem_;
+ 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 {
+ explicit 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 {
+ explicit CoincidencePredicateMenuName(const std::string& newItem)
+ : newItem_(newItem)
+ {};
+
+ bool operator()(smart_objects::SmartObject obj) {
+ return obj[strings::menu_name].asString() == newItem_;
+ }
+
+ const std::string& 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 {
- explicit CoincidencePredicateVRCommands(const smart_objects::SmartObject& newItem)
- :newItem_(newItem)
- {};
-
- bool operator()(smart_objects::SmartObject obj) {
- return compareStr(obj, 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 {
+ explicit CoincidencePredicateVRCommands(
+ const smart_objects::SmartObject& newItem): newItem_(newItem) {}
+
+ bool operator()(smart_objects::SmartObject obj) {
+ return compareStr(obj, newItem_);
+ }
+
+ const smart_objects::SmartObject& 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(
+ /*
+ * @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(
+ /*
+ * @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 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);
- DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetRequest);
+ DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetRequest);
};
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
+#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/generic_response.h b/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h
index c3b39bf91..1fb931d50 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index aefa7f9c2..11d82925e 100644
--- 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
@@ -63,7 +63,7 @@ class OnHMIStatusNotification : public CommandNotificationImpl {
**/
virtual void Run();
- private:
+private:
DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotification);
};
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
new file mode 100644
index 000000000..70a8bf745
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h
@@ -0,0 +1,75 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
+
+#include "application_manager/commands/command_notification_from_mobile_impl.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
+ **/
+ explicit OnHMIStatusNotificationFromMobile(const MessageSharedPtr& message);
+
+ /**
+ * @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_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_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
index 183b673af..7eee61170 100644
--- 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
@@ -64,8 +64,7 @@ class OnSystemRequestNotification : public CommandNotificationImpl {
* @brief Execute command
**/
virtual void Run();
-
- private:
+ private:
DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
};
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
index ce85a7017..02575c112 100644
--- 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
@@ -80,12 +80,6 @@ class PerformInteractionRequest : public CommandRequestImpl {
*/
virtual void on_event(const event_engine::Event& event);
- /**
- * @brief Timer callback function
- *
- */
- void onTimer();
-
private:
/*
* @brief Function is called by RequestController when request execution time
@@ -204,14 +198,14 @@ class PerformInteractionRequest : public CommandRequestImpl {
bool CheckChoiceIDFromResponse(ApplicationSharedPtr app, int32_t choice_id);
// members
- timer::TimerThread<PerformInteractionRequest> timer_;
-
- DISALLOW_COPY_AND_ASSIGN(PerformInteractionRequest);
- mobile_apis::Result::eType vr_perform_interaction_code_;
+ mobile_apis::Result::eType vr_perform_interaction_code_;
mobile_apis::InteractionMode::eType interaction_mode_;
- bool ui_response_recived;
- bool vr_response_recived;
+ bool ui_response_recived_;
+ bool vr_response_recived_;
+ bool app_pi_was_active_before_;
+ static uint32_t pi_requests_count_;
+ DISALLOW_COPY_AND_ASSIGN(PerformInteractionRequest);
};
} // namespace commands
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
index 9c1d46368..e5bcf40da 100644
--- 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
@@ -72,14 +72,6 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl {
* @brief Execute command
**/
virtual void Run();
- // virtual void cleanUp() = 0;
-
- /**
- * @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 Sends RegisterAppInterface response to mobile
@@ -99,23 +91,6 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl {
bool IsApplicationWithSameAppIdRegistered();
/*
- * @brief Check for some request param. names restrictions, e.g. for
- * newline characters
- *
- * return SUCCESS if param name pass the check, otherwise - error code
- * will be returned
- */
- mobile_apis::Result::eType CheckRestrictions() const;
-
- /*
- * @brief Removes hidden symbols and spaces
- *
- * return cleared copy of param name
- */
- std::string ClearParamName(std::string param_name) const;
-
-
- /*
* @brief Check new application parameters (name, tts, vr) for
* coincidence with already known parameters of registered applications
*
@@ -162,7 +137,26 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl {
*/
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();
+
+private:
std::string response_info_;
+ mobile_apis::Result::eType result_checking_app_hmi_type_;
+
DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceRequest);
};
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
index 36fd311ad..f0c0ea8f7 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index e178e284d..581c779aa 100644
--- 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
@@ -67,6 +67,7 @@ class SendLocationRequest : public CommandRequestImpl {
*/
virtual void on_event(const event_engine::Event& event);
+
private:
/**
@@ -76,7 +77,7 @@ class SendLocationRequest : public CommandRequestImpl {
*/
bool IsWhiteSpaceExist();
-
+ bool CheckHMICapabilities(std::list<hmi_apis::Common_TextFieldName::eType>& fields_names);
DISALLOW_COPY_AND_ASSIGN(SendLocationRequest);
};
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
index 6e18aa5f2..fe88a2af2 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
new file mode 100644
index 000000000..da21decd8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h
@@ -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.
+ */
+
+#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 "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
+ **/
+ explicit SetAppIconRequest(const MessageSharedPtr& message);
+
+ /**
+ * @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
+ */
+ static int8_t is_icons_saving_enabled_;
+};
+
+} // 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_app_icon_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h
new file mode 100644
index 000000000..02be7fe37
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT 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 "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
+ **/
+ explicit SetAppIconResponse(const MessageSharedPtr& message);
+
+ /**
+ * @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_ICON_RESPONSE_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
index e835c17c8..46844bd2f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 970b54747..c327bc3b3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index b7821adca..1888388e7 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index ef9b8f89d..cbf1ec40d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 3e0cc2cea..12168e247 100644
--- 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
@@ -76,9 +76,21 @@ class SubscribeButtonRequest : public CommandRequestImpl {
*
* @return TRUE on success, otherwise false
**/
- bool IsSubscribtionAllowed(ApplicationSharedPtr app,
+ 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();
+
+ /**
+ * @brief Checks HMI capabilities for specified button support
+ * @param button Button to check
+ */
+ bool CheckHMICapabilities(mobile_apis::ButtonName::eType button);
+
DISALLOW_COPY_AND_ASSIGN(SubscribeButtonRequest);
};
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
index 64a6510fc..25accb1db 100644
--- 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
@@ -34,8 +34,15 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_REQUEST_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_REQUEST_H_
+#include <string>
#include "application_manager/commands/command_request_impl.h"
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
namespace application_manager {
namespace commands {
@@ -68,9 +75,18 @@ class SystemRequest : public CommandRequestImpl {
* @param event The received event
*/
virtual void on_event(const event_engine::Event& event);
- private:
+private:
+ /**
+ * @brief Validates data coming within QueryApps response
+ * @param data Data
+ * @return true, if data is valid, otherwise - false
+ */
+ bool ValidateQueryAppData(const smart_objects::SmartObject& data) const;
+
+ private:
static uint32_t index;
+ std::string processing_file_;
DISALLOW_COPY_AND_ASSIGN(SystemRequest);
};
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
index 3ec216de2..58c9dc8de 100644
--- 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
@@ -64,6 +64,12 @@ class UnsubscribeButtonRequest : public CommandRequestImpl {
virtual void Run();
private:
+ /**
+ * @brief Sends ButtonSubscription notification
+ * to notify HMI that app unsubscribed from the button.
+ */
+ void SendUnsubscribeButtonNotification();
+
DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonRequest);
};
diff --git a/src/components/application_manager/include/application_manager/event_engine/event.h b/src/components/application_manager/include/application_manager/event_engine/event.h
index e76b767f1..55f5cd132 100644
--- a/src/components/application_manager/include/application_manager/event_engine/event.h
+++ b/src/components/application_manager/include/application_manager/event_engine/event.h
@@ -77,7 +77,7 @@ class Event {
*
* @param so The smart_object received in HMI response
*/
- void set_smart_object(smart_objects::SmartObject& so);
+ void set_smart_object(const smart_objects::SmartObject& so);
/*
* @brief Retrieves event smart object
diff --git a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h
index 875add282..ff21b01c5 100644
--- a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h
+++ b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h
@@ -97,6 +97,13 @@ class EventDispatcher : public utils::Singleton<EventDispatcher> {
*/
virtual ~EventDispatcher();
+ /*
+ * @brief removes observer
+ * when occurs unsubscribe from event
+ * @param observer to be removed
+ */
+ void remove_observer_from_list(EventObserver* const observer);
+
DISALLOW_COPY_AND_ASSIGN(EventDispatcher);
FRIEND_BASE_SINGLETON_CLASS(EventDispatcher);
@@ -108,7 +115,10 @@ class EventDispatcher : public utils::Singleton<EventDispatcher> {
// Members section
sync_primitives::Lock state_lock_;
+ sync_primitives::Lock observer_list_lock_;
EventObserverMap observers_;
+ ObserverList observers_list_;
+
};
}
diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities.h b/src/components/application_manager/include/application_manager/hmi_capabilities.h
index 20a849bae..277455ff4 100644
--- a/src/components/application_manager/include/application_manager/hmi_capabilities.h
+++ b/src/components/application_manager/include/application_manager/hmi_capabilities.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -362,6 +362,50 @@ class HMICapabilities {
void set_prerecorded_speech(
const smart_objects::SmartObject& prerecorded_speech);
+ /*
+ * @brief Interface used to store information if navigation
+ * supported by the system
+ *
+ * @param supported Indicates if navigation supported by the system
+ */
+ void set_navigation_supported(bool supported);
+
+ /*
+ * @brief Retrieves information if navi supported by the system
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ inline bool navigation_supported() const;
+
+ /*
+ * @brief Interface used to store information if phone call
+ * supported by the system
+ *
+ * @param supported Indicates if navigation supported by the sustem
+ */
+ void set_phone_call_supported(bool supported);
+
+ /*
+ * @brief Retrieves information if phone call supported by the system
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ inline bool phone_call_supported() const;
+
+ /*
+ * @brief Interface used to store information about software version of the target
+ *
+ * @param ccpu_version Received system/hmi software version
+ */
+ void set_ccpu_version(const std::string& ccpu_version);
+
+ /*
+ * @brief Returns software version of the target
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ inline const std::string& ccpu_version() const;
+
protected:
/*
@@ -426,6 +470,9 @@ class HMICapabilities {
smart_objects::SmartObject* speech_capabilities_;
smart_objects::SmartObject* audio_pass_thru_capabilities_;
smart_objects::SmartObject* prerecorded_speech_;
+ bool is_navigation_supported_;
+ bool is_phone_call_supported_;
+ std::string ccpu_version_;
ApplicationManagerImpl* app_mngr_;
@@ -533,6 +580,18 @@ HMICapabilities::prerecorded_speech() const {
return prerecorded_speech_;
}
+bool HMICapabilities::navigation_supported() const {
+ return is_navigation_supported_;
+}
+
+bool HMICapabilities::phone_call_supported() const {
+ return is_phone_call_supported_;
+}
+
+const std::string& HMICapabilities::ccpu_version() const {
+ return ccpu_version_;
+}
+
} // namespace application_manager
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
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
index d6f85a480..89936e4ca 100644
--- a/src/components/application_manager/include/application_manager/hmi_command_factory.h
+++ b/src/components/application_manager/include/application_manager/hmi_command_factory.h
@@ -51,7 +51,7 @@ class HMICommandFactory {
* @param smartObject SmartObject shared pointer.
* @return Pointer to created command object.
**/
- static CommandSharedPtr CreateCommand(const MessageSharedPtr& message);
+ static CommandSharedPtr CreateCommand(const commands::MessageSharedPtr& message);
private:
HMICommandFactory();
diff --git a/src/components/application_manager/include/application_manager/hmi_state.h b/src/components/application_manager/include/application_manager/hmi_state.h
new file mode 100644
index 000000000..4451fb685
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/hmi_state.h
@@ -0,0 +1,186 @@
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMISTATE_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMISTATE_H
+
+#include <list>
+#include "interfaces/MOBILE_API.h"
+#include "utils/shared_ptr.h"
+#include "application_manager/state_context.h"
+
+namespace application_manager {
+
+class HmiState;
+typedef utils::SharedPtr<HmiState> HmiStatePtr;
+typedef std::list<HmiStatePtr> HmiStateList;
+
+ /**
+ * @brief The HmiState class
+ * Handle Hmi state of application (hmi level,
+ * audio streaming state, system context)
+ *
+ */
+class HmiState {
+
+ public:
+ /**
+ * @brief The StateID enum describes state of application
+ * If no events occured STATE_ID_DEFAULT shuld be presented
+ */
+ enum StateID {
+ STATE_ID_REGULAR,
+ STATE_ID_PHONE_CALL,
+ STATE_ID_SAFETY_MODE,
+ STATE_ID_VR_SESSION,
+ STATE_ID_TTS_SESSION,
+ STATE_ID_NAVI_STREAMING,
+ };
+
+ HmiState(uint32_t app_id, const StateContext& state_context_);
+ HmiState(uint32_t app_id, const StateContext& state_context_,
+ StateID state_id);
+
+
+ virtual ~HmiState() {}
+
+ /**
+ * @brief setParent setup parent state
+ * @param parent state to setup
+ */
+ void set_parent(HmiStatePtr parent);
+
+ /**
+ * @brief parent get parent state
+ * @return parent state
+ */
+ const HmiStatePtr parent() const {
+ return parent_;
+ }
+
+ /**
+ * @brief hmi_level
+ * @return return hmi level member
+ */
+ virtual mobile_apis::HMILevel::eType hmi_level() const {
+ if (parent_) {
+ return parent_->hmi_level();
+ }
+ return hmi_level_;
+ }
+ /**
+ * @brief set_hmi_level set hmi_level member
+ * @param hmi_level hmi level to setup
+ */
+ void set_hmi_level(mobile_apis::HMILevel::eType hmi_level) {
+ hmi_level_ = hmi_level;
+ }
+
+ /**
+ * @brief audio_streaming_state
+ * @return return audio streaming state member
+ */
+ virtual mobile_apis::AudioStreamingState::eType
+ audio_streaming_state() const {
+ if (parent_) {
+ return parent_->audio_streaming_state();
+ }
+ return audio_streaming_state_;
+ }
+ /**
+ * @brief set_audio_streaming_state set audio_streaming_state member
+ * @param audio_state audio_state to setup
+ */
+ virtual void set_audio_streaming_state(
+ mobile_apis::AudioStreamingState::eType audio_state) {
+ audio_streaming_state_ = audio_state;
+ }
+
+ /**
+ * @brief system_context
+ * @return return system context member
+ */
+ virtual mobile_apis::SystemContext::eType system_context() const {
+ if (parent_) {
+ return parent_->system_context();
+ }
+ return system_context_;
+ }
+
+ /**
+ * @brief set_system_context set system_context member
+ * @param system_context system_context to setup
+ */
+ virtual void set_system_context(
+ mobile_apis::SystemContext::eType system_context){
+ system_context_ = system_context;
+ }
+
+ /**
+ * @brief state_id state type
+ * @return reutrn state type
+ */
+ StateID state_id() const {
+ return state_id_;
+ }
+ protected:
+ uint32_t app_id_;
+ StateID state_id_;
+ const StateContext& state_context_;
+ HmiStatePtr parent_;
+ mobile_apis::HMILevel::eType hmi_level_;
+ mobile_apis::AudioStreamingState::eType audio_streaming_state_;
+ mobile_apis::SystemContext::eType system_context_;
+ private:
+ void operator=(const HmiState&);
+};
+
+/**
+ * @brief The VRHmiState class impement logic of VR temporary state
+ */
+class VRHmiState : public HmiState {
+ public:
+ virtual mobile_apis::AudioStreamingState::eType audio_streaming_state() const;
+ VRHmiState(uint32_t app_id, StateContext& state_context);
+};
+
+/**
+ * @brief The TTSHmiState class impement logic of TTS temporary state
+ */
+class TTSHmiState : public HmiState {
+ public:
+ TTSHmiState(uint32_t app_id, StateContext& state_context);
+ virtual mobile_apis::AudioStreamingState::eType audio_streaming_state() const;
+};
+
+/**
+ * @brief The NaviStreamingState class impement logic of NaviStreaming temporary state
+ */
+class NaviStreamingHmiState : public HmiState {
+ public:
+ NaviStreamingHmiState(uint32_t app_id, StateContext& state_context);
+ virtual mobile_apis::AudioStreamingState::eType audio_streaming_state() const;
+};
+
+/**
+ * @brief The PhoneCallHmiState class impement logic of PhoneCall temporary state
+ */
+class PhoneCallHmiState : public HmiState {
+ public:
+ PhoneCallHmiState(uint32_t app_id, StateContext& state_context);
+ virtual mobile_apis::HMILevel::eType hmi_level() const;
+ virtual mobile_apis::AudioStreamingState::eType audio_streaming_state() const {
+ return mobile_apis::AudioStreamingState::NOT_AUDIBLE;
+ }
+};
+
+/**
+ * @brief The SafetyModeHmiState class impement logic of SafetyMode temporary state
+ */
+class SafetyModeHmiState : public HmiState {
+ public:
+ SafetyModeHmiState(uint32_t app_id, StateContext& state_context);
+ virtual mobile_apis::AudioStreamingState::eType audio_streaming_state() const {
+ return mobile_apis::AudioStreamingState::NOT_AUDIBLE;
+ }
+};
+
+}
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMISTATE_H
diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h
index d92c89adf..5a2c8bdc1 100644
--- a/src/components/application_manager/include/application_manager/message.h
+++ b/src/components/application_manager/include/application_manager/message.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -64,7 +64,8 @@ enum ProtocolVersion {
kHMI = 0,
kV1 = 1,
kV2 = 2,
- kV3 = 3
+ kV3 = 3,
+ kV4 = 4
};
class Message {
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 6bfc36e09..cfd3d4c72 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (c) 2013, Ford Motor Company
All rights reserved.
@@ -67,9 +67,6 @@ typedef std::map<std::string, VehicleDataType> VehicleData;
**/
class MessageHelper {
public:
-
- typedef std::vector<smart_objects::SmartObject*> SmartObjectList;
-
/**
* @brief Creates request for different interfaces(JSON, DBUS)
* @param correlation_id unique ID
@@ -99,7 +96,17 @@ class MessageHelper {
/**
* @brief Create mobile HashUpdateNotification
*/
- static smart_objects::SmartObject* GetHashUpdateNotification(const uint32_t app_id);
+ static smart_objects::SmartObjectSPtr GetHashUpdateNotification(const uint32_t app_id);
+
+ /**
+ * @brief Create OnSystemRequest notification for lock screen icon url
+ */
+ static smart_objects::SmartObject* GetLockScreenIconUrlNotification(const uint32_t connection_key);
+
+ /**
+ * @brief Send the OnSystemRequest notification for lock screen icon url to the mobile device
+ */
+ static void SendLockScreenIconUrlNotification(const uint32_t connection_key);
/**
* @brief Sends to mobile HashUpdateNotification
@@ -149,7 +156,7 @@ class MessageHelper {
static std::string StringifiedFunctionID(
mobile_apis::FunctionID::eType function_id);
- static smart_objects::SmartObject* CreateBlockedByPoliciesResponse(
+ static smart_objects::SmartObjectSPtr CreateBlockedByPoliciesResponse(
mobile_apis::FunctionID::eType function_id,
mobile_apis::Result::eType result, uint32_t correlation_id,
uint32_t connection_key);
@@ -161,45 +168,64 @@ class MessageHelper {
* @param devices Devices list
*
*/
- static smart_objects::SmartObject* CreateDeviceListSO(
- const connection_handler::DeviceMap& devices);
+ static smart_objects::SmartObjectSPtr CreateDeviceListSO(
+ const connection_handler::DeviceMap& devices);
- static smart_objects::SmartObject* CreateModuleInfoSO(
- uint32_t function_id);
+ static smart_objects::SmartObjectSPtr CreateModuleInfoSO(
+ uint32_t function_id);
- static smart_objects::SmartObject* CreateSetAppIcon(
- const std::string& path_to_icon, uint32_t app_id);
+ static smart_objects::SmartObjectSPtr CreateSetAppIcon(
+ const std::string& path_to_icon, uint32_t app_id);
/**
- * @brief Sends IVI subscriptions
+ * @brief Sends IVI subscription requests
*/
static bool SendIVISubscribtions(const uint32_t app_id);
/**
- * @brief Sends IVI subscriptions
+ * @brief Returns IVI subscription requests
*/
- static SmartObjectList GetIVISubscribtionRequests(const uint32_t app_id);
+ static smart_objects::SmartObjectList GetIVISubscriptionRequests(ApplicationSharedPtr app);
+
+ /**
+ * @brief Sends button subscription notification
+ */
+ static void SendOnButtonSubscriptionNotification(
+ uint32_t app_id, hmi_apis::Common_ButtonName::eType button, bool is_subscribed);
+
+ /**
+ * @brief Sends button subscription notifications for all buttons
+ * that application is subscribed on
+ */
+ static void SendAllOnButtonSubscriptionNotificationsForApp(
+ ApplicationConstSharedPtr app);
static void SendAppDataToHMI(ApplicationConstSharedPtr app);
static void SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app);
- static SmartObjectList CreateGlobalPropertiesRequestsToHMI(ApplicationConstSharedPtr app);
+ static smart_objects::SmartObjectList CreateGlobalPropertiesRequestsToHMI(ApplicationConstSharedPtr app);
- static smart_objects::SmartObject* CreateAppVrHelp(ApplicationConstSharedPtr app);
+ static smart_objects::SmartObjectSPtr CreateAppVrHelp(
+ ApplicationConstSharedPtr app);
- static SmartObjectList CreateShowRequestToHMI(ApplicationConstSharedPtr app);
+ static smart_objects::SmartObjectList CreateShowRequestToHMI(ApplicationConstSharedPtr app);
static void SendShowRequestToHMI(ApplicationConstSharedPtr app);
static void SendShowConstantTBTRequestToHMI(ApplicationConstSharedPtr app);
static void SendAddCommandRequestToHMI(ApplicationConstSharedPtr app);
- static SmartObjectList CreateAddCommandRequestToHMI(ApplicationConstSharedPtr app);
+ static smart_objects::SmartObjectList CreateAddCommandRequestToHMI(ApplicationConstSharedPtr app);
+ /**
+ * @brief Sends UI_ChangeRegistration to HMI with list of AppHMIType
+ * @param app applicaton instace
+ */
+ static void SendUIChangeRegistrationRequestToHMI(ApplicationConstSharedPtr app);
static void SendChangeRegistrationRequestToHMI(ApplicationConstSharedPtr app);
static void SendAddVRCommandToHMI(
uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
uint32_t app_id);
- static smart_objects::SmartObject* CreateAddVRCommandToHMI(
- uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
- uint32_t app_id);
+ static smart_objects::SmartObjectSPtr CreateAddVRCommandToHMI(
+ uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
+ uint32_t app_id);
/*
* @brief Create Common.HMIApplication struct application instance
@@ -211,7 +237,7 @@ class MessageHelper {
smart_objects::SmartObject& output);
static void SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app);
- static SmartObjectList CreateAddSubMenuRequestToHMI(ApplicationConstSharedPtr app);
+ static smart_objects::SmartObjectList CreateAddSubMenuRequestToHMI(ApplicationConstSharedPtr app);
/*
* @brief Creates BasicCommunication.OnAppUnregistered notification
@@ -221,9 +247,10 @@ class MessageHelper {
*/
static void SendOnAppUnregNotificationToHMI(ApplicationConstSharedPtr app,
bool is_unexpected_disconnect = false);
- static void SendActivateAppToHMI(
+ static uint32_t SendActivateAppToHMI(
uint32_t const app_id,
- hmi_apis::Common_HMILevel::eType level = hmi_apis::Common_HMILevel::FULL);
+ hmi_apis::Common_HMILevel::eType level = hmi_apis::Common_HMILevel::FULL,
+ bool send_policy_priority = true);
static void SendOnResumeAudioSourceToHMI(const uint32_t app_id);
@@ -305,6 +332,29 @@ class MessageHelper {
unsigned int connection_key, const std::vector<uint8_t>& policy_data,
const std::string& url = "", int timeout = -1);
+ static void SendSystemRequestNotification(
+ uint32_t connection_key,
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& content);
+
+ /**
+ * @brief SendLaunchApp allows to send OnSystemRequest with LAUNCH_UP.
+ *
+ * @param connection_key application id.
+ *
+ * @param urlSchema application's url schema.
+ *
+ * @param packageName application's package name.
+ */
+ static void SendLaunchApp(uint32_t connection_key,
+ const std::string& urlSchema,
+ const std::string& packageName);
+
+ /**
+ * @brief Sends OnSystemRequest which queries remote apps list
+ * @param connection_key application id, which is used for sending out
+ */
+ static void SendQueryApps(uint32_t connection_key);
+
/*
* @brief Send notification to mobile on application permissions update
* @param connection_key Id of application to send message to
@@ -365,6 +415,9 @@ class MessageHelper {
*/
static void SendAudioStopStream(int32_t connection_key);
+ static void SendOnDataStreaming(protocol_handler::ServiceType service,
+ bool available);
+
/*
* @brief Sends notification to HMI to stop audioPathThru
*
@@ -374,9 +427,9 @@ class MessageHelper {
*/
static bool SendStopAudioPathThru();
- static smart_objects::SmartObject* CreateNegativeResponse(
- uint32_t connection_key, int32_t function_id, uint32_t correlation_id,
- int32_t result_code);
+ static smart_objects::SmartObjectSPtr CreateNegativeResponse(
+ uint32_t connection_key, int32_t function_id, uint32_t correlation_id,
+ int32_t result_code);
/*
* @brief Verify image and add image file full path
@@ -421,6 +474,16 @@ class MessageHelper {
smart_objects::SmartObject& message_params,
ApplicationConstSharedPtr app);
+ /**
+ * @brief checkWithPolicy allows to check soft button's parameters
+ * according to the current policy
+ * @param system_action system action
+ * @param app_mobile_id policy application id
+ * @return
+ */
+ static bool CheckWithPolicy(mobile_apis::SystemAction::eType system_action,
+ const std::string& app_mobile_id);
+
/*
* @brief subscribe application to softbutton
*
@@ -451,6 +514,14 @@ class MessageHelper {
hmi_apis::Common_Language::eType language);
/**
+ * @brief Converts string to common language enum value
+ * @param language language as string
+ * @return Common language enum value
+ */
+ static hmi_apis::Common_Language::eType CommonLanguageFromString(
+ const std::string& language);
+
+ /**
* @brief Gets command limit number per minute for specific application
* @param policy_app_id Unique application id
* @return Limit for number of command per minute
@@ -471,7 +542,16 @@ class MessageHelper {
static void SendTTSGlobalProperties(
ApplicationSharedPtr app, bool default_help_prompt);
- private:
+ /**
+ * @brief SendSetAppIcon allows to send SetAppIcon request.
+ *
+ * @param app_id application for which icon request should be sent.
+ *
+ * @param icon_path path to the icon.
+ */
+ static void SendSetAppIcon(uint32_t app_id,
+ const std::string& icon_path);
+ private:
/**
* @brief Allows to fill SO according to the current permissions.
* @param permissions application permissions.
@@ -480,8 +560,9 @@ class MessageHelper {
static void FillAppRevokedPermissions(const policy::AppPermissions& permissions,
smart_objects::SmartObject& message);
- static smart_objects::SmartObject* CreateChangeRegistration(
- int32_t function_id, int32_t language, uint32_t app_id);
+ static smart_objects::SmartObjectSPtr CreateChangeRegistration(
+ int32_t function_id, int32_t language, uint32_t app_id,
+ const smart_objects::SmartObject* app_types = NULL);
MessageHelper();
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
index 1bf60fb74..b28e0abb3 100644
--- a/src/components/application_manager/include/application_manager/mobile_command_factory.h
+++ b/src/components/application_manager/include/application_manager/mobile_command_factory.h
@@ -51,7 +51,9 @@ class MobileCommandFactory {
* @param smartObject SmartObject shared pointer.
* @return Pointer to created command object.
**/
- static commands::Command* CreateCommand(const MessageSharedPtr& message);
+ static commands::Command* CreateCommand(
+ const commands::MessageSharedPtr& message,
+ commands::Command::CommandOrigin origin);
private:
MobileCommandFactory();
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 67d51c0da..5e8d551ae 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
@@ -41,13 +41,20 @@ namespace application_manager {
typedef utils::SharedPtr<application_manager::Message> MobileMessage;
class MobileMessageHandler {
public:
+ static application_manager::Message* HandleIncomingMessageProtocol(
+ const protocol_handler::RawMessagePtr message);
+
+ static protocol_handler::RawMessage* HandleOutgoingMessageProtocol(
+ const MobileMessage& message);
+ //! -------------------------------------------------------------
+ private:
static application_manager::Message* HandleIncomingMessageProtocolV1(
const protocol_handler::RawMessagePtr message);
static application_manager::Message* HandleIncomingMessageProtocolV2(
const protocol_handler::RawMessagePtr message);
- //! -------------------------------------------------------------
+ //! -------------------------------------------------------------
static protocol_handler::RawMessage* HandleOutgoingMessageProtocolV1(
const MobileMessage& message);
@@ -55,8 +62,6 @@ class MobileMessageHandler {
static protocol_handler::RawMessage* HandleOutgoingMessageProtocolV2(
const MobileMessage& message);
- //! -------------------------------------------------------------
- private:
DISALLOW_COPY_AND_ASSIGN(MobileMessageHandler);
};
} // namespace application_manager
diff --git a/src/components/application_manager/include/application_manager/policies/policy_event_observer.h b/src/components/application_manager/include/application_manager/policies/policy_event_observer.h
index 7fdfb4e0a..e251170fe 100644
--- a/src/components/application_manager/include/application_manager/policies/policy_event_observer.h
+++ b/src/components/application_manager/include/application_manager/policies/policy_event_observer.h
@@ -34,26 +34,26 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_EVENT_OBSERVER_H_
#include "application_manager/event_engine/event_observer.h"
-#include "utils/shared_ptr.h"
namespace policy {
namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-class PolicyManager;
+class PolicyHandler;
class PolicyEventObserver :
public application_manager::event_engine::EventObserver {
public:
- PolicyEventObserver(utils::SharedPtr<PolicyManager> policy_manager);
+ explicit PolicyEventObserver(policy::PolicyHandler* const policy_handler);
+ void set_policy_handler(policy::PolicyHandler* const policy_handler);
void on_event(const application_manager::event_engine::Event& event);
void subscribe_on_event(
const application_manager::event_engine::Event::EventID& event_id,
int32_t hmi_correlation_id = 0);
private:
- utils::SharedPtr<PolicyManager> policy_manager_;
+ sync_primitives::Lock policy_handler_lock_;
+ PolicyHandler* policy_handler_;
void ProcessOdometerEvent(const smart_objects::SmartObject& message);
};
} // namespace policy
-
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_EVENT_OBSERVER_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 dfc29fe00..39ab4205d 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
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (c) 2013, Ford Motor Company
All rights reserved.
@@ -39,10 +39,17 @@
#include <vector>
#include "policy/policy_manager.h"
#include "application_manager/policies/policy_event_observer.h"
-#include "application_manager/policies/pt_exchange_handler.h"
+#include "application_manager/policies/delegates/statistics_delegate.h"
#include "utils/logger.h"
#include "utils/singleton.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+#include "utils/conditional_variable.h"
+#include "utils/rwlock.h"
#include "usage_statistics/statistics_manager.h"
+#include "application_manager/policies/policy_handler_observer.h"
+#include "utils/threads/async_runner.h"
+#include "application_manager/application_manager_impl.h"
namespace Json {
class Value;
@@ -54,7 +61,8 @@ typedef std::vector<uint32_t> DeviceHandles;
class PolicyHandler :
public utils::Singleton<PolicyHandler, utils::deleters::Deleter<PolicyHandler> >,
- public PolicyListener {
+ public PolicyListener,
+ public threads::AsyncRunner {
public:
virtual ~PolicyHandler();
bool LoadPolicyLibrary();
@@ -62,14 +70,20 @@ class PolicyHandler :
bool InitPolicyTable();
bool ResetPolicyTable();
bool ClearUserConsent();
- bool SendMessageToSDK(const BinaryMessage& pt_string);
+ bool SendMessageToSDK(const BinaryMessage& pt_string, const std::string& url);
bool ReceiveMessageFromSDK(const std::string& file,
const BinaryMessage& pt_string);
bool UnloadPolicyLibrary();
- void OnPTExchangeNeeded();
- void OnPermissionsUpdated(const std::string& policy_app_id,
- const Permissions& permissions,
- const HMILevel& default_hmi);
+ virtual void OnPermissionsUpdated(const std::string& policy_app_id,
+ const Permissions& permissions,
+ const HMILevel& default_hmi);
+
+ virtual void OnPermissionsUpdated(const std::string& policy_app_id,
+ const Permissions& permissions);
+
+ virtual void OnSnapshotCreated(const BinaryMessage& pt_string,
+ const std::vector<int>& retry_delay_seconds,
+ int timeout_exchange);
bool GetPriority(const std::string& policy_app_id, std::string* priority);
void CheckPermissions(const PTString& app_id,
@@ -85,33 +99,31 @@ class PolicyHandler :
bool GetInitialAppData(const std::string& application_id,
StringArray* nicknames = NULL,
StringArray* app_hmi_types = NULL);
- EndpointUrls GetUpdateUrls(int service_type);
+ void GetServiceUrls(const std::string& service_type,
+ EndpointUrls& end_points);
+
+ std::string GetLockScreenIconUrl() const;
void ResetRetrySequence();
int NextRetryTimeout();
int TimeoutExchange();
void OnExceededTimeout();
- BinaryMessageSptr RequestPTUpdate();
- const std::vector<int> RetrySequenceDelaysSeconds();
+ void OnSystemReady();
+ void PTUpdatedAt(int kilometers, int days_after_epoch);
+ void add_listener(PolicyHandlerObserver* listener);
+ void remove_listener(PolicyHandlerObserver* listener);
utils::SharedPtr<usage_statistics::StatisticsManager> GetStatisticManager();
/**
- * Checks system action of application for permission of keep context
- * @param system_action system action (see mobile api)
- * @param policy_app_id unique application id
- * @return false if system_action is KEEP_CONTEXT and it isn't allowed by policy
- * otherwise true
- */
- bool CheckKeepContext(int system_action, const std::string& policy_app_id);
-
- /**
- * Checks system action of application for permission of steal focus
- * @param system_action system action (see mobile api)
- * @param policy_app_id unique application id
- * @return false if system_action is STEAL_FOCUS and it isn't allowed by policy
- * otherwise true
+ * @brief CheckSystemAction allows to check whether certain system
+ * action is enabled.
+ *
+ * @param system_action system action to check.
+ *
+ * @return true if specified system action is enabled, false otherwise.
*/
- bool CheckStealFocus(int system_action, const std::string& policy_app_id);
+ bool CheckSystemAction(mobile_apis::SystemAction::eType system_action,
+ const std::string& policy_app_id);
/**
* Lets client to notify PolicyHandler that more kilometers expired
@@ -138,20 +150,9 @@ class PolicyHandler :
*/
void OnIgnitionCycleOver();
- /**
- * @brief Send notification to HMI concerning revocation of application
- * @param policy_app_id Unique identifier of application
- */
- void OnAppRevoked(const std::string& policy_app_id);
-
void OnPendingPermissionChange(const std::string& policy_app_id);
/**
- * Initializes PT exchange at ignition if need
- */
- void PTExchangeAtRegistration(const std::string& app_id);
-
- /**
* Initializes PT exchange at user request
* @param correlation_id correlation id of request
*/
@@ -171,7 +172,7 @@ class PolicyHandler :
* @param permissions User-changed group permissions consent
*/
void OnAppPermissionConsent(const uint32_t connection_key,
- PermissionConsent& permissions);
+ const PermissionConsent &permissions);
/**
* @brief Get appropriate message parameters and send them with response
@@ -204,7 +205,7 @@ class PolicyHandler :
* @brief Send notification to HMI with changed policy update status
* @param status Current policy update state
*/
- void OnUpdateStatusChanged(policy::PolicyTableStatus status);
+ void OnUpdateStatusChanged(const std::string& status);
/**
* @brief Update currently used device id in policies manager for given
@@ -271,11 +272,19 @@ class PolicyHandler :
std::string GetAppName(const std::string& policy_app_id);
- virtual void OnUserRequestedUpdateCheckRequired();
+ virtual void OnUpdateHMIAppType(std::map<std::string, StringArray> app_hmi_types);
+
+ virtual void OnCertificateUpdated(const std::string& certificate_data);
+
+ virtual bool CanUpdate();
virtual void OnDeviceConsentChanged(const std::string& device_id,
bool is_allowed);
+ virtual void OnPTExchangeNeeded();
+
+ virtual void GetAvailableApps(std::queue<std::string>& apps);
+
/**
* @brief Allows to add new or update existed application during
* registration process
@@ -303,6 +312,38 @@ class PolicyHandler :
*/
uint16_t HeartBeatTimeout(const std::string& app_id) const;
+ /**
+ * @brief Returns URL for querying list of remote apps
+ */
+ const std::string RemoteAppsUrl() const;
+
+ /**
+ * @brief Handler on applications search started
+ */
+ void OnAppsSearchStarted();
+
+ /**
+ * @brief Handler on applications search completed
+ */
+ void OnAppsSearchCompleted();
+
+ /**
+ * @brief Checks if certain request type is allowed for application
+ * @param policy_app_id Unique applicaion id
+ * @param type Request type
+ * @return true, if allowed, otherwise - false
+ */
+ bool IsRequestTypeAllowed(const std::string& policy_app_id,
+ mobile_apis::RequestType::eType type) const;
+
+ /**
+ * @brief Gets application request types
+ * @param policy_app_id Unique application id
+ * @return request types
+ */
+ const std::vector<std::string> GetAppRequestTypes(
+ const std::string& policy_app_id) const;
+
//TODO(AKutsan) REMOVE THIS UGLY HOTFIX
virtual void Increment(usage_statistics::GlobalCounterId type);
virtual void Increment(const std::string& app_id,
@@ -314,7 +355,6 @@ class PolicyHandler :
usage_statistics::AppStopwatchId type,
int32_t timespan_seconds);
-
protected:
/**
@@ -322,72 +362,80 @@ protected:
*/
void StartNextRetry();
- /**
- * Initializes PT exchange at odometer if need
- * @param kilometers value from odometer in kilometers
- */
- void PTExchangeAtOdometer(int kilometers);
+ private:
/**
- * Starts proccess updating policy table
+ * Checks system action of application for permission of keep context
+ * @param system_action system action (see mobile api)
+ * @param policy_app_id unique application id
+ * @return false if system_action is KEEP_CONTEXT and it isn't allowed by policy
+ * otherwise true
*/
- void StartPTExchange(bool skip_device_selection = false);
+ bool CheckKeepContext(const std::string& policy_app_id);
- private:
/**
- * @brief Choose device according to app HMI status and user consent for
- * device
- * @param device_info Struct with selected device parameters
- * @return consent status for selected device
+ * Checks system action of application for permission of steal focus
+ * @param system_action system action (see mobile api)
+ * @param policy_app_id unique application id
+ * @return false if system_action is STEAL_FOCUS and it isn't allowed by policy
+ * otherwise true
*/
- DeviceConsent GetDeviceForSending(DeviceParams& device_params);
+ bool CheckStealFocus(const std::string& policy_app_id);
/**
- * @brief Convert internal policy update status to appropriate status for HMI
- * @param status Internal policy update status
- * @return Converted status for sending to HMI
+ * @brief OnAppPermissionConsentInternal reacts on permission changing
+ *
+ * @param connection_key connection key
+ *
+ * @param permissions new permissions.
*/
- const std::string ConvertUpdateStatus(policy::PolicyTableStatus status);
-
+ void OnAppPermissionConsentInternal(const uint32_t connection_key,
+ PermissionConsent& permissions);
private:
-
class StatisticManagerImpl: public usage_statistics::StatisticsManager {
//TODO(AKutsan) REMOVE THIS UGLY HOTFIX
virtual void Increment(usage_statistics::GlobalCounterId type) {
- return PolicyHandler::instance()->Increment(type);
+
+ PolicyHandler::instance()->AsyncRun(new StatisticsDelegate(type));
}
virtual void Increment(const std::string& app_id,
usage_statistics::AppCounterId type) {
- return PolicyHandler::instance()->Increment(app_id, type);
+
+ PolicyHandler::instance()->AsyncRun(new StatisticsDelegate(app_id,
+ type));
}
virtual void Set(const std::string& app_id,
usage_statistics::AppInfoId type,
const std::string& value) {
- return PolicyHandler::instance()->Set(app_id, type, value);
+
+ PolicyHandler::instance()->AsyncRun(new StatisticsDelegate(app_id,
+ type,
+ value));
}
virtual void Add(const std::string& app_id,
usage_statistics::AppStopwatchId type,
int32_t timespan_seconds) {
- return PolicyHandler::instance()->Add(app_id, type, timespan_seconds);
+
+ PolicyHandler::instance()->AsyncRun(new StatisticsDelegate(
+ app_id, type, timespan_seconds));
}
};
//TODO(AKutsan) REMOVE THIS UGLY HOTFIX
PolicyHandler();
+ bool SaveSnapshot(const BinaryMessage& pt_string, std::string& snap_path);
static PolicyHandler* instance_;
static const std::string kLibrary;
+ mutable sync_primitives::RWLock policy_manager_lock_;
utils::SharedPtr<PolicyManager> policy_manager_;
void* dl_handle_;
AppIds last_used_app_ids_;
- utils::SharedPtr<PTExchangeHandler> exchange_handler_;
utils::SharedPtr<PolicyEventObserver> event_observer_;
- bool on_ignition_check_done_;
uint32_t last_activated_app_id_;
- bool registration_in_progress;
/**
* @brief Contains device handles, which were sent for user consent to HMI
@@ -396,7 +444,9 @@ private:
inline bool CreateManager();
- bool is_user_requested_policy_table_update_;
+ typedef std::list <PolicyHandlerObserver*> HandlersCollection;
+ HandlersCollection listeners_;
+ sync_primitives::Lock listeners_lock_;
/**
* @brief Application-to-device map is used for getting/setting user consents
@@ -404,9 +454,12 @@ private:
*/
std::map<std::string, std::string> app_to_device_link_;
+ // Lock for app to device list
+ sync_primitives::Lock app_to_device_link_lock_;
utils::SharedPtr<StatisticManagerImpl> statistic_manager_impl_;
+ friend class AppPermissionDelegate;
DISALLOW_COPY_AND_ASSIGN(PolicyHandler);
FRIEND_BASE_SINGLETON_CLASS_WITH_DELETER(PolicyHandler,
diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler_observer.h b/src/components/application_manager/include/application_manager/policies/policy_handler_observer.h
index 558b2a4b3..c9b32b7e1 100644
--- a/src/components/application_manager/include/application_manager/policies/policy_handler_observer.h
+++ b/src/components/application_manager/include/application_manager/policies/policy_handler_observer.h
@@ -38,6 +38,7 @@ namespace policy {
class PolicyHandlerObserver{
public:
virtual void OnUpdateHMIAppType(std::map<std::string, std::vector<std::string> > app_hmi_types) = 0;
+ virtual void OnCertificateUpdated(const std::string& certificate_data) {}
virtual ~PolicyHandlerObserver() {}
};
} // namespace policy
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 2bc5f5466..cddcd7233 100644
--- a/src/components/application_manager/include/application_manager/request_controller.h
+++ b/src/components/application_manager/include/application_manager/request_controller.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -54,20 +54,16 @@ namespace application_manager {
namespace request_controller {
-using namespace threads;
-
/**
* @brief RequestController class is used to control currently active mobile
* requests.
*/
class RequestController {
public:
-
/**
* @brief Result code for addRequest
*/
- enum TResult
- {
+ enum TResult {
SUCCESS = 0,
TOO_MANY_REQUESTS,
TOO_MANY_PENDING_REQUESTS,
@@ -78,8 +74,7 @@ class RequestController {
/**
* @brief Thread pool state
*/
- enum TPoolState
- {
+ enum TPoolState {
UNDEFINED = 0,
STARTED,
STOPPED,
@@ -120,7 +115,7 @@ class RequestController {
* @return Result code
*
*/
- TResult addMobileRequest(const MobileRequestPtr& request,
+ TResult addMobileRequest(const RequestPtr request,
const mobile_apis::HMILevel::eType& hmi_level);
@@ -140,22 +135,36 @@ class RequestController {
*/
void addNotification(const RequestPtr ptr);
+
/**
* @brief Removes request from queue
*
- * @param mobile_corellation_id Active mobile request correlation ID
+ * @param correlation_id Active request correlation ID,
+ * @param connection_key Active request connection key (0 for HMI requersts)
+ * @param force_terminate if true, request controller will terminate
+ * even if not allowed by request
+ */
+ void terminateRequest(const uint32_t& correlation_id,
+ const uint32_t& connection_key,
+ bool force_terminate = false);
+
+ /**
+ * @brief Removes request from queue
+ *
+ * @param mobile_correlation_id Active mobile request correlation ID
*
*/
- void terminateMobileRequest(const uint32_t& mobile_correlation_id);
+ void OnMobileResponse(const uint32_t& mobile_correlation_id,
+ const uint32_t& connection_key);
/**
* @brief Removes request from queue
*
- * @param mobile_corellation_id Active mobile request correlation ID
+ * @param mobile_correlation_id Active mobile request correlation ID
*
*/
- void terminateHMIRequest(const uint32_t& correlation_id);
+ void OnHMIResponse(const uint32_t& correlation_id);
/**
* @ Add notification to collection
@@ -177,6 +186,12 @@ class RequestController {
*/
void terminateAllHMIRequests();
+
+ /**
+ * @brief Terminates all requests from Mobile
+ */
+ void terminateAllMobileRequests();
+
/**
* @brief Updates request timeout
*
@@ -188,30 +203,22 @@ class RequestController {
const uint32_t& mobile_correlation_id,
const uint32_t& new_timeout);
- protected:
-
- /**
- * @brief Checs if this app as able to add new requests, or limits was exceeded
- * @param app_id - application id
- * @param app_time_scale - time scale (seconds)
- * @param max_request_per_time_scale - maximum count of request that should be allowed for app_time_scale secconds
+ /*
+ * @brief Function Should be called when Low Voltage is occured
*/
- bool checkTimeScaleMaxRequest(const uint32_t& app_id,
- const uint32_t& app_time_scale,
- const uint32_t& max_request_per_time_scale);
+ void OnLowVoltage();
- /**
- * @brief Checs if this app as able to add new requests in current hmi_level, or limits was exceeded
- * @param hmi_level - hmi level
- * @param app_id - application id
- * @param app_time_scale - time scale (seconds)
- * @param max_request_per_time_scale - maximum count of request that should be allowed for app_time_scale secconds
+ /*
+ * @brief Function Should be called when Low Voltage is occured
*/
- bool checkHMILevelTimeScaleMaxRequest(const mobile_apis::HMILevel::eType& hmi_level,
- const uint32_t& app_id,
- const uint32_t& app_time_scale,
- const uint32_t& max_request_per_time_scale);
+ void OnWakeUp();
+ bool IsLowVoltage();
+
+ protected:
+ /**
+ * @brief Timer Callback
+ */
void onTimer();
/**
@@ -220,16 +227,30 @@ class RequestController {
*/
void UpdateTimer();
- private:
+ void terminateWaitingForExecutionAppRequests(const uint32_t& app_id);
+ void terminateWaitingForResponseAppRequests(const uint32_t& app_id);
- // Data types
+ /**
+ * @brief Check Posibility to add new requests, or limits was exceeded
+ * @param request - request to check possipility to Add
+ * @return True if new request could be added, false otherwise
+ */
+ TResult CheckPosibilitytoAdd(const RequestPtr request);
+
+ /**
+ * @brief Check Posibility to add new requests, or limits was exceeded
+ * @param pending_requests_amount - maximum count of request that should be allowed for all applications
+ * @return True if new request could be added, false otherwise
+ */
+ bool CheckPendingRequestsAmount(const uint32_t& pending_requests_amount);
- class Worker : public ThreadDelegate {
+ private:
+ class Worker : public threads::ThreadDelegate {
public:
- Worker(RequestController* requestController);
+ explicit Worker(RequestController* requestController);
virtual ~Worker();
virtual void threadMain();
- virtual bool exitThreadMain();
+ virtual void exitThreadMain();
protected:
private:
RequestController* request_controller_;
@@ -237,25 +258,33 @@ class RequestController {
volatile bool stop_flag_;
};
- std::vector<Thread*> pool_;
+ std::vector<threads::Thread*> pool_;
volatile TPoolState pool_state_;
uint32_t pool_size_;
sync_primitives::ConditionalVariable cond_var_;
- std::list<MobileRequestPtr> mobile_request_list_;
- sync_primitives::Lock mobile_request_list_lock_;
+ std::list<RequestInfoPtr> mobile_request_info_list_;
+ sync_primitives::Lock mobile_request_info_list_lock_;
- RequestInfoSet pending_request_set_;
- sync_primitives::Lock pending_request_set_lock_;
+ /*
+ * Requests, that are waiting for responses
+ * RequestInfoSet provides correct processing of requests with thre same
+ * app_id and corr_id
+ */
+ RequestInfoSet waiting_for_response_;
/**
* @brief Set of HMI notifications with timeout.
*/
std::list<RequestPtr> notification_list_;
- timer::TimerThread<RequestController> timer_;
+ /*
+ * timer for checking requests timeout
+ */
+ timer::TimerThread<RequestController> timer_;
static const uint32_t dafault_sleep_time_ = UINT_MAX;
+ bool is_low_voltage_;
DISALLOW_COPY_AND_ASSIGN(RequestController);
};
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 b1409488f..3b48d78d4 100644
--- a/src/components/application_manager/include/application_manager/request_info.h
+++ b/src/components/application_manager/include/application_manager/request_info.h
@@ -1,34 +1,34 @@
-/**
-* \file request_info.h
-* \brief request information structure header file.
-*
-* 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)
+/*
+ * \file request_info.h
+ * \brief request information structure header file.
+ *
+ * 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.
*/
@@ -37,6 +37,7 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_INFO_H_
#include <stdint.h>
+#include <set>
#include "application_manager/commands/command_request_impl.h"
#include "commands/hmi/request_to_hmi.h"
@@ -52,56 +53,48 @@ namespace request_controller {
*
*/
typedef utils::SharedPtr<commands::Command> RequestPtr;
- typedef utils::SharedPtr<commands::CommandRequestImpl> MobileRequestPtr;
struct RequestInfo {
- RequestInfo(const uint64_t timeout_sec)
- : timeout_sec_(timeout_sec) {
- start_time_ = date_time::DateTime::getCurrentTime();
- updateEndTime();
- }
+ enum RequestType {MobileRequest, HMIRequest};
- RequestInfo(const TimevalStruct& start_time,const uint64_t timeout_sec)
- : start_time_(start_time),
+ RequestInfo() {}
+ virtual ~RequestInfo() {}
+
+ RequestInfo(RequestPtr request,
+ const RequestType requst_type,
+ const uint64_t timeout_sec)
+ : request_(request),
timeout_sec_(timeout_sec) {
+ start_time_ = date_time::DateTime::getCurrentTime();
updateEndTime();
- }
+ requst_type_ = requst_type;
+ }
- virtual ~RequestInfo(){}
+ RequestInfo(RequestPtr request, const RequestType requst_type,
+ const TimevalStruct& start_time, const uint64_t timeout_sec);
- virtual uint32_t requestId() = 0;
- virtual commands::Command* request() = 0;
+ void updateEndTime();
- void updateEndTime() {
- end_time_ = date_time::DateTime::getCurrentTime();
- end_time_.tv_sec += timeout_sec_;
+ void updateTimeOut(const uint64_t& timeout_sec);
- // possible delay during IPC
- const uint32_t hmi_delay_sec = 1;
- end_time_.tv_sec += hmi_delay_sec;
- }
-
- void updateTimeOut(const uint64_t& timeout_sec) {
- timeout_sec_ = timeout_sec;
- updateEndTime();
- }
-
- bool isExpired() {
- if ( date_time::GREATER ==
- date_time::DateTime::compareTime(end_time_, date_time::DateTime::getCurrentTime()) ) {
- return false;
- }
- return true;
- }
+ bool isExpired();
TimevalStruct start_time() {
return start_time_;
}
+ void update_start_time(TimevalStruct start_time) {
+ start_time_ = start_time;
+ }
+
uint64_t timeout_sec() {
return timeout_sec_;
}
+ void set_timeout_sec(uint64_t timeout) {
+ timeout_sec_ = timeout;
+ }
+
TimevalStruct end_time() {
return end_time_;
}
@@ -114,65 +107,194 @@ namespace request_controller {
return hmi_level_;
}
+ void set_hmi_level(const mobile_apis::HMILevel::eType& level) {
+ hmi_level_ = level;
+ }
+
+ RequestType requst_type() const {
+ return requst_type_;
+ }
+
+ uint32_t requestId() {
+ return correlation_id_;
+ }
+
+ commands::Command* request() {
+ return request_.get();
+ }
+ uint64_t hash();
+ static uint64_t GenerateHash(uint32_t var1, uint32_t var2);
+ static uint32_t HmiConnectoinKey;
protected:
+ RequestPtr request_;
TimevalStruct start_time_;
uint64_t timeout_sec_;
TimevalStruct end_time_;
uint32_t app_id_;
mobile_apis::HMILevel::eType hmi_level_;
+ RequestType requst_type_;
+ uint32_t correlation_id_;
};
typedef utils::SharedPtr<RequestInfo> RequestInfoPtr;
- struct RequestInfoComparator {
- bool operator() (const RequestInfoPtr lhs,
- const RequestInfoPtr rhs) const {
- date_time::TimeCompare compare_result =
- date_time::DateTime::compareTime(lhs->end_time(), rhs->end_time());
-
- return compare_result == date_time::LESS;
- }
+ struct MobileRequestInfo: public RequestInfo {
+ MobileRequestInfo(RequestPtr request,
+ const uint64_t timeout_sec);
+ MobileRequestInfo(RequestPtr request,
+ const TimevalStruct& start_time,
+ const uint64_t timeout_sec);
};
- typedef std::set<RequestInfoPtr,RequestInfoComparator> RequestInfoSet;
-
struct HMIRequestInfo: public RequestInfo {
HMIRequestInfo(RequestPtr request, const uint64_t timeout_sec);
HMIRequestInfo(RequestPtr request, const TimevalStruct& start_time,
const uint64_t timeout_sec);
+ };
- RequestPtr request_;
- uint32_t correlation_id_;
-
- virtual uint32_t requestId() {
- return correlation_id_;
- }
-
- virtual commands::Command* request() {
- return request_.get();
- }
+ // Request info, for searching in request info set by log_n time
+ // Returns correct hash by app_id and corr_id
+ struct FakeRequestInfo :public RequestInfo {
+ FakeRequestInfo(uint32_t app_id, uint32_t correaltion_id);
};
- struct MobileRequestInfo: public RequestInfo {
- MobileRequestInfo(RequestPtr request,
- const uint64_t timeout_sec);
+ struct RequestInfoTimeComparator {
+ bool operator() (const RequestInfoPtr lhs,
+ const RequestInfoPtr rhs) const;
+ };
- MobileRequestInfo(RequestPtr request,
- const TimevalStruct& start_time,
- const uint64_t timeout_sec);
+ struct RequestInfoHashComparator {
+ bool operator() (const RequestInfoPtr lhs,
+ const RequestInfoPtr rhs) const;
+ };
- RequestPtr request_;
- uint32_t mobile_correlation_id_;
- virtual uint32_t requestId() {
- return mobile_correlation_id_;
- }
+ typedef std::set<RequestInfoPtr, RequestInfoTimeComparator> TimeSortedRequestInfoSet;
+ typedef std::set<RequestInfoPtr, RequestInfoHashComparator> HashSortedRequestInfoSet;
- virtual commands::Command* request() {
- return request_.get();
- }
+ /*
+ * @brief RequestInfoSet provides uniue requests bu corralation_id and app_id
+ *
+ */
+ class RequestInfoSet {
+ public:
+ /*
+ * @brief Add requests into colletion by log(n) time
+ * @param request_info - request to add
+ * @return false is request with the same app_id and correlation_id exist
+ */
+ bool Add(RequestInfoPtr request_info);
+
+ /*
+ * @brief Find requests int colletion by log(n) time
+ * @param connection_key - connection_key of request
+ * @param correlation_id - correlation_id of request
+ * @return founded request or shared_ptr with NULL
+ */
+ RequestInfoPtr Find(const uint32_t connection_key,
+ const uint32_t correlation_id);
+
+ /*
+ * @brief Get request with smalest end_time_
+ * @return founded request or shared_ptr with NULL
+ */
+ RequestInfoPtr Front();
+
+ /*
+ * @brief Get request with smalest end_time_ != 0
+ * @return founded request or shared_ptr with NULL
+ */
+ RequestInfoPtr FrontWithNotNullTimeout();
+
+ /*
+ * @brief Erase request from colletion by log(n) time
+ * @param request_info - request to erase
+ * @return true if Erase succes, otherwise return false
+ */
+ bool RemoveRequest(const RequestInfoPtr request_info);
+
+ /*
+ * @brief Erase request from colletion by connection_key
+ * @param connection_key - connection_key of requests to erase
+ * @return count of erased requests
+ */
+ uint32_t RemoveByConnectionKey(uint32_t connection_key);
+
+ /*
+ * @brief Erase all mobile requests from controller
+ * @return count of erased requests
+ */
+ uint32_t RemoveMobileRequests();
+
+ /*
+ * @return count of requestd in collections
+ */
+ const size_t Size();
+
+ /**
+ * @brief Check if this app is able to add new requests,
+ * or limits was exceeded
+ * @param app_id - application id
+ * @param app_time_scale - time scale (seconds)
+ * @param max_request_per_time_scale - maximum count of request
+ * that should be allowed for app_time_scale seconds
+ * @return True if new request could be added, false otherwise
+ */
+ bool CheckTimeScaleMaxRequest(uint32_t app_id,
+ uint32_t app_time_scale,
+ uint32_t max_request_per_time_scale);
+
+ /**
+ * @brief Check if this app is able to add new requests
+ * in current hmi_level, or limits was exceeded
+ * @param hmi_level - hmi level
+ * @param app_id - application id
+ * @param app_time_scale - time scale (seconds)
+ * @param max_request_per_time_scale - maximum count of request
+ * that should be allowed for app_time_scale seconds
+ * @return True if new request could be added, false otherwise
+ */
+ bool CheckHMILevelTimeScaleMaxRequest(mobile_apis::HMILevel::eType hmi_level,
+ uint32_t app_id,
+ uint32_t app_time_scale,
+ uint32_t max_request_per_time_scale);
+ private:
+ /*
+ * @brief Comparator of connection key for std::find_if function
+ */
+ struct AppIdCompararator {
+ enum CompareType {Equal, NotEqual};
+ AppIdCompararator(CompareType compare_type, uint32_t app_id):
+ app_id_(app_id),
+ compare_type_(compare_type) {}
+ bool operator()(const RequestInfoPtr value_compare) const;
+
+ private:
+ uint32_t app_id_;
+ CompareType compare_type_;
+ };
+
+ bool Erase(const RequestInfoPtr request_info);
+
+ /*
+ * @brief Erase requests from collection if filter allows
+ * @param filter - filtering predicate
+ * @return count of erased requests
+ */
+ uint32_t RemoveRequests(const RequestInfoSet::AppIdCompararator& filter);
+
+ /*
+ * @brief Debug function, will raise assert if set sizes are noit equal
+ */
+ inline void CheckSetSizes();
+ 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_;
};
+
/**
* @brief Structure used in std algorithms to determine amount of request
* during time scale
@@ -186,7 +308,6 @@ namespace request_controller {
app_id_(app_id) {}
bool operator()(RequestInfoPtr setEntry) {
-
if (!setEntry.valid()) {
return false;
}
@@ -247,6 +368,7 @@ namespace request_controller {
return true;
}
+
private:
TimevalStruct start_;
TimevalStruct end_;
@@ -254,9 +376,7 @@ namespace request_controller {
mobile_apis::HMILevel::eType hmi_level_;
};
-
-
} // namespace request_controller
-} // namespace application_manager
+} // namespace application_manager
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_INFO_H_
diff --git a/src/components/application_manager/include/application_manager/resume_ctrl.h b/src/components/application_manager/include/application_manager/resume_ctrl.h
index 463df0b86..99d694570 100644
--- a/src/components/application_manager/include/application_manager/resume_ctrl.h
+++ b/src/components/application_manager/include/application_manager/resume_ctrl.h
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -88,7 +88,7 @@ class ResumeCtrl: public event_engine::EventObserver {
* @param application is application witch HMI Level is need to restore
* @return true if success, otherwise return false
*/
- bool RestoreApplicationHMILevel(ApplicationSharedPtr application);
+ bool RestoreAppHMIState(ApplicationSharedPtr application);
/**
* @brief Set application HMI Level as stored in policy
@@ -106,9 +106,8 @@ class ResumeCtrl: public event_engine::EventObserver {
* @param check_policy indicate if policy data consent must be verified
* @return true if success, otherwise return false
*/
- bool SetupHMILevel(ApplicationSharedPtr application,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_streaming_state,
+ bool SetAppHMIState(ApplicationSharedPtr application,
+ const mobile_apis::HMILevel::eType hmi_level,
bool check_policy = true);
/**
@@ -127,15 +126,33 @@ class ResumeCtrl: public event_engine::EventObserver {
/**
* @brief Remove application from list of saved applications
- * @param application is application witch need to be removed
+ * @param mobile_app_id application witch need to be removed
* @return return true, if success, otherwise return false
*/
- bool RemoveApplicationFromSaved(ApplicationConstSharedPtr application);
+ bool RemoveApplicationFromSaved(const std::string& mobile_app_id);
/**
* @brief Increments ignition counter for all registered applications
+ * and remember ign_off time stamp
*/
- void IgnitionOff();
+ void Suspend();
+
+ /**
+ * @brief Increments ignition counter for all registered applications
+ * and remember ign_off time stamp
+ */
+ void OnAwake();
+
+ /**
+ * @brief Method starts timer "RsmCtrlPercist" when SDL receives onAwakeSDL notification
+ */
+ void StartSavePersistentDataTimer();
+
+ /**
+ * @brief Method stops timer "RsmCtrlPercist" when SDL receives OnExitAllApplication notification
+ * with reason "SUSPEND"
+ */
+ void StopSavePersistentDataTimer();
/**
* @brief Start timer for resumption applications
@@ -143,7 +160,7 @@ class ResumeCtrl: public event_engine::EventObserver {
* @param application that is need to be restored
* @return true if it was saved, otherwise return false
*/
- bool StartResumption(ApplicationSharedPtr application, uint32_t hash);
+ bool StartResumption(ApplicationSharedPtr application, const std::string& hash);
/**
* @brief Start timer for resumption applications
@@ -165,7 +182,7 @@ class ResumeCtrl: public event_engine::EventObserver {
* @param application that is need to be restored
* @return true if it was saved, otherwise return false
*/
- bool CheckApplicationHash(ApplicationSharedPtr application, uint32_t hash);
+ bool CheckApplicationHash(ApplicationSharedPtr application, const std::string& hash);
/**
* @brief Check if Resume controller have saved application with hmi app id
@@ -192,17 +209,36 @@ class ResumeCtrl: public event_engine::EventObserver {
uint32_t GetHMIApplicationID(const std::string& mobile_app_id);
/**
- * @brief Timer callback function
- *
+ * @brief SaveDataOnTimer :
+ * Timer callback for persisting ResumptionData each N seconds
+ * N gets from property
*/
- void onTimer();
+ void SaveDataOnTimer();
void ClearResumptionInfo();
+ void ApplicationsDataUpdated() {
+ is_data_saved = false;
+ }
+
+ /**
+ * @brief Resume HMI Level and audio streaming state if needed
+ * @param application - application to restore hmi level
+ * and audio streaming state
+ */
+ void StartAppHmiStateResumption(ApplicationSharedPtr application);
+ /**
+ * @brief Update launch_time_ to current
+ */
+ void ResetLaunchTime();
+
private:
+
typedef std::pair<uint32_t, uint32_t> application_timestamp;
+ std::set<ApplicationSharedPtr> retrieve_application();
+
/**
* @brief This struct need to map
* timestamp and application from correlationID
@@ -220,6 +256,12 @@ class ResumeCtrl: public event_engine::EventObserver {
};
/**
+ * @brief geter for launch_time_
+ * @return value of launch_time_
+ */
+ time_t launch_time() const;
+
+ /**
* @brief Check device MAC address
*
* @param application that is need to be restored
@@ -229,9 +271,34 @@ class ResumeCtrl: public event_engine::EventObserver {
*/
bool IsDeviceMacAddressEqual(ApplicationSharedPtr application,
const std::string& saved_device_mac);
+ /**
+ * @brief Get Resumption section of LastState
+ * @return Resumption section of LastState in Json
+ */
+ Json::Value& GetResumptionData();
+ /**
+ * @brief Get applications for resumption of LastState
+ * @return applications for resumption of LastState
+ */
Json::Value& GetSavedApplications();
+ /**
+ * @brief Get the last ignition off time from LastState
+ * @return the last ignition off time from LastState
+ */
+ time_t GetIgnOffTime();
+
+ /**
+ * @brief Setup IgnOff time to LastState
+ * @param ign_off_time - igition off time
+ */
+ void SetLastIgnOffTime(time_t ign_off_time);
+
+ /**
+ * @brief Set applications for resumption to LastState
+ * @parems apps_json applications to write in LastState
+ */
void SetSavedApplication(Json::Value& apps_json);
Json::Value GetApplicationCommands(
@@ -249,21 +316,184 @@ class ResumeCtrl: public event_engine::EventObserver {
Json::Value GetApplicationShow(
ApplicationConstSharedPtr application);
- Json::Value JsonFromSO(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject *so);
+ Json::Value JsonFromSO(const smart_objects::SmartObject *so);
- void SendHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ uint32_t SendHMIRequest(const hmi_apis::FunctionID::eType& function_id,
const smart_objects::SmartObject* msg_params = NULL,
bool use_events = false);
bool ProcessHMIRequest(
- NsSmartDeviceLink::NsSmartObjects::SmartObject* request = NULL,
+ smart_objects::SmartObjectSPtr request = NULL,
bool use_events = false);
+ void InsertToTimerQueue(uint32_t app_id, uint32_t time_stamp);
+
+ /**
+ * @brief AddFiles allows to add files for the application
+ * which should be resumed
+ *
+ * @param application application which will be resumed
+ *
+ * @param saved_app application specific section from backup file
+ */
+ void AddFiles(ApplicationSharedPtr application, const Json::Value& saved_app);
+
/**
- * @brief Time step to check resumption TIME_OUT
+ * @brief AddSubmenues allows to add sub menues for the application
+ * which should be resumed
+ *
+ * @param application application which will be resumed
+ *
+ * @param saved_app application specific section from backup file
+ */
+ void AddSubmenues(ApplicationSharedPtr application, const Json::Value& saved_app);
+
+ /**
+ * @brief AddCommands allows to add commands for the application
+ * which should be resumed
+ *
+ * @param application application which will be resumed
+ *
+ * @param saved_app application specific section from backup file
+ */
+ void AddCommands(ApplicationSharedPtr application, const Json::Value& saved_app);
+
+ /**
+ * @brief AddChoicesets allows to add choice sets for the application
+ * which should be resumed
+ *
+ * @param application application which will be resumed
+ *
+ * @param saved_app application specific section from backup file
+ */
+ void AddChoicesets(ApplicationSharedPtr application, const Json::Value& saved_app);
+
+ /**
+ * @brief SetGlobalProperties allows to restore global properties.
+ *
+ * @param application application which will be resumed
+ *
+ * @param saved_app application specific section from backup file
+ */
+ void SetGlobalProperties(ApplicationSharedPtr application, const Json::Value& saved_app);
+
+ /**
+ * @brief AddSubscriptions allows to restore subscriptions
+ *
+ * @param application application which will be resumed
+ *
+ * @param saved_app application specific section from backup file
+ */
+ void AddSubscriptions(ApplicationSharedPtr application, const Json::Value& saved_app);
+
+ /**
+ * @brief ProcessHMIRequests allows to process obtained requests.
+ *
+ * @param requests request that should be processed.
+ */
+ void ProcessHMIRequests(const smart_objects::SmartObjectList& requests);
+
+ /**
+ * @brief CheckIcons allows to check application icons
+ *
+ * @param application application under resumtion application
+ *
+ * @param json_object
+ *
+ * @return true in case icons exists, false otherwise
+ */
+ bool CheckIcons(ApplicationSharedPtr application, const Json::Value& json_object);
+
+ /**
+ * @brief GetFromSavedOrAppend allows to get existed record about application
+ * or adds the new one.
+ *
+ * @param mobile_app_id application id.
+ *
+ * @return the reference to the record in applications array.
+ */
+ Json::Value& GetFromSavedOrAppend(const std::string& mobile_app_id);
+
+ /**
+ * @brief CheckIgnCycleRestrictions checks if is needed to resume HMI state
+ * by ign cycle restrictions
+ * @param json_app - saved application
+ * @return true if resumptions allowed, otherwise return false
+ */
+ bool CheckIgnCycleRestrictions(const Json::Value& json_app);
+
+ /**
+ * @brief DisconnectedInLastIgnCycle should check if was connected in prev ign cycle
+ * @param json_app - saved applicationa
+ * @return true if app connected in frep ign_cycle otherwise return false
+ */
+ bool DisconnectedInLastIgnCycle(const Json::Value& json_app);
+
+ /**
+ * @brief DisconnectedJustBeforeIgnOff should check if application
+ * was dissconnected in N secconds delay before ign off.
+ * N will be readed from profile
+ * @param json_app - saved applicationa
+ * @return was dissconnected in N secconds delay before ign off
+ * otherwise return false
+ */
+ bool DisconnectedJustBeforeIgnOff(const Json::Value& json_app);
+
+ /**
+ * @brief CheckDelayAfterIgnOn should check if SDL was started less
+ * then N secconds ago. N will be readed from profile.
+ * @return true if SDL started N secconds ago, otherwise return false
+ */
+ bool CheckDelayAfterIgnOn();
+
+ /**
+ * @brief CheckAppRestrictions checks if is needed to resume HMI state
+ * by application type and saved app_level
+ * @param json_app - saved application
+ * @return true if resumptions allowed, otherwise return false
+ */
+ bool CheckAppRestrictions(ApplicationSharedPtr application,
+ const Json::Value& json_app);
+ /**
+ * @brief GetObjectIndex allows to obtain specified obbject index from
+ * applications arrays.
+ *
+ * @param mobile_app_id application id that should be found.
+ *
+ * @return application's index of or -1 if it doesn't exists
+ */
+ int GetObjectIndex(const std::string& mobile_app_id);
+
+ /**
+ * @brief Timer callback for restoring HMI Level
+ *
+ */
+ void ApplicationResumptiOnTimer();
+
+ /*
+ * @brief Loads data on start up
+ */
+ void LoadResumeData();
+
+ /*
+ * @brief Return true if application resumption data is valid,
+ * otherwise false
+ *
+ * @param index application index in the resumption list
*/
- static const uint32_t kTimeStep = 3;
+ bool IsResumptionDataValid(uint32_t index);
+
+ template<typename Iterator>
+ Json::Value Append(Iterator first,
+ Iterator last,
+ const std::string& key,
+ Json::Value& result) {
+ while (first != last) {
+ result[key].append(*first);
+ ++first;
+ }
+ return result;
+ }
/**
* @brief times of IGN_OFF that zombie application have to be saved.
@@ -275,10 +505,15 @@ class ResumeCtrl: public event_engine::EventObserver {
* wait for timer to resume HMI Level
*
*/
- std::multiset<application_timestamp, TimeStampComparator> waiting_for_timer_;
mutable sync_primitives::Lock queue_lock_;
+ sync_primitives::Lock resumtion_lock_;
ApplicationManagerImpl* app_mngr_;
- timer::TimerThread<ResumeCtrl> timer_;
+ timer::TimerThread<ResumeCtrl> save_persistent_data_timer_;
+ timer::TimerThread<ResumeCtrl> restore_hmi_level_timer_;
+ std::vector<uint32_t> waiting_for_timer_;
+ bool is_resumption_active_;
+ bool is_data_saved;
+ time_t launch_time_;
};
} // namespace application_manager
diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h
index 3d0398987..ff8974d1f 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
@@ -47,14 +47,15 @@ const char connection_key[] = "connection_key";
const char error[] = "error";
const char error_msg[] = "message";
const char default_app_id[] = "default";
-
-
const char msg_params[] = "msg_params";
+const char method_name[] = "methodName";
const char info[] = "info";
const char app_id[] = "appID";
const char hmi_app_id[] = "hmiAppID";
const char device_mac[] = "deviceMAC";
const char url[] = "url";
+const char urlScheme[] = "urlScheme";
+const char packageName[] = "packageName";
const char cmd_icon[] = "cmdIcon";
const char result_code[] = "resultCode";
const char success[] = "success";
@@ -66,6 +67,7 @@ const char ngn_media_screen_app_name[] = "ngnMediaScreenAppName";
const char vr_synonyms[] = "vrSynonyms";
const char uses_vehicle_data[] = "usesVehicleData";
const char is_media_application[] = "isMediaApplication";
+const char greyOut[] = "greyOut";
const char language_desired[] = "languageDesired";
const char auto_activated_id[] = "autoActivateID";
const char app_type[] = "appType";
@@ -182,6 +184,7 @@ const char device_info[] = "deviceInfo";
const char name[] = "name";
const char id[] = "id";
const char isSDLAllowed[] = "isSDLAllowed";
+const char transport_type[] = "transportType";
const char application[] = "application";
const char applications[] = "applications";
const char icon[] = "icon";
@@ -239,6 +242,11 @@ const char slider_position[] = "sliderPosition";
const char system_action[] = "systemAction";
const char prerecorded_speech[] = "prerecordedSpeech";
const char supported_diag_modes[] = "supportedDiagModes";
+const char hmi_capabilities[] = "hmiCapabilities";
+const char navigation[] = "navigation";
+const char phone_call[] = "phoneCall";
+const char sdl_version[] = "sdlVersion";
+const char system_software_version[] = "systemSoftwareVersion";
const char priority[] = "priority";
//resuming
@@ -252,9 +260,14 @@ const char application_subscribtions[] = "subscribtions";
const char application_files[] = "applicationFiles";
const char application_show[] = "applicationShow";
const char resumption[] = "resumption";
+const char resume_app_list[] = "resume_app_list";
+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 suspend_count[] = "suspend_count";
+
const char connection_info[] = "connection_info";
const char is_download_complete[] = "is_download_complete";
@@ -268,8 +281,42 @@ const char location_description[] = "locationDescription";
const char address_lines[] = "addressLines";
const char phone_number[] = "phoneNumber";
const char location_image[] = "locationImage";
+const char is_suscribed[] = "isSubscribed";
+const char message_data[] = "messageData";
} // namespace strings
+namespace json {
+const char appId[] = "appId";
+const char name[] = "name";
+const char ios[] = "ios";
+const char android[] = "android";
+const char appHmiType[] = "appHmiType";
+const char urlScheme[] = "urlScheme";
+const char packageName[] = "packageName";
+const char response[] = "response";
+const char is_media_application[] = "isMediaApplication";
+const char default_[] = "default";
+const char languages[] = "languages";
+const char ttsName[] = "ttsName";
+const char vrSynonyms[] = "vrSynonyms";
+} // namespace json
+
+namespace http_request {
+const char httpRequest[] = "HTTPRequest";
+const char headers[] = "headers";
+const char content_type[] = "ContentType";
+const char connect_timeout[] = "ConnectTimout";
+const char do_output[] = "DoOutput";
+const char do_input[] = "DoInput";
+const char use_caches[] = "UseCaches";
+const char request_method[] = "RequestMethod";
+const char read_timeout[] = "ReadTimeout";
+const char instance_follow_redirect[] = "InstanceFollowRedirect";
+const char charset[] = "charset";
+const char content_lenght[] = "Content_Lenght";
+const char GET[] = "GET";
+} // http_request
+
namespace mobile_notification {
const char state[] = "state";
const char syncp_timeout[] = "Timeout";
@@ -350,6 +397,8 @@ const char screen_params[] = "screenParams";
const char num_custom_presets_available[] = "numCustomPresetsAvailable";
const char urls[] = "urls";
const char policy_app_id[] = "policyAppId";
+const char enabled[] = "enabled";
+
} // namespace hmi_response
namespace hmi_notification {
diff --git a/src/components/application_manager/include/application_manager/state_context.h b/src/components/application_manager/include/application_manager/state_context.h
new file mode 100644
index 000000000..94962c23b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/state_context.h
@@ -0,0 +1,75 @@
+/*
+ * 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_STATE_CONTEXT_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_STATE_CONTEXT_H_
+
+#include <inttypes.h>
+
+namespace application_manager {
+/**
+* @brief The StateContext implement acessing to data, that is required by HmiState
+*/
+class StateContext {
+ public:
+
+ /**
+ * @brief is_navi_app check if app is navi
+ * @param app_id application id
+ * @return true if app is navi, otherwise return false
+ */
+ bool is_navi_app(const uint32_t app_id) const;
+
+ /**
+ * @brief is_meida_app check if app is is meida
+ * @param app_id application id
+ * @return @return true if meida_app, otherwise return false
+ */
+ bool is_meida_app(const uint32_t app_id) const;
+
+ /**
+ * @brief is_voice_comunication_app check if app is voice comunication
+ * @param app_id application id
+ * @return @return true if voice_comunication_app, otherwise return false
+ */
+ bool is_voice_comunication_app(const uint32_t app_id) const;
+
+ /**
+ * @brief is_attenuated_supported check if HMI support attenuated mode
+ * @return true if supported, otherwise return false
+ */
+ bool is_attenuated_supported() const;
+};
+
+}
+#endif // STATE_CONTEXT_H
+
diff --git a/src/components/application_manager/include/application_manager/state_controller.h b/src/components/application_manager/include/application_manager/state_controller.h
new file mode 100644
index 000000000..fc10597a6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/state_controller.h
@@ -0,0 +1,408 @@
+/*
+ * 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_STATE_CONTROLLER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_STATE_CONTROLLER_H_
+#include <list>
+
+#include "application_manager/hmi_state.h"
+#include "application_manager/application.h"
+#include "event_engine/event_observer.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/state_context.h"
+#include "utils/lock.h"
+
+namespace application_manager {
+class ApplicationManagerImpl;
+class StateController : public event_engine::EventObserver {
+ public:
+
+ StateController();
+
+ /**
+ * @brief SetRegularState setup regular hmi state, tha 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 SetRegularState(ApplicationSharedPtr app,
+ HmiStatePtr state) {
+ if (!app) {
+ return;
+ }
+ DCHECK_OR_RETURN_VOID(state);
+ DCHECK_OR_RETURN_VOID(state->state_id() == HmiState::STATE_ID_REGULAR);
+
+ if (SendActivateApp) {
+ uint32_t corr_id = MessageHelper::SendActivateAppToHMI(app->app_id());
+ subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_ActivateApp,
+ corr_id);
+ waiting_for_activate[app->app_id()] = state;
+ } else {
+ ApplyRegularState(app, state);
+ }
+ }
+
+ /**
+ * @brief SetRegularState Change regular audio state
+ * @param app appication to setup regular State
+ * @param audio_state of new regular state
+ */
+ void SetRegularState(ApplicationSharedPtr app,
+ const mobile_apis::AudioStreamingState::eType audio_state);
+
+ /**
+ * @brief SetRegularState 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 SetRegularState(ApplicationSharedPtr app,
+ const mobile_apis::HMILevel::eType hmi_level,
+ const mobile_apis::AudioStreamingState::eType audio_state) {
+ if (!app) {
+ return;
+ }
+ HmiStatePtr prev_regular = app->RegularHmiState();
+ DCHECK_OR_RETURN_VOID(prev_regular);
+ HmiStatePtr hmi_state = CreateHmiState(app->app_id(),
+ 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_system_context(prev_regular->system_context());
+ SetRegularState<SendActivateApp>(app, hmi_state);
+ }
+
+
+ /**
+ * @brief SetRegularState Change regular hmi level
+ * @param app appication to setup regular State
+ * @param hmi_level of new regular state
+ * @param SendActivateApp: if true, ActivateAppRequest will be sent on HMI */
+ template <bool SendActivateApp>
+ void SetRegularState(ApplicationSharedPtr app,
+ const mobile_apis::HMILevel::eType hmi_level) {
+ if (!app) {
+ return;
+ }
+ HmiStatePtr prev_regular = app->RegularHmiState();
+ DCHECK_OR_RETURN_VOID(prev_regular);
+ HmiStatePtr hmi_state = CreateHmiState(app->app_id(),
+ HmiState::StateID::STATE_ID_REGULAR);
+ DCHECK_OR_RETURN_VOID(hmi_state);
+ hmi_state->set_hmi_level(hmi_level);
+ hmi_state->set_audio_streaming_state(prev_regular->audio_streaming_state());
+ hmi_state->set_system_context(prev_regular->system_context());
+ SetRegularState<SendActivateApp>(app, hmi_state);
+ }
+
+ /**
+ * @brief SetRegularState Change regular hmi level, audio state and system context
+ * @param app appication to setup regular State
+ * @param hmi_level of new regular state
+ * @param audio_state of new regular state
+ * @param system_context of new regular state
+ * @param SendActivateApp: if true, ActivateAppRequest will be sent on HMI */
+ template <bool SendActivateApp>
+ void SetRegularState(ApplicationSharedPtr app,
+ const mobile_apis::HMILevel::eType hmi_level,
+ const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::SystemContext::eType system_context) {
+ if (!app) {
+ return;
+ }
+
+ HmiStatePtr hmi_state = CreateHmiState(app->app_id(),
+ 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_system_context(system_context);
+ SetRegularState<SendActivateApp>(app, hmi_state);
+ }
+
+ /**
+ * @brief SetRegularState Change regular system context
+ * @param app appication to setup regular State
+ * @param system_context of new regular state
+ */
+ void SetRegularState(ApplicationSharedPtr app,
+ const mobile_apis::SystemContext::eType system_context) {
+ if (!app) {
+ return;
+ }
+ HmiStatePtr prev_regular = app->RegularHmiState();
+ DCHECK_OR_RETURN_VOID(prev_regular);
+ HmiStatePtr hmi_state = CreateHmiState(app->app_id(),
+ HmiState::StateID::STATE_ID_REGULAR);
+ DCHECK_OR_RETURN_VOID(hmi_state);
+ hmi_state->set_hmi_level(prev_regular->hmi_level());
+ hmi_state->set_audio_streaming_state(prev_regular->audio_streaming_state());
+ hmi_state->set_system_context(system_context);
+ SetRegularState<false>(app, hmi_state);
+ }
+
+ // EventObserver interface
+ void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief OnStateChanged send HMIStatusNotification if neded
+ * @param app application
+ * @param old_state state before change
+ * @param new_state state after change
+ */
+ void OnStateChanged(ApplicationSharedPtr app, HmiStatePtr old_state,
+ HmiStatePtr new_state);
+ /**
+ * @brief state_context getter for state_context
+ * @return
+ */
+ const StateContext& state_context() const {
+ return state_context_;
+ }
+
+ /**
+ * @brief ApplyStatesForApp apply active HMI states for new App without s
+ * ending any OnHMIStatus
+ * @param app application to apply states
+ */
+ void ApplyStatesForApp(ApplicationSharedPtr app);
+
+ /**
+ * @brief OnNaviStreamingStarted process Navi streaming started
+ */
+ void OnNaviStreamingStarted();
+
+ /**
+ * @brief OnNaviStreamingStopped process Navi streaming stopped
+ */
+ void OnNaviStreamingStopped();
+
+ private:
+ /**
+ * Execute Unary punction for each application
+ */
+ template < typename UnaryFunction,
+ typename ContextAcessor = ApplicationManagerImpl >
+ void ForEachApplication(UnaryFunction func) {
+ using namespace utils;
+ typename ContextAcessor::ApplicationListAccessor accessor;
+ typedef typename ContextAcessor::ApplictionSetConstIt Iter;
+ for (Iter it = accessor.begin(); it != accessor.end(); ++it) {
+ if (it->valid()) {
+ ApplicationConstSharedPtr const_app = *it;
+ func(ContextAcessor::instance()->application(const_app->app_id()));
+ }
+ }
+ }
+
+ /**
+ * @brief The HmiLevelConflictResolver struct
+ * Move other application to HmiStates if applied moved to FULL or LIMITED
+ */
+ struct HmiLevelConflictResolver {
+ ApplicationSharedPtr applied_;
+ HmiStatePtr state_;
+ StateController* state_ctrl_;
+ HmiLevelConflictResolver(ApplicationSharedPtr app,
+ HmiStatePtr state,
+ StateController* state_ctrl):
+ applied_(app), state_(state) {}
+ void operator()(ApplicationSharedPtr to_resolve);
+ };
+
+ /**
+ * Function to add new temporary HmiState for application
+ */
+ template <HmiState::StateID ID>
+ void HMIStateStarted(ApplicationSharedPtr app) {
+ DCHECK_OR_RETURN_VOID(app);
+ HmiStatePtr old_hmi_state = app->CurrentHmiState();
+ HmiStatePtr new_hmi_state = CreateHmiState(app->app_id(), ID);
+ DCHECK_OR_RETURN_VOID(new_hmi_state);
+ DCHECK_OR_RETURN_VOID(new_hmi_state->state_id() != HmiState::STATE_ID_REGULAR);
+ new_hmi_state->set_parent(old_hmi_state);
+ app->AddHMIState(new_hmi_state);
+ OnStateChanged(app, old_hmi_state, new_hmi_state);
+ }
+
+ /**
+ * @brief TempStateStarted add HMI State ID in StateController collection
+ * @param ID state identifier
+ */
+ void TempStateStarted(HmiState::StateID ID);
+
+ /**
+ * @brief TempStateStopped remove HMI State ID from StateController collection
+ * @param ID state identifier
+ */
+ void TempStateStopped(HmiState::StateID ID);
+
+
+ /**
+ * Function to remove temporary HmiState for application
+ */
+ template <HmiState::StateID ID>
+ void HMIStateStopped(ApplicationSharedPtr app) {
+ DCHECK_OR_RETURN_VOID(app);
+ HmiStatePtr cur = app->CurrentHmiState();
+ HmiStatePtr old_hmi_state = CreateHmiState(app->app_id(),
+ HmiState::StateID::STATE_ID_REGULAR);
+ 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_system_context(cur->system_context());
+ app->RemoveHMIState(ID);
+ HmiStatePtr new_hmi_state = app->CurrentHmiState();
+ OnStateChanged(app, old_hmi_state, new_hmi_state);
+ }
+
+ /**
+ * @brief ApplyRegularState setup regular hmi state, that will appear if no
+ * specific events are active, without sending ActivateApp
+ * @param app appication to setup default State
+ * @param state state of new defailt state
+ */
+ void ApplyRegularState(ApplicationSharedPtr app,
+ HmiStatePtr state);
+
+ /**
+ * @brief SetupRegularHmiState set regular HMI State without
+ * resolwing conflicts and ActivateApp request
+ * @param app application
+ * @param state hmi_state to setup
+ */
+ void SetupRegularHmiState(ApplicationSharedPtr app,
+ HmiStatePtr state);
+
+ /**
+ * @brief IsSameAppType checkis 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
+ * resolwing 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
+ */
+ 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
+ * resolwing 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);
+
+ /**
+ * @brief OnActivateAppResponse calback for activate app response
+ * @param message Smart Object
+ */
+ void OnActivateAppResponse(const smart_objects::SmartObject& message);
+
+ /**
+ * @brief OnPhoneCallStarted process Phone Call Started event
+ */
+ void OnPhoneCallStarted();
+
+ /**
+ * @brief OnPhoneCallEnded process Phone Call Ended event
+ */
+ void OnPhoneCallEnded();
+
+
+ /**
+ * @brief OnSafetyModeEnabled process Safety Mode Enable event
+ */
+ void OnSafetyModeEnabled();
+
+ /**
+ * @brief OnSafetyModeDisabled process Safety Mode Disable event
+ */
+ void OnSafetyModeDisabled();
+
+ /**
+ * @brief OnVRStarted process VR session started
+ */
+ void OnVRStarted();
+
+ /**
+ * @brief OnVREnded process VR session ended
+ */
+ void OnVREnded();
+ /**
+ * @brief OnTTSStarted process TTS session started
+ */
+ void OnTTSStarted();
+
+ /**
+ * @brief OnTTSEnded process TTS session ended
+ */
+ void OnTTSStopped();
+
+ /**
+ * @brief CreateHmiState creates Hmi state according to state_id
+ * @param app_id application ID
+ * @param state_id state id
+ * @return
+ */
+ HmiStatePtr CreateHmiState(uint32_t app_id, HmiState::StateID state_id);
+
+ typedef std::list<HmiState::StateID> StateIDList;
+ StateIDList active_states_;
+ sync_primitives::Lock active_states_lock_;
+ std::map<uint32_t, HmiStatePtr> waiting_for_activate;
+ StateContext state_context_;
+};
+
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_STATE_CONTROLLER_H_
+
diff --git a/src/components/application_manager/include/application_manager/time_metric_observer.h b/src/components/application_manager/include/application_manager/time_metric_observer.h
index 780401f6f..de3deb837 100644
--- a/src/components/application_manager/include/application_manager/time_metric_observer.h
+++ b/src/components/application_manager/include/application_manager/time_metric_observer.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
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 dcd57aee3..d6ff1f2c4 100644
--- a/src/components/application_manager/include/application_manager/usage_statistics.h
+++ b/src/components/application_manager/include/application_manager/usage_statistics.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/application_manager/src/application_data_impl.cc b/src/components/application_manager/src/application_data_impl.cc
index 56fc88ffe..bfdbadfc8 100644
--- a/src/components/application_manager/src/application_data_impl.cc
+++ b/src/components/application_manager/src/application_data_impl.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -30,15 +30,18 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <algorithm>
+
#include "application_manager/application_data_impl.h"
#include "application_manager/smart_object_keys.h"
+#include "utils/logger.h"
namespace application_manager {
+CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationDataImpl")
InitialApplicationDataImpl::InitialApplicationDataImpl()
: app_types_(NULL),
vr_synonyms_(NULL),
- mobile_app_id_(NULL),
tts_name_(NULL),
ngn_media_screen_name_(NULL),
language_(mobile_api::Language::INVALID_ENUM),
@@ -56,11 +59,6 @@ InitialApplicationDataImpl::~InitialApplicationDataImpl() {
vr_synonyms_ = NULL;
}
- if (mobile_app_id_) {
- delete mobile_app_id_;
- mobile_app_id_ = NULL;
- }
-
if (tts_name_) {
delete tts_name_;
tts_name_ = NULL;
@@ -82,8 +80,7 @@ InitialApplicationDataImpl::vr_synonyms() const {
return vr_synonyms_;
}
-const smart_objects::SmartObject*
-InitialApplicationDataImpl::mobile_app_id() const {
+std::string InitialApplicationDataImpl::mobile_app_id() const {
return mobile_app_id_;
}
@@ -124,11 +121,8 @@ void InitialApplicationDataImpl::set_vr_synonyms(
}
void InitialApplicationDataImpl::set_mobile_app_id(
- const smart_objects::SmartObject& mobile_app_id) {
- if (mobile_app_id_) {
- delete mobile_app_id_;
- }
- mobile_app_id_ = new smart_objects::SmartObject(mobile_app_id);
+ const std::string& mobile_app_id) {
+ mobile_app_id_ = mobile_app_id;
}
void InitialApplicationDataImpl::set_tts_name(
@@ -171,11 +165,12 @@ DynamicApplicationDataImpl::DynamicApplicationDataImpl()
menu_icon_(NULL),
tbt_show_command_(NULL),
commands_(),
+ commands_lock_(true),
sub_menu_(),
choice_set_map_(),
performinteraction_choice_set_map_(),
+ performinteraction_choice_set_lock_(true),
is_perform_interaction_active_(false),
- perform_interaction_ui_corrid_(0),
is_reset_global_properties_active_(false),
perform_interaction_mode_(-1) {
}
@@ -225,7 +220,11 @@ DynamicApplicationDataImpl::~DynamicApplicationDataImpl() {
PerformChoiceSetMap::iterator it = performinteraction_choice_set_map_.begin();
for (; performinteraction_choice_set_map_.end() != it; ++it) {
- delete it->second;
+ PerformChoice::iterator choice_it = performinteraction_choice_set_map_[it->first].begin();
+ for (; performinteraction_choice_set_map_[it->first].end() != choice_it; ++choice_it) {
+ delete choice_it->second;
+ }
+ performinteraction_choice_set_map_[it->first].clear();
}
performinteraction_choice_set_map_.clear();
}
@@ -265,18 +264,42 @@ DynamicApplicationDataImpl::tbt_show_command() const {
return tbt_show_command_;
}
-const NsSmartDeviceLink::NsSmartObjects::SmartObject *DynamicApplicationDataImpl::keyboard_props() const {
+const smart_objects::SmartObject* DynamicApplicationDataImpl::keyboard_props() const {
return keyboard_props_;
}
-const NsSmartDeviceLink::NsSmartObjects::SmartObject *DynamicApplicationDataImpl::menu_title() const {
+const smart_objects::SmartObject* DynamicApplicationDataImpl::menu_title() const {
return menu_title_;
}
-const NsSmartDeviceLink::NsSmartObjects::SmartObject* DynamicApplicationDataImpl::menu_icon() const {
+const smart_objects::SmartObject* DynamicApplicationDataImpl::menu_icon() const {
return menu_icon_;
}
+void DynamicApplicationDataImpl::load_global_properties(
+ const smart_objects::SmartObject& properties_so) {
+ SetGlobalProperties(properties_so.getElement(strings::vr_help_title),
+ &DynamicApplicationData::set_vr_help_title);
+
+ SetGlobalProperties(properties_so.getElement(strings::vr_help),
+ &DynamicApplicationData::set_vr_help);
+
+ SetGlobalProperties(properties_so.getElement(strings::timeout_prompt),
+ &DynamicApplicationData::set_timeout_prompt);
+
+ SetGlobalProperties(properties_so.getElement(strings::help_prompt),
+ &DynamicApplicationData::set_help_prompt);
+
+ SetGlobalProperties(properties_so.getElement(strings::keyboard_properties),
+ &DynamicApplicationData::set_keyboard_props);
+
+ SetGlobalProperties(properties_so.getElement(strings::menu_title),
+ &DynamicApplicationData::set_menu_title);
+
+ SetGlobalProperties(properties_so.getElement(strings::menu_icon),
+ &DynamicApplicationData::set_menu_icon);
+}
+
void DynamicApplicationDataImpl::set_help_prompt(
const smart_objects::SmartObject& help_prompt) {
if (help_prompt_) {
@@ -368,15 +391,34 @@ void DynamicApplicationDataImpl::set_menu_icon(
menu_icon_= new smart_objects::SmartObject(menu_icon);
}
+void DynamicApplicationDataImpl::SetGlobalProperties(
+ const smart_objects::SmartObject& param,
+ void (DynamicApplicationData::*callback)(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject&)) {
+
+ smart_objects::SmartType so_type = param.getType();
+ if (so_type != smart_objects::SmartType::SmartType_Invalid &&
+ so_type != smart_objects::SmartType::SmartType_Null) {
+ if (callback) {
+ (this->*callback)(param);
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Invalid or Null smart object");
+ }
+}
void DynamicApplicationDataImpl::AddCommand(
uint32_t cmd_id, const smart_objects::SmartObject& command) {
- commands_[cmd_id] = new smart_objects::SmartObject(command);
+ sync_primitives::AutoLock lock(commands_lock_);
+ CommandsMap::const_iterator it = commands_.find(cmd_id);
+ if (commands_.end() == it) {
+ commands_[cmd_id] = new smart_objects::SmartObject(command);
+ }
}
void DynamicApplicationDataImpl::RemoveCommand(uint32_t cmd_id) {
+ sync_primitives::AutoLock lock(commands_lock_);
CommandsMap::iterator it = commands_.find(cmd_id);
-
if (commands_.end() != it) {
delete it->second;
commands_.erase(it);
@@ -385,6 +427,7 @@ void DynamicApplicationDataImpl::RemoveCommand(uint32_t cmd_id) {
smart_objects::SmartObject* DynamicApplicationDataImpl::FindCommand(
uint32_t cmd_id) {
+ sync_primitives::AutoLock lock(commands_lock_);
CommandsMap::const_iterator it = commands_.find(cmd_id);
if (it != commands_.end()) {
return it->second;
@@ -396,10 +439,15 @@ 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) {
- sub_menu_[menu_id] = new smart_objects::SmartObject(menu);
+ sync_primitives::AutoLock lock(sub_menu_lock_);
+ SubMenuMap::const_iterator it = sub_menu_.find(menu_id);
+ if (sub_menu_.end() == it) {
+ sub_menu_[menu_id] = new smart_objects::SmartObject(menu);
+ }
}
void DynamicApplicationDataImpl::RemoveSubMenu(uint32_t menu_id) {
+ sync_primitives::AutoLock lock(sub_menu_lock_);
SubMenuMap::iterator it = sub_menu_.find(menu_id);
if (sub_menu_.end() != it) {
@@ -410,6 +458,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_);
SubMenuMap::const_iterator it = sub_menu_.find(menu_id);
if (it != sub_menu_.end()) {
return it->second;
@@ -420,6 +469,7 @@ smart_objects::SmartObject* DynamicApplicationDataImpl::FindSubMenu(
bool DynamicApplicationDataImpl::IsSubMenuNameAlreadyExist(
const std::string& name) {
+ sync_primitives::AutoLock lock(sub_menu_lock_);
for (SubMenuMap::iterator it = sub_menu_.begin();
sub_menu_.end() != it;
++it) {
@@ -433,10 +483,15 @@ bool DynamicApplicationDataImpl::IsSubMenuNameAlreadyExist(
void DynamicApplicationDataImpl::AddChoiceSet(
uint32_t choice_set_id, const smart_objects::SmartObject& choice_set) {
- choice_set_map_[choice_set_id] = new smart_objects::SmartObject(choice_set);
+ sync_primitives::AutoLock lock(choice_set_map_lock_);
+ 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);
+ }
}
void DynamicApplicationDataImpl::RemoveChoiceSet(uint32_t choice_set_id) {
+ sync_primitives::AutoLock lock(choice_set_map_lock_);
ChoiceSetMap::iterator it = choice_set_map_.find(choice_set_id);
if (choice_set_map_.end() != it) {
@@ -447,6 +502,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_);
ChoiceSetMap::const_iterator it = choice_set_map_.find(choice_set_id);
if (it != choice_set_map_.end()) {
return it->second;
@@ -456,30 +512,23 @@ smart_objects::SmartObject* DynamicApplicationDataImpl::FindChoiceSet(
}
void DynamicApplicationDataImpl::AddPerformInteractionChoiceSet(
- uint32_t choice_set_id, const smart_objects::SmartObject& vr_commands) {
- performinteraction_choice_set_map_[choice_set_id] =
- new smart_objects::SmartObject(vr_commands);
-}
-
-void DynamicApplicationDataImpl::DeletePerformInteractionChoiceSetMap() {
- PerformChoiceSetMap::iterator it = performinteraction_choice_set_map_.begin();
- for (; performinteraction_choice_set_map_.end() != it; ++it) {
+ uint32_t correlation_id, uint32_t choice_set_id,
+ const smart_objects::SmartObject& vr_commands) {
+ sync_primitives::AutoLock lock(performinteraction_choice_set_lock_);
+ 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_);
+ PerformChoice::iterator it =
+ performinteraction_choice_set_map_[correlation_id].begin();
+ for (; performinteraction_choice_set_map_[correlation_id].end() != it; ++it) {
delete it->second;
}
- performinteraction_choice_set_map_.clear();
-}
-
-smart_objects::SmartObject*
-DynamicApplicationDataImpl::FindPerformInteractionChoiceSet(
- uint32_t choice_set_id) const {
- PerformChoiceSetMap::const_iterator it = performinteraction_choice_set_map_
- .find(choice_set_id);
-
- if (it != performinteraction_choice_set_map_.end()) {
- return it->second;
- }
-
- return NULL;
+ performinteraction_choice_set_map_[correlation_id].clear();
+ performinteraction_choice_set_map_.erase(correlation_id);
}
void DynamicApplicationDataImpl::set_perform_interaction_active(
@@ -487,11 +536,6 @@ void DynamicApplicationDataImpl::set_perform_interaction_active(
is_perform_interaction_active_ = active;
}
-void DynamicApplicationDataImpl::set_perform_interaction_ui_corrid(
- uint32_t corr_id) {
- perform_interaction_ui_corrid_ = corr_id;
-}
-
void DynamicApplicationDataImpl::set_reset_global_properties_active(
bool active) {
is_reset_global_properties_active_ = active;
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index f52467f75..59b383044 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) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,13 +32,15 @@
#include <string>
#include <strings.h>
-#include <stdlib.h>
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
+#include "application_manager/application_manager_impl.h"
+#include "protocol_handler/protocol_handler.h"
#include "config_profile/profile.h"
#include "interfaces/MOBILE_API.h"
#include "utils/file_system.h"
#include "utils/logger.h"
+#include "utils/gen_hash.h"
namespace {
@@ -79,29 +81,28 @@ ApplicationImpl::ApplicationImpl(uint32_t application_id,
const std::string& app_name,
utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager)
: grammar_id_(0),
+ hmi_app_id_(0),
app_id_(application_id),
active_message_(NULL),
is_media_(false),
- allowed_support_navigation_(false),
- hmi_supports_navi_video_streaming_(false),
- hmi_supports_navi_audio_streaming_(false),
+ is_navi_(false),
+ video_streaming_approved_(false),
+ audio_streaming_approved_(false),
+ video_streaming_allowed_(false),
+ audio_streaming_allowed_(false),
+ video_streaming_suspended_(true),
+ audio_streaming_suspended_(true),
is_app_allowed_(true),
has_been_activated_(false),
- tts_speak_state_(false),
tts_properties_in_none_(false),
tts_properties_in_full_(false),
- hmi_level_(mobile_api::HMILevel::HMI_NONE),
put_file_in_none_count_(0),
delete_file_in_none_count_(0),
list_files_in_none_count_(0),
- system_context_(mobile_api::SystemContext::SYSCTXT_MAIN),
- audio_streaming_state_(mobile_api::AudioStreamingState::NOT_AUDIBLE),
device_(0),
usage_report_(mobile_app_id, statistics_manager),
protocol_version_(ProtocolVersion::kV3),
is_voice_communication_application_(false),
- is_video_stream_retry_active_(false),
- is_audio_stream_retry_active_(false),
video_stream_retry_number_(0),
audio_stream_retry_number_(0) {
@@ -110,15 +111,35 @@ ApplicationImpl::ApplicationImpl(uint32_t application_id,
cmd_number_to_time_limits_[mobile_apis::FunctionID::GetVehicleDataID] =
{date_time::DateTime::getCurrentTime(), 0};
-
- set_mobile_app_id(smart_objects::SmartObject(mobile_app_id));
+ set_mobile_app_id(mobile_app_id);
set_name(app_name);
+ MarkUnregistered();
// subscribe application to custom button by default
SubscribeToButton(mobile_apis::ButtonName::CUSTOM_BUTTON);
// load persistent files
LoadPersistentFiles();
+ HmiStatePtr initial_state =
+ ApplicationManagerImpl::instance()->CreateRegularState(app_id(),
+ mobile_apis::HMILevel::INVALID_ENUM,
+ mobile_apis::AudioStreamingState::INVALID_ENUM,
+ mobile_api::SystemContext::SYSCTXT_MAIN);
+ hmi_states_.push_back(initial_state);
+
+ video_stream_suspend_timeout_ =
+ profile::Profile::instance()->video_data_stopped_timeout() / 1000;
+ audio_stream_suspend_timeout_ =
+ profile::Profile::instance()->audio_data_stopped_timeout() / 1000;
+
+ video_stream_suspend_timer_ = ApplicationTimerPtr(
+ new timer::TimerThread<ApplicationImpl>(
+ "VideoStreamSuspend", this,
+ &ApplicationImpl::OnVideoStreamSuspend, true));
+ audio_stream_suspend_timer_ = ApplicationTimerPtr(
+ new timer::TimerThread<ApplicationImpl>(
+ "AudioStreamSuspend", this,
+ &ApplicationImpl::OnAudioStreamSuspend, true));
}
ApplicationImpl::~ApplicationImpl() {
@@ -133,7 +154,6 @@ ApplicationImpl::~ApplicationImpl() {
if (is_perform_interaction_active()) {
set_perform_interaction_active(0);
set_perform_interaction_mode(-1);
- DeletePerformInteractionChoiceSetMap();
}
CleanupFiles();
}
@@ -144,37 +164,32 @@ void ApplicationImpl::CloseActiveMessage() {
}
bool ApplicationImpl::IsFullscreen() const {
- return mobile_api::HMILevel::HMI_FULL == hmi_level_;
+ return mobile_api::HMILevel::HMI_FULL == hmi_level();
}
-bool ApplicationImpl::MakeFullscreen() {
- hmi_level_ = mobile_api::HMILevel::HMI_FULL;
- if (is_media_ && !tts_speak_state_) {
- audio_streaming_state_ = mobile_api::AudioStreamingState::AUDIBLE;
- }
- system_context_ = mobile_api::SystemContext::SYSCTXT_MAIN;
- if (!has_been_activated_) {
- has_been_activated_ = true;
- }
- return true;
-}
+void ApplicationImpl::ChangeSupportingAppHMIType() {
+ is_navi_ = false;
+ is_voice_communication_application_ = false;
+ const smart_objects::SmartObject& array_app_types = *app_types_;
+ uint32_t lenght_app_types = array_app_types.length();
-bool ApplicationImpl::IsAudible() const {
- return mobile_api::HMILevel::HMI_FULL == hmi_level_
- || mobile_api::HMILevel::HMI_LIMITED == hmi_level_;
-}
-
-void ApplicationImpl::MakeNotAudible() {
- hmi_level_ = mobile_api::HMILevel::HMI_BACKGROUND;
- audio_streaming_state_ = mobile_api::AudioStreamingState::NOT_AUDIBLE;
+ for (uint32_t i = 0; i < lenght_app_types; ++i) {
+ if (mobile_apis::AppHMIType::NAVIGATION ==
+ static_cast<mobile_apis::AppHMIType::eType>(
+ array_app_types[i].asUInt())) {
+ is_navi_ = true;
+ }
+ if (mobile_apis::AppHMIType::COMMUNICATION ==
+ static_cast<mobile_apis::AppHMIType::eType>(
+ array_app_types[i].asUInt())) {
+ is_voice_communication_application_ = true;
+ }
+ }
}
-bool ApplicationImpl::allowed_support_navigation() const {
- return allowed_support_navigation_;
-}
-void ApplicationImpl::set_allowed_support_navigation(bool allow) {
- allowed_support_navigation_ = allow;
+void ApplicationImpl::set_is_navi(bool allow) {
+ is_navi_ = allow;
}
bool ApplicationImpl::is_voice_communication_supported() const {
@@ -189,7 +204,72 @@ void ApplicationImpl::set_voice_communication_supported(
bool ApplicationImpl::IsAudioApplication() const {
return is_media_ ||
is_voice_communication_application_ ||
- allowed_support_navigation_;
+ is_navi_;
+}
+
+void ApplicationImpl::SetRegularState(HmiStatePtr state) {
+ DCHECK_OR_RETURN_VOID(state);
+ sync_primitives::AutoLock auto_lock(hmi_states_lock_);
+ DCHECK_OR_RETURN_VOID(!hmi_states_.empty());
+ hmi_states_.erase(hmi_states_.begin());
+ if (hmi_states_.begin() != hmi_states_.end()) {
+ HmiStatePtr first_temp = hmi_states_.front();
+ DCHECK_OR_RETURN_VOID(first_temp);
+ first_temp->set_parent(state);
+ }
+ hmi_states_.push_front(state);
+}
+
+void ApplicationImpl::AddHMIState(HmiStatePtr state) {
+ DCHECK_OR_RETURN_VOID(state);
+ sync_primitives::AutoLock auto_lock(hmi_states_lock_);
+ hmi_states_.push_back(state);
+}
+
+struct StateIdFindPredicate {
+ HmiState::StateID state_id_;
+ StateIdFindPredicate(HmiState::StateID state_id):
+ state_id_(state_id) {}
+ bool operator ()(const HmiStatePtr cur) {
+ return cur->state_id() == state_id_;
+ }
+};
+
+void ApplicationImpl::RemoveHMIState(HmiState::StateID state_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(hmi_states_lock_);
+ HmiStateList::iterator it =
+ std::find_if(hmi_states_.begin(), hmi_states_.end(),
+ StateIdFindPredicate(state_id));
+ if (it != hmi_states_.end()) {
+ // unable to remove regular state
+ DCHECK_OR_RETURN_VOID(it != hmi_states_.begin());
+ HmiStateList::iterator next = it;
+ HmiStateList::iterator prev = it;
+ next++;
+ prev--;
+ if (next != hmi_states_.end()) {
+ HmiStatePtr next_state = *next;
+ HmiStatePtr prev_state = *prev;
+ next_state->set_parent(prev_state);
+ }
+ hmi_states_.erase(it);
+ } else {
+ LOG4CXX_ERROR(logger_, "Unsuccesfull remove HmiState: " << state_id);
+ }
+}
+
+const HmiStatePtr ApplicationImpl::CurrentHmiState() const {
+ sync_primitives::AutoLock auto_lock(hmi_states_lock_);
+ DCHECK_OR_RETURN(!hmi_states_.empty(), HmiStatePtr());
+ //TODO(APPLINK-11448) Need implement
+ return hmi_states_.back();
+}
+
+const HmiStatePtr ApplicationImpl::RegularHmiState() const{
+ //sync_primitives::AutoLock auto_lock(hmi_states_lock_);
+ DCHECK_OR_RETURN(!hmi_states_.empty(), HmiStatePtr());
+ return hmi_states_.front();
}
const smart_objects::SmartObject* ApplicationImpl::active_message() const {
@@ -209,15 +289,25 @@ const std::string& ApplicationImpl::name() const {
}
const std::string ApplicationImpl::folder_name() const {
- return name() + mobile_app_id()->asString();
+ return name() + mobile_app_id();
}
bool ApplicationImpl::is_media_application() const {
return is_media_;
}
-const mobile_api::HMILevel::eType& ApplicationImpl::hmi_level() const {
- return hmi_level_;
+const mobile_api::HMILevel::eType ApplicationImpl::hmi_level() const {
+ using namespace mobile_apis;
+ const HmiStatePtr hmi_state = CurrentHmiState();
+ return hmi_state ? hmi_state->hmi_level() : HMILevel::INVALID_ENUM;
+}
+
+bool application_manager::ApplicationImpl::is_foreground() const {
+ return is_foreground_;
+}
+
+void application_manager::ApplicationImpl::set_foreground(bool is_foreground) {
+ is_foreground_ = is_foreground;
}
const uint32_t ApplicationImpl::put_file_in_none_count() const {
@@ -232,9 +322,12 @@ const uint32_t ApplicationImpl::list_files_in_none_count() const {
return list_files_in_none_count_;
}
-const mobile_api::SystemContext::eType&
+const mobile_api::SystemContext::eType
ApplicationImpl::system_context() const {
- return system_context_;
+ using namespace mobile_apis;
+ const HmiStatePtr hmi_state = CurrentHmiState();
+ return hmi_state ? hmi_state->system_context() :
+ SystemContext::INVALID_ENUM;;
}
const std::string& ApplicationImpl::app_icon_path() const {
@@ -255,18 +348,17 @@ void ApplicationImpl::set_name(const std::string& name) {
void ApplicationImpl::set_is_media_application(bool is_media) {
is_media_ = is_media;
- // Audio streaming state for non-media application can not be different
- // from NOT_AUDIBLE
- if (!is_media)
- set_audio_streaming_state(mobile_api::AudioStreamingState::NOT_AUDIBLE);
}
-void ApplicationImpl::set_tts_speak_state(bool state_tts_speak) {
- tts_speak_state_ = state_tts_speak;
+bool IsTTSState(const HmiStatePtr state) {
+ return state->state_id() == HmiState::STATE_ID_TTS_SESSION ;
}
bool ApplicationImpl::tts_speak_state() {
- return tts_speak_state_;
+ sync_primitives::AutoLock autolock(hmi_states_lock_);
+ HmiStateList::const_iterator it =
+ std::find_if(hmi_states_.begin(), hmi_states_.end(), IsTTSState);
+ return it != hmi_states_.end();
}
void ApplicationImpl::set_tts_properties_in_none(
@@ -287,113 +379,155 @@ bool ApplicationImpl::tts_properties_in_full() {
return tts_properties_in_full_;
}
-void ApplicationImpl::set_hmi_level(
- const mobile_api::HMILevel::eType& hmi_level) {
- if (mobile_api::HMILevel::HMI_NONE != hmi_level_ &&
- mobile_api::HMILevel::HMI_NONE == hmi_level) {
- put_file_in_none_count_ = 0;
- delete_file_in_none_count_ = 0;
- list_files_in_none_count_ = 0;
- }
+void ApplicationImpl::set_video_streaming_approved(bool state) {
+ video_streaming_approved_ = state;
+}
- hmi_level_ = hmi_level;
- usage_report_.RecordHmiStateChanged(hmi_level);
+bool ApplicationImpl::video_streaming_approved() const {
+ return video_streaming_approved_;
}
-void ApplicationImpl::set_hmi_supports_navi_video_streaming(bool supports) {
- hmi_supports_navi_video_streaming_ = supports;
+void ApplicationImpl::set_audio_streaming_approved(bool state) {
+ audio_streaming_approved_ = state;
+}
- if ((!supports) && (!video_stream_retry_active())) {
- std::pair<uint32_t, int32_t> stream_retry =
- profile::Profile::instance()->start_stream_retry_amount();
- set_video_stream_retry_active(true);
- video_stream_retry_number_ = stream_retry.first;
- video_stream_retry_timer_ =
- utils::SharedPtr<timer::TimerThread<ApplicationImpl>>(
- new timer::TimerThread<ApplicationImpl>(
- "VideoStreamRetry", this, &ApplicationImpl::OnVideoStreamRetry, true));
- // start separate pthread for timer without delays
- video_stream_retry_timer_->start(0);
- }
+bool ApplicationImpl::audio_streaming_approved() const {
+ return audio_streaming_approved_;
}
-bool ApplicationImpl::hmi_supports_navi_video_streaming() const {
- return hmi_supports_navi_video_streaming_;
+void ApplicationImpl::set_video_streaming_allowed(bool state) {
+ video_streaming_allowed_ = state;
}
-void ApplicationImpl::set_hmi_supports_navi_audio_streaming(bool supports) {
- hmi_supports_navi_audio_streaming_ = supports;
+bool ApplicationImpl::video_streaming_allowed() const {
+ return video_streaming_allowed_;
+}
- if ((!supports) && (!audio_stream_retry_active())) {
- std::pair<uint32_t, int32_t> stream_retry =
- profile::Profile::instance()->start_stream_retry_amount();
- set_audio_stream_retry_active(true);
- audio_stream_retry_number_ = stream_retry.first;
- audio_stream_retry_timer_ =
- utils::SharedPtr<timer::TimerThread<ApplicationImpl>>(
- new timer::TimerThread<ApplicationImpl>(
- "AudioStreamRetry", this, &ApplicationImpl::OnAudioStreamRetry, true));
- // start separate pthread for timer without delays
- audio_stream_retry_timer_->start(0);
- }
+void ApplicationImpl::set_audio_streaming_allowed(bool state) {
+ audio_streaming_allowed_ = state;
}
-bool ApplicationImpl::hmi_supports_navi_audio_streaming() const {
- return hmi_supports_navi_audio_streaming_;
+bool ApplicationImpl::audio_streaming_allowed() const {
+ return audio_streaming_allowed_;
}
-bool ApplicationImpl::video_stream_retry_active() const {
- return is_video_stream_retry_active_;
+void ApplicationImpl::StartStreaming(
+ protocol_handler::ServiceType service_type) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (ServiceType::kMobileNav == service_type) {
+ if (!video_streaming_approved()) {
+ MessageHelper::SendNaviStartStream(app_id());
+ set_video_stream_retry_number(0);
+ }
+ } else if (ServiceType::kAudio == service_type) {
+ if (!audio_streaming_approved()) {
+ MessageHelper::SendAudioStartStream(app_id());
+ set_video_stream_retry_number(0);
+ }
+ }
}
-void ApplicationImpl::set_video_stream_retry_active(bool active) {
- is_video_stream_retry_active_ = active;
+void ApplicationImpl::StopStreaming(
+ protocol_handler::ServiceType service_type) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SuspendStreaming(service_type);
+
+ if (ServiceType::kMobileNav == service_type) {
+ if (video_streaming_approved()) {
+ video_stream_suspend_timer_->stop();
+ MessageHelper::SendNaviStopStream(app_id());
+ set_video_streaming_approved(false);
+ }
+ } else if (ServiceType::kAudio == service_type) {
+ if (audio_streaming_approved()) {
+ audio_stream_suspend_timer_->stop();
+ MessageHelper::SendAudioStopStream(app_id());
+ set_audio_streaming_approved(false);
+ }
+ }
}
-bool ApplicationImpl::audio_stream_retry_active() const {
- return is_audio_stream_retry_active_;
+void ApplicationImpl::SuspendStreaming(
+ protocol_handler::ServiceType service_type) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (ServiceType::kMobileNav == service_type) {
+ video_stream_suspend_timer_->suspend();
+ ApplicationManagerImpl::instance()->OnAppStreaming(
+ app_id(), service_type, false);
+ sync_primitives::AutoLock lock(video_streaming_suspended_lock_);
+ video_streaming_suspended_ = true;
+ } else if (ServiceType::kAudio == service_type) {
+ audio_stream_suspend_timer_->suspend();
+ ApplicationManagerImpl::instance()->OnAppStreaming(
+ app_id(), service_type, false);
+ sync_primitives::AutoLock lock(audio_streaming_suspended_lock_);
+ audio_streaming_suspended_ = true;
+ }
+ MessageHelper::SendOnDataStreaming(service_type, false);
}
-void ApplicationImpl::set_audio_stream_retry_active(bool active) {
- is_audio_stream_retry_active_ = active;
+void ApplicationImpl::WakeUpStreaming(
+ protocol_handler::ServiceType service_type) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (ServiceType::kMobileNav == service_type) {
+ sync_primitives::AutoLock lock(video_streaming_suspended_lock_);
+ if (video_streaming_suspended_) {
+ ApplicationManagerImpl::instance()->OnAppStreaming(
+ app_id(), service_type, true);
+ MessageHelper::SendOnDataStreaming(ServiceType::kMobileNav, true);
+ video_streaming_suspended_ = false;
+ }
+ video_stream_suspend_timer_->start(video_stream_suspend_timeout_);
+ } else if (ServiceType::kAudio == service_type) {
+ sync_primitives::AutoLock lock(audio_streaming_suspended_lock_);
+ if (audio_streaming_suspended_) {
+ ApplicationManagerImpl::instance()->OnAppStreaming(
+ app_id(), service_type, true);
+ MessageHelper::SendOnDataStreaming(ServiceType::kAudio, true);
+ audio_streaming_suspended_ = false;
+ }
+ audio_stream_suspend_timer_->start(audio_stream_suspend_timeout_);
+ }
}
-void ApplicationImpl::OnVideoStreamRetry() {
- if (video_stream_retry_number_) {
- LOG4CXX_INFO(logger_, "Send video stream retry "
- << video_stream_retry_number_);
+void ApplicationImpl::OnVideoStreamSuspend() {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_INFO(logger_, "Suspend video streaming by timer");
+ SuspendStreaming(ServiceType::kMobileNav);
+}
- application_manager::MessageHelper::SendNaviStartStream(app_id());
- --video_stream_retry_number_;
+void ApplicationImpl::OnAudioStreamSuspend() {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_INFO(logger_, "Suspend audio streaming by timer");
+ SuspendStreaming(ServiceType::kAudio);
+}
- std::pair<uint32_t, int32_t> stream_retry =
- profile::Profile::instance()->start_stream_retry_amount();
- int32_t time_out = stream_retry.second;
- video_stream_retry_timer_->updateTimeOut(time_out);
- } else {
- LOG4CXX_INFO(logger_, "Stop video streaming retry");
- video_stream_retry_timer_.release();
- set_video_stream_retry_active(false);
- }
+uint32_t ApplicationImpl::audio_stream_retry_number() const {
+ return audio_stream_retry_number_;
}
-void ApplicationImpl::OnAudioStreamRetry() {
- if (audio_stream_retry_number_) {
- LOG4CXX_INFO(logger_, "Send audio streaming retry "
- << audio_stream_retry_number_);
+uint32_t ApplicationImpl::video_stream_retry_number() const {
+ return video_stream_retry_number_;
+}
- application_manager::MessageHelper::SendAudioStartStream(app_id());
- --audio_stream_retry_number_;
+void ApplicationImpl::set_video_stream_retry_number(
+ const uint32_t& video_stream_retry_number) {
+ video_stream_retry_number_ = video_stream_retry_number;
+}
- std::pair<uint32_t, int32_t> stream_retry =
- profile::Profile::instance()->start_stream_retry_amount();
- int32_t time_out = stream_retry.second;
- audio_stream_retry_timer_->updateTimeOut(time_out);
- } else {
- LOG4CXX_INFO(logger_, "Stop audio streaming retry");
- audio_stream_retry_timer_.release();
- set_audio_stream_retry_active(false);
- }
+void ApplicationImpl::set_audio_stream_retry_number(
+ const uint32_t& audio_stream_retry_number) {
+ audio_stream_retry_number_ = audio_stream_retry_number;
}
void ApplicationImpl::increment_put_file_in_none_count() {
@@ -408,22 +542,6 @@ void ApplicationImpl::increment_list_files_in_none_count() {
++list_files_in_none_count_;
}
-void ApplicationImpl::set_system_context(
- const mobile_api::SystemContext::eType& system_context) {
- system_context_ = system_context;
-}
-
-void ApplicationImpl::set_audio_streaming_state(
- const mobile_api::AudioStreamingState::eType& state) {
- if (!is_media_application()
- && state != mobile_api::AudioStreamingState::NOT_AUDIBLE) {
- LOG4CXX_WARN(logger_, "Trying to set audio streaming state"
- " for non-media application to different from NOT_AUDIBLE");
- return;
- }
- audio_streaming_state_ = state;
-}
-
bool ApplicationImpl::set_app_icon_path(const std::string& path) {
if (app_files_.find(path) != app_files_.end()) {
app_icon_path_ = path;
@@ -448,10 +566,21 @@ void ApplicationImpl::set_grammar_id(uint32_t value) {
grammar_id_ = value;
}
+void ApplicationImpl::ResetDataInNone() {
+ put_file_in_none_count_ = 0;
+ delete_file_in_none_count_ = 0;
+ list_files_in_none_count_ = 0;
+}
+
bool ApplicationImpl::has_been_activated() const {
return has_been_activated_;
}
+bool ApplicationImpl::set_activated(bool is_active) {
+ has_been_activated_ = is_active;
+ return true;
+}
+
void ApplicationImpl::set_protocol_version(
const ProtocolVersion& protocol_version) {
protocol_version_ = protocol_version;
@@ -599,7 +728,7 @@ bool ApplicationImpl::IsCommandLimitsExceeded(
// commands per minute, e.g. 10 command per minute i.e. 1 command per 6 sec
case POLICY_TABLE: {
uint32_t cmd_limit = application_manager::MessageHelper::GetAppCommandLimit(
- mobile_app_id_->asString());
+ mobile_app_id_);
if (0 == cmd_limit) {
return true;
@@ -646,19 +775,14 @@ const std::set<uint32_t>& ApplicationImpl::SubscribesIVI() const {
return subscribed_vehicle_info_;
}
-uint32_t ApplicationImpl::nextHash() {
- hash_val_ = rand();
+const std::string& ApplicationImpl::curHash() const {
return hash_val_;
}
-uint32_t ApplicationImpl::curHash() const {
- return hash_val_;
-}
-
-uint32_t ApplicationImpl::UpdateHash() {
- uint32_t new_hash= nextHash();
+void ApplicationImpl::UpdateHash() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ hash_val_ = utils::gen_hash(profile::Profile::instance()->hash_string_size());
MessageHelper::SendHashUpdateNotification(app_id());
- return new_hash;
}
void ApplicationImpl::CleanupFiles() {
@@ -690,8 +814,23 @@ void ApplicationImpl::CleanupFiles() {
}
void ApplicationImpl::LoadPersistentFiles() {
- std::string directory_name =
- profile::Profile::instance()->app_storage_folder();
+ using namespace profile;
+
+ if (kWaitingForRegistration == app_state_) {
+ const std::string app_icon_dir(Profile::instance()->app_icons_folder());
+ const std::string full_icon_path(app_icon_dir + "/" + mobile_app_id_);
+ if (file_system::FileExists(full_icon_path)) {
+ AppFile file;
+ file.is_persistent = true;
+ file.is_download_complete = true;
+ file.file_name = full_icon_path;
+ file.file_type = mobile_apis::FileType::GRAPHIC_PNG;
+ AddFile(file);
+ }
+ return;
+ }
+
+ std::string directory_name = Profile::instance()->app_storage_folder();
directory_name += "/" + folder_name();
if (file_system::DirectoryExists(directory_name)) {
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 6d7fdeec6..0c686c79a 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -35,6 +35,7 @@
#include <climits>
#include <string>
#include <fstream>
+#include <utility>
#include "application_manager/application_manager_impl.h"
#include "application_manager/mobile_command_factory.h"
@@ -43,6 +44,7 @@
#include "application_manager/message_helper.h"
#include "application_manager/mobile_message_handler.h"
#include "application_manager/policies/policy_handler.h"
+#include "protocol_handler/protocol_handler.h"
#include "hmi_message_handler/hmi_message_handler.h"
#include "connection_handler/connection_handler_impl.h"
#include "formatters/formatter_json_rpc.h"
@@ -51,10 +53,19 @@
#include "config_profile/profile.h"
#include "utils/threads/thread.h"
#include "utils/file_system.h"
+#include "utils/helpers.h"
+#include "smart_objects/enum_schema_item.h"
+#include "interfaces/HMI_API_schema.h"
#include "application_manager/application_impl.h"
#include "usage_statistics/counter.h"
#include <time.h>
+namespace {
+ int get_rand_from_range(uint32_t from = 0, int to = RAND_MAX) {
+ return std::rand() % to + from;
+ }
+}
+
namespace application_manager {
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
@@ -65,6 +76,8 @@ const uint32_t ApplicationManagerImpl::max_corelation_id_ = UINT_MAX;
namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
namespace jhs = NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace NsSmartDeviceLink::NsSmartObjects;
+
ApplicationManagerImpl::ApplicationManagerImpl()
: applications_list_lock_(true),
audio_pass_thru_active_(false),
@@ -83,9 +96,12 @@ ApplicationManagerImpl::ApplicationManagerImpl()
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_(this),
- unregister_reason_(mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF),
+ unregister_reason_(mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM),
resume_ctrl_(this),
+ navi_close_app_timeout_(profile::Profile::instance()->stop_streaming_timeout()),
+ navi_end_stream_timeout_(profile::Profile::instance()->stop_streaming_timeout()),
#ifdef TIME_TESTER
metric_observer_(NULL),
#endif // TIME_TESTER
@@ -93,33 +109,58 @@ ApplicationManagerImpl::ApplicationManagerImpl()
tts_global_properties_timer_("TTSGLPRTimer",
this,
&ApplicationManagerImpl::OnTimerSendTTSGlobalProperties,
- true) {
+ true),
+ is_low_voltage_(false),
+ is_stopping_(false) {
+
std::srand(std::time(0));
+ AddPolicyObserver(this);
+
+ dir_type_to_string_map_ = {
+ {TYPE_STORAGE, "Storage"},
+ {TYPE_SYSTEM, "System"},
+ {TYPE_ICONS, "Icons"}
+ };
+
+ sync_primitives::AutoLock lock(timer_pool_lock_);
+ ApplicationManagerTimerPtr clearTimerPoolTimer(new TimerThread<ApplicationManagerImpl>(
+ "ClearTimerPoolTimer", this, &ApplicationManagerImpl::ClearTimerPool, true));
+ clearTimerPoolTimer->start(10);
+ timer_pool_.push_back(clearTimerPoolTimer);
}
ApplicationManagerImpl::~ApplicationManagerImpl() {
LOG4CXX_INFO(logger_, "Destructing ApplicationManager.");
+ is_stopping_ = true;
SendOnSDLClose();
media_manager_ = NULL;
hmi_handler_ = NULL;
connection_handler_ = NULL;
- if (hmi_so_factory_) {
+ if(hmi_so_factory_) {
delete hmi_so_factory_;
+ hmi_so_factory_ = NULL;
}
- hmi_so_factory_ = NULL;
- if (mobile_so_factory_) {
+ if(mobile_so_factory_) {
delete mobile_so_factory_;
+ mobile_so_factory_ = NULL;
}
- mobile_so_factory_ = NULL;
protocol_handler_ = NULL;
media_manager_ = NULL;
LOG4CXX_INFO(logger_, "Destroying Policy Handler");
+ RemovePolicyObserver(this);
policy::PolicyHandler::destroy();
+
+ sync_primitives::AutoLock lock(timer_pool_lock_);
+ timer_pool_.clear();
+
+ navi_app_to_stop_.clear();
+ navi_app_to_end_stream_.clear();
}
bool ApplicationManagerImpl::Stop() {
LOG4CXX_INFO(logger_, "Stop ApplicationManager.");
+ is_stopping_ = true;
application_list_update_timer_->stop();
try {
UnregisterAllApplications();
@@ -128,8 +169,9 @@ bool ApplicationManagerImpl::Stop() {
"An error occurred during unregistering applications.");
}
+ request_ctrl_.DestroyThreadpool();
- // for PASA customer policy backup should happen OnExitAllApp(SUSPEND)
+ // for PASA customer policy backup should happen :AllApp(SUSPEND)
LOG4CXX_INFO(logger_, "Unloading policy library.");
policy::PolicyHandler::instance()->UnloadPolicyLibrary();
@@ -137,110 +179,130 @@ bool ApplicationManagerImpl::Stop() {
}
ApplicationSharedPtr ApplicationManagerImpl::application(uint32_t app_id) const {
- sync_primitives::AutoLock lock(applications_list_lock_);
-
- std::set<ApplicationSharedPtr>::const_iterator it =
- application_list_.begin();
- for (; it != application_list_.end(); ++it) {
- if ((*it)->app_id() == app_id) {
- return (*it);
- }
- }
- return ApplicationSharedPtr();
+ AppIdPredicate finder(app_id);
+ ApplicationListAccessor accessor;
+ ApplicationSharedPtr app = accessor.Find(finder);
+ LOG4CXX_DEBUG(logger_, " app_id << " << app_id << "Found = " << app);
+ return app;
}
ApplicationSharedPtr ApplicationManagerImpl::application_by_hmi_app(
uint32_t hmi_app_id) const {
- sync_primitives::AutoLock lock(applications_list_lock_);
-
- std::set<ApplicationSharedPtr>::const_iterator it =
- application_list_.begin();
- for (; it != application_list_.end(); ++it) {
- if ((*it)->hmi_app_id() == hmi_app_id) {
- return (*it);
- }
- }
- return ApplicationSharedPtr();
+ HmiAppIdPredicate finder(hmi_app_id);
+ ApplicationListAccessor accessor;
+ ApplicationSharedPtr app = accessor.Find(finder);
+ LOG4CXX_DEBUG(logger_, " hmi_app_id << " << hmi_app_id << "Found = " << app);
+ return app;
}
ApplicationSharedPtr ApplicationManagerImpl::application_by_policy_id(
const std::string& policy_app_id) const {
- sync_primitives::AutoLock lock(applications_list_lock_);
+ MobileAppIdPredicate finder(policy_app_id);
+ ApplicationListAccessor accessor;
+ ApplicationSharedPtr app = accessor.Find(finder);
+ LOG4CXX_DEBUG(logger_, " policy_app_id << " << policy_app_id << "Found = " << app);
+ return app;
+}
- std::vector<ApplicationSharedPtr> result;
- for (std::set<ApplicationSharedPtr>::iterator it = application_list_.begin();
- application_list_.end() != it;
- ++it) {
- if (policy_app_id.compare((*it)->mobile_app_id()->asString()) == 0) {
- return *it;
- }
- }
- return ApplicationSharedPtr();
+bool ActiveAppPredicate (const ApplicationSharedPtr app) {
+ return app ? app->IsFullscreen() : false;
}
ApplicationSharedPtr ApplicationManagerImpl::active_application() const {
// TODO(DK) : check driver distraction
- for (std::set<ApplicationSharedPtr>::iterator it = application_list_.begin();
- application_list_.end() != it;
- ++it) {
- if ((*it)->IsFullscreen()) {
- return *it;
- }
- }
- return ApplicationSharedPtr();
+ ApplicationListAccessor accessor;
+ ApplicationSharedPtr app = accessor.Find(ActiveAppPredicate);
+ LOG4CXX_DEBUG(logger_, " Found = " << app);
+ return app;
}
+bool LimitedAppPredicate (const ApplicationSharedPtr app) {
+ return app ? app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED :
+ false;
+}
ApplicationSharedPtr
ApplicationManagerImpl::get_limited_media_application() const {
- sync_primitives::AutoLock lock(applications_list_lock_);
-
- for (TAppListIt it = application_list_.begin();
- application_list_.end() != it; ++it) {
- if ((*it)->is_media_application() &&
- (mobile_api::HMILevel::HMI_LIMITED == (*it)->hmi_level())) {
- return *it;
- }
- }
+ ApplicationListAccessor accessor;
+ ApplicationSharedPtr app = accessor.Find(LimitedAppPredicate);
+ LOG4CXX_DEBUG(logger_, " Found = " << app);
+ return app;
+}
- return ApplicationSharedPtr();
+bool LimitedNaviAppPredicate (const ApplicationSharedPtr app) {
+ return app ? (app->is_navi() &&
+ app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED) :
+ false;
}
ApplicationSharedPtr
ApplicationManagerImpl::get_limited_navi_application() const {
- sync_primitives::AutoLock lock(applications_list_lock_);
-
- for (TAppListIt it = application_list_.begin();
- application_list_.end() != it; ++it) {
- if ((*it)->allowed_support_navigation() &&
- (mobile_api::HMILevel::HMI_LIMITED == (*it)->hmi_level())) {
- return *it;
- }
- }
+ ApplicationListAccessor accessor;
+ ApplicationSharedPtr app = accessor.Find(LimitedNaviAppPredicate);
+ LOG4CXX_DEBUG(logger_, " Found = " << app);
+ return app;
+}
- return ApplicationSharedPtr();
+bool LimitedVoiceAppPredicate (const ApplicationSharedPtr app) {
+ return app ? (app->is_voice_communication_supported() &&
+ app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED) :
+ false;
}
ApplicationSharedPtr
ApplicationManagerImpl::get_limited_voice_application() const {
- sync_primitives::AutoLock lock(applications_list_lock_);
+ ApplicationListAccessor accessor;
+ ApplicationSharedPtr app = accessor.Find(LimitedVoiceAppPredicate);
+ LOG4CXX_DEBUG(logger_, " Found = " << app);
+ return app;
+}
- for (TAppListIt it = application_list_.begin();
- application_list_.end() != it; ++it) {
- if ((*it)->is_voice_communication_supported() &&
- (mobile_api::HMILevel::HMI_LIMITED == (*it)->hmi_level())) {
- return *it;
- }
+bool NaviAppPredicate (const ApplicationSharedPtr app) {
+ return app ? app->is_navi() : false;
+}
+
+std::vector<ApplicationSharedPtr> ApplicationManagerImpl::applications_with_navi() {
+ ApplicationListAccessor accessor;
+ std::vector<ApplicationSharedPtr> apps = accessor.FindAll(NaviAppPredicate);
+ LOG4CXX_DEBUG(logger_, " Found count: " << apps.size());
+ return apps;
+}
+std::vector<ApplicationSharedPtr> ApplicationManagerImpl::applications_by_button(
+ uint32_t button) {
+ SubscribedToButtonPredicate finder(
+ static_cast<mobile_apis::ButtonName::eType>(button));
+ ApplicationListAccessor accessor;
+ std::vector<ApplicationSharedPtr> apps = accessor.FindAll(finder);
+ LOG4CXX_DEBUG(logger_, " Found count: " << apps.size());
+ return apps;
+}
+
+std::vector<ApplicationSharedPtr> ApplicationManagerImpl::IviInfoUpdated(
+ VehicleDataType vehicle_info, int value) {
+
+ // Notify Policy Manager if available about info it's interested in,
+ // i.e. odometer etc
+ switch (vehicle_info) {
+ case ODOMETER:
+ policy::PolicyHandler::instance()->KmsChanged(value);
+ break;
+ default:
+ break;
}
- return ApplicationSharedPtr();
+ SubscribedToIVIPredicate finder(
+ static_cast<int32_t>(vehicle_info));
+ ApplicationListAccessor accessor;
+ std::vector<ApplicationSharedPtr> apps = accessor.FindAll(NaviAppPredicate);
+ LOG4CXX_DEBUG(logger_, " vehicle_info << " << vehicle_info << "Found count: " << apps.size());
+ return apps;
}
-bool ApplicationManagerImpl::DoesAudioAppWithSameHMITypeExistInFullOrLimited(
+bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
ApplicationSharedPtr app) const {
bool voice_state = app->is_voice_communication_supported();
bool media_state = app->is_media_application();
- bool navi_state = app->hmi_supports_navi_video_streaming();
+ bool navi_state = app->is_navi();
ApplicationSharedPtr active_app = active_application();
// Check app in FULL level
if (active_app.valid()) {
@@ -258,7 +320,7 @@ bool ApplicationManagerImpl::DoesAudioAppWithSameHMITypeExistInFullOrLimited(
return true;
}
- if (navi_state && active_app->hmi_supports_navi_video_streaming()) {
+ if (navi_state && active_app->is_navi()) {
return true;
}
}
@@ -288,58 +350,13 @@ bool ApplicationManagerImpl::DoesAudioAppWithSameHMITypeExistInFullOrLimited(
return false;
}
-std::vector<ApplicationSharedPtr> ApplicationManagerImpl::applications_by_button(
- uint32_t button) {
- std::vector<ApplicationSharedPtr> result;
- for (std::set<ApplicationSharedPtr>::iterator it = application_list_.begin();
- application_list_.end() != it; ++it) {
- if ((*it)->IsSubscribedToButton(
- static_cast<mobile_apis::ButtonName::eType>(button))) {
- result.push_back(*it);
- }
- }
- return result;
-}
-
-std::vector<utils::SharedPtr<Application>> ApplicationManagerImpl::IviInfoUpdated(
-VehicleDataType vehicle_info, int value) {
- // Notify Policy Manager if available about info it's interested in,
- // i.e. odometer etc
- switch (vehicle_info) {
- case ODOMETER:
- policy::PolicyHandler::instance()->KmsChanged(value);
- break;
- default:
- break;
- }
-
- std::vector<utils::SharedPtr<application_manager::Application>> result;
- for (std::set<utils::SharedPtr<application_manager::Application>>::iterator it = application_list_.begin();
- application_list_.end() != it; ++it) {
- if ((*it)->IsSubscribedToIVI(static_cast<uint32_t>(vehicle_info))) {
- result.push_back(*it);
- }
- }
- return result;
-}
-
-std::vector<ApplicationSharedPtr> ApplicationManagerImpl::applications_with_navi() {
- std::vector<ApplicationSharedPtr> result;
- for (std::set<ApplicationSharedPtr>::iterator it = application_list_.begin();
- application_list_.end() != it;
- ++it) {
- if ((*it)->allowed_support_navigation()) {
- result.push_back(*it);
- }
- }
- return result;
-}
ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
const utils::SharedPtr<smart_objects::SmartObject>&
request_for_registration) {
LOG4CXX_DEBUG(logger_, "Restarting application list update timer");
+ policy::PolicyHandler::instance()->OnAppsSearchStarted();
uint32_t timeout = profile::Profile::instance()->application_list_update_timeout();
application_list_update_timer_->start(timeout);
@@ -368,8 +385,8 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
if (connection_handler_) {
connection_handler::ConnectionHandlerImpl* con_handler_impl =
static_cast<connection_handler::ConnectionHandlerImpl*>(
-
connection_handler_);
+
if (con_handler_impl->GetDataOnSessionKey(connection_key, &app_id,
&sessions_list, &device_id)
== -1) {
@@ -391,6 +408,9 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
const std::string& app_name =
message[strings::msg_params][strings::app_name].asString();
+ LOG4CXX_DEBUG(logger_, "App with connection key: " << connection_key
+ << " registered from handle: " << device_id);
+
ApplicationSharedPtr application(
new ApplicationImpl(app_id,
mobile_app_id, app_name,
@@ -409,6 +429,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
ManageMobileCommand(response);
return ApplicationSharedPtr();
}
+
application->set_device(device_id);
application->set_grammar_id(GenerateGrammarID());
mobile_api::Language::eType launguage_desired =
@@ -429,35 +450,11 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
int32_t min_version =
message[strings::msg_params][strings::sync_msg_version]
[strings::minor_version].asInt();
-
- /*if (min_version < APIVersion::kAPIV2) {
- LOG4CXX_ERROR(logger_, "UNSUPPORTED_VERSION");
- utils::SharedPtr<smart_objects::SmartObject> response(
- MessageHelper::CreateNegativeResponse(
- connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID,
- message[strings::params][strings::correlation_id],
- mobile_apis::Result::UNSUPPORTED_VERSION));
- ManageMobileCommand(response);
- delete application;
- return NULL;
- }*/
version.min_supported_api_version = static_cast<APIVersion>(min_version);
int32_t max_version =
message[strings::msg_params][strings::sync_msg_version]
[strings::major_version].asInt();
-
- /*if (max_version > APIVersion::kAPIV2) {
- LOG4CXX_ERROR(logger_, "UNSUPPORTED_VERSION");
- utils::SharedPtr<smart_objects::SmartObject> response(
- MessageHelper::CreateNegativeResponse(
- connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID,
- message[strings::params][strings::correlation_id],
- mobile_apis::Result::UNSUPPORTED_VERSION));
- ManageMobileCommand(response);
- delete application;
- return NULL;
- }*/
version.max_supported_api_version = static_cast<APIVersion>(max_version);
application->set_version(version);
@@ -470,14 +467,34 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
connection_handler_->BindProtocolVersionWithSession(
connection_key, static_cast<uint8_t>(protocol_version));
}
- if (ProtocolVersion::kV3 == protocol_version) {
+ if (protocol_version >= ProtocolVersion::kV3 &&
+ profile::Profile::instance()->heart_beat_timeout() > 0) {
connection_handler_->StartSessionHeartBeat(connection_key);
}
}
- sync_primitives::AutoLock lock(applications_list_lock_);
+ // Keep HMI add id in case app is present in "waiting for registration" list
+ apps_to_register_list_lock_.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();
+
+ if (!application->hmi_app_id()) {
+ const bool is_saved = resume_ctrl_.IsApplicationSaved(mobile_app_id);
+ application->set_hmi_application_id(is_saved ?
+ resume_ctrl_.GetHMIApplicationID(mobile_app_id) : GenerateNewHMIAppID());
+ }
- application_list_.insert(application);
+ ApplicationListAccessor app_list_accesor;
+ application->MarkRegistered();
+ state_ctrl_.ApplyStatesForApp(application);
+ app_list_accesor.Insert(application);
+
+ policy::PolicyHandler::instance()->AddApplication(
+ application->mobile_app_id());
return application;
}
@@ -491,116 +508,70 @@ bool ApplicationManagerImpl::LoadAppDataToHMI(ApplicationSharedPtr app) {
}
bool ApplicationManagerImpl::ActivateApplication(ApplicationSharedPtr app) {
- if (!app) {
- LOG4CXX_ERROR(logger_, "Null-pointer application received.");
- NOTREACHED();
- return false;
- }
+ using namespace mobile_api;
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(app, false);
- if (app->IsFullscreen()) {
- LOG4CXX_WARN(logger_, "Application is already active.");
- return false;
- }
-
- bool is_new_app_media = app->is_media_application();
- ApplicationSharedPtr current_active_app = active_application();
-
- if (mobile_api::HMILevel::eType::HMI_LIMITED != app->hmi_level()) {
- if (app->has_been_activated()) {
- MessageHelper::SendAppDataToHMI(app);
- }
- }
-
- if (current_active_app.valid()) {
- if (is_new_app_media && current_active_app->is_media_application()) {
- current_active_app->MakeNotAudible();
- } else if (!(current_active_app->IsAudioApplication())) {
- current_active_app->set_hmi_level(mobile_api::HMILevel::HMI_BACKGROUND);
- } else {
- current_active_app->set_hmi_level(mobile_api::HMILevel::HMI_LIMITED);
- }
-
- MessageHelper::SendHMIStatusNotification(*current_active_app);
- }
-
- app->MakeFullscreen();
-
- if (is_new_app_media) {
- ApplicationSharedPtr limited_app = get_limited_media_application();
- if (limited_app.valid()) {
- limited_app->MakeNotAudible();
- MessageHelper::SendHMIStatusNotification(*limited_app);
- }
- }
-
- if (app->is_voice_communication_supported()) {
- ApplicationSharedPtr limited_app = get_limited_voice_application();
- if (limited_app.valid()) {
- if (limited_app->is_media_application()) {
- limited_app->set_audio_streaming_state(
- mobile_api::AudioStreamingState::NOT_AUDIBLE);
- }
- limited_app->set_hmi_level(mobile_api::HMILevel::HMI_BACKGROUND);
- MessageHelper::SendHMIStatusNotification(*limited_app);
- }
- }
-
- if (app->allowed_support_navigation()) {
- ApplicationSharedPtr limited_app = get_limited_navi_application();
- if (limited_app.valid()) {
- if (limited_app->is_media_application()) {
- limited_app->set_audio_streaming_state(
- mobile_api::AudioStreamingState::NOT_AUDIBLE);
- }
- limited_app->set_hmi_level(mobile_api::HMILevel::HMI_BACKGROUND);
- MessageHelper::SendHMIStatusNotification(*limited_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_.ApplyStatesForApp(app);
+ state_ctrl_.SetRegularState<false>(app, hmi_level, audio_state);
return true;
}
-mobile_api::HMILevel::eType ApplicationManagerImpl::PutApplicationInFull(
+mobile_api::HMILevel::eType ApplicationManagerImpl::IsHmiLevelFullAllowed(
ApplicationSharedPtr app) {
- DCHECK(app.get())
-
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application pointer invalid");
+ NOTREACHED();
+ return mobile_api::HMILevel::INVALID_ENUM;
+ }
bool is_audio_app = app->IsAudioApplication();
bool does_audio_app_with_same_type_exist =
- DoesAudioAppWithSameHMITypeExistInFullOrLimited(app);
-
- mobile_api::HMILevel::eType result = mobile_api::HMILevel::HMI_FULL;
-
+ IsAppTypeExistsInFullOrLimited(app);
bool is_active_app_exist = active_application().valid();
+ mobile_api::HMILevel::eType result = mobile_api::HMILevel::HMI_FULL;
if (is_audio_app && does_audio_app_with_same_type_exist) {
- result = mobile_apis::HMILevel::HMI_BACKGROUND;
+ result = GetDefaultHmiLevel(app);
} else if (is_active_app_exist && is_audio_app) {
result = mobile_apis::HMILevel::HMI_LIMITED;
} else if (is_active_app_exist && (!is_audio_app)) {
- result = mobile_apis::HMILevel::HMI_BACKGROUND;
- }
-
- if (mobile_api::HMILevel::HMI_FULL == result) {
- app->set_hmi_level(result);
- MessageHelper::SendActivateAppToHMI(app->app_id());
+ result = GetDefaultHmiLevel(app);
}
+ LOG4CXX_ERROR(logger_, "is_audio_app : " << is_audio_app
+ << "; does_audio_app_with_same_type_exist : " << does_audio_app_with_same_type_exist
+ << "; is_active_app_exist : " << is_active_app_exist
+ << "; result : " << result);
return result;
}
-void ApplicationManagerImpl::ConnectToDevice(uint32_t id) {
+void ApplicationManagerImpl::ConnectToDevice(const std::string& device_mac) {
// TODO(VS): Call function from ConnectionHandler
if (!connection_handler_) {
LOG4CXX_WARN(logger_, "Connection handler is not set.");
return;
}
- connection_handler_->ConnectToDevice(id);
+ connection_handler::DeviceHandle handle;
+ if (!connection_handler_->GetDeviceID(device_mac, &handle) ) {
+ LOG4CXX_ERROR(logger_, "Attempt to connect to invalid device with mac:"
+ << device_mac );
+ return;
+ }
+ connection_handler_->ConnectToDevice(handle);
}
void ApplicationManagerImpl::OnHMIStartedCooperation() {
hmi_cooperating_ = true;
LOG4CXX_INFO(logger_, "ApplicationManagerImpl::OnHMIStartedCooperation()");
+ MessageHelper::SendGetSystemInfoRequest();
+
utils::SharedPtr<smart_objects::SmartObject> is_vr_ready(
MessageHelper::CreateModuleInfoSO(
static_cast<uint32_t>(hmi_apis::FunctionID::VR_IsReady)));
@@ -633,6 +604,7 @@ void ApplicationManagerImpl::OnHMIStartedCooperation() {
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported));
ManageHMICommand(mixing_audio_supported_request);
+ resume_controller().ResetLaunchTime();
}
uint32_t ApplicationManagerImpl::GetNextHMICorrelationID() {
@@ -677,6 +649,17 @@ void ApplicationManagerImpl::set_all_apps_allowed(const bool& allowed) {
is_all_apps_allowed_ = allowed;
}
+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, state_ctrl_.state_context()));
+ state->set_hmi_level(hmi_level);
+ state->set_audio_streaming_state(audio_state);
+ state->set_system_context(system_context);
+ return state;
+}
+
void ApplicationManagerImpl::StartAudioPassThruThread(int32_t session_key,
int32_t correlation_id, int32_t max_duration, int32_t sampling_rate,
int32_t bits_per_sample, int32_t audio_type) {
@@ -691,50 +674,23 @@ void ApplicationManagerImpl::StartAudioPassThruThread(int32_t session_key,
void ApplicationManagerImpl::SendAudioPassThroughNotification(
uint32_t session_key,
- std::vector<uint8_t> binaryData) {
- LOG4CXX_TRACE_ENTER(logger_);
+ 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;
}
- smart_objects::SmartObject* on_audio_pass = NULL;
- on_audio_pass = new smart_objects::SmartObject();
-
- if (NULL == on_audio_pass) {
- LOG4CXX_ERROR_EXT(logger_, "OnAudioPassThru NULL pointer");
-
- return;
- }
-
- LOG4CXX_INFO_EXT(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>(session_key);
- (*on_audio_pass)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::OnAudioPassThruID;
-
- LOG4CXX_INFO_EXT(logger_, "Fill binary data");
- // binary data
- (*on_audio_pass)[strings::params][strings::binary_data] =
- smart_objects::SmartObject(binaryData);
-
- LOG4CXX_INFO_EXT(logger_, "After fill binary data");
-
- LOG4CXX_INFO_EXT(logger_, "Send data");
- CommandSharedPtr command (
- MobileCommandFactory::CreateCommand(&(*on_audio_pass)));
- command->Init();
- command->Run();
- command->CleanUp();
+ 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_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(audio_pass_thru_lock_);
if (NULL != media_manager_) {
media_manager_->StopMicrophoneRecording(application_key);
@@ -759,9 +715,27 @@ std::string ApplicationManagerImpl::GetDeviceName(
return device_name;
}
+hmi_apis::Common_TransportType::eType ApplicationManagerImpl::GetDeviceTransportType(
+ const std::string& transport_type) {
+ hmi_apis::Common_TransportType::eType result =
+ hmi_apis::Common_TransportType::INVALID_ENUM;
+
+ if ("BLUETOOTH" == transport_type) {
+ result = hmi_apis::Common_TransportType::BLUETOOTH;
+ } else if ("WIFI" == transport_type) {
+ result = hmi_apis::Common_TransportType::WIFI;
+ } else if ("USB" == transport_type) {
+ result = hmi_apis::Common_TransportType::USB;
+ } else {
+ LOG4CXX_ERROR(logger_, "Unknown transport type " << transport_type);
+ }
+
+ return result;
+}
+
void ApplicationManagerImpl::OnMessageReceived(
const ::protocol_handler::RawMessagePtr message) {
- LOG4CXX_INFO(logger_, "ApplicationManagerImpl::OnMessageReceived");
+ LOG4CXX_AUTO_TRACE(logger_);
if (!message) {
LOG4CXX_ERROR(logger_, "Null-pointer message received.");
@@ -779,12 +753,12 @@ void ApplicationManagerImpl::OnMessageReceived(
void ApplicationManagerImpl::OnMobileMessageSent(
const ::protocol_handler::RawMessagePtr message) {
- LOG4CXX_INFO(logger_, "ApplicationManagerImpl::OnMobileMessageSent");
+ LOG4CXX_AUTO_TRACE(logger_);
}
void ApplicationManagerImpl::OnMessageReceived(
hmi_message_handler::MessageSharedPointer message) {
- LOG4CXX_INFO(logger_, "ApplicationManagerImpl::OnMessageReceived");
+ LOG4CXX_AUTO_TRACE(logger_);
if (!message) {
LOG4CXX_ERROR(logger_, "Null-pointer message received.");
@@ -795,6 +769,56 @@ void ApplicationManagerImpl::OnMessageReceived(
messages_from_hmi_.PostMessage(impl::MessageFromHmi(message));
}
+
+ApplicationConstSharedPtr ApplicationManagerImpl::waiting_app(
+ const uint32_t hmi_id) const {
+ AppsWaitRegistrationSet app_list = apps_waiting_for_registration().GetData();
+
+ AppsWaitRegistrationSet::const_iterator it_end = app_list.end();
+
+ HmiAppIdPredicate finder(hmi_id);
+ ApplicationSharedPtr result;
+ ApplictionSetConstIt it_app = std::find_if(app_list.begin(), it_end, finder);
+ if (it_app != it_end) {
+ result = *it_app;
+ }
+ return result;
+}
+
+DataAccessor<ApplicationManagerImpl::AppsWaitRegistrationSet>
+ApplicationManagerImpl::apps_waiting_for_registration() const {
+ return DataAccessor<AppsWaitRegistrationSet>(
+ ApplicationManagerImpl::instance()->apps_to_register_,
+ ApplicationManagerImpl::instance()->apps_to_register_list_lock_);
+}
+
+bool ApplicationManagerImpl::IsAppsQueriedFrom(
+ const connection_handler::DeviceHandle handle) const {
+ sync_primitives::AutoLock lock(apps_to_register_list_lock_);
+ AppsWaitRegistrationSet::iterator it = apps_to_register_.begin();
+ AppsWaitRegistrationSet::const_iterator it_end = apps_to_register_.end();
+ for (; it != it_end; ++it) {
+ if (handle == (*it)->device()) {
+ return true;
+ }
+ }
+ return false;
+}
+
+void application_manager::ApplicationManagerImpl::MarkAppsGreyOut(
+ const connection_handler::DeviceHandle handle,
+ bool is_greyed_out) {
+ sync_primitives::AutoLock lock(apps_to_register_list_lock_);
+ AppsWaitRegistrationSet::iterator it = apps_to_register_.begin();
+ AppsWaitRegistrationSet::const_iterator it_end = apps_to_register_.end();
+ for (; it != it_end; ++it) {
+ if (handle == (*it)->device()) {
+ (*it)->set_greyed_out(is_greyed_out);
+ }
+ }
+}
+
+
void ApplicationManagerImpl::OnErrorSending(
hmi_message_handler::MessageSharedPointer message) {
return;
@@ -802,9 +826,15 @@ void ApplicationManagerImpl::OnErrorSending(
void ApplicationManagerImpl::OnDeviceListUpdated(
const connection_handler::DeviceMap& device_list) {
- LOG4CXX_INFO(logger_, "ApplicationManagerImpl::OnDeviceListUpdated");
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr msg_params = MessageHelper::CreateDeviceListSO(
+ device_list);
+ if (!msg_params) {
+ LOG4CXX_WARN(logger_, "Failed to create sub-smart object.");
+ return;
+ }
- smart_objects::SmartObject* update_list = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr update_list = new 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;
@@ -813,13 +843,6 @@ void ApplicationManagerImpl::OnDeviceListUpdated(
so_to_send[jhs::S_PARAMS][jhs::S_PROTOCOL_VERSION] = 3;
so_to_send[jhs::S_PARAMS][jhs::S_PROTOCOL_TYPE] = 1;
so_to_send[jhs::S_PARAMS][jhs::S_CORRELATION_ID] = GetNextHMICorrelationID();
- smart_objects::SmartObject* msg_params = MessageHelper::CreateDeviceListSO(
- device_list);
- if (!msg_params) {
- LOG4CXX_WARN(logger_, "Failed to create sub-smart object.");
- delete update_list;
- return;
- }
so_to_send[jhs::S_MSG_PARAMS] = *msg_params;
ManageHMICommand(update_list);
}
@@ -829,41 +852,25 @@ void ApplicationManagerImpl::OnFindNewApplicationsRequest() {
LOG4CXX_DEBUG(logger_, "Starting application list update timer");
uint32_t timeout = profile::Profile::instance()->application_list_update_timeout();
application_list_update_timer_->start(timeout);
+ policy::PolicyHandler::instance()->OnAppsSearchStarted();
}
-void ApplicationManagerImpl::SendUpdateAppList(const std::list<uint32_t>& applications_ids) {
- LOG4CXX_TRACE(logger_, "SendUpdateAppList");
+void ApplicationManagerImpl::SendUpdateAppList() {
+ LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, applications_ids.size() << " applications.");
+ using namespace smart_objects;
+ using namespace hmi_apis;
- smart_objects::SmartObject* request = MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::BasicCommunication_UpdateAppList);
- (*request)[strings::msg_params][strings::applications] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
+ SmartObjectSPtr request = MessageHelper::CreateModuleInfoSO(
+ FunctionID::BasicCommunication_UpdateAppList);
- smart_objects::SmartObject& applications =
- (*request)[strings::msg_params][strings::applications];
+ (*request)[strings::msg_params][strings::applications] = SmartObject(SmartType_Array);
- uint32_t app_count = 0;
- for (std::list<uint32_t>::const_iterator it = applications_ids.begin();
- it != applications_ids.end(); ++it) {
- ApplicationSharedPtr app = application(*it);
+ SmartObject& applications = (*request)[strings::msg_params][strings::applications];
- if (!app.valid()) {
- LOG4CXX_ERROR(logger_, "Application not found , id = " << *it);
- continue;
- }
+ PrepareApplicationListSO(applications_, applications);
+ PrepareApplicationListSO(apps_to_register_, applications);
- smart_objects::SmartObject hmi_application(smart_objects::SmartType_Map);;
- if (!MessageHelper::CreateHMIApplicationStruct(app, hmi_application)) {
- LOG4CXX_ERROR(logger_, "Can't CreateHMIApplicationStruct ', id = " << *it);
- continue;
- }
- applications[app_count++] = hmi_application;
- }
- if (app_count <= 0) {
- LOG4CXX_WARN(logger_, "Empty applications list");
- }
ManageHMICommand(request);
}
@@ -872,40 +879,34 @@ void ApplicationManagerImpl::RemoveDevice(
LOG4CXX_INFO(logger_, "device_handle " << device_handle);
}
-bool ApplicationManagerImpl::IsAudioStreamingAllowed(uint32_t application_key) const {
- ApplicationSharedPtr app = application(application_key);
-
- if (!app) {
- LOG4CXX_WARN(logger_, "An application is not registered.");
- return false;
- }
-
- const mobile_api::HMILevel::eType& hmi_level = app->hmi_level();
+mobile_apis::HMILevel::eType ApplicationManagerImpl::GetDefaultHmiLevel(
+ ApplicationSharedPtr application) const {
+ using namespace mobile_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
+ HMILevel::eType default_hmi = HMILevel::HMI_NONE;
- if (mobile_api::HMILevel::HMI_FULL == hmi_level ||
- mobile_api::HMILevel::HMI_LIMITED == hmi_level) {
- return true;
- }
-
- return false;
-}
-
-bool ApplicationManagerImpl::IsVideoStreamingAllowed(uint32_t application_key) const {
- ApplicationSharedPtr app = application(application_key);
-
- if (!app) {
- LOG4CXX_WARN(logger_, "An application is not registered.");
- return false;
- }
-
- const mobile_api::HMILevel::eType& hmi_level = app->hmi_level();
-
- if (mobile_api::HMILevel::HMI_FULL == hmi_level &&
- app->hmi_supports_navi_video_streaming()) {
- return true;
+ if (policy::PolicyHandler::instance()->PolicyEnabled()) {
+ const std::string policy_app_id = application->mobile_app_id();
+ std::string default_hmi_string = "";
+ if (policy::PolicyHandler::instance()->GetDefaultHmi(
+ policy_app_id, &default_hmi_string)) {
+ if ("BACKGROUND" == default_hmi_string) {
+ default_hmi = HMILevel::HMI_BACKGROUND;
+ } else if ("FULL" == default_hmi_string) {
+ default_hmi = HMILevel::HMI_FULL;
+ } else if ("LIMITED" == default_hmi_string) {
+ default_hmi = HMILevel::HMI_LIMITED;
+ } else if ("NONE" == default_hmi_string) {
+ default_hmi = HMILevel::HMI_NONE;
+ } else {
+ LOG4CXX_ERROR(logger_, "Unable to convert " + default_hmi_string + " to HMILevel");
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "Unable to get default hmi_level for "
+ << policy_app_id);
+ }
}
-
- return false;
+ return default_hmi;
}
uint32_t ApplicationManagerImpl::GenerateGrammarID() {
@@ -913,19 +914,23 @@ uint32_t ApplicationManagerImpl::GenerateGrammarID() {
}
uint32_t ApplicationManagerImpl::GenerateNewHMIAppID() {
- uint32_t hmi_app_id = rand();
+ LOG4CXX_TRACE(logger_, "ENTER");
+ uint32_t hmi_app_id = get_rand_from_range(1);
+ LOG4CXX_DEBUG(logger_, "GenerateNewHMIAppID value is: " << hmi_app_id);
while (resume_ctrl_.IsHMIApplicationIdExist(hmi_app_id)) {
- hmi_app_id = rand();
+ 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);
}
+ LOG4CXX_TRACE(logger_, "EXIT");
return hmi_app_id;
}
void ApplicationManagerImpl::ReplaceMobileByHMIAppId(
smart_objects::SmartObject& message) {
MessageHelper::PrintSmartObject(message);
- flush(std::cout);
if (message.keyExists(strings::app_id)) {
ApplicationSharedPtr application =
ApplicationManagerImpl::instance()->application(
@@ -998,93 +1003,154 @@ void ApplicationManagerImpl::ReplaceHMIByMobileAppId(
}
}
+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) {
+ 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;
+ }
+ return false;
+}
+
+void ApplicationManagerImpl::StopNaviService(
+ uint32_t app_id, protocol_handler::ServiceType service_type) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ NaviServiceStatusMap::iterator it =
+ navi_service_status_.find(app_id);
+ if (navi_service_status_.end() == it) {
+ LOG4CXX_WARN(logger_, "No Information about navi service "
+ << service_type);
+ } else {
+ // Fill NaviServices map. Set false to first value of pair if
+ // we've stopped video service or to second value if we've
+ // stopped audio service
+ service_type == ServiceType::kMobileNav ? it->second.first =
+ false : it->second.second = false;
+ }
+
+ ApplicationSharedPtr app = application(app_id);
+ if (!app) {
+ LOG4CXX_WARN(logger_, "An application is not registered.");
+ return;
+ }
+ app->StopStreaming(service_type);
+}
+
bool ApplicationManagerImpl::OnServiceStartedCallback(
const connection_handler::DeviceHandle& device_handle,
const int32_t& session_key,
const protocol_handler::ServiceType& type) {
- LOG4CXX_INFO(logger_,
- "OnServiceStartedCallback " << type << " in session " << session_key);
+ using namespace helpers;
+ using namespace protocol_handler;
+
+ LOG4CXX_DEBUG(logger_,
+ "OnServiceStartedCallback " << type
+ << " in session 0x" << std::hex << session_key);
+ if (type == kRpc) {
+ LOG4CXX_INFO(logger_, "RPC service is about to be started.");
+ return true;
+ }
ApplicationSharedPtr app = application(session_key);
+ if (!app) {
+ LOG4CXX_DEBUG(logger_, "The application with id:" << session_key <<
+ " doesn't exists.");
+ return false;
+ }
- switch (type) {
- case protocol_handler::kRpc: {
- LOG4CXX_INFO(logger_, "RPC service is about to be started.");
- break;
- }
- case protocol_handler::kMobileNav: {
- LOG4CXX_INFO(logger_, "Video service is about to be started.");
- if (media_manager_) {
- if (!app) {
- LOG4CXX_ERROR_EXT(logger_, "An application is not registered.");
- return false;
- }
- if (app->allowed_support_navigation()) {
- media_manager_->StartVideoStreaming(session_key);
- } else {
- return false;
- }
- }
- break;
- }
- case protocol_handler::kAudio: {
- LOG4CXX_INFO(logger_, "Audio service is about to be started.");
- if (media_manager_) {
- if (!app) {
- LOG4CXX_ERROR_EXT(logger_, "An application is not registered.");
- return false;
- }
- if (app->allowed_support_navigation()) {
- media_manager_->StartAudioStreaming(session_key);
- } else {
- return false;
- }
- }
- break;
- }
- default: {
- LOG4CXX_WARN(logger_, "Unknown type of service to be started.");
- break;
+ if (Compare<ServiceType, EQ, ONE>(type,
+ ServiceType::kMobileNav, ServiceType::kAudio)) {
+ if (app->is_navi()) {
+ return StartNaviService(session_key, type);
}
}
-
- return true;
+ return false;
}
-void ApplicationManagerImpl::OnServiceEndedCallback(const int32_t& session_key,
- const protocol_handler::ServiceType& type) {
- LOG4CXX_INFO_EXT(
- logger_,
- "OnServiceEndedCallback " << type << " in session " << session_key);
-
- switch (type) {
- case protocol_handler::kRpc: {
- LOG4CXX_INFO(logger_, "Remove application.");
- /* in case it was unexpected disconnect application will be removed
- and we will notify HMI that it was unexpected disconnect,
- but in case it was closed by mobile we will be unable to find it in the list
- */
- UnregisterApplication(session_key, mobile_apis::Result::INVALID_ENUM,
- true, true);
- break;
- }
- case protocol_handler::kMobileNav: {
- LOG4CXX_INFO(logger_, "Stop video streaming.");
- if (media_manager_) {
- media_manager_->StopVideoStreaming(session_key);
+void ApplicationManagerImpl::OnServiceEndedCallback(
+ const int32_t& session_key,
+ const protocol_handler::ServiceType& type,
+ const connection_handler::CloseSessionReason& close_reason) {
+ using namespace helpers;
+ using namespace protocol_handler;
+ using namespace mobile_apis;
+ using namespace connection_handler;
+ using namespace mobile_apis;
+
+ LOG4CXX_DEBUG(logger_, "OnServiceEndedCallback for service "
+ << type << " with reason " << close_reason
+ << " in session 0x" << std::hex << session_key);
+
+ if (type == kRpc) {
+ LOG4CXX_INFO(logger_, "Remove application.");
+ /* In case it was unexpected disconnect or some special case
+ (malformed message, flood) application will be removed
+ and we will unregister application correctly, but in case it was
+ closed by mobile and already unregistered we will be unable
+ to find it in the list
+ */
+
+ Result::eType reason;
+ bool is_resuming;
+ bool is_unexpected_disconnect;
+ switch (close_reason) {
+ case CloseSessionReason::kFlood: {
+ reason = Result::TOO_MANY_PENDING_REQUESTS;
+ is_resuming = true;
+ is_unexpected_disconnect = false;
+
+ MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
+ session_key, AppInterfaceUnregisteredReason::TOO_MANY_REQUESTS);
+ break;
}
- break;
- }
- case protocol_handler::kAudio: {
- LOG4CXX_INFO(logger_, "Stop audio service.");
- if (media_manager_) {
- media_manager_->StopAudioStreaming(session_key);
+ case CloseSessionReason::kMalformed: {
+ reason = Result::INVALID_ENUM;
+ is_resuming = true;
+ is_unexpected_disconnect = false;
+ break;
+ }
+ case CloseSessionReason::kUnauthorizedApp: {
+ reason = Result::INVALID_ENUM;
+ is_resuming = true;
+ is_unexpected_disconnect = false;
+ break;
+ }
+ default: {
+ reason = Result::INVALID_ENUM;
+ is_resuming = true;
+ is_unexpected_disconnect = true;
+ break;
}
- break;
}
- default:
- LOG4CXX_WARN(logger_, "Unknown type of service to be ended." <<
- type);
- break;
+ UnregisterApplication(
+ session_key, reason, is_resuming, is_unexpected_disconnect);
+ return;
+ }
+
+ if (Compare<ServiceType, EQ, ONE>(type,
+ ServiceType::kMobileNav, ServiceType::kAudio)) {
+ StopNaviService(session_key, type);
}
}
@@ -1113,9 +1179,8 @@ void ApplicationManagerImpl::StartDevicesDiscovery() {
}
void ApplicationManagerImpl::SendMessageToMobile(
- const utils::SharedPtr<smart_objects::SmartObject> message,
- bool final_message) {
- LOG4CXX_INFO(logger_, "ApplicationManagerImpl::SendMessageToMobile");
+ const commands::MessageSharedPtr message, bool final_message) {
+ LOG4CXX_AUTO_TRACE(logger_);
if (!message) {
LOG4CXX_ERROR(logger_, "Null-pointer message received.");
@@ -1141,7 +1206,7 @@ void ApplicationManagerImpl::SendMessageToMobile(
ProtocolVersion::kV1;
} else {
(*message)[strings::params][strings::protocol_version] =
- ProtocolVersion::kV3;
+ SupportedSDLVersion();
}
} else {
(*message)[strings::params][strings::protocol_version] =
@@ -1165,8 +1230,9 @@ void ApplicationManagerImpl::SendMessageToMobile(
// 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_.terminateMobileRequest(
- msg_to_mobile[strings::params][strings::correlation_id].asInt());
+ request_ctrl_.OnMobileResponse(
+ msg_to_mobile[strings::params][strings::correlation_id].asInt(),
+ msg_to_mobile[strings::params][strings::connection_key].asInt());
} else if (app) {
mobile_apis::FunctionID::eType function_id =
static_cast<mobile_apis::FunctionID::eType>(
@@ -1179,11 +1245,14 @@ void ApplicationManagerImpl::SendMessageToMobile(
smart_objects::SmartMap::iterator iter_end = s_map.map_end();
for (; iter != iter_end; ++iter) {
- params.push_back(iter->first);
+ if (true == iter->second.asBool()) {
+ LOG4CXX_INFO(logger_, "Request's param: " << iter->first);
+ params.push_back(iter->first);
+ }
}
}
const mobile_apis::Result::eType check_result =
- CheckPolicyPermissions( app->mobile_app_id()->asString(),
+ CheckPolicyPermissions( app->mobile_app_id(),
app->hmi_level(), function_id, params);
if (mobile_apis::Result::SUCCESS != check_result) {
const std::string string_functionID =
@@ -1194,30 +1263,48 @@ void ApplicationManagerImpl::SendMessageToMobile(
}
if (function_id == mobile_apis::FunctionID::OnSystemRequestID) {
- policy::PolicyHandler::instance()->OnUpdateRequestSentToMobile();
+ 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) {
+ policy::PolicyHandler::instance()->OnUpdateRequestSentToMobile();
+ }
}
}
+ 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));
+ final_message));
+}
+
+void ApplicationManagerImpl::TerminateRequest(uint32_t connection_key, uint32_t corr_id) {
+ request_ctrl_.terminateRequest(corr_id, connection_key, true);
}
bool ApplicationManagerImpl::ManageMobileCommand(
- const utils::SharedPtr<smart_objects::SmartObject> message) {
- LOG4CXX_INFO(logger_, "ApplicationManagerImpl::ManageMobileCommand");
+ const commands::MessageSharedPtr message,
+ commands::Command::CommandOrigin origin) {
+ LOG4CXX_AUTO_TRACE(logger_);
if (!message) {
LOG4CXX_WARN(logger_, "RET Null-pointer message received.");
- NOTREACHED()
return false;
}
+ if (IsLowVoltage()) {
+ LOG4CXX_WARN(logger_, "Low Voltage is active");
+ return false;
+ }
#ifdef DEBUG
MessageHelper::PrintSmartObject(*message);
#endif
LOG4CXX_INFO(logger_, "Trying to create message in mobile factory.");
- commands::Command* command = MobileCommandFactory::CreateCommand(message);
+ utils::SharedPtr<commands::Command> command(
+ MobileCommandFactory::CreateCommand(message, origin));
if (!command) {
LOG4CXX_WARN(logger_, "RET Failed to create mobile command from smart object");
@@ -1249,12 +1336,11 @@ bool ApplicationManagerImpl::ManageMobileCommand(
app = ApplicationManagerImpl::instance()->application(connection_key);
if (!app) {
LOG4CXX_ERROR_EXT(logger_, "RET APPLICATION_NOT_REGISTERED");
- smart_objects::SmartObject* response =
- MessageHelper::CreateNegativeResponse(
- connection_key,
- static_cast<int32_t>(function_id),
- correlation_id,
- static_cast<int32_t>(mobile_apis::Result::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;
@@ -1270,18 +1356,15 @@ bool ApplicationManagerImpl::ManageMobileCommand(
command->Run();
command->CleanUp();
}
- delete command;
return true;
}
if (message_type ==
mobile_apis::messageType::notification) {
- commands::CommandNotificationImpl* command_notify =
- static_cast<commands::CommandNotificationImpl*>(command);
- request_ctrl_.addNotification(command_notify);
- if (command_notify->Init()) {
- command_notify->Run();
- if (command_notify->CleanUp()) {
- request_ctrl_.removeNotification(command_notify);
+ 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.
}
@@ -1291,8 +1374,6 @@ bool ApplicationManagerImpl::ManageMobileCommand(
if (message_type ==
mobile_apis::messageType::request) {
- commands::CommandRequestImpl* command_request =
- static_cast<commands::CommandRequestImpl*>(command);
// commands will be launched from requesr_ctrl
mobile_apis::HMILevel::eType app_hmi_level = mobile_apis::HMILevel::INVALID_ENUM;
if (app) {
@@ -1301,8 +1382,8 @@ bool ApplicationManagerImpl::ManageMobileCommand(
// commands will be launched from request_ctrl
- request_controller::RequestController::TResult result =
- request_ctrl_.addMobileRequest(command_request, app_hmi_level);
+ const request_controller::RequestController::TResult result =
+ request_ctrl_.addMobileRequest(command, app_hmi_level);
if (result == request_controller::RequestController::SUCCESS) {
LOG4CXX_INFO(logger_, "Perform request");
@@ -1312,12 +1393,11 @@ bool ApplicationManagerImpl::ManageMobileCommand(
LOG4CXX_ERROR_EXT(logger_, "RET Unable top perform request: " <<
"TOO_MANY_PENDING_REQUESTS");
- smart_objects::SmartObject* response =
- MessageHelper::CreateNegativeResponse(
- connection_key,
- static_cast<int32_t>(function_id),
- correlation_id,
- static_cast<int32_t>(mobile_apis::Result::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));
SendMessageToMobile(response);
return false;
@@ -1344,7 +1424,10 @@ bool ApplicationManagerImpl::ManageMobileCommand(
connection_key, mobile_api::AppInterfaceUnregisteredReason::
REQUEST_WHILE_IN_NONE_HMI_LEVEL);
- application(connection_key)->usage_report().RecordRemovalsForBadBehavior();
+ 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;
@@ -1360,8 +1443,8 @@ bool ApplicationManagerImpl::ManageMobileCommand(
}
void ApplicationManagerImpl::SendMessageToHMI(
- const utils::SharedPtr<smart_objects::SmartObject> message) {
- LOG4CXX_INFO(logger_, "ApplicationManagerImpl::SendMessageToHMI");
+ const commands::MessageSharedPtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
if (!message) {
LOG4CXX_WARN(logger_, "Null-pointer message received.");
@@ -1387,7 +1470,6 @@ void ApplicationManagerImpl::SendMessageToHMI(
logger_,
"Attached schema to message, result if valid: " << message->isValid());
-
#ifdef HMI_DBUS_API
message_to_send->set_smart_object(*message);
#else
@@ -1402,15 +1484,18 @@ void ApplicationManagerImpl::SendMessageToHMI(
}
bool ApplicationManagerImpl::ManageHMICommand(
- const utils::SharedPtr<smart_objects::SmartObject> message) {
- LOG4CXX_INFO(logger_, "ApplicationManagerImpl::ManageHMICommand");
+ const commands::MessageSharedPtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
if (!message) {
LOG4CXX_WARN(logger_, "Null-pointer message received.");
- NOTREACHED();
return false;
}
+ if (IsLowVoltage()) {
+ LOG4CXX_WARN(logger_, "Low Voltage is active");
+ return false;
+ }
MessageHelper::PrintSmartObject(*message);
@@ -1420,18 +1505,20 @@ bool ApplicationManagerImpl::ManageHMICommand(
return false;
}
- int32_t message_type = (*(message.get()))[strings::params][strings::message_type].asInt();
-
- if (kRequest == message_type) {
- LOG4CXX_DEBUG(logger_, "ManageHMICommand");
- request_ctrl_.addHMIRequest(command);
- }
+ int32_t message_type =
+ (*(message.get()))[strings::params][strings::message_type].asInt();
+ // Init before adding to request controller to be able to set request timeout
if (command->Init()) {
+ if (kRequest == message_type) {
+ LOG4CXX_DEBUG(logger_, "ManageHMICommand");
+ request_ctrl_.addHMIRequest(command);
+ }
command->Run();
if (kResponse == message_type) {
- int32_t correlation_id = (*(message.get()))[strings::params][strings::correlation_id].asInt();
- request_ctrl_.terminateHMIRequest(correlation_id);
+ int32_t correlation_id =
+ (*(message.get()))[strings::params][strings::correlation_id].asInt();
+ request_ctrl_.OnHMIResponse(correlation_id);
}
return true;
}
@@ -1440,6 +1527,29 @@ bool ApplicationManagerImpl::ManageHMICommand(
bool ApplicationManagerImpl::Init() {
LOG4CXX_TRACE(logger_, "Init application manager");
+ const std::string app_storage_folder =
+ profile::Profile::instance()->app_storage_folder();
+ if (!InitDirectory(app_storage_folder, TYPE_STORAGE) ||
+ !IsReadWriteAllowed(app_storage_folder, TYPE_STORAGE)) {
+ return false;
+ }
+
+ const std::string system_files_path =
+ profile::Profile::instance()->system_files_path();
+ if (!InitDirectory(system_files_path, TYPE_SYSTEM) ||
+ !IsReadWriteAllowed(system_files_path, TYPE_SYSTEM)) {
+ return false;
+ }
+
+ const std::string app_icons_folder =
+ profile::Profile::instance()->app_icons_folder();
+ if (!InitDirectory(app_icons_folder, TYPE_ICONS)) {
+ return false;
+ }
+ // In case there is no R/W permissions for this location, SDL just has to
+ // log this and proceed
+ IsReadWriteAllowed(app_icons_folder, TYPE_ICONS);
+
if (policy::PolicyHandler::instance()->PolicyEnabled()) {
if(!policy::PolicyHandler::instance()->LoadPolicyLibrary()) {
LOG4CXX_ERROR(logger_, "Policy library is not loaded. Check LD_LIBRARY_PATH");
@@ -1453,41 +1563,6 @@ bool ApplicationManagerImpl::Init() {
} else {
LOG4CXX_WARN(logger_, "System is configured to work without policy functionality.");
}
- const std::string app_storage_folder =
- profile::Profile::instance()->app_storage_folder();
- if (!file_system::DirectoryExists(app_storage_folder)) {
- LOG4CXX_WARN(logger_, "Storage directory doesn't exist");
- // if storage directory doesn't exist try to create it
- if (!file_system::CreateDirectoryRecursively(app_storage_folder)) {
- LOG4CXX_ERROR(logger_, "Unable to create Storage directory "
- << app_storage_folder);
- return false;
- }
- }
- if (!(file_system::IsWritingAllowed(app_storage_folder) &&
- file_system::IsReadingAllowed(app_storage_folder))) {
- LOG4CXX_ERROR(logger_,
- "Storage directory doesn't have read/write permissions");
- return false;
- }
-
- const std::string system_files_path =
- profile::Profile::instance()->system_files_path();
- if (!file_system::DirectoryExists(system_files_path)) {
- LOG4CXX_WARN(logger_, "System files directory doesn't exist");
- // if system directory doesn't exist try to create it
- if (!file_system::CreateDirectoryRecursively(system_files_path)) {
- LOG4CXX_ERROR(logger_, "Unable to create System directory "
- << system_files_path);
- return false;
- }
- }
- if (!(file_system::IsWritingAllowed(system_files_path) &&
- file_system::IsReadingAllowed(system_files_path))) {
- LOG4CXX_ERROR(logger_,
- "System directory doesn't have read/write permissions");
- return false;
- }
media_manager_ = media_manager::MediaManagerImpl::instance();
return true;
}
@@ -1500,6 +1575,7 @@ bool ApplicationManagerImpl::ConvertMessageToSO(
<< "; json " << message.json_message());
switch (message.protocol_version()) {
+ case ProtocolVersion::kV4:
case ProtocolVersion::kV3:
case ProtocolVersion::kV2: {
const bool conversion_result =
@@ -1559,7 +1635,20 @@ bool ApplicationManagerImpl::ConvertMessageToSO(
return false;
}
if (output.validate() != smart_objects::Errors::OK) {
- LOG4CXX_WARN(logger_, "Incorrect parameter from HMI");
+ LOG4CXX_ERROR(logger_, "Incorrect parameter from HMI");
+
+ if (application_manager::MessageType::kNotification ==
+ output[strings::params][strings::message_type].asInt()) {
+ LOG4CXX_ERROR(logger_, "Ignore wrong HMI notification");
+ return false;
+ }
+
+ if (application_manager::MessageType::kRequest ==
+ output[strings::params][strings::message_type].asInt()) {
+ LOG4CXX_ERROR(logger_, "Ignore wrong HMI request");
+ return false;
+ }
+
output.erase(strings::msg_params);
output[strings::params][hmi_response::code] =
hmi_apis::Common_Result::INVALID_DATA;
@@ -1595,7 +1684,7 @@ bool ApplicationManagerImpl::ConvertMessageToSO(
output[strings::msg_params][strings::result_code] =
NsSmartDeviceLinkRPC::V1::Result::UNSUPPORTED_VERSION;
- smart_objects::SmartObject* msg_to_send = new smart_objects::SmartObject(output);
+ smart_objects::SmartObjectSPtr msg_to_send = new smart_objects::SmartObject(output);
v1_shema.attachSchema(*msg_to_send);
SendMessageToMobile(msg_to_send);
return false;
@@ -1728,18 +1817,7 @@ utils::SharedPtr<Message> ApplicationManagerImpl::ConvertRawMsgToMessage(
return outgoing_message;
}
- Message* convertion_result = NULL;
- if (message->protocol_version() == 1) {
- convertion_result =
- MobileMessageHandler::HandleIncomingMessageProtocolV1(message);
- } else if ((message->protocol_version() == 2) ||
- (message->protocol_version() == 3)) {
- convertion_result =
- MobileMessageHandler::HandleIncomingMessageProtocolV2(message);
- } else {
- LOG4CXX_WARN(logger_, "Unknown protocol version.");
- return outgoing_message;
- }
+ Message* convertion_result = MobileMessageHandler::HandleIncomingMessageProtocol(message);
if (convertion_result) {
outgoing_message = convertion_result;
@@ -1756,8 +1834,7 @@ void ApplicationManagerImpl::ProcessMessageFromMobile(
AMMetricObserver::MessageMetricSharedPtr metric(new AMMetricObserver::MessageMetric());
metric->begin = date_time::DateTime::getCurrentTime();
#endif // TIME_TESTER
- utils::SharedPtr<smart_objects::SmartObject> so_from_mobile(
- new smart_objects::SmartObject);
+ smart_objects::SmartObjectSPtr so_from_mobile(new smart_objects::SmartObject);
if (!so_from_mobile) {
LOG4CXX_ERROR(logger_, "Null pointer");
@@ -1772,7 +1849,8 @@ void ApplicationManagerImpl::ProcessMessageFromMobile(
metric->message = so_from_mobile;
#endif // TIME_TESTER
- if (!ManageMobileCommand(so_from_mobile)) {
+ if (!ManageMobileCommand(so_from_mobile,
+ commands::Command::ORIGIN_MOBILE)) {
LOG4CXX_ERROR(logger_, "Received command didn't run successfully");
}
#ifdef TIME_TESTER
@@ -1786,8 +1864,7 @@ void ApplicationManagerImpl::ProcessMessageFromMobile(
void ApplicationManagerImpl::ProcessMessageFromHMI(
const utils::SharedPtr<Message> message) {
LOG4CXX_INFO(logger_, "ApplicationManagerImpl::ProcessMessageFromHMI()");
- utils::SharedPtr<smart_objects::SmartObject> smart_object(
- new smart_objects::SmartObject);
+ smart_objects::SmartObjectSPtr smart_object(new smart_objects::SmartObject);
if (!smart_object) {
LOG4CXX_ERROR(logger_, "Null pointer");
@@ -1835,6 +1912,162 @@ HMICapabilities& ApplicationManagerImpl::hmi_capabilities() {
return hmi_capabilities_;
}
+void ApplicationManagerImpl::PullLanguagesInfo(const SmartObject& app_data,
+ SmartObject& ttsName,
+ SmartObject& vrSynonym) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (app_data.keyExists(json::languages)) {
+
+ const HMICapabilities& hmi_cap = hmi_capabilities();
+ std::string vr(MessageHelper::CommonLanguageToString(hmi_cap.active_vr_language()));
+ const SmartObject& arr = app_data[json::languages];
+
+ std::transform(vr.begin(), vr.end(), vr.begin(), ::toupper);
+
+ ssize_t default_idx = -1;
+ ssize_t specific_idx = -1;
+
+ const size_t size = arr.length();
+ for (size_t idx = 0; idx < size; ++idx) {
+ if (arr[idx].keyExists(vr)) {
+ specific_idx = idx; break;
+ } else if (arr[idx].keyExists(json::default_)) { default_idx = idx; }
+ else { LOG4CXX_DEBUG(logger_, "Unknown key was specified."); }
+ }
+
+ const ssize_t regular_id = specific_idx != -1 ? specific_idx : default_idx;
+
+ if (regular_id != -1 &&
+ app_data[json::languages][regular_id][vr].keyExists(json::ttsName) &&
+ app_data[json::languages][regular_id][vr].keyExists(json::vrSynonyms)) {
+ ttsName = app_data[json::languages][regular_id][vr][json::ttsName];
+ vrSynonym = app_data[json::languages][regular_id][vr][json::vrSynonyms];
+ }
+ }
+}
+
+void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array,
+ const uint32_t connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace policy;
+ using namespace profile;
+
+ const std::size_t arr_size(obj_array.size());
+ for (std::size_t idx = 0; idx < arr_size; ++idx) {
+ const SmartObject& app_data = obj_array[idx];
+
+ if (!(app_data.keyExists(json::name) && app_data.keyExists(json::appId))) {
+ LOG4CXX_DEBUG(logger_, "The entry in query apps json is not valid");
+ continue;
+ }
+
+ const std::string mobile_app_id(app_data[json::appId].asString());
+ ApplicationSharedPtr registered_app =
+ ApplicationManagerImpl::instance()->
+ application_by_policy_id(mobile_app_id);
+ if (registered_app) {
+ LOG4CXX_DEBUG(logger_, "Application with the same id: " << mobile_app_id
+ << " is registered already.");
+ continue;
+ }
+
+ std::string url_scheme;
+ std::string package_name;
+ std::string os_type;
+ SmartObject vrSynonym;
+ SmartObject ttsName;
+
+ const std::string appName(app_data[json::name].asString());
+
+ if (app_data.keyExists(json::ios)) {
+ os_type = json::ios;
+ url_scheme = app_data[os_type][json::urlScheme].asString();
+ } else if (app_data.keyExists(json::android)) {
+ os_type = json::android;
+ package_name =
+ app_data[os_type][json::packageName].asString();
+ }
+
+ PullLanguagesInfo(app_data[os_type], ttsName, vrSynonym);
+
+ if (ttsName.empty() || vrSynonym.empty()) {
+ ttsName = SmartObject(SmartType_Array);
+ vrSynonym = SmartObject(SmartType_Array);
+
+ ttsName[0] = appName;
+ vrSynonym[0] = appName;
+ }
+
+ const uint32_t hmi_app_id = resume_ctrl_.IsApplicationSaved(mobile_app_id)?
+ resume_ctrl_.GetHMIApplicationID(mobile_app_id) : GenerateNewHMIAppID();
+
+ const std::string app_icon_dir(Profile::instance()->app_icons_folder());
+ const std::string full_icon_path(app_icon_dir + "/" + mobile_app_id);
+
+ uint32_t device_id = 0;
+ connection_handler::ConnectionHandlerImpl* con_handler_impl =
+ static_cast<connection_handler::ConnectionHandlerImpl*>(
+ connection_handler_);
+
+ if (-1 == con_handler_impl->GetDataOnSessionKey(
+ connection_key, NULL, NULL, &device_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to create application: no connection info.");
+ continue;
+ }
+
+ // AppId = 0 because this is query_app(provided by hmi for download, but not yet registered)
+ ApplicationSharedPtr app(
+ new ApplicationImpl(0,
+ mobile_app_id,
+ appName,
+ PolicyHandler::instance()->GetStatisticManager()));
+ DCHECK_OR_RETURN_VOID(app);
+ app->SetShemaUrl(url_scheme);
+ app->SetPackageName(package_name);
+ app->set_app_icon_path(full_icon_path);
+ app->set_hmi_application_id(hmi_app_id);
+ app->set_device(device_id);
+
+ app->set_vr_synonyms(vrSynonym);
+ app->set_tts_name(ttsName);
+
+ sync_primitives::AutoLock lock(apps_to_register_list_lock_);
+ LOG4CXX_DEBUG(logger_, "apps_to_register_ size before: "
+ << apps_to_register_.size());
+ apps_to_register_.insert(app);
+ LOG4CXX_DEBUG(logger_, "apps_to_register_ size after: "
+ << apps_to_register_.size());
+ }
+}
+
+void ApplicationManagerImpl::ProcessQueryApp(
+ const smart_objects::SmartObject& sm_object,
+ const uint32_t connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace policy;
+
+ if (!sm_object.keyExists(json::response)) {
+ LOG4CXX_DEBUG(logger_, "The response key is not exists.");
+ return;
+ }
+
+ SmartArray* obj_array = sm_object[json::response].asArray();
+ if (NULL != obj_array) {
+ CreateApplications(*obj_array, connection_key);
+ SendUpdateAppList();
+
+ AppsWaitRegistrationSet::const_iterator it = apps_to_register_.begin();
+ for (; it != apps_to_register_.end(); ++it) {
+
+ const std::string full_icon_path((*it)->app_icon_path());
+ if (file_system::FileExists(full_icon_path)) {
+ MessageHelper::SendSetAppIcon((*it)->hmi_app_id(), full_icon_path);
+ }
+ }
+ }
+}
+
#ifdef TIME_TESTER
void ApplicationManagerImpl::SetTimeMetricObserver(AMMetricObserver* observer) {
metric_observer_ = observer;
@@ -1852,6 +2085,7 @@ void ApplicationManagerImpl::removeNotification(const commands::Command* notific
void ApplicationManagerImpl::updateRequestTimeout(uint32_t connection_key,
uint32_t mobile_correlation_id,
uint32_t new_timeout_value) {
+ LOG4CXX_AUTO_TRACE(logger_);
request_ctrl_.updateRequestTimeout(connection_key, mobile_correlation_id,
new_timeout_value);
}
@@ -1876,8 +2110,17 @@ void ApplicationManagerImpl::set_application_id(const int32_t correlation_id,
(correlation_id, app_id));
}
+void ApplicationManagerImpl::AddPolicyObserver( policy::PolicyHandlerObserver* listener) {
+ policy::PolicyHandler::instance()->add_listener(listener);
+}
+
+void ApplicationManagerImpl::RemovePolicyObserver(policy::PolicyHandlerObserver* listener) {
+ policy::PolicyHandler::instance()->remove_listener(listener);
+}
+
void ApplicationManagerImpl::SetUnregisterAllApplicationsReason(
mobile_api::AppInterfaceUnregisteredReason::eType reason) {
+ LOG4CXX_TRACE(logger_, "reason = " << reason);
unregister_reason_ = reason;
}
@@ -1885,9 +2128,12 @@ void ApplicationManagerImpl::HeadUnitReset(
mobile_api::AppInterfaceUnregisteredReason::eType reason) {
switch (reason) {
case mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET: {
- file_system::remove_directory_content(profile::Profile::instance()->app_storage_folder());
- resume_controller().ClearResumptionInfo();
+ UnregisterAllApplications();
policy::PolicyHandler::instance()->ResetPolicyTable();
+ policy::PolicyHandler::instance()->UnloadPolicyLibrary();
+
+ resume_controller().StopSavePersistentDataTimer();
+ file_system::remove_directory_content(profile::Profile::instance()->app_storage_folder());
break;
}
case mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS: {
@@ -1901,15 +2147,12 @@ void ApplicationManagerImpl::HeadUnitReset(
}
}
-void ApplicationManagerImpl::HeadUnitSuspend() {
- LOG4CXX_INFO(logger_, "ApplicationManagerImpl::HeadUnitSuspend");
-}
void ApplicationManagerImpl::SendOnSDLClose() {
- LOG4CXX_INFO(logger_, "ApplicationManagerImpl::SendOnSDLClose");
+ LOG4CXX_AUTO_TRACE(logger_);
// must be sent to PASA HMI on shutdown synchronously
- smart_objects::SmartObject* msg = new smart_objects::SmartObject(
+ smart_objects::SmartObjectSPtr msg = new smart_objects::SmartObject(
smart_objects::SmartType_Map);
(*msg)[strings::params][strings::function_id] =
@@ -1952,53 +2195,88 @@ void ApplicationManagerImpl::SendOnSDLClose() {
return;
}
- delete msg;
hmi_handler_->SendMessageToHMI(message_to_send);
}
-void ApplicationManagerImpl::UnregisterAllApplications(bool generated_by_hmi) {
- LOG4CXX_INFO(logger_, "ApplicationManagerImpl::UnregisterAllApplications " <<
- unregister_reason_);
- hmi_cooperating_ = false;
+void ApplicationManagerImpl::UnregisterAllApplications() {
+ LOG4CXX_DEBUG(logger_, "Unregister reason " << unregister_reason_);
- bool is_ignition_off =
- unregister_reason_ ==
- mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF ? true : false;
-
- bool is_unexpected_disconnect = (generated_by_hmi != true);
+ hmi_cooperating_ = false;
+ bool is_ignition_off = false;
+ using namespace mobile_api::AppInterfaceUnregisteredReason;
+ using namespace helpers;
+
+ is_ignition_off =
+ Compare<eType, EQ, ONE>(unregister_reason_, IGNITION_OFF, INVALID_ENUM);
+
+ bool is_unexpected_disconnect =
+ Compare<eType, NEQ, ALL>(unregister_reason_,
+ IGNITION_OFF, MASTER_RESET, FACTORY_DEFAULTS);
+ ApplicationListAccessor accessor;
+ ApplictionSetConstIt it = accessor.begin();
+ while (it != accessor.end()) {
+ ApplicationSharedPtr app_to_remove = *it;
- sync_primitives::AutoLock lock(applications_list_lock_);
+#ifdef CUSTOMER_PASA
+ if (!is_ignition_off) {
+#endif // CUSTOMER_PASA
+ MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
+ app_to_remove->app_id(), unregister_reason_);
+#ifdef CUSTOMER_PASA
+ }
+#endif // CUSTOMER_PASA
- std::set<ApplicationSharedPtr>::iterator it = application_list_.begin();
- while (it != application_list_.end()) {
- ApplicationSharedPtr app_to_remove = *it;
- MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
- app_to_remove->app_id(), unregister_reason_);
UnregisterApplication(app_to_remove->app_id(),
mobile_apis::Result::INVALID_ENUM, is_ignition_off,
is_unexpected_disconnect);
-
- connection_handler_->CloseSession(app_to_remove->app_id());
- it = application_list_.begin();
+ connection_handler_->CloseSession(app_to_remove->app_id(),
+ connection_handler::kCommon);
+ it = accessor.begin();
}
-
if (is_ignition_off) {
- resume_controller().IgnitionOff();
+ resume_controller().Suspend();
}
request_ctrl_.terminateAllHMIRequests();
}
+void ApplicationManagerImpl::RemoveAppsWaitingForRegistration(
+ const connection_handler::DeviceHandle handle) {
+ DevicePredicate device_finder(handle);
+ apps_to_register_list_lock_.Acquire();
+ AppsWaitRegistrationSet::iterator it_app =
+ std::find_if(apps_to_register_.begin(), apps_to_register_.end(),
+ device_finder);
+
+ while (apps_to_register_.end()!= it_app) {
+ LOG4CXX_DEBUG(logger_, "Waiting app: " << (*it_app)->name()
+ << " is removed.");
+ apps_to_register_.erase(it_app);
+ it_app = std::find_if(apps_to_register_.begin(),
+ apps_to_register_.end(),
+ device_finder);
+ }
+
+ apps_to_register_list_lock_.Release();
+}
+
void ApplicationManagerImpl::UnregisterApplication(
const uint32_t& app_id, mobile_apis::Result::eType reason,
bool is_resuming, bool is_unexpected_disconnect) {
- LOG4CXX_INFO(logger_,
- "ApplicationManagerImpl::UnregisterApplication " << app_id);
+ LOG4CXX_INFO(logger_, "app_id = " << app_id
+ << "; reason = " << reason
+ << "; is_resuming = " << is_resuming
+ << "; is_unexpected_disconnect = " << is_unexpected_disconnect);
+
+ NaviServiceStatusMap::iterator it =
+ navi_service_status_.find(app_id);
+ if (navi_service_status_.end() != it) {
+ navi_service_status_.erase(it);
+ }
+
//remove appID from tts_global_properties_app_list_
RemoveAppFromTTSGlobalPropertiesList(app_id);
- sync_primitives::AutoLock lock(applications_list_lock_);
-
switch (reason) {
case mobile_apis::Result::SUCCESS:break;
case mobile_apis::Result::DISALLOWED: break;
@@ -2006,7 +2284,10 @@ void ApplicationManagerImpl::UnregisterApplication(
case mobile_apis::Result::INVALID_CERT: break;
case mobile_apis::Result::EXPIRED_CERT: break;
case mobile_apis::Result::TOO_MANY_PENDING_REQUESTS: {
- application(app_id)->usage_report().RecordRemovalsForBadBehavior();
+ ApplicationSharedPtr app_ptr = application(app_id);
+ if(app_ptr) {
+ app_ptr->usage_report().RecordRemovalsForBadBehavior();
+ }
break;
}
default: {
@@ -2016,21 +2297,38 @@ void ApplicationManagerImpl::UnregisterApplication(
}
ApplicationSharedPtr app_to_remove;
- std::set<ApplicationSharedPtr>::const_iterator it = application_list_.begin();
- for (; it != application_list_.end(); ++it) {
- if ((*it)->app_id() == app_id) {
- app_to_remove = *it;
- break;
+ connection_handler::DeviceHandle handle = 0;
+ {
+ ApplicationListAccessor accessor;
+ ApplictionSetConstIt it = accessor.begin();
+ for (; it != accessor.end(); ++it) {
+ if ((*it)->app_id() == app_id) {
+ app_to_remove = *it;
+ handle = app_to_remove->device();
+ break;
+ }
+ }
+ if (!app_to_remove) {
+ LOG4CXX_ERROR(logger_, "Cant find application with app_id = " << app_id);
+ return;
+ }
+ accessor.Erase(app_to_remove);
+
+ AppV4DevicePredicate finder(handle);
+ ApplicationSharedPtr app = accessor.Find(finder);
+ if (!app) {
+ LOG4CXX_DEBUG(logger_, "There is no more SDL4 apps with device handle: "
+ << handle);
+
+ RemoveAppsWaitingForRegistration(handle);
+ SendUpdateAppList();
}
}
- if (!app_to_remove) {
- LOG4CXX_ERROR(logger_, "Cant find application with app_id = " << app_id);
- return;
- }
- application_list_.erase(app_to_remove);
if (is_resuming) {
- resume_ctrl_.SaveApplication(app_to_remove);
+ resume_ctrl_.SaveApplication(app_to_remove);
+ } else {
+ resume_ctrl_.RemoveApplicationFromSaved(app_to_remove->mobile_app_id());
}
if (audio_pass_thru_active_) {
@@ -2046,16 +2344,8 @@ void ApplicationManagerImpl::UnregisterApplication(
return;
}
-
-void ApplicationManagerImpl::UnregisterRevokedApplication(
- const uint32_t& app_id, mobile_apis::Result::eType reason) {
- UnregisterApplication(app_id, reason);
-
- connection_handler_->CloseSession(app_id);
-
- if (application_list_.empty()) {
- connection_handler_->CloseRevokedConnection(app_id);
- }
+void ApplicationManagerImpl::OnAppUnauthorized(const uint32_t& app_id) {
+ connection_handler_->CloseSession(app_id, connection_handler::kUnauthorizedApp);
}
void ApplicationManagerImpl::Handle(const impl::MessageFromMobile message) {
@@ -2069,26 +2359,19 @@ void ApplicationManagerImpl::Handle(const impl::MessageFromMobile message) {
}
void ApplicationManagerImpl::Handle(const impl::MessageToMobile message) {
- protocol_handler::RawMessage* rawMessage = 0;
- if (message->protocol_version() == application_manager::kV1) {
- rawMessage = MobileMessageHandler::HandleOutgoingMessageProtocolV1(message);
- } else if ((message->protocol_version() == application_manager::kV2) ||
- (message->protocol_version() == application_manager::kV3)) {
- rawMessage = MobileMessageHandler::HandleOutgoingMessageProtocolV2(message);
- } else {
- return;
- }
- if (!rawMessage) {
- LOG4CXX_ERROR(logger_, "Failed to create raw message.");
- return;
- }
-
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;
@@ -2103,7 +2386,8 @@ void ApplicationManagerImpl::Handle(const impl::MessageToMobile message) {
LOG4CXX_INFO(logger_, "Message for mobile given away");
if (close_session) {
- connection_handler_->CloseSession(message->connection_key());
+ connection_handler_->CloseSession(message->connection_key(),
+ connection_handler::kCommon);
}
}
@@ -2129,6 +2413,41 @@ void ApplicationManagerImpl::Handle(const impl::MessageToHmi message) {
LOG4CXX_INFO(logger_, "Message to hmi given away.");
}
+void ApplicationManagerImpl::Handle(const impl::AudioData message) {
+ LOG4CXX_INFO(logger_, "Send AudioPassThru notification");
+ smart_objects::SmartObjectSPtr on_audio_pass = new smart_objects::SmartObject();
+
+ if (!on_audio_pass) {
+ LOG4CXX_ERROR_EXT(logger_, "OnAudioPassThru NULL pointer");
+ return;
+ }
+
+ LOG4CXX_INFO_EXT(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_INFO_EXT(logger_, "Fill binary data");
+ // binary data
+ (*on_audio_pass)[strings::params][strings::binary_data] =
+ smart_objects::SmartObject(message.binary_data);
+
+ LOG4CXX_INFO_EXT(logger_, "After fill binary data");
+
+ LOG4CXX_INFO_EXT(logger_, "Send data");
+ CommandSharedPtr command (
+ MobileCommandFactory::CreateCommand(on_audio_pass,
+ commands::Command::ORIGIN_SDL));
+ command->Init();
+ command->Run();
+ command->CleanUp();
+}
+
mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
const std::string& policy_app_id,
mobile_apis::HMILevel::eType hmi_level,
@@ -2184,8 +2503,12 @@ mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
if (result.hmi_level_permitted != policy::kRpcAllowed) {
LOG4CXX_WARN(logger_, "Request is blocked by policies. " << log_msg );
- application_by_policy_id(policy_app_id)->
- usage_report().RecordPolicyRejectedRpcCall();
+ ApplicationSharedPtr app = application_by_policy_id(policy_app_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "No application for policy id " << policy_app_id);
+ return mobile_apis::Result::GENERIC_ERROR;
+ }
+ app->usage_report().RecordPolicyRejectedRpcCall();
switch (result.hmi_level_permitted) {
case policy::kRpcDisallowed:
@@ -2200,59 +2523,285 @@ mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
return mobile_api::Result::SUCCESS;
}
-void ApplicationManagerImpl::Mute(VRTTSSessionChanging changing_state) {
- mobile_apis::AudioStreamingState::eType state =
- hmi_capabilities_.attenuated_supported()
- ? mobile_apis::AudioStreamingState::ATTENUATED
- : mobile_apis::AudioStreamingState::NOT_AUDIBLE;
- ApplicationManagerImpl::ApplicationListAccessor accessor;
- ApplicationManagerImpl::TAppList local_app_list = accessor.applications();
-
- ApplicationManagerImpl::TAppListConstIt it = local_app_list.begin();
- ApplicationManagerImpl::TAppListConstIt itEnd = local_app_list.end();
- for (; it != itEnd; ++it) {
- if ((*it).valid()) {
- if ((*it)->is_media_application()) {
- if (kTTSSessionChanging == changing_state) {
- (*it)->set_tts_speak_state(true);
- }
- if ((*it)->audio_streaming_state() != state &&
- (mobile_api::HMILevel::HMI_NONE != (*it)->hmi_level()) &&
- (mobile_api::HMILevel::HMI_BACKGROUND != (*it)->hmi_level())) {
- (*it)->set_audio_streaming_state(state);
- MessageHelper::SendHMIStatusNotification(*(*it));
- }
- }
+
+void ApplicationManagerImpl::OnLowVoltage() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ is_low_voltage_ = true;
+ request_ctrl_.OnLowVoltage();
+}
+
+bool ApplicationManagerImpl::IsLowVoltage() {
+ LOG4CXX_TRACE(logger_, "result: " << is_low_voltage_);
+ return is_low_voltage_;
+}
+
+bool ApplicationManagerImpl::HMILevelAllowsStreaming(
+ uint32_t app_id, protocol_handler::ServiceType service_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis::HMILevel;
+ using namespace helpers;
+
+ ApplicationSharedPtr app = application(app_id);
+ if (!app) {
+ LOG4CXX_WARN(logger_, "An application is not registered.");
+ return false;
+ }
+ return Compare<eType, EQ, ONE>(
+ app->hmi_level(), HMI_FULL, HMI_LIMITED);
+}
+
+bool ApplicationManagerImpl::CanAppStream(
+ uint32_t app_id, protocol_handler::ServiceType service_type) const {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application(app_id);
+ if (!app) {
+ LOG4CXX_WARN(logger_, "An application is not registered.");
+ return false;
+ }
+
+ bool is_allowed = false;
+ if (ServiceType::kMobileNav == service_type) {
+ is_allowed = app->video_streaming_allowed();
+ } else if (ServiceType::kAudio == service_type) {
+ is_allowed = app->audio_streaming_allowed();
+ } else {
+ LOG4CXX_WARN(logger_, "Unsupported service_type " << service_type);
+ }
+ return HMILevelAllowsStreaming(app_id, service_type) && is_allowed;
+}
+
+void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) {
+ using namespace mobile_apis::AppInterfaceUnregisteredReason;
+ using namespace mobile_apis::Result;
+
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application(app_id);
+ if (!app || !app->is_navi()) {
+ LOG4CXX_DEBUG(logger_, "There is no navi application with id: " << app_id);
+ return;
+ }
+
+ if (navi_app_to_stop_.end() != std::find(navi_app_to_stop_.begin(),
+ navi_app_to_stop_.end(), app_id) ||
+ navi_app_to_end_stream_.end() != std::find(navi_app_to_end_stream_.begin(),
+ navi_app_to_end_stream_.end(), app_id)) {
+ return;
+ }
+
+ NaviServiceStatusMap::iterator it =
+ navi_service_status_.find(app_id);
+ if (navi_service_status_.end() == it ||
+ (!it->second.first && !it->second.second)) {
+ MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
+ app_id, PROTOCOL_VIOLATION);
+ UnregisterApplication(app_id, ABORTED);
+ return;
+ }
+ EndNaviServices(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);
+ if (!app || !app->is_navi()) {
+ LOG4CXX_DEBUG(logger_, " There is no navi application with id: " << app_id);
+ return;
+ }
+ DCHECK_OR_RETURN_VOID(media_manager_);
+
+ if (state) {
+ state_ctrl_.OnNaviStreamingStarted();
+ media_manager_->StartStreaming(app_id, service_type);
+ } else {
+ media_manager_->StopStreaming(app_id, service_type);
+ state_ctrl_.OnNaviStreamingStopped();
+ }
+}
+
+void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application(app_id);
+ if (!app || !app->is_navi()) {
+ LOG4CXX_DEBUG(logger_, "There is no navi application with id: " << app_id);
+ return;
+ }
+
+ NaviServiceStatusMap::iterator it =
+ navi_service_status_.find(app_id);
+ if (navi_service_status_.end() == it) {
+ return;
+ }
+
+ if (connection_handler_) {
+ if (it->second.first) {
+ LOG4CXX_DEBUG(logger_, "Going to end video service");
+ connection_handler_->SendEndService(app_id, ServiceType::kMobileNav);
+ app->set_video_streaming_approved(false);
+ app->set_video_streaming_allowed(false);
+ }
+ if (it->second.second) {
+ LOG4CXX_DEBUG(logger_, "Going to end audio service");
+ connection_handler_->SendEndService(app_id, ServiceType::kAudio);
+ app->set_audio_streaming_approved(false);
+ app->set_audio_streaming_allowed(false);
+ }
+ navi_app_to_stop_.push_back(app_id);
+
+ ApplicationManagerTimerPtr closeTimer(new TimerThread<ApplicationManagerImpl>(
+ "CloseAppTimer", this, &ApplicationManagerImpl::CloseNaviApp));
+ closeTimer->start(navi_close_app_timeout_);
+
+ sync_primitives::AutoLock lock(timer_pool_lock_);
+ timer_pool_.push_back(closeTimer);
+ }
+}
+
+void ApplicationManagerImpl::OnHMILevelChanged(uint32_t app_id,
+ mobile_apis::HMILevel::eType from,
+ mobile_apis::HMILevel::eType to) {
+ using namespace mobile_apis::HMILevel;
+ using namespace helpers;
+
+ if (from == to) {
+ return;
+ }
+
+ ApplicationSharedPtr app = application(app_id);
+ if (!app || !app->is_navi()) {
+ LOG4CXX_ERROR(logger_, "Navi application not found");
+ return;
+ }
+
+ if (to == HMI_FULL || to == HMI_LIMITED) {
+ if (from == HMI_BACKGROUND) {
+ AllowStreaming(app_id);
+ }
+ } else if (to == HMI_BACKGROUND) {
+ if (from == HMI_FULL || from == HMI_LIMITED) {
+ navi_app_to_end_stream_.push_back(app_id);
+
+ ApplicationManagerTimerPtr endStreamTimer(new TimerThread<ApplicationManagerImpl>(
+ "EndStreamTimer", this, &ApplicationManagerImpl::EndNaviStreaming));
+ endStreamTimer->start(navi_end_stream_timeout_);
+
+ sync_primitives::AutoLock lock(timer_pool_lock_);
+ timer_pool_.push_back(endStreamTimer);
+ }
+ } else if (to == HMI_NONE) {
+ if (from == HMI_FULL || from == HMI_LIMITED ||
+ from == HMI_BACKGROUND) {
+ EndNaviServices(app_id);
}
}
}
-void ApplicationManagerImpl::Unmute(VRTTSSessionChanging changing_state) {
+void ApplicationManagerImpl::ClearTimerPool() {
+ LOG4CXX_AUTO_TRACE(logger_);
- ApplicationManagerImpl::ApplicationListAccessor accessor;
- ApplicationManagerImpl::TAppList local_app_list = application_list_;
- ApplicationManagerImpl::TAppListConstIt it = local_app_list.begin();
- ApplicationManagerImpl::TAppListConstIt itEnd = local_app_list.end();
+ std::vector<ApplicationManagerTimerPtr> new_timer_pool;
- for (; it != itEnd; ++it) {
- if ((*it).valid()) {
- if ((*it)->is_media_application()) {
- if (kTTSSessionChanging == changing_state) {
- (*it)->set_tts_speak_state(false);
- }
- if ((!(vr_session_started())) &&
- (!((*it)->tts_speak_state())) &&
- ((*it)->audio_streaming_state() !=
- mobile_apis::AudioStreamingState::AUDIBLE) &&
- (mobile_api::HMILevel::HMI_NONE != (*it)->hmi_level()) &&
- (mobile_api::HMILevel::HMI_BACKGROUND != (*it)->hmi_level())) {
- (*it)->set_audio_streaming_state(
- mobile_apis::AudioStreamingState::AUDIBLE);
- MessageHelper::SendHMIStatusNotification(*(*it));
- }
- }
+ sync_primitives::AutoLock lock(timer_pool_lock_);
+ new_timer_pool.push_back(timer_pool_[0]);
+
+ for (size_t i = 1; i < timer_pool_.size(); i++) {
+ if (timer_pool_[i]->isRunning()) {
+ new_timer_pool.push_back(timer_pool_[i]);
}
}
+
+ timer_pool_.swap(new_timer_pool);
+ new_timer_pool.clear();
+}
+
+void ApplicationManagerImpl::CloseNaviApp() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis::AppInterfaceUnregisteredReason;
+ using namespace mobile_apis::Result;
+
+ uint32_t app_id = navi_app_to_stop_.front();
+ navi_app_to_stop_.pop_front();
+
+ NaviServiceStatusMap::iterator it =
+ navi_service_status_.find(app_id);
+ if (navi_service_status_.end() != it) {
+ if (it->second.first || it->second.second) {
+ MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
+ app_id, PROTOCOL_VIOLATION);
+ UnregisterApplication(app_id, ABORTED);
+ }
+ }
+}
+
+void ApplicationManagerImpl::EndNaviStreaming() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis::AppInterfaceUnregisteredReason;
+ using namespace mobile_apis::Result;
+
+ uint32_t app_id = navi_app_to_end_stream_.front();
+ navi_app_to_end_stream_.pop_front();
+
+ if (navi_app_to_stop_.end() == std::find(navi_app_to_stop_.begin(),
+ navi_app_to_stop_.end(), app_id)) {
+ DisallowStreaming(app_id);
+ }
+}
+
+void ApplicationManagerImpl::DisallowStreaming(uint32_t app_id) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application(app_id);
+ if (!app || !app->is_navi()) {
+ LOG4CXX_ERROR(logger_, "Navi application not found");
+ return;
+ }
+
+ NaviServiceStatusMap::iterator it =
+ navi_service_status_.find(app_id);
+ if (navi_service_status_.end() != it) {
+ if (it->second.first) {
+ app->set_video_streaming_allowed(false);
+ }
+ if (it->second.second) {
+ app->set_audio_streaming_allowed(false);
+ }
+ }
+}
+
+void ApplicationManagerImpl::AllowStreaming(uint32_t app_id) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application(app_id);
+ if (!app || !app->is_navi()) {
+ LOG4CXX_ERROR(logger_, "Navi application not found");
+ return;
+ }
+
+ NaviServiceStatusMap::iterator it =
+ navi_service_status_.find(app_id);
+ if (navi_service_status_.end() != it) {
+ if (it->second.first) {
+ app->set_video_streaming_allowed(true);
+ }
+ if (it->second.second) {
+ app->set_audio_streaming_allowed(true);
+ }
+ }
+}
+
+void ApplicationManagerImpl::OnWakeUp() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ is_low_voltage_ = false;
+ request_ctrl_.OnWakeUp();
}
mobile_apis::Result::eType ApplicationManagerImpl::SaveBinary(
@@ -2332,19 +2881,8 @@ bool ApplicationManagerImpl::IsHMICooperating() const {
void ApplicationManagerImpl::OnApplicationListUpdateTimer() {
LOG4CXX_DEBUG(logger_, "Application list update timer finished");
-
- std::list <uint32_t> applications_ids;
-
- applications_list_lock_.Acquire();
- for (std::set<ApplicationSharedPtr>::const_iterator i = application_list_.begin();
- i != application_list_.end(); ++i) {
- ApplicationSharedPtr application = *i;
- uint32_t app_id = application->app_id();
- applications_ids.push_back(app_id);
- }
- applications_list_lock_.Release();
-
- SendUpdateAppList(applications_ids);
+ SendUpdateAppList();
+ policy::PolicyHandler::instance()->OnAppsSearchCompleted();
}
void ApplicationManagerImpl::OnTimerSendTTSGlobalProperties() {
@@ -2375,11 +2913,12 @@ void ApplicationManagerImpl::OnTimerSendTTSGlobalProperties() {
void ApplicationManagerImpl::AddAppToTTSGlobalPropertiesList(
const uint32_t app_id) {
- LOG4CXX_INFO(logger_, "ApplicationManagerImpl::AddAppToTTSGlobalPropertiesList");
+ LOG4CXX_AUTO_TRACE(logger_);
uint16_t timeout = profile::Profile::instance()->tts_global_properties_timeout();
TimevalStruct current_time = date_time::DateTime::getCurrentTime();
current_time.tv_sec += timeout;
- sync_primitives::AutoLock lock(tts_global_properties_app_list_lock_);
+ // please avoid AutoLock usage to avoid deadlock
+ tts_global_properties_app_list_lock_.Acquire();
if (tts_global_properties_app_list_.end() ==
tts_global_properties_app_list_.find(app_id)) {
tts_global_properties_app_list_[app_id] = current_time;
@@ -2387,75 +2926,206 @@ void ApplicationManagerImpl::AddAppToTTSGlobalPropertiesList(
//if add first item need to start timer on one second
if (1 == tts_global_properties_app_list_.size()) {
LOG4CXX_INFO(logger_, "Start tts_global_properties_timer_");
+ tts_global_properties_app_list_lock_.Release();
tts_global_properties_timer_.start(1);
+ return;
}
+ tts_global_properties_app_list_lock_.Release();
}
void ApplicationManagerImpl::RemoveAppFromTTSGlobalPropertiesList(
const uint32_t app_id) {
- LOG4CXX_INFO(logger_, "ApplicationManagerImpl::RemoveAppFromTTSGlobalPropertiesList");
- sync_primitives::AutoLock lock(tts_global_properties_app_list_lock_);
+ 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 =
tts_global_properties_app_list_.find(app_id);
if (tts_global_properties_app_list_.end() != it) {
tts_global_properties_app_list_.erase(it);
- if (!(tts_global_properties_app_list_.size())) {
+ if (tts_global_properties_app_list_.empty()) {
LOG4CXX_INFO(logger_, "Stop tts_global_properties_timer_");
- //if container is empty need to stop timer
- tts_global_properties_timer_.stop();
+ // if container is empty need to stop timer
+ tts_global_properties_app_list_lock_.Release();
+ tts_global_properties_timer_.suspend();
+ return;
+ }
+ }
+ tts_global_properties_app_list_lock_.Release();
+}
+
+mobile_apis::AppHMIType::eType ApplicationManagerImpl::StringToAppHMIType(std::string str) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ 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 {
+ return mobile_apis::AppHMIType::INVALID_ENUM;
+ }
+}
+
+bool ApplicationManagerImpl::CompareAppHMIType (const smart_objects::SmartObject& from_policy,
+ const smart_objects::SmartObject& from_application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool equal = false;
+ uint32_t lenght_policy_app_types = from_policy.length();
+ uint32_t lenght_application_app_types = from_application.length();
+
+ for(uint32_t i = 0; i < lenght_application_app_types; ++i) {
+ for(uint32_t k = 0; k < lenght_policy_app_types; ++k) {
+ if (from_application[i] == from_policy[k]) {
+ equal = true;
+ break;
+ }
}
+ if(!equal) {
+ return false;
+ }
+ equal = false;
}
+ return true;
}
-void ApplicationManagerImpl::CreatePhoneCallAppList() {
- LOG4CXX_TRACE_ENTER(logger_);
+void ApplicationManagerImpl::OnUpdateHMIAppType(
+ std::map<std::string, std::vector<std::string> > app_hmi_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::map<std::string, std::vector<std::string> >::iterator it_app_hmi_types_from_policy;
+ std::vector<std::string> hmi_types_from_policy;
+ smart_objects::SmartObject transform_app_hmi_types(smart_objects::SmartType_Array);
+ bool flag_diffirence_app_hmi_type = false;
+ ApplicationListAccessor accessor;
+ for (ApplictionSetIt it = accessor.begin();
+ it != accessor.end(); ++it) {
+
+ it_app_hmi_types_from_policy =
+ app_hmi_types.find(((*it)->mobile_app_id()));
- ApplicationManagerImpl::ApplicationListAccessor accessor;
- ApplicationManagerImpl::TAppList local_app_list = accessor.applications();
+ if (it_app_hmi_types_from_policy != app_hmi_types.end() &&
+ ((it_app_hmi_types_from_policy->second).size())) {
+ flag_diffirence_app_hmi_type = false;
+ hmi_types_from_policy = (it_app_hmi_types_from_policy->second);
- ApplicationManagerImpl::TAppListIt it = local_app_list.begin();
- ApplicationManagerImpl::TAppListIt itEnd = local_app_list.end();
+ if(transform_app_hmi_types.length()) {
+ transform_app_hmi_types =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ }
+
+ for(uint32_t i = 0; i < hmi_types_from_policy.size(); ++i) {
+ transform_app_hmi_types[i] = StringToAppHMIType(hmi_types_from_policy[i]);
+ }
+
+ ApplicationConstSharedPtr app = *it;
+ const smart_objects::SmartObject* save_application_hmi_type = app->app_types();
+
+ if (save_application_hmi_type == NULL ||
+ ((*save_application_hmi_type).length() != transform_app_hmi_types.length())) {
+ flag_diffirence_app_hmi_type = true;
+ } else {
+ flag_diffirence_app_hmi_type = !(CompareAppHMIType(transform_app_hmi_types,
+ *save_application_hmi_type));
+ }
- for (; it != itEnd; ++it) {
- if (mobile_api::HMILevel::HMI_FULL == (*it)->hmi_level() ||
- mobile_api::HMILevel::HMI_LIMITED == (*it)->hmi_level()) {
+ if (flag_diffirence_app_hmi_type) {
+ (*it)->set_app_types(transform_app_hmi_types);
+ (*it)->ChangeSupportingAppHMIType();
+ if ((*it)->hmi_level() == mobile_api::HMILevel::HMI_BACKGROUND) {
- // back up app state
- on_phone_call_app_list_.insert(std::pair<uint32_t, AppState>(
- (*it)->app_id(), AppState((*it)->hmi_level(),
- (*it)->audio_streaming_state(),
- (*it)->system_context())));
+ MessageHelper::SendUIChangeRegistrationRequestToHMI(*it);
+ } else if (((*it)->hmi_level() == mobile_api::HMILevel::HMI_FULL) ||
+ ((*it)->hmi_level() == mobile_api::HMILevel::HMI_LIMITED)) {
- // app state during phone call
- (*it)->set_hmi_level(mobile_api::HMILevel::HMI_BACKGROUND);
- (*it)->set_audio_streaming_state(mobile_api::AudioStreamingState::NOT_AUDIBLE);
- (*it)->set_system_context(mobile_api::SystemContext::SYSCTXT_MAIN);
- MessageHelper::SendHMIStatusNotification(*(*it));
+ MessageHelper::SendUIChangeRegistrationRequestToHMI(*it);
+ ApplicationManagerImpl::instance()->SetState<true>((*it)->app_id(),
+ mobile_apis::HMILevel::HMI_BACKGROUND
+ );
+ }
+ }
}
}
}
-void ApplicationManagerImpl::ResetPhoneCallAppList() {
- LOG4CXX_TRACE_ENTER(logger_);
+ProtocolVersion ApplicationManagerImpl::SupportedSDLVersion() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool heart_beat_support =
+ profile::Profile::instance()->heart_beat_timeout();
+ bool sdl4_support = profile::Profile::instance()->enable_protocol_4();
+
+ if (sdl4_support) {
+ LOG4CXX_DEBUG(logger_, "SDL Supported protocol version "<<ProtocolVersion::kV4);
+ return ProtocolVersion::kV4;
+ }
+ if (heart_beat_support) {
+ LOG4CXX_DEBUG(logger_, "SDL Supported protocol version "<<ProtocolVersion::kV3);
+ return ProtocolVersion::kV3;
+ }
- ApplicationManagerImpl::ApplicationListAccessor accessor;
- ApplicationManagerImpl::TAppList local_app_list = accessor.applications();
+ LOG4CXX_DEBUG(logger_, "SDL Supported protocol version "<<ProtocolVersion::kV2);
+ return ProtocolVersion::kV2;
+}
- std::map<uint32_t, AppState>::iterator it =
- on_phone_call_app_list_.begin();
- std::map<uint32_t, AppState>::iterator it_end =
- on_phone_call_app_list_.end();
- for (; it != it_end; ++it) {
- ApplicationSharedPtr app = application(it->first);
- if (app) {
- app->set_hmi_level(it->second.hmi_level);
- app->set_audio_streaming_state(it->second.audio_streaming_state);
- app->set_system_context(it->second.system_context);
- MessageHelper::SendHMIStatusNotification(*app);
+const std::string ApplicationManagerImpl::DirectoryTypeToString(
+ ApplicationManagerImpl::DirectoryType type) const {
+ DirectoryTypeMap::const_iterator it = dir_type_to_string_map_.find(type);
+ if (it != dir_type_to_string_map_.end()) {
+ return it->second;
+ }
+ return "Unknown";
+}
+
+bool ApplicationManagerImpl::InitDirectory(
+ const std::string& path,
+ ApplicationManagerImpl::DirectoryType type) const {
+ const std::string directory_type = DirectoryTypeToString(type);
+ if (!file_system::DirectoryExists(path)) {
+ LOG4CXX_WARN(logger_, directory_type << " directory doesn't exist.");
+ // if storage directory doesn't exist try to create it
+ if (!file_system::CreateDirectoryRecursively(path)) {
+ LOG4CXX_ERROR(logger_, "Unable to create " << directory_type
+ << " directory " << path);
+ return false;
}
+ LOG4CXX_DEBUG(logger_, directory_type << " directory has been created: "
+ << path);
}
- on_phone_call_app_list_.clear();
+ return true;
+}
+
+bool ApplicationManagerImpl::IsReadWriteAllowed(
+ const std::string& path,
+ DirectoryType type) const {
+ const std::string directory_type = DirectoryTypeToString(type);
+ if (!(file_system::IsWritingAllowed(path) &&
+ file_system::IsReadingAllowed(path))) {
+ LOG4CXX_ERROR(logger_, directory_type
+ << " directory doesn't have read/write permissions.");
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_, directory_type
+ << " directory has read/write permissions.");
+
+ return true;
+}
+
+ApplicationManagerImpl::ApplicationListAccessor::~ApplicationListAccessor() {
}
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc
index 86b764c46..5fd344916 100644
--- a/src/components/application_manager/src/commands/command_impl.cc
+++ b/src/components/application_manager/src/commands/command_impl.cc
@@ -1,4 +1,4 @@
-/**
+/*
Copyright (c) 2014, Ford Motor Company
All rights reserved.
@@ -44,7 +44,8 @@ const int32_t CommandImpl::protocol_version_ = 3;
CommandImpl::CommandImpl(const MessageSharedPtr& message)
: message_(message),
- default_timeout_(profile::Profile::instance()->default_timeout()) {
+ default_timeout_(profile::Profile::instance()->default_timeout()),
+ allowed_to_terminate_(true) {
}
CommandImpl::~CommandImpl() {
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
new file mode 100644
index 000000000..ee7afaddf
--- /dev/null
+++ b/src/components/application_manager/src/commands/command_notification_from_mobile_impl.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/command_notification_from_mobile_impl.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+
+namespace commands {
+
+CommandNotificationFromMobileImpl::CommandNotificationFromMobileImpl(
+ const MessageSharedPtr& message)
+ : CommandImpl(message) {
+}
+
+CommandNotificationFromMobileImpl::~CommandNotificationFromMobileImpl() {
+}
+
+bool CommandNotificationFromMobileImpl::Init() {
+ return true;
+}
+
+bool CommandNotificationFromMobileImpl::CleanUp() {
+ return true;
+}
+
+void CommandNotificationFromMobileImpl::Run() {
+}
+
+void CommandNotificationFromMobileImpl::SendNotification() {
+ (*message_)[strings::params][strings::protocol_type] = mobile_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+ (*message_)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ LOG4CXX_INFO(logger_, "SendNotification");
+ MessageHelper::PrintSmartObject(*message_);
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc
index 5f8757754..544b12a29 100644
--- a/src/components/application_manager/src/commands/command_request_impl.cc
+++ b/src/components/application_manager/src/commands/command_request_impl.cc
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (c) 2013, Ford Motor Company
All rights reserved.
@@ -53,12 +53,12 @@ struct DisallowedParamsInserter {
application_manager::MessageHelper::vehicle_data();
VehicleData::const_iterator it = vehicle_data.find(param);
if (vehicle_data.end() != it) {
- smart_objects::SmartObject* disallowed_param =
+ smart_objects::SmartObjectSPtr disallowed_param =
new 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;
- return true;
+ response_[strings::msg_params][param.c_str()] = *disallowed_param;
+ return true;
}
return false;
}
@@ -75,7 +75,7 @@ CommandRequestImpl::CommandRequestImpl(const MessageSharedPtr& message)
CommandRequestImpl::~CommandRequestImpl() {
}
-bool CommandRequestImpl::Init() {
+bool CommandRequestImpl::Init() {
return true;
}
@@ -91,12 +91,14 @@ void CommandRequestImpl::Run() {
}
void CommandRequestImpl::onTimeOut() {
- LOG4CXX_INFO(logger_, "CommandRequestImpl::onTimeOut");
+ LOG4CXX_AUTO_TRACE(logger_);
unsubscribe_from_all_events();
{
+ // FIXME (dchmerev@luxoft.com): atomic_xchg fits better
sync_primitives::AutoLock auto_lock(state_lock_);
if (kCompleted == current_state_) {
+ LOG4CXX_DEBUG(logger_, "current_state_ = kCompleted");
// don't send timeout if request completed
return;
}
@@ -104,7 +106,7 @@ void CommandRequestImpl::onTimeOut() {
current_state_ = kTimedOut;
}
- smart_objects::SmartObject* response =
+ smart_objects::SmartObjectSPtr response =
MessageHelper::CreateNegativeResponse(connection_key(), function_id(),
correlation_id(), mobile_api::Result::GENERIC_ERROR);
@@ -116,7 +118,7 @@ void CommandRequestImpl::on_event(const event_engine::Event& event) {
void CommandRequestImpl::SendResponse(
const bool success, const mobile_apis::Result::eType& result_code,
- const char* info, const NsSmart::SmartObject* response_params) {
+ const char* info, const smart_objects::SmartObject* response_params) {
{
sync_primitives::AutoLock auto_lock(state_lock_);
@@ -128,13 +130,12 @@ void CommandRequestImpl::SendResponse(
current_state_ = kCompleted;
}
- NsSmartDeviceLink::NsSmartObjects::SmartObject* result =
- new NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
if (!result) {
LOG4CXX_ERROR(logger_, "Memory allocation failed.");
return;
}
- NsSmartDeviceLink::NsSmartObjects::SmartObject& response = *result;
+ smart_objects::SmartObject& response = *result;
response[strings::params][strings::message_type] = MessageType::kResponse;
response[strings::params][strings::correlation_id] = correlation_id();
@@ -191,25 +192,20 @@ bool CommandRequestImpl::CheckSyntax(std::string str, bool allow_empty_line) {
return true;
}
-void CommandRequestImpl::SendHMIRequest(
+uint32_t CommandRequestImpl::SendHMIRequest(
const hmi_apis::FunctionID::eType& function_id,
- const NsSmart::SmartObject* msg_params, bool use_events) {
+ const smart_objects::SmartObject* msg_params, bool use_events) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject* result =
- new NsSmartDeviceLink::NsSmartObjects::SmartObject;
- if (!result) {
- LOG4CXX_ERROR(logger_, "Memory allocation failed.");
- return;
- }
+ smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
const uint32_t hmi_correlation_id =
ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
if (use_events) {
- LOG4CXX_WARN(logger_, "subscribe_on_event " << function_id << " " << hmi_correlation_id);
+ LOG4CXX_DEBUG(logger_, "subscribe_on_event " << function_id << " " << hmi_correlation_id);
subscribe_on_event(function_id, hmi_correlation_id);
}
- NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result;
+ 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;
@@ -226,22 +222,26 @@ void CommandRequestImpl::SendHMIRequest(
LOG4CXX_ERROR(logger_, "Unable to send request");
SendResponse(false, mobile_apis::Result::OUT_OF_MEMORY);
}
+ return hmi_correlation_id;
}
void CommandRequestImpl::CreateHMINotification(
const hmi_apis::FunctionID::eType& function_id,
const NsSmart::SmartObject& msg_params) const {
- NsSmartDeviceLink::NsSmartObjects::SmartObject* result =
- new NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
if (!result) {
LOG4CXX_ERROR(logger_, "Memory allocation failed.");
return;
}
- NsSmartDeviceLink::NsSmartObjects::SmartObject& notify = *result;
+ smart_objects::SmartObject& notify = *result;
notify[strings::params][strings::message_type] =
static_cast<int32_t>(application_manager::MessageType::kNotification);
+ notify[strings::params][strings::protocol_version] =
+ CommandImpl::protocol_version_;
+ notify[strings::params][strings::protocol_type] =
+ CommandImpl::hmi_protocol_type_;
notify[strings::params][strings::function_id] = function_id;
notify[strings::msg_params] = msg_params;
@@ -369,11 +369,11 @@ bool CommandRequestImpl::CheckAllowedParameters() {
return true;
}
- typedef std::set<application_manager::ApplicationSharedPtr> ApplicationList;
ApplicationManagerImpl::ApplicationListAccessor accessor;
- ApplicationList app_list = accessor.applications();
- ApplicationList::const_iterator it_app_list = app_list.begin();
- ApplicationList::const_iterator it_app_list_end = app_list.end();
+ ApplicationManagerImpl::ApplictionSetConstIt it_app_list =
+ accessor.begin();
+ ApplicationManagerImpl::ApplictionSetConstIt it_app_list_end =
+ accessor.end();
for (; it_app_list != it_app_list_end; ++it_app_list) {
if (connection_key() == (*it_app_list).get()->app_id()) {
@@ -385,7 +385,10 @@ bool CommandRequestImpl::CheckAllowedParameters() {
smart_objects::SmartMap::iterator iter_end = s_map.map_end();
for (; iter != iter_end; ++iter) {
- params.push_back(iter->first);
+ if (true == iter->second.asBool()) {
+ LOG4CXX_INFO(logger_, "Request's param: " << iter->first);
+ params.push_back(iter->first);
+ }
}
}
@@ -393,7 +396,7 @@ bool CommandRequestImpl::CheckAllowedParameters() {
mobile_apis::Result::eType check_result =
application_manager::ApplicationManagerImpl::instance()->
CheckPolicyPermissions(
- (*it_app_list).get()->mobile_app_id()->asString(),
+ (*it_app_list).get()->mobile_app_id(),
(*it_app_list).get()->hmi_level(),
static_cast<mobile_api::FunctionID::eType>(function_id()),
params,
@@ -401,7 +404,7 @@ bool CommandRequestImpl::CheckAllowedParameters() {
// Check, if RPC is allowed by policy
if (mobile_apis::Result::SUCCESS != check_result) {
- smart_objects::SmartObject* response =
+ smart_objects::SmartObjectSPtr response =
MessageHelper::CreateBlockedByPoliciesResponse(
static_cast<mobile_api::FunctionID::eType>(function_id()),
check_result, correlation_id(), (*it_app_list)->app_id());
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
index 29d998640..c8258bd74 100644
--- a/src/components/application_manager/src/commands/hmi/activate_app_request.cc
+++ b/src/components/application_manager/src/commands/hmi/activate_app_request.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -62,45 +62,9 @@ namespace application_manager {
}
#endif
SendRequest();
- subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_ActivateApp,
- correlation_id());
LOG4CXX_TRACE(logger_, "exit");
}
-
- void ActivateAppRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_TRACE_ENTER(logger_);
- const smart_objects::SmartObject* response = &(event.smart_object());
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- (*response)[strings::params][hmi_response::code].asInt());
- if (hmi_apis::Common_Result::SUCCESS != code) {
- LOG4CXX_ERROR(logger_, "Error ActivateApp result code " << code);
- return;
- }
- int32_t correlation_id = RequestToHMI::correlation_id();
- // Mobile id is converted to HMI id for HMI requests
- const uint32_t hmi_app_id = ApplicationManagerImpl::instance()->
- application_id(correlation_id);
- mobile_apis::HMILevel::eType requested_hmi_level = static_cast<mobile_apis::HMILevel::eType>(
- (*message_)[strings::msg_params][strings::activate_app_hmi_level].asInt());
- if (0 == hmi_app_id) {
- LOG4CXX_ERROR(logger_, "Error hmi_app_id = "<< hmi_app_id);
- return;
- }
-
- ApplicationSharedPtr application = ApplicationManagerImpl::instance()->
- application_by_hmi_app(hmi_app_id);
- if (!application.valid()) {
- LOG4CXX_ERROR(logger_, "Application can't be activated.");
- return;
- }
- if (mobile_apis::HMILevel::HMI_FULL == requested_hmi_level) {
- if (ApplicationManagerImpl::instance()->ActivateApplication(application)) {
- MessageHelper::SendHMIStatusNotification(*(application.get()));
- }
- }
- }
} // 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
index aba588609..2f63198d8 100644
--- a/src/components/application_manager/src/commands/hmi/activate_app_response.cc
+++ b/src/components/application_manager/src/commands/hmi/activate_app_response.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index c11621045..73c9a49de 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -47,7 +47,7 @@ AddStatisticsInfoNotification::~AddStatisticsInfoNotification() {
}
void AddStatisticsInfoNotification::Run() {
- LOG4CXX_INFO(logger_, "AddStatisticsInfoNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
int type = (*message_)[strings::msg_params][hmi_notification::statistic_type]
.asInt();
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
index 6ac42c7a0..548238f00 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ AllowAllAppsRequest::~AllowAllAppsRequest() {
}
void AllowAllAppsRequest::Run() {
- LOG4CXX_INFO(logger_, "AllowAllAppsRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 69c52a326..eca936325 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ AllowAllAppsResponse::~AllowAllAppsResponse() {
}
void AllowAllAppsResponse::Run() {
- LOG4CXX_INFO(logger_, "AllowAllAppsResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->set_all_apps_allowed(
(*message_)[strings::msg_params][hmi_response::allowed].asBool());
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
index 302a8c676..2f0d4bcc9 100644
--- a/src/components/application_manager/src/commands/hmi/allow_app_request.cc
+++ b/src/components/application_manager/src/commands/hmi/allow_app_request.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ AllowAppRequest::~AllowAppRequest() {
}
void AllowAppRequest::Run() {
- LOG4CXX_INFO(logger_, "AllowAppRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 035e41438..7a7f3dd56 100644
--- a/src/components/application_manager/src/commands/hmi/allow_app_response.cc
+++ b/src/components/application_manager/src/commands/hmi/allow_app_response.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ AllowAppResponse::~AllowAppResponse() {
}
void AllowAppResponse::Run() {
- LOG4CXX_INFO(logger_, "AllowAppResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
uint32_t connection_key =
(*message_)[strings::params][strings::connection_key].asInt();
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
index 0d2bcca4f..d0251a727 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ BasicCommunicationSystemRequest::~BasicCommunicationSystemRequest() {
}
void BasicCommunicationSystemRequest::Run() {
- LOG4CXX_INFO(logger_, "BasicCommunicationSystemRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index dd9f657ad..6106266d1 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ BasicCommunicationSystemResponse::~BasicCommunicationSystemResponse() {
}
void BasicCommunicationSystemResponse::Run() {
- LOG4CXX_INFO(logger_, "BasicCommunicationSystemResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_SystemRequest);
event.set_smart_object(*message_);
event.raise();
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
index e00b3fdc5..87cf1aa78 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ ButtonGetCapabilitiesRequest::~ButtonGetCapabilitiesRequest() {
}
void ButtonGetCapabilitiesRequest::Run() {
- LOG4CXX_INFO(logger_, "ButtonGetCapabilitiesRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 0b6723474..69cfbe49c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ ButtonGetCapabilitiesResponse::~ButtonGetCapabilitiesResponse() {
}
void ButtonGetCapabilitiesResponse::Run() {
- LOG4CXX_INFO(logger_, "ButtonGetCapabilitiesResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
HMICapabilities& hmi_capabilities =
ApplicationManagerImpl::instance()->hmi_capabilities();
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
index 3cc581868..352a28134 100644
--- a/src/components/application_manager/src/commands/hmi/close_popup_request.cc
+++ b/src/components/application_manager/src/commands/hmi/close_popup_request.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ ClosePopupRequest::~ClosePopupRequest() {
}
void ClosePopupRequest::Run() {
- LOG4CXX_INFO(logger_, "ClosePopupRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index fa98be5e0..078d24ef2 100644
--- a/src/components/application_manager/src/commands/hmi/close_popup_response.cc
+++ b/src/components/application_manager/src/commands/hmi/close_popup_response.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -43,7 +43,7 @@ ClosePopupResponse::~ClosePopupResponse() {
}
void ClosePopupResponse::Run() {
- LOG4CXX_INFO(logger_, "ClosePopupResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// TODO(VS): Process response from HMI
}
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
index 53a084d23..902433146 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ GetSystemInfoRequest::~GetSystemInfoRequest() {
}
void GetSystemInfoRequest::Run() {
- LOG4CXX_INFO(logger_, "GetSystemInfoRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
uint32_t correlation_id = RequestToHMI::correlation_id();
uint32_t app_id = RequestToHMI::application_id();
ApplicationManagerImpl::instance()->set_application_id(correlation_id, app_id);
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
index 090b04c3e..5b1ec94e9 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -30,6 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "application_manager/commands/hmi/get_system_info_response.h"
+#include "application_manager/application_manager_impl.h"
#include "application_manager/policies/policy_handler.h"
#include "application_manager/message_helper.h"
@@ -45,24 +46,41 @@ GetSystemInfoResponse::~GetSystemInfoResponse() {
}
void GetSystemInfoResponse::Run() {
- LOG4CXX_INFO(logger_, "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());
- if (hmi_apis::Common_Result::SUCCESS != code) {
+ std::string ccpu_version;
+ std::string wers_country_code;
+ std::string language;
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ ccpu_version =
+ (*message_)[strings::msg_params]["ccpu_version"].asString();
+ wers_country_code =
+ (*message_)[strings::msg_params]["wersCountryCode"].asString();
+ uint32_t lang_code = (*message_)[strings::msg_params]["language"].asUInt();
+ language = application_manager::MessageHelper::CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code));
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ hmi_capabilities.set_ccpu_version(ccpu_version);
+ } else {
LOG4CXX_WARN(logger_, "GetSystemError returns an error code " << code);
+
+ // We have to set preloaded flag as false in policy table on any response
+ // of GetSystemInfo (SDLAQ-CRS-2365)
+ const std::string empty_value;
+ policy::PolicyHandler::instance()->OnGetSystemInfo(empty_value,
+ empty_value,
+ empty_value);
return;
}
- const std::string ccpu_version =
- (*message_)[strings::msg_params]["ccpu_version"].asString();
- const std::string wers_country_code =
- (*message_)[strings::msg_params]["wersCountryCode"].asString();
- uint32_t lang_code = (*message_)[strings::msg_params]["language"].asUInt();
- const std::string language =
- application_manager::MessageHelper::CommonLanguageToString(
- static_cast<hmi_apis::Common_Language::eType>(lang_code));
+ // We have to set preloaded flag as false in policy table on any response
+ // of GetSystemInfo (SDLAQ-CRS-2365)
policy::PolicyHandler::instance()->OnGetSystemInfo(ccpu_version,
wers_country_code,
language);
diff --git a/src/components/application_manager/src/commands/hmi/get_urls.cc b/src/components/application_manager/src/commands/hmi/get_urls.cc
index b3d0f6061..c8a347167 100644
--- a/src/components/application_manager/src/commands/hmi/get_urls.cc
+++ b/src/components/application_manager/src/commands/hmi/get_urls.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,27 +46,50 @@ GetUrls::~GetUrls() {
}
void GetUrls::Run() {
- LOG4CXX_INFO(logger_, "GetUrls::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject& object = *message_;
object[strings::params][strings::message_type] = MessageType::kResponse;
if (policy::PolicyHandler::instance()->PolicyEnabled()) {
- policy::EndpointUrls endpoints =
- policy::PolicyHandler::instance()->GetUpdateUrls(
- object[strings::msg_params][hmi_request::service].asInt());
- object[strings::msg_params].erase(hmi_request::service);
- object[strings::msg_params][hmi_response::urls] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- for (size_t i = 0; i < endpoints.size(); ++i) {
- std::string url = endpoints[i].url.empty() ? "" : endpoints[i].url[0];
- object[strings::msg_params][hmi_response::urls][i][strings::url] = url;
- if (policy::kDefaultId != endpoints[i].app_id) {
- object[strings::msg_params][hmi_response::urls][i][hmi_response::policy_app_id] =
- endpoints[i].app_id;
+ policy::EndpointUrls endpoints;
+ policy::PolicyHandler::instance()->GetServiceUrls(
+ object[strings::msg_params][hmi_request::service].asString(),
+ endpoints);
+
+ if (!endpoints.empty()) {
+ object[strings::msg_params].erase(hmi_request::service);
+
+ object[strings::msg_params][hmi_response::urls] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ smart_objects::SmartObject& urls =
+ object[strings::msg_params][hmi_response::urls];
+
+ size_t index = 0;
+
+ for (size_t i = 0; i < endpoints.size(); ++i) {
+ for (size_t k = 0; k < endpoints[i].url.size(); ++k, ++index) {
+ const std::string url = endpoints[i].url[k];
+
+ urls[index] = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ smart_objects::SmartObject& service_info = urls[index];
+
+ service_info[strings::url] = url;
+ if (policy::kDefaultId != endpoints[i].app_id) {
+ service_info[hmi_response::policy_app_id] =
+ endpoints[i].app_id;
+ }
+ }
}
+ object[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ } else {
+ object[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::DATA_NOT_AVAILABLE;
}
- object[strings::params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
} else {
- object[strings::params][hmi_response::code] = hmi_apis::Common_Result::DATA_NOT_AVAILABLE;
+ object[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::DATA_NOT_AVAILABLE;
}
ApplicationManagerImpl::instance()->ManageHMICommand(message_);
}
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
index f8086affe..b446f088b 100644
--- a/src/components/application_manager/src/commands/hmi/get_urls_response.cc
+++ b/src/components/application_manager/src/commands/hmi/get_urls_response.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ GetUrlsResponse::~GetUrlsResponse() {
}
void GetUrlsResponse::Run() {
- LOG4CXX_INFO(logger_, "GetUrlsResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
(*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
(*message_)[strings::params][strings::protocol_version] = protocol_version_;
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
index 9ab4bf5db..059843355 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ MixingAudioSupportedRequest::~MixingAudioSupportedRequest() {
}
void MixingAudioSupportedRequest::Run() {
- LOG4CXX_INFO(logger_, "MixingAudioSupportedRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 4a4fc276d..2da8bdc45 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ MixingAudioSupportedResponse::~MixingAudioSupportedResponse() {
}
void MixingAudioSupportedResponse::Run() {
- LOG4CXX_INFO(logger_, "MixingAudioSupportedResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
HMICapabilities& hmi_capabilities =
ApplicationManagerImpl::instance()->hmi_capabilities();
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
index 7128231b1..77b370190 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ NaviAlertManeuverRequest::~NaviAlertManeuverRequest() {
}
void NaviAlertManeuverRequest::Run() {
- LOG4CXX_INFO(logger_, "NaviAlertManeuverRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 823c96211..49d659777 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ NaviAlertManeuverResponse::~NaviAlertManeuverResponse() {
}
void NaviAlertManeuverResponse::Run() {
- LOG4CXX_INFO(logger_, "NaviAlertManeuverResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::Navigation_AlertManeuver);
event.set_smart_object(*message_);
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
index 3c7a7d3ab..4a637341c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -31,6 +31,9 @@
*/
#include "application_manager/commands/hmi/navi_audio_start_stream_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "protocol_handler/protocol_handler.h"
+#include "config_profile/profile.h"
namespace application_manager {
@@ -38,20 +41,116 @@ namespace commands {
AudioStartStreamRequest::AudioStartStreamRequest(
const MessageSharedPtr& message)
- : RequestToHMI(message) {
+ : RequestToHMI(message),
+ retry_number_(0) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::pair<uint32_t, int32_t> stream_retry =
+ profile::Profile::instance()->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::RetryStartSession() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->
+ application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "StartAudioStreamRequest aborted. Application not found");
+ return;
+ }
+ if (app->audio_streaming_approved()) {
+ LOG4CXX_DEBUG(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();
+ if (curr_retry_number < retry_number_ - 1) {
+ LOG4CXX_DEBUG(logger_, "Send AudioStartStream retry. retry_number = "
+ << curr_retry_number);
+ MessageHelper::SendAudioStartStream(app->app_id());
+ app->set_audio_stream_retry_number(++curr_retry_number);
+ } else {
+ LOG4CXX_DEBUG(logger_, "Audio start stream retry sequence stopped. "
+ << "Attempts expired.");
+ app->set_audio_stream_retry_number(0);
+ ApplicationManagerImpl::instance()->EndNaviServices(app->app_id());
+ }
+}
+
+void AudioStartStreamRequest::onTimeOut() {
+ RetryStartSession();
+
+ ApplicationManagerImpl::instance()->TerminateRequest(
+ connection_key(), correlation_id());
+}
+
void AudioStartStreamRequest::Run() {
- LOG4CXX_INFO(logger_, "AudioStartStreamRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SetAllowedToTerminate(false);
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_StartAudioStream,
+ correlation_id());
- SendRequest();
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->
+ application_by_hmi_app(application_id());
+ if (app) {
+ app->set_audio_streaming_allowed(true);
+ SendRequest();
+ } else {
+ LOG4CXX_ERROR(logger_, "Applcation with hmi_app_id "
+ << application_id() << " does not exist");
+ }
}
-} // namespace commands
+void AudioStartStreamRequest::on_event(const event_engine::Event& event) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
-} // namespace application_manager
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->
+ 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_DEBUG(logger_, "StartAudioStreamResponse SUCCESS");
+ if (ApplicationManagerImpl::instance()->
+ HMILevelAllowsStreaming(app->app_id(), ServiceType::kAudio)) {
+ app->set_audio_streaming_approved(true);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "StartAudioStreamRequest aborted. Application can not stream");
+ }
+ }
+ 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_audio_start_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc
index e4cc8f4cc..5547057a1 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -30,8 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "application_manager/commands/hmi/navi_audio_start_stream_response.h"
-#include "application_manager/application_manager_impl.h"
-#include "application_manager/application_impl.h"
namespace application_manager {
@@ -45,26 +43,11 @@ AudioStartStreamResponse::~AudioStartStreamResponse() {
}
void AudioStartStreamResponse::Run() {
- LOG4CXX_INFO(logger_, "AudioStartStreamResponse::Run");
- ApplicationSharedPtr app =
- ApplicationManagerImpl::instance()->active_application();
+ LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR_EXT(logger_, "NaviStartStreamResponse no active app!");
- return;
- }
-
- 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_, "AudioStartStreamResponse SUCCESS");
- app->set_hmi_supports_navi_audio_streaming(true);
- } else {
- LOG4CXX_INFO(logger_, "AudioStartStreamResponse NOT SUCCESS");
- app->set_hmi_supports_navi_audio_streaming(false);
- }
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_StartAudioStream);
+ event.set_smart_object(*message_);
+ event.raise();
}
} // namespace commands
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
index 4052769d5..ea00d5bc3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ AudioStopStreamRequest::~AudioStopStreamRequest() {
}
void AudioStopStreamRequest::Run() {
- LOG4CXX_INFO(logger_, "AudioStopStreamRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 81a6c62e8..29e6708e1 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -43,7 +43,7 @@ AudioStopStreamResponse::~AudioStopStreamResponse() {
}
void AudioStopStreamResponse::Run() {
- LOG4CXX_INFO(logger_, "AudioStopStreamResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
}
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
index b7a179942..4c0090878 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ NaviIsReadyRequest::~NaviIsReadyRequest() {
}
void NaviIsReadyRequest::Run() {
- LOG4CXX_INFO(logger_, "NaviIsReadyRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 8aef42b40..a3387aec3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ NaviIsReadyResponse::~NaviIsReadyResponse() {
}
void NaviIsReadyResponse::Run() {
- LOG4CXX_INFO(logger_, "NaviIsReadyResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject& object = *message_;
bool is_available = false;
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
index f396a2432..94d569c4e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ NaviSendLocationRequest::~NaviSendLocationRequest() {
}
void NaviSendLocationRequest::Run() {
- LOG4CXX_INFO(logger_, "NaviSendLocationRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 944ced170..7ec5a5907 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ NaviSendLocationResponse::~NaviSendLocationResponse() {
}
void NaviSendLocationResponse::Run() {
- LOG4CXX_INFO(logger_, "NaviSendLocationResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::Navigation_SendLocation);
event.set_smart_object(*message_);
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
index 9103e1f6c..b477dc8da 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ NaviShowConstantTBTRequest::~NaviShowConstantTBTRequest() {
}
void NaviShowConstantTBTRequest::Run() {
- LOG4CXX_INFO(logger_, "NaviShowConstantTBTRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 03c70dd81..58878a3c0 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ NaviShowConstantTBTResponse::~NaviShowConstantTBTResponse() {
}
void NaviShowConstantTBTResponse::Run() {
- LOG4CXX_INFO(logger_, "NaviShowConstantTBTResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::Navigation_ShowConstantTBT);
event.set_smart_object(*message_);
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
index cb9dbd61e..1ff7916b9 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -31,6 +31,9 @@
*/
#include "application_manager/commands/hmi/navi_start_stream_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "protocol_handler/protocol_handler.h"
+#include "config_profile/profile.h"
namespace application_manager {
@@ -38,20 +41,116 @@ namespace commands {
NaviStartStreamRequest::NaviStartStreamRequest(
const MessageSharedPtr& message)
- : RequestToHMI(message) {
+ : RequestToHMI(message),
+ retry_number_(0) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::pair<uint32_t, int32_t> stream_retry =
+ profile::Profile::instance()->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_INFO(logger_, "NaviStartStreamRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
+ SetAllowedToTerminate(false);
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_StartStream,
+ correlation_id());
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->
+ application_by_hmi_app(application_id());
+ if (app) {
+ app->set_video_streaming_allowed(true);
+ SendRequest();
+ } else {
+ LOG4CXX_ERROR(logger_, "Applcation with hmi_app_id "
+ << application_id() << "does not exist");
+ }
}
-} // namespace commands
+void NaviStartStreamRequest::on_event(const event_engine::Event& event) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
-} // namespace application_manager
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->
+ 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_DEBUG(logger_, "NaviStartStreamResponse SUCCESS");
+ if (ApplicationManagerImpl::instance()->
+ HMILevelAllowsStreaming(app->app_id(), ServiceType::kMobileNav)) {
+ app->set_video_streaming_approved(true);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "NaviStartStreamRequest aborted. Application can not stream");
+ }
+ }
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_,"Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void NaviStartStreamRequest::onTimeOut() {
+ RetryStartSession();
+ ApplicationManagerImpl::instance()->TerminateRequest(
+ connection_key(), correlation_id());
+}
+
+void NaviStartStreamRequest::RetryStartSession() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->
+ application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "NaviStartStreamRequest aborted. Application not found");
+ return;
+ }
+ if (app->video_streaming_approved()) {
+ LOG4CXX_DEBUG(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();
+ if (curr_retry_number < retry_number_ - 1) {
+ LOG4CXX_DEBUG(logger_, "Send NaviStartStream retry. retry_number = "
+ << curr_retry_number);
+ MessageHelper::SendNaviStartStream(app->app_id());
+ app->set_video_stream_retry_number(++curr_retry_number);
+ } else {
+ LOG4CXX_DEBUG(logger_, "NaviStartStream retry sequence stopped. "
+ << "Attempts expired");
+ app->set_video_stream_retry_number(0);
+ ApplicationManagerImpl::instance()->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
index 79d51dcb6..a28389105 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -30,8 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "application_manager/commands/hmi/navi_start_stream_response.h"
-#include "application_manager/application_manager_impl.h"
-#include "application_manager/application_impl.h"
namespace application_manager {
@@ -45,27 +43,11 @@ NaviStartStreamResponse::~NaviStartStreamResponse() {
}
void NaviStartStreamResponse::Run() {
- LOG4CXX_INFO(logger_, "NaviStartStreamResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app =
- ApplicationManagerImpl::instance()->active_application();
-
- if (!app) {
- LOG4CXX_ERROR_EXT(logger_, "NaviStartStreamResponse no active app!");
- return;
- }
-
- 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");
- app->set_hmi_supports_navi_video_streaming(true);
- } else {
- LOG4CXX_INFO(logger_, "NaviStartStreamResponse NOT SUCCESS");
- app->set_hmi_supports_navi_video_streaming(false);
- }
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_StartStream);
+ event.set_smart_object(*message_);
+ event.raise();
}
} // namespace commands
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
index 2f1e14a12..3d74c2753 100644
--- 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
@@ -13,7 +13,7 @@ NaviStopStreamRequest::~NaviStopStreamRequest() {
}
void NaviStopStreamRequest::Run() {
- LOG4CXX_INFO(logger_, "NaviStopStreamRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index c368940d5..0603df6a6 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -43,7 +43,7 @@ NaviStopStreamResponse::~NaviStopStreamResponse() {
}
void NaviStopStreamResponse::Run() {
- LOG4CXX_INFO(logger_, "NaviStopStreamResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
}
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
index d0df9ec86..37037245f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ NaviUpdateTurnListRequest::~NaviUpdateTurnListRequest() {
}
void NaviUpdateTurnListRequest::Run() {
- LOG4CXX_INFO(logger_, "NaviUpdateTurnListRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index d93b67bb5..d196db93e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ NaviUpdateTurnListResponse::~NaviUpdateTurnListResponse() {
}
void NaviUpdateTurnListResponse::Run() {
- LOG4CXX_INFO(logger_, "NaviUpdateTurnListResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
event.set_smart_object(*message_);
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
index 2b7ec13c4..9c483459e 100644
--- a/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc
+++ b/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc
@@ -42,7 +42,7 @@ NotificationFromHMI::NotificationFromHMI(const MessageSharedPtr& message)
: CommandImpl(message) {
// Replace HMI app id with Mobile connection id
- ApplicationManagerImpl::instance()->ReplaceHMIByMobileAppId(*(message.get()));
+ ApplicationManagerImpl::instance()->ReplaceHMIByMobileAppId(*message);
}
NotificationFromHMI::~NotificationFromHMI() {
@@ -61,15 +61,17 @@ void NotificationFromHMI::Run() {
void NotificationFromHMI::SendNotificationToMobile(
const MessageSharedPtr& message) {
+
+ (*message)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
ApplicationManagerImpl::instance()->ManageMobileCommand(message);
}
void NotificationFromHMI::CreateHMIRequest(
const hmi_apis::FunctionID::eType& function_id,
- const NsSmartObj::SmartObject& msg_params) const {
+ const smart_objects::SmartObject& msg_params) const {
- NsSmartDeviceLink::NsSmartObjects::SmartObject* result =
- new NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
if (!result) {
LOG4CXX_ERROR(logger_, "Memory allocation failed.");
return;
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
index 020428d6c..506413ce1 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnAllowSDLFunctionalityNotification::~OnAllowSDLFunctionalityNotification() {
}
void OnAllowSDLFunctionalityNotification::Run() {
- LOG4CXX_INFO(logger_, "OnAllowSDLFunctionalityNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
uint32_t device_id = 0;
if ((*message_)[strings::msg_params].keyExists("device")) {
device_id = (*message_)[strings::msg_params]["device"]["id"].asUInt();
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
index 8152244a9..0ff76a45f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -48,9 +48,11 @@ OnAppActivatedNotification::~OnAppActivatedNotification() {
}
void OnAppActivatedNotification::Run() {
- LOG4CXX_INFO(logger_, "OnAppActivatedNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
uint32_t app_id = ((*message_)[strings::msg_params][strings::app_id]).asUInt();
- MessageHelper::SendActivateAppToHMI(app_id);
+ ApplicationManagerImpl::instance()->SetState<true>(app_id,
+ mobile_apis::HMILevel::HMI_FULL
+ );
}
} // namespace commands
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
index 19dd91ab2..3df1c566d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -35,6 +35,7 @@
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
#include "config_profile/profile.h"
+#include "utils/helpers.h"
namespace application_manager {
@@ -49,89 +50,66 @@ OnAppDeactivatedNotification::~OnAppDeactivatedNotification() {
}
void OnAppDeactivatedNotification::Run() {
- LOG4CXX_INFO(logger_, "OnAppDeactivatedNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
+
uint32_t app_id = (*message_)[strings::msg_params][strings::app_id].asUInt();
ApplicationSharedPtr app =
ApplicationManagerImpl::instance()->application(app_id);
+
if (!app.valid()) {
- LOG4CXX_ERROR(logger_, "Application not found, id="<<app_id);
+ LOG4CXX_ERROR(logger_, "Application with id " << app_id << " not found");
return;
}
- if (!(((hmi_apis::Common_DeactivateReason::AUDIO ==
- (*message_)[strings::msg_params][hmi_request::reason].asInt()) ||
- (hmi_apis::Common_DeactivateReason::PHONECALL ==
- (*message_)[strings::msg_params][hmi_request::reason].asInt())) &&
- (app->hmi_level() == mobile_api::HMILevel::eType::HMI_LIMITED))) {
+ using namespace hmi_apis;
+ using namespace mobile_apis;
+ using namespace helpers;
+
+ Common_DeactivateReason::eType deactivate_reason =
+ static_cast<Common_DeactivateReason::eType>
+ ((*message_)[strings::msg_params][hmi_request::reason].asInt());
+
+ if (!((Common_DeactivateReason::AUDIO == deactivate_reason ||
+ Common_DeactivateReason::PHONECALL == deactivate_reason) &&
+ HMILevel::HMI_LIMITED == app->hmi_level())) {
app = ApplicationManagerImpl::instance()->active_application();
+
if (!app.valid()) {
- LOG4CXX_ERROR_EXT(logger_, "OnAppDeactivatedNotification no active app!");
+ LOG4CXX_ERROR_EXT(logger_, "No active application");
return;
}
if (app_id != app->app_id()) {
- LOG4CXX_ERROR_EXT(logger_, "Wrong application id!");
+ LOG4CXX_ERROR_EXT(logger_, "Wrong application id");
return;
}
}
- if (mobile_api::HMILevel::eType::HMI_NONE == app->hmi_level()) {
+ if (HMILevel::HMI_NONE == app->hmi_level()) {
return;
}
+ HmiStatePtr regular = app->RegularHmiState();
+ DCHECK_OR_RETURN_VOID(regular);
+ HmiStatePtr new_regular(new HmiState(*regular));
switch ((*message_)[strings::msg_params][hmi_request::reason].asInt()) {
case hmi_apis::Common_DeactivateReason::AUDIO: {
- if (app->is_media_application()) {
- if (profile::Profile::instance()->is_mixing_audio_supported() &&
- (ApplicationManagerImpl::instance()->vr_session_started() ||
- app->tts_speak_state())) {
- app->set_audio_streaming_state(mobile_api::AudioStreamingState::ATTENUATED);
- } else {
- app->set_audio_streaming_state(mobile_api::AudioStreamingState::NOT_AUDIBLE);
- }
- }
- // switch HMI level for all applications in FULL or LIMITED
- ApplicationManagerImpl::ApplicationListAccessor accessor;
- ApplicationManagerImpl::TAppList applications =
- accessor.applications();
- ApplicationManagerImpl::TAppListIt it =
- applications.begin();
- for (; applications.end() != it; ++it) {
- ApplicationSharedPtr app = *it;
- if (app.valid()) {
- if (mobile_apis::HMILevel::eType::HMI_FULL == app->hmi_level() ||
- mobile_apis::HMILevel::eType::HMI_LIMITED == app->hmi_level()) {
- app->set_hmi_level(mobile_api::HMILevel::HMI_BACKGROUND);
- MessageHelper::SendHMIStatusNotification(*app);
- }
- }
- }
- break;
- }
- case hmi_apis::Common_DeactivateReason::PHONECALL: {
- app->set_audio_streaming_state(mobile_api::AudioStreamingState::NOT_AUDIBLE);
- app->set_hmi_level(mobile_api::HMILevel::HMI_BACKGROUND);
+ new_regular->set_audio_streaming_state(mobile_api::AudioStreamingState::NOT_AUDIBLE);
+ new_regular->set_hmi_level(mobile_api::HMILevel::HMI_BACKGROUND);
break;
}
case hmi_apis::Common_DeactivateReason::NAVIGATIONMAP:
case hmi_apis::Common_DeactivateReason::PHONEMENU:
case hmi_apis::Common_DeactivateReason::SYNCSETTINGS:
case hmi_apis::Common_DeactivateReason::GENERAL: {
- if ((!app->IsAudioApplication()) ||
- ApplicationManagerImpl::instance()->
- DoesAudioAppWithSameHMITypeExistInFullOrLimited(app)) {
- app->set_hmi_level(mobile_api::HMILevel::HMI_BACKGROUND);
+ if (app->IsAudioApplication()) {
+ new_regular->set_hmi_level(mobile_api::HMILevel::HMI_LIMITED);
} else {
- app->set_hmi_level(mobile_api::HMILevel::HMI_LIMITED);
+ new_regular->set_hmi_level(mobile_api::HMILevel::HMI_BACKGROUND);
}
- break;
- }
- default: {
- LOG4CXX_ERROR_EXT(logger_, "Unknown reason of app deactivation");
- return;
}
}
+ ApplicationManagerImpl::instance()->SetState<false>(app->app_id(), new_regular);
- MessageHelper::SendHMIStatusNotification(*app);
}
} // namespace commands
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
index 26d580e83..c786b486f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ OnAppPermissionChangedNotification::~OnAppPermissionChangedNotification() {
}
void OnAppPermissionChangedNotification::Run() {
- LOG4CXX_INFO(logger_, "OnAppPermissionChangedNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendNotification();
}
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
index 951a2ebdf..69a18200f 100644
--- 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
@@ -48,7 +48,7 @@ OnAppPermissionConsentNotification::~OnAppPermissionConsentNotification() {
}
void OnAppPermissionConsentNotification::Run() {
- LOG4CXX_INFO(logger_, "OnAppPermissionConsentNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
uint32_t connection_key = 0;
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
index 26bc396db..af3f45fed 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,9 +45,13 @@ OnAppRegisteredNotification::~OnAppRegisteredNotification() {
}
void OnAppRegisteredNotification::Run() {
- LOG4CXX_INFO(logger_, "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();
}
} // namespace commands
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
index 2bedcb063..571c6f381 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnAppUnregisteredNotification::~OnAppUnregisteredNotification() {
}
void OnAppUnregisteredNotification::Run() {
- LOG4CXX_INFO(logger_, "OnAppUnregisteredNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
//sending event for delete VRCommand on PerformInteraction
event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered);
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
new file mode 100644
index 000000000..d94d29850
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_audio_data_streaming_notification.cc
@@ -0,0 +1,55 @@
+/*
+ * 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)
+ : NotificationToHMI(message) {
+}
+
+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
index 23aceaa7d..2beffc2bd 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnButtonEventNotification::OnButtonEventNotification(
}
void OnButtonEventNotification::Run() {
- LOG4CXX_INFO(logger_, "OnButtonEventNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
(*message_)[strings::params][strings::function_id] =
static_cast<int32_t>(mobile_apis::FunctionID::OnButtonEventID);
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
index 83bcbd7ef..261aa68ee 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -47,7 +47,7 @@ OnButtonPressNotification::OnButtonPressNotification(
}
void OnButtonPressNotification::Run() {
- LOG4CXX_INFO(logger_, "OnButtonPressNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::Buttons_OnButtonPress);
event.set_smart_object(*message_);
event.raise();
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
new file mode 100644
index 000000000..3c31de054
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_button_subscription_notification.cc
@@ -0,0 +1,59 @@
+/*
+ * 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) : NotificationToHMI(message) {
+}
+
+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
index 537c246f4..441538bee 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,12 +45,12 @@ OnDeviceChosenNotification::~OnDeviceChosenNotification() {
}
void OnDeviceChosenNotification::Run() {
- LOG4CXX_INFO(logger_, "OnDeviceChosenNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
if ((*message_)[strings::msg_params].keyExists(strings::device_info)) {
ApplicationManagerImpl::instance()->ConnectToDevice(
(*message_)[strings::msg_params][strings::device_info][strings::id]
- .asInt());
+ .asString());
}
}
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
index 8af2571b5..b41eb6b86 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -30,10 +30,47 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <algorithm>
#include "application_manager/commands/hmi/on_device_state_changed_notification.h"
#include "application_manager/policies/policy_handler.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 {
@@ -48,17 +85,25 @@ OnDeviceStateChangedNotification::~OnDeviceStateChangedNotification() {
}
void OnDeviceStateChangedNotification::Run() {
- LOG4CXX_INFO(logger_, "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 = MessageHelper::GetDeviceMacAddressForHandle(
- (*message_)[strings::msg_params]["deviceId"]["id"].asInt());
+ 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::PolicyHandler::instance()->RemoveDevice(device_id);
}
@@ -67,4 +112,3 @@ void OnDeviceStateChangedNotification::Run() {
} // 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
index d5a8edc48..ceb6e1b58 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -52,7 +52,7 @@ OnDriverDistractionNotification::~OnDriverDistractionNotification() {
}
void OnDriverDistractionNotification::Run() {
- LOG4CXX_INFO(logger_, "OnDriverDistractionNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
const hmi_apis::Common_DriverDistractionState::eType state =
static_cast<hmi_apis::Common_DriverDistractionState::eType>(
@@ -60,10 +60,10 @@ void OnDriverDistractionNotification::Run() {
.asInt());
ApplicationManagerImpl::instance()->set_driver_distraction(state);
- MessageSharedPtr on_driver_distraction =
+ smart_objects::SmartObjectSPtr on_driver_distraction =
new smart_objects::SmartObject();
- if (false == on_driver_distraction.valid()) {
+ if (!on_driver_distraction) {
LOG4CXX_ERROR_EXT(logger_, "NULL pointer");
return;
}
@@ -75,17 +75,15 @@ void OnDriverDistractionNotification::Run() {
state;
ApplicationManagerImpl::ApplicationListAccessor accessor;
- const std::set<ApplicationSharedPtr> applications = accessor.applications();
+ const ApplicationManagerImpl::ApplictionSet applications = accessor.applications();
- std::set<ApplicationSharedPtr>::const_iterator it = applications.begin();
+ ApplicationManagerImpl::ApplictionSetConstIt it = applications.begin();
for (; applications.end() != it; ++it) {
- ApplicationSharedPtr app = *it;
- if (app.valid()) {
- if (mobile_apis::HMILevel::eType::HMI_NONE != app->hmi_level()) {
- (*on_driver_distraction)[strings::params]
- [strings::connection_key] = app->app_id();
- SendNotificationToMobile(on_driver_distraction);
- }
+ const ApplicationSharedPtr app = *it;
+ if (app) {
+ (*on_driver_distraction)[strings::params]
+ [strings::connection_key] = app->app_id();
+ SendNotificationToMobile(on_driver_distraction);
}
}
}
diff --git a/src/components/application_manager/src/commands/hmi/on_emergency_event_notification.cc b/src/components/application_manager/src/commands/hmi/on_emergency_event_notification.cc
new file mode 100644
index 000000000..47b80a1d2
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_emergency_event_notification.cc
@@ -0,0 +1,59 @@
+/*
+ * 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_emergency_event_notification.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnEmergencyEventNotification::OnEmergencyEventNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnEmergencyEventNotification::~OnEmergencyEventNotification() {
+}
+
+void OnEmergencyEventNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnEmergencyEvent);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // 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
index b284c81f2..7c09800d2 100644
--- 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
@@ -52,11 +52,12 @@ OnExitAllApplicationsNotification::~OnExitAllApplicationsNotification() {
}
void OnExitAllApplicationsNotification::Run() {
- LOG4CXX_INFO(logger_, "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;
@@ -77,7 +78,6 @@ void OnExitAllApplicationsNotification::Run() {
break;
}
case hmi_apis::Common_ApplicationsCloseReason::SUSPEND: {
- app_manager->HeadUnitSuspend();
SendOnSDLPersistenceComplete();
return;
}
@@ -93,15 +93,13 @@ void OnExitAllApplicationsNotification::Run() {
mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS == mob_reason) {
app_manager->HeadUnitReset(mob_reason);
}
-
kill(getpid(), SIGINT);
}
void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() {
- LOG4CXX_INFO(logger_, ""
- "OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete");
+ LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject* message =
+ smart_objects::SmartObjectSPtr message =
new smart_objects::SmartObject(smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete;
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
index f4aed6139..d64ba3adf 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -49,7 +49,7 @@ OnExitApplicationNotification::~OnExitApplicationNotification() {
}
void OnExitApplicationNotification::Run() {
- LOG4CXX_INFO(logger_, "OnExitApplicationNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl* app_mgr = ApplicationManagerImpl::instance();
ApplicationSharedPtr app_impl = app_mgr->application(
@@ -70,10 +70,11 @@ void OnExitApplicationNotification::Run() {
break;
}
}
- app_impl->set_hmi_level(mobile_apis::HMILevel::HMI_NONE);
- app_impl->set_audio_streaming_state(mobile_apis::AudioStreamingState::NOT_AUDIBLE);
- app_impl->set_system_context(mobile_api::SystemContext::SYSCTXT_MAIN);
- MessageHelper::SendHMIStatusNotification(*app_impl);
+ using namespace mobile_apis;
+ ApplicationManagerImpl::instance()->SetState<false>(app_impl->app_id(),
+ HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN);
}
} // namespace commands
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
index f1a590ee0..83c3e61a0 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ OnFileRemovedNotification::~OnFileRemovedNotification() {
}
void OnFileRemovedNotification::Run() {
- LOG4CXX_INFO(logger_, "OnFileRemovedNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendNotification();
}
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
index bc32ab1cf..fc1b72c73 100644
--- a/src/components/application_manager/src/commands/hmi/on_find_applications.cc
+++ b/src/components/application_manager/src/commands/hmi/on_find_applications.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ OnFindApplications::~OnFindApplications() {
}
void OnFindApplications::Run() {
- LOG4CXX_INFO(logger_, "OnFindApplications::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// TODO(PV): add UpdateAppsOnDevice to ApplicationManager
}
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
index 523013734..32babf05c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnIgnitionCycleOverNotification::~OnIgnitionCycleOverNotification() {
}
void OnIgnitionCycleOverNotification::Run() {
- LOG4CXX_INFO(logger_, "OnIgnitionCycleOverNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
policy::PolicyHandler::instance()->OnIgnitionCycleOver();
}
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
index a68ae9079..87db5d4a3 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnNaviTBTClientStateNotification::~OnNaviTBTClientStateNotification() {
}
void OnNaviTBTClientStateNotification::Run() {
- LOG4CXX_INFO(logger_, "OnNaviTBTClientStateNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
diff --git a/src/components/application_manager/src/commands/hmi/on_phone_call_notification.cc b/src/components/application_manager/src/commands/hmi/on_phone_call_notification.cc
index 9bd9099c7..5f47c2908 100644
--- a/src/components/application_manager/src/commands/hmi/on_phone_call_notification.cc
+++ b/src/components/application_manager/src/commands/hmi/on_phone_call_notification.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -50,16 +50,10 @@ OnPhoneCallNotification::~OnPhoneCallNotification() {
}
void OnPhoneCallNotification::Run() {
- LOG4CXX_INFO(logger_, "OnPhoneCallNotification::Run");
-
- bool is_active =
- (*message_)[strings::msg_params][hmi_notification::is_active].asBool();
-
- if (is_active) {
- ApplicationManagerImpl::instance()->CreatePhoneCallAppList();
- } else {
- ApplicationManagerImpl::instance()->ResetPhoneCallAppList();
- }
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnPhoneCall);
+ event.set_smart_object(*message_);
+ event.raise();
}
} // namespace hmi
diff --git a/src/components/application_manager/src/commands/hmi/on_play_tone_notification.cc b/src/components/application_manager/src/commands/hmi/on_play_tone_notification.cc
index e05b38d45..9820bb02a 100644
--- a/src/components/application_manager/src/commands/hmi/on_play_tone_notification.cc
+++ b/src/components/application_manager/src/commands/hmi/on_play_tone_notification.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ OnPlayToneNotification::~OnPlayToneNotification() {
}
void OnPlayToneNotification::Run() {
- LOG4CXX_INFO(logger_, "OnPlayToneNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendNotification();
}
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
index b3f5803d4..56c544888 100644
--- a/src/components/application_manager/src/commands/hmi/on_policy_update.cc
+++ b/src/components/application_manager/src/commands/hmi/on_policy_update.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ OnPolicyUpdate::~OnPolicyUpdate() {
}
void OnPolicyUpdate::Run() {
- LOG4CXX_INFO(logger_, "OnPolicyUpdate::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
policy::PolicyHandler::instance()->OnPTExchangeNeeded();
}
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
index 2fecbec9c..cf0297df0 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnPutFileNotification::~OnPutFileNotification() {
}
void OnPutFileNotification::Run() {
- LOG4CXX_INFO(logger_, "OnPutFileNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendNotification();
}
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
index 783aa4af4..f1ac8b6d3 100644
--- a/src/components/application_manager/src/commands/hmi/on_ready_notification.cc
+++ b/src/components/application_manager/src/commands/hmi/on_ready_notification.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ OnReadyNotification::~OnReadyNotification() {
}
void OnReadyNotification::Run() {
- LOG4CXX_INFO(logger_, "OnReadyNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->OnHMIStartedCooperation();
event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnReady);
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
index 1e517f35d..a5ea29c6d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -47,7 +47,7 @@ OnReceivedPolicyUpdate::~OnReceivedPolicyUpdate() {
}
void OnReceivedPolicyUpdate::Run() {
- LOG4CXX_INFO(logger_, "OnReceivedPolicyUpdate::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
const std::string& file_path =
(*message_)[strings::msg_params][hmi_notification::policyfile].asString();
policy::BinaryMessage file_content;
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
index e0dae8f04..163b52562 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ OnRecordStartdNotification::~OnRecordStartdNotification() {
}
void OnRecordStartdNotification::Run() {
- LOG4CXX_INFO(logger_, "OnRecordStartdNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendNotification();
}
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
index 70868b826..8e00c3447 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnResumeAudioSourceNotification::~OnResumeAudioSourceNotification() {
}
void OnResumeAudioSourceNotification::Run() {
- LOG4CXX_INFO(logger_, "OnResumeAudioSourceNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendNotification();
}
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
index 70240b4bf..c39321913 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 1fda4986e..20010111f 100644
--- 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
@@ -46,7 +46,7 @@ OnSDLConsentNeededNotification::~OnSDLConsentNeededNotification() {
}
void OnSDLConsentNeededNotification::Run() {
- LOG4CXX_INFO(logger_, "OnSDLConsentNeededNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendNotification();
}
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
index d71413ef8..afe0ffeab 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index fc5ffed42..6f867adbc 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ OnStartDeviceDiscovery::~OnStartDeviceDiscovery() {
}
void OnStartDeviceDiscovery::Run() {
- LOG4CXX_INFO(logger_, "OnStartDeviceDiscovery::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->StartDevicesDiscovery();
}
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
index 6e4e65987..7db0053e2 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 5a5c12b90..aa334d825 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -47,7 +47,7 @@ OnSystemContextNotification::~OnSystemContextNotification() {
}
void OnSystemContextNotification::Run() {
- LOG4CXX_INFO(logger_, "OnSystemContextNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
mobile_api::SystemContext::eType system_context =
static_cast<mobile_api::SystemContext::eType>(
@@ -77,8 +77,8 @@ void OnSystemContextNotification::Run() {
void OnSystemContextNotification::SendSystemContextNotification(ApplicationSharedPtr app,
mobile_api::SystemContext::eType system_context) {
- app->set_system_context(system_context);
- MessageHelper::SendHMIStatusNotification(*app);
+ ApplicationManagerImpl::instance()->SetState(app->app_id(),
+ system_context);
}
} // namespace commands
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
index bac3d3735..09a96cc79 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -47,7 +47,7 @@ OnSystemErrorNotification::~OnSystemErrorNotification() {
}
void OnSystemErrorNotification::Run() {
- LOG4CXX_INFO(logger_, "OnSystemErrorNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
int code = (*message_)[strings::msg_params][hmi_notification::error]
.asInt();
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
index ec8460d58..fb5a9abc4 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -47,7 +47,7 @@ OnSystemInfoChangedNotification::~OnSystemInfoChangedNotification() {
}
void OnSystemInfoChangedNotification::Run() {
- LOG4CXX_INFO(logger_, "OnSystemInfoChangedNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
uint32_t lang_code =
(*message_)[strings::msg_params][strings::language].asUInt();
const std::string language =
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
index e3d0ea511..2977ed158 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -52,7 +52,7 @@ OnSystemRequestNotification::~OnSystemRequestNotification() {
}
void OnSystemRequestNotification::Run() {
- LOG4CXX_INFO(logger_, "OnSystemRequestNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject& params = (*message_)[strings::params];
smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
@@ -60,8 +60,10 @@ void OnSystemRequestNotification::Run() {
params[strings::function_id] =
static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID);
- std::string app_id = msg_params[strings::app_id].asString();
+ const std::string app_id = msg_params[strings::app_id].asString();
+ LOG4CXX_DEBUG(logger_, "Received OnSystemRequest for " << app_id );
+ ApplicationSharedPtr app;
if (strings::default_app_id == app_id) {
PolicyHandler* policy_handler = PolicyHandler::instance();
uint32_t selected_app_id = policy_handler->GetAppIdForSending();
@@ -71,22 +73,18 @@ void OnSystemRequestNotification::Run() {
return;
}
ApplicationManagerImpl* app_mgr = ApplicationManagerImpl::instance();
- ApplicationSharedPtr selected_app = app_mgr->application(selected_app_id);
- if (!selected_app.valid()) {
- LOG4CXX_ERROR(logger_, "PolicyHandler selected invalid app_id");
- return;
- }
- params[strings::connection_key] = selected_app_id;
+ app = app_mgr->application(selected_app_id);
} else {
- ApplicationSharedPtr app =
- ApplicationManagerImpl::instance()->application_by_policy_id(app_id);
- if (!app.valid()) {
- LOG4CXX_WARN(logger_, "Application with such id is not yet registered.");
- return;
- }
- params[strings::connection_key] = app->app_id();
+ app = ApplicationManagerImpl::instance()->application_by_policy_id(app_id);
+ }
+
+ if (!app.valid()) {
+ LOG4CXX_WARN(logger_, "Application with connection key " << app_id <<
+ "is not registered.");
+ return;
}
+ params[strings::connection_key] = app->app_id();
SendNotificationToMobile(message_);
}
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
index 60c0dca10..daa307d62 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -49,7 +49,7 @@ OnTTSLanguageChangeNotification::~OnTTSLanguageChangeNotification() {
}
void OnTTSLanguageChangeNotification::Run() {
- LOG4CXX_INFO(logger_, "OnTTSLanguageChangeNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
HMICapabilities& hmi_capabilities =
ApplicationManagerImpl::instance()->hmi_capabilities();
@@ -71,11 +71,10 @@ void OnTTSLanguageChangeNotification::Run() {
static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
ApplicationManagerImpl::ApplicationListAccessor accessor;
- const std::set<ApplicationSharedPtr> applications = accessor.applications();
- std::set<ApplicationSharedPtr>::iterator it = applications.begin();
- for (;applications.end() != it; ++it) {
- ApplicationSharedPtr app = (*it);
+ ApplicationManagerImpl::ApplictionSetIt it = accessor.begin();
+ for (; accessor.end() != it;) {
+ ApplicationSharedPtr app = *it++;
(*message_)[strings::params][strings::connection_key] = app->app_id();
SendNotificationToMobile(message_);
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
index 047a5d985..96089384c 100644
--- 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
@@ -16,7 +16,7 @@ OnTTSResetTimeoutNotification::~OnTTSResetTimeoutNotification() {
}
void OnTTSResetTimeoutNotification::Run() {
- LOG4CXX_INFO(logger_, "OnTTSResetTimeoutNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout);
event.set_smart_object(*message_);
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
index 519fc290d..dc69246d5 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,9 +46,10 @@ OnTTSStartedNotification::~OnTTSStartedNotification() {
}
void OnTTSStartedNotification::Run() {
- LOG4CXX_INFO(logger_, "OnTTSStartedNotification::Run");
-
- ApplicationManagerImpl::instance()->Mute(kTTSSessionChanging);
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::TTS_Started);
+ event.set_smart_object(*message_);
+ event.raise();
}
} // namespace commands
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
index b3e3683f3..8d429ed17 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -47,13 +47,11 @@ OnTTSStoppedNotification::~OnTTSStoppedNotification() {
}
void OnTTSStoppedNotification::Run() {
- LOG4CXX_INFO(logger_, "OnTTSStoppedNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::TTS_Stopped);
event.set_smart_object(*message_);
event.raise();
- ApplicationManagerImpl::instance()->Unmute(kTTSSessionChanging);
-
}
} // namespace commands
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
index 4ed5839e5..d8fe1ebde 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnUICommandNotification::~OnUICommandNotification() {
}
void OnUICommandNotification::Run() {
- LOG4CXX_INFO(logger_, "OnUICommandNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
(*message_)[strings::params][strings::function_id] =
static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID);
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
index 45ff7425b..9dcfe01e6 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -47,7 +47,7 @@ OnUIKeyBoardInputNotification::~OnUIKeyBoardInputNotification() {
}
void OnUIKeyBoardInputNotification::Run() {
- LOG4CXX_INFO(logger_, "OnUIKeyBoardInputNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
//prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 5756f50eb..7e5409999 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -49,7 +49,7 @@ OnUILanguageChangeNotification::~OnUILanguageChangeNotification() {
}
void OnUILanguageChangeNotification::Run() {
- LOG4CXX_INFO(logger_, "OnUILanguageChangeNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
HMICapabilities& hmi_capabilities =
ApplicationManagerImpl::instance()->hmi_capabilities();
@@ -68,11 +68,10 @@ void OnUILanguageChangeNotification::Run() {
static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
ApplicationManagerImpl::ApplicationListAccessor accessor;
- const std::set<ApplicationSharedPtr> applications = accessor.applications();
- std::set<ApplicationSharedPtr>::iterator it = applications.begin();
- for (;applications.end() != it; ++it) {
- ApplicationSharedPtr app = *it;
+ ApplicationManagerImpl::ApplictionSetIt it = accessor.begin();
+ for (; accessor.end() != it;) {
+ ApplicationSharedPtr app = *it++;
(*message_)[strings::params][strings::connection_key] = app->app_id();
SendNotificationToMobile(message_);
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
index 357bfc4cb..96f65839c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -48,7 +48,7 @@ OnUIResetTimeoutNotification::~OnUIResetTimeoutNotification() {
}
void OnUIResetTimeoutNotification::Run() {
- LOG4CXX_INFO(logger_, "OnUIResetTimeoutNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
event.set_smart_object(*message_);
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
index 7868e8119..00e0e4d2c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -47,7 +47,7 @@ OnUITouchEventNotification::~OnUITouchEventNotification() {
}
void OnUITouchEventNotification::Run() {
- LOG4CXX_INFO(logger_, "OnUITouchEventNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
//prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index a5b84748e..8716fb416 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ OnUpdateDeviceList::~OnUpdateDeviceList() {
}
void OnUpdateDeviceList::Run() {
- LOG4CXX_INFO(logger_, "OnUpdateDeviceList::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
}
} // namespace commands
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
index be0c4ebb6..f1e515e2f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIAccPedalPositionNotification::~OnVIAccPedalPositionNotification() {
}
void OnVIAccPedalPositionNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIAccPedalPositionNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 688a5c1fb..0dd5361f7 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIBeltStatusNotification::~OnVIBeltStatusNotification() {
}
void OnVIBeltStatusNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIBeltStatusNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index e80a2edcf..27c902c88 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIBodyInformationNotification::~OnVIBodyInformationNotification() {
}
void OnVIBodyInformationNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIBodyInformationNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 4669398da..07b96f101 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIDeviceStatusNotification::~OnVIDeviceStatusNotification() {
}
void OnVIDeviceStatusNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIDeviceStatusNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 8b61d0af2..57a8f9c6e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIDriverBrakingNotification::~OnVIDriverBrakingNotification() {
}
void OnVIDriverBrakingNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIDriverBrakingNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 1b0989b1e..750988449 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIEngineTorqueNotification::~OnVIEngineTorqueNotification() {
}
void OnVIEngineTorqueNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIEngineTorqueNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index f7a921359..64dd411bd 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIExternalTemperatureNotification::~OnVIExternalTemperatureNotification() {
}
void OnVIExternalTemperatureNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIExternalTemperatureNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 97d797b63..59ecab0ab 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIFuelLevelNotification::~OnVIFuelLevelNotification() {
}
void OnVIFuelLevelNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIFuelLevelNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 0024f17a8..faa8a0522 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIFuelLevelStateNotification::~OnVIFuelLevelStateNotification() {
}
void OnVIFuelLevelStateNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIFuelLevelStateNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 5b7ec7297..df582418c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIGpsDataNotification::~OnVIGpsDataNotification() {
}
void OnVIGpsDataNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIGpsDataNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 355c00f0c..01a0a725e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIHeadLampStatusNotification::~OnVIHeadLampStatusNotification() {
}
void OnVIHeadLampStatusNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIHeadLampStatusNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 17240bce6..b13d50fc1 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIInstantFuelConsumptionNotification::~OnVIInstantFuelConsumptionNotification(
}
void OnVIInstantFuelConsumptionNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIInstantFuelConsumptionNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 1caaecb44..71870522c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIMyKeyNotification::~OnVIMyKeyNotification() {
}
void OnVIMyKeyNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIMyKeyNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 02127a138..5db3ef3bb 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIOdometerNotification::~OnVIOdometerNotification() {
}
void OnVIOdometerNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIOdometerNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 4692191cb..1739f4809 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIPrndlNotification::~OnVIPrndlNotification() {
}
void OnVIPrndlNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIPrndlNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index b16421903..336847ced 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIRpmNotification::~OnVIRpmNotification() {
}
void OnVIRpmNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIRpmNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 6bc1e8b2c..ad38bf50a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVISpeedNotification::~OnVISpeedNotification() {
}
void OnVISpeedNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVISpeedNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 853b4eeea..4fd70bf16 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVISteeringWheelAngleNotification::~OnVISteeringWheelAngleNotification() {
}
void OnVISteeringWheelAngleNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVISteeringWheelAngleNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 01ac7e9f8..fda6e6e28 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVITirePressureNotification::~OnVITirePressureNotification() {
}
void OnVITirePressureNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVITirePressureNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index eda88ef60..15ccf940b 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIVehicleDataNotification::~OnVIVehicleDataNotification() {
}
void OnVIVehicleDataNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIVehicleDataNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 546dc0d3c..aa1683c5f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIVinNotification::~OnVIVinNotification() {
}
void OnVIVinNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIVinNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
index 101427df0..0d27f4238 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ OnVIWiperStatusNotification::~OnVIWiperStatusNotification() {
}
void OnVIWiperStatusNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVIWiperStatusNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// prepare SmartObject for mobile factory
(*message_)[strings::params][strings::function_id] =
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
new file mode 100644
index 000000000..12642a75f
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_video_data_streaming_notification.cc
@@ -0,0 +1,55 @@
+
+/*
+ * 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)
+ : NotificationToHMI(message) {
+}
+
+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
index 99842b852..f8f9b4dfa 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -51,7 +51,7 @@ OnVRCommandNotification::~OnVRCommandNotification() {
}
void OnVRCommandNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVRCommandNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr active_app = ApplicationManagerImpl::instance()
->active_application();
@@ -62,7 +62,10 @@ void OnVRCommandNotification::Run() {
// Check if this is one of standart VR commands (i.e. "Help")
if (cmd_id > max_cmd_id + 1) {
LOG4CXX_INFO(logger_, "Switched App");
- MessageHelper::SendActivateAppToHMI(cmd_id - max_cmd_id);
+ const uint32_t app_id = cmd_id - max_cmd_id;
+ ApplicationManagerImpl::instance()->SetState<true>(app_id,
+ mobile_apis::HMILevel::HMI_FULL
+ );
return;
}
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
index 92e7cb7b2..9a146c19e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -49,7 +49,7 @@ OnVRLanguageChangeNotification::~OnVRLanguageChangeNotification() {
}
void OnVRLanguageChangeNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVRLanguageChangeNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
HMICapabilities& hmi_capabilities =
ApplicationManagerImpl::instance()->hmi_capabilities();
@@ -65,16 +65,17 @@ void OnVRLanguageChangeNotification::Run() {
static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
ApplicationManagerImpl::ApplicationListAccessor accessor;
- const std::set<ApplicationSharedPtr> applications = accessor.applications();
- std::set<ApplicationSharedPtr>::iterator it = applications.begin();
- for (;applications.end() != it; ++it) {
- ApplicationSharedPtr app = (*it);
+ ApplicationManagerImpl::ApplictionSetIt 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()) {
- app->set_hmi_level(mobile_api::HMILevel::HMI_NONE);
+
+ ApplicationManagerImpl::instance()->SetState<false>(app->app_id(),
+ mobile_api::HMILevel::HMI_NONE);
MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
app->app_id(),
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
index 72f6767e8..85994ad80 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,10 +46,11 @@ OnVRStartedNotification::~OnVRStartedNotification() {
}
void OnVRStartedNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVRStartedNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
- ApplicationManagerImpl::instance()->set_vr_session_started(true);
- ApplicationManagerImpl::instance()->Mute(kVRSessionChanging);
+ event_engine::Event event(hmi_apis::FunctionID::VR_Started);
+ event.set_smart_object(*message_);
+ event.raise();
}
} // namespace commands
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
index 46274a3b2..89bdc18eb 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,10 +46,11 @@ OnVRStoppedNotification::~OnVRStoppedNotification() {
}
void OnVRStoppedNotification::Run() {
- LOG4CXX_INFO(logger_, "OnVRStoppedNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
- ApplicationManagerImpl::instance()->set_vr_session_started(false);
- ApplicationManagerImpl::instance()->Unmute(kVRSessionChanging);
+ event_engine::Event event(hmi_apis::FunctionID::VR_Stopped);
+ event.set_smart_object(*message_);
+ event.raise();
}
} // namespace commands
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
index 7b7f74090..5713cf2a1 100644
--- a/src/components/application_manager/src/commands/hmi/request_from_hmi.cc
+++ b/src/components/application_manager/src/commands/hmi/request_from_hmi.cc
@@ -58,6 +58,24 @@ bool RequestFromHMI::CleanUp() {
void RequestFromHMI::Run() {
}
+void RequestFromHMI::on_event(const event_engine::Event& event) {
+}
+
+void RequestFromHMI::SendResponse(uint32_t correlation_id,
+ hmi_apis::FunctionID::eType function_id,
+ hmi_apis::Common_Result::eType result_code) {
+ smart_objects::SmartObject* message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ (*message)[strings::params][strings::function_id] = function_id;
+ (*message)[strings::params][strings::message_type] = MessageType::kResponse;
+ (*message)[strings::params][strings::correlation_id] = correlation_id;
+ (*message)[strings::params][hmi_response::code] = result_code;
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+}
+
+
} // 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
index 242118a41..82b36be0f 100644
--- a/src/components/application_manager/src/commands/hmi/request_to_hmi.cc
+++ b/src/components/application_manager/src/commands/hmi/request_to_hmi.cc
@@ -1,4 +1,4 @@
-/**
+/*
Copyright (c) 2014, Ford Motor Company
All rights reserved.
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
index 42bebb847..9f6ced597 100644
--- a/src/components/application_manager/src/commands/hmi/response_from_hmi.cc
+++ b/src/components/application_manager/src/commands/hmi/response_from_hmi.cc
@@ -72,10 +72,9 @@ void ResponseFromHMI::SendResponseToMobile(const MessageSharedPtr& message) {
void ResponseFromHMI::CreateHMIRequest(
const hmi_apis::FunctionID::eType& function_id,
- const NsSmart::SmartObject& msg_params) const {
+ const smart_objects::SmartObject& msg_params) const {
- NsSmartDeviceLink::NsSmartObjects::SmartObject* result =
- new NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
if (!result) {
LOG4CXX_ERROR(logger_, "Memory allocation failed.");
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
index 72abf233c..af55040ad 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -32,6 +32,7 @@
#include "application_manager/commands/hmi/sdl_activate_app_request.h"
#include "application_manager/policies/policy_handler.h"
+#include "application_manager/message_helper.h"
namespace application_manager {
@@ -45,10 +46,135 @@ SDLActivateAppRequest::~SDLActivateAppRequest() {
}
void SDLActivateAppRequest::Run() {
- LOG4CXX_INFO(logger_, "SDLActivateAppRequest::Run");
- policy::PolicyHandler::instance()->OnActivateApp(
- (*message_)[strings::msg_params][strings::app_id].asUInt(),
- (*message_)[strings::params][strings::correlation_id].asInt());
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis::FunctionID;
+ using namespace hmi_apis::Common_Result;
+
+ const uint32_t application_id = app_id();
+
+ ApplicationConstSharedPtr app =
+ ApplicationManagerImpl::instance()->application(application_id);
+
+ if (!app) {
+ LOG4CXX_WARN(logger_, "Can't find application within regular apps: "
+ << application_id);
+
+ app = ApplicationManagerImpl::instance()->waiting_app(application_id);
+
+ if (!app) {
+ LOG4CXX_WARN(logger_, "Can't find application within waiting apps: "
+ << application_id);
+ return;
+ }
+ }
+
+ if (!app->IsRegistered()) {
+ DevicesApps devices_apps =
+ FindAllAppOnParticularDevice(app->device());
+ if (!devices_apps.first && devices_apps.second.empty()) {
+ LOG4CXX_ERROR(logger_, "Can't find regular foreground app with the same "
+ "connection id:" << app->device());
+ SendResponse(correlation_id(),
+ SDL_ActivateApp, NO_APPS_REGISTERED);
+ return;
+ }
+ if (devices_apps.first) {
+ MessageHelper::SendLaunchApp(devices_apps.first->app_id(),
+ app->SchemaUrl(),
+ app->PackageName());
+ } else {
+ std::vector<ApplicationSharedPtr>::const_iterator it = devices_apps.second.begin();
+ for (; it != devices_apps.second.end(); ++it) {
+ MessageHelper::SendLaunchApp((*it)->app_id(),
+ app->SchemaUrl(),
+ app->PackageName());
+ }
+ }
+ subscribe_on_event(BasicCommunication_OnAppRegistered);
+ } else {
+ policy::PolicyHandler::instance()->OnActivateApp(application_id,
+ correlation_id());
+ }
+}
+
+void SDLActivateAppRequest::onTimeOut() {
+ using namespace hmi_apis::FunctionID;
+ using namespace hmi_apis::Common_Result;
+ using namespace application_manager;
+ unsubscribe_from_event(BasicCommunication_OnAppRegistered);
+ SendResponse(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::ApplicationManagerImpl::instance()->
+ application_by_hmi_app(hmi_application_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application not found by HMI app id: "
+ << hmi_application_id);
+ return;
+ }
+ policy::PolicyHandler::instance()->OnActivateApp(app->app_id(),
+ correlation_id());
+}
+
+uint32_t SDLActivateAppRequest::app_id() const {
+ if ((*message_).keyExists(strings::msg_params)) {
+ if ((*message_)[strings::msg_params].keyExists(strings::app_id)){
+ return (*message_)[strings::msg_params][strings::app_id].asUInt();
+ }
+ }
+ LOG4CXX_DEBUG(logger_, "app_id section is absent in the message.");
+ return 0;
+}
+
+uint32_t SDLActivateAppRequest::hmi_app_id(
+ const smart_objects::SmartObject& so) const {
+ if (so.keyExists(strings::params)) {
+ if (so[strings::msg_params].keyExists(strings::application)){
+ if (so[strings::msg_params][strings::application].
+ keyExists(strings::app_id)) {
+ return so[strings::msg_params][strings::application]
+ [strings::app_id].asUInt();
+ }
+ }
+ }
+ LOG4CXX_DEBUG(logger_, "Can't find app_id section is absent in the message.");
+ return 0;
+}
+
+DevicesApps
+SDLActivateAppRequest::FindAllAppOnParticularDevice(
+ const connection_handler::DeviceHandle handle) {
+ DevicesApps apps;
+
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ ApplicationManagerImpl::ApplictionSet app_list = accessor.GetData();
+
+ ApplicationManagerImpl::ApplictionSetIt it = app_list.begin();
+ ApplicationManagerImpl::ApplictionSetIt it_end = app_list.end();
+
+ for (;it != it_end; ++it) {
+ if (handle == (*it)->device()) {
+ if ((*it)->is_foreground()) {
+ apps.first = *it;
+ }
+ apps.second.push_back(*it);
+ }
+ }
+ return apps;
}
} // namespace commands
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
index 46eb402f4..6c7a0b535 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ SDLActivateAppResponse::~SDLActivateAppResponse() {
}
void SDLActivateAppResponse::Run() {
- LOG4CXX_INFO(logger_, "SDLActivateAppResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
(*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
(*message_)[strings::params][strings::protocol_version] = protocol_version_;
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
index 7eb5a268a..a6649b257 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ SDLGetListOfPermissionsRequest::~SDLGetListOfPermissionsRequest() {
}
void SDLGetListOfPermissionsRequest::Run() {
- LOG4CXX_INFO(logger_, "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();
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
index da474cb12..5d5e75e5c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ SDLGetListOfPermissionsResponse::~SDLGetListOfPermissionsResponse() {
}
void SDLGetListOfPermissionsResponse::Run() {
- LOG4CXX_INFO(logger_, "SDLGetListOfPermissionsResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
(*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
(*message_)[strings::params][strings::protocol_version] = protocol_version_;
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
index cc5fbc63a..dd977d99f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ SDLGetStatusUpdateRequest::~SDLGetStatusUpdateRequest() {
}
void SDLGetStatusUpdateRequest::Run() {
- LOG4CXX_INFO(logger_, "SDLGetStatusUpdateRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
policy::PolicyHandler::instance()->OnGetStatusUpdate(
(*message_)[strings::params][strings::correlation_id].asUInt());
}
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
index 08d8d315a..ab1c57e9a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ SDLGetStatusUpdateResponse::~SDLGetStatusUpdateResponse() {
}
void SDLGetStatusUpdateResponse::Run() {
- LOG4CXX_INFO(logger_, "SDLGetStatusUpdateResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
(*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
(*message_)[strings::params][strings::protocol_version] = protocol_version_;
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
index 047d6bf84..cdd5c16ed 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -48,7 +48,7 @@ SDLGetUserFriendlyMessageRequest::~SDLGetUserFriendlyMessageRequest() {
}
void SDLGetUserFriendlyMessageRequest::Run() {
- LOG4CXX_INFO(logger_, "SDLGetUserFriendlyMessageRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
const std::string messageCodes = "messageCodes";
if (!(*message_)[strings::msg_params].keyExists(messageCodes)) {
LOG4CXX_WARN(logger_,
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
index c849204cc..8cc1b2d62 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ SDLGetUserFriendlyMessageResponse::~SDLGetUserFriendlyMessageResponse() {
}
void SDLGetUserFriendlyMessageResponse::Run() {
- LOG4CXX_INFO(logger_, "SDLGetUserFriendlyMessageResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
(*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
(*message_)[strings::params][strings::protocol_version] = protocol_version_;
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
index 4779e106c..b9c5aaa08 100644
--- a/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc
+++ b/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ SDLPolicyUpdate::~SDLPolicyUpdate() {
}
void SDLPolicyUpdate::Run() {
- LOG4CXX_INFO(logger_, "SDLPolicyUpdate::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index a3db3a904..bc7c6e0d7 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -43,7 +43,7 @@ SDLPolicyUpdateResponse::~SDLPolicyUpdateResponse() {
}
void SDLPolicyUpdateResponse::Run() {
- LOG4CXX_INFO(logger_, "SDLPolicyUpdateResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// TODO(PV): add some logic here
}
} // namespace commands
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
index 638503d16..dd127ec43 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ TTSChangeRegistrationRequest::~TTSChangeRegistrationRequest() {
}
void TTSChangeRegistrationRequest::Run() {
- LOG4CXX_INFO(logger_, "TTSChangeRegistrationRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 67e48b4ed..03b51e5db 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ TTSChangeRegistratioResponse::~TTSChangeRegistratioResponse() {
}
void TTSChangeRegistratioResponse::Run() {
- LOG4CXX_INFO(logger_, "TTSChangeRegistratioResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::TTS_ChangeRegistration);
event.set_smart_object(*message_);
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
index 59cf50b38..fb3dedc1c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ TTSGetCapabilitiesRequest::~TTSGetCapabilitiesRequest() {
}
void TTSGetCapabilitiesRequest::Run() {
- LOG4CXX_INFO(logger_, "TTSGetCapabilitiesRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index f7309822d..53a1bd391 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ TTSGetCapabilitiesResponse::~TTSGetCapabilitiesResponse() {
}
void TTSGetCapabilitiesResponse::Run() {
- LOG4CXX_INFO(logger_, "TTSGetCapabilitiesResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
HMICapabilities& hmi_capabilities =
ApplicationManagerImpl::instance()->hmi_capabilities();
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
index 9f2fe7134..6d4e4f465 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ TTSGetLanguageRequest::~TTSGetLanguageRequest() {
}
void TTSGetLanguageRequest::Run() {
- LOG4CXX_INFO(logger_, "TTSGetLanguageRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index e26fa8773..6c2122557 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ TTSGetLanguageResponse::~TTSGetLanguageResponse() {
}
void TTSGetLanguageResponse::Run() {
- LOG4CXX_INFO(logger_, "TTSGetLanguageResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
HMICapabilities& hmi_capabilities =
ApplicationManagerImpl::instance()->hmi_capabilities();
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
index 08c1d8244..5251832bc 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ TTSGetSupportedLanguagesRequest::~TTSGetSupportedLanguagesRequest() {
}
void TTSGetSupportedLanguagesRequest::Run() {
- LOG4CXX_INFO(logger_, "TTSGetSupportedLanguagesRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index aa041f66b..a5d022a6c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ TTSGetSupportedLanguagesResponse::~TTSGetSupportedLanguagesResponse() {
}
void TTSGetSupportedLanguagesResponse::Run() {
- LOG4CXX_INFO(logger_, "TTSGetSupportedLanguagesResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
const hmi_apis::Common_Result::eType code =
static_cast<hmi_apis::Common_Result::eType>(
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
index 7733de488..3a50cfef9 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ TTSIsReadyRequest::~TTSIsReadyRequest() {
}
void TTSIsReadyRequest::Run() {
- LOG4CXX_INFO(logger_, "TTSIsReadyRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index fb3cb4858..dd8eab753 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ TTSIsReadyResponse::~TTSIsReadyResponse() {
}
void TTSIsReadyResponse::Run() {
- LOG4CXX_INFO(logger_, "TTSIsReadyResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject& object = *message_;
bool is_available = false;
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
index 04f1380d9..ce330c355 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ TTSSetGlobalPropertiesRequest::~TTSSetGlobalPropertiesRequest() {
}
void TTSSetGlobalPropertiesRequest::Run() {
- LOG4CXX_INFO(logger_, "TTSSetGlobalPropertiesRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index c90655186..70dc46d6a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ TTSSetGlobalPropertiesResponse::~TTSSetGlobalPropertiesResponse() {
}
void TTSSetGlobalPropertiesResponse::Run() {
- LOG4CXX_INFO(logger_, "TTSSetGlobalPropertiesResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
event.set_smart_object(*message_);
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
index 9b4bd6858..79fbde2c4 100644
--- a/src/components/application_manager/src/commands/hmi/tts_speak_request.cc
+++ b/src/components/application_manager/src/commands/hmi/tts_speak_request.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ TTSSpeakRequest::~TTSSpeakRequest() {
}
void TTSSpeakRequest::Run() {
- LOG4CXX_INFO(logger_, "TTSSpeakRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 9b9e43dbe..ff60115e7 100644
--- a/src/components/application_manager/src/commands/hmi/tts_speak_response.cc
+++ b/src/components/application_manager/src/commands/hmi/tts_speak_response.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ TTSSpeakResponse::~TTSSpeakResponse() {
}
void TTSSpeakResponse::Run() {
- LOG4CXX_INFO(logger_, "TTSSpeakResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
event.set_smart_object(*message_);
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
index 107cb7933..32aaec27e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ TTSStopSpeakingRequest::~TTSStopSpeakingRequest() {
}
void TTSStopSpeakingRequest::Run() {
- LOG4CXX_INFO(logger_, "TTSStopSpeakingRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 9bd4f8966..b32cf52bb 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ TTSStopSpeakingResponse::~TTSStopSpeakingResponse() {
}
void TTSStopSpeakingResponse::Run() {
- LOG4CXX_INFO(logger_, "TTSStopSpeakingResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::TTS_StopSpeaking);
event.set_smart_object(*message_);
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
index 9aa5d2e2d..ed9f7979a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UIAddCommandRequest::~UIAddCommandRequest() {
}
void UIAddCommandRequest::Run() {
- LOG4CXX_INFO(logger_, "UIAddCommandRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 21b34e063..13b2ab1b2 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ UIAddCommandResponse::~UIAddCommandResponse() {
}
void UIAddCommandResponse::Run() {
- LOG4CXX_INFO(logger_, "UIAddCommandResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_AddCommand);
event.set_smart_object(*message_);
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
index 7a9c5c6fe..667499584 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index af88de2b4..54247dbbc 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ UIAddSubmenuResponse::~UIAddSubmenuResponse() {
}
void UIAddSubmenuResponse::Run() {
- LOG4CXX_INFO(logger_, "UIAddSubmenuResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_AddSubMenu);
event.set_smart_object(*message_);
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
index f8c9ed570..c706d5fdb 100644
--- a/src/components/application_manager/src/commands/hmi/ui_alert_request.cc
+++ b/src/components/application_manager/src/commands/hmi/ui_alert_request.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UIAlertRequest::~UIAlertRequest() {
}
void UIAlertRequest::Run() {
- LOG4CXX_INFO(logger_, "UIAlertRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 289b90d29..8c9ddef7a 100644
--- a/src/components/application_manager/src/commands/hmi/ui_alert_response.cc
+++ b/src/components/application_manager/src/commands/hmi/ui_alert_response.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ UIAlertResponse::~UIAlertResponse() {
}
void UIAlertResponse::Run() {
- LOG4CXX_INFO(logger_, "UIAlertResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_Alert);
event.set_smart_object(*message_);
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
index fbba2b402..67c9be6cb 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ UIChangeRegistrationRequest::~UIChangeRegistrationRequest() {
}
void UIChangeRegistrationRequest::Run() {
- LOG4CXX_INFO(logger_, "UIChangeRegistrationRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 16447077d..1d59d66d7 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ UIChangeRegistratioResponse::~UIChangeRegistratioResponse() {
}
void UIChangeRegistratioResponse::Run() {
- LOG4CXX_INFO(logger_, "UIChangeRegistratioResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_ChangeRegistration);
event.set_smart_object(*message_);
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
index 23fb4c67f..7d5532f30 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UIDeleteCommandRequest::~UIDeleteCommandRequest() {
}
void UIDeleteCommandRequest::Run() {
- LOG4CXX_INFO(logger_, "UIDeleteCommandRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 0ac32877c..2fb94a63a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ UIDeleteCommandResponse::~UIDeleteCommandResponse() {
}
void UIDeleteCommandResponse::Run() {
- LOG4CXX_INFO(logger_, "UIDeleteCommandResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_DeleteCommand);
event.set_smart_object(*message_);
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
index 41f356b98..e94513963 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UIDeleteSubmenuRequest::~UIDeleteSubmenuRequest() {
}
void UIDeleteSubmenuRequest::Run() {
- LOG4CXX_INFO(logger_, "UIDeleteSubmenuRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 5a3359b72..89a5a19a0 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ UIDeleteSubmenuResponse::~UIDeleteSubmenuResponse() {
}
void UIDeleteSubmenuResponse::Run() {
- LOG4CXX_INFO(logger_, "UIDeleteSubmenuResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
event.set_smart_object(*message_);
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
index 4c93f9235..b87e1d89b 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ UIEndAudioPassThruRequest::~UIEndAudioPassThruRequest() {
}
void UIEndAudioPassThruRequest::Run() {
- LOG4CXX_INFO(logger_, "UIEndAudioPassThruRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index e560ae293..8f5d92b78 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ UIEndAudioPassThruResponse::~UIEndAudioPassThruResponse() {
}
void UIEndAudioPassThruResponse::Run() {
- LOG4CXX_INFO(logger_, "UIEndAudioPassThruResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_EndAudioPassThru);
event.set_smart_object(*message_);
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
index b9f1b6917..74ee67e88 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ UIGetCapabilitiesRequest::~UIGetCapabilitiesRequest() {
}
void UIGetCapabilitiesRequest::Run() {
- LOG4CXX_INFO(logger_, "UIGetCapabilitiesRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 0663bf033..b62f24cc5 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,29 +45,45 @@ UIGetCapabilitiesResponse::~UIGetCapabilitiesResponse() {
}
void UIGetCapabilitiesResponse::Run() {
- LOG4CXX_INFO(logger_, "UIGetCapabilitiesResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
HMICapabilities& hmi_capabilities =
ApplicationManagerImpl::instance()->hmi_capabilities();
- hmi_capabilities.set_display_capabilities(
- (*message_)[strings::msg_params][hmi_response::display_capabilities]);
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
- hmi_capabilities.set_hmi_zone_capabilities(
- (*message_)[strings::msg_params][hmi_response::hmi_zone_capabilities]);
+ if (msg_params.keyExists(hmi_response::display_capabilities)) {
+ hmi_capabilities.set_display_capabilities(
+ msg_params[hmi_response::display_capabilities]);
+ }
- if ((*message_)[strings::msg_params].keyExists(
- hmi_response::soft_button_capabilities)) {
- hmi_capabilities.set_soft_button_capabilities(
- (*message_)[strings::msg_params][hmi_response::soft_button_capabilities]);
+ if (msg_params.keyExists(hmi_response::hmi_zone_capabilities)) {
+ hmi_capabilities.set_hmi_zone_capabilities(
+ msg_params[hmi_response::hmi_zone_capabilities]);
}
- if ((*message_)[strings::msg_params].keyExists(
- strings::audio_pass_thru_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(
- (*message_)[strings::msg_params][strings::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());
+ }
+ }
+
}
} // namespace commands
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
index ffca242d4..1b22a9b58 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UIGetLanguageRequest::~UIGetLanguageRequest() {
}
void UIGetLanguageRequest::Run() {
- LOG4CXX_INFO(logger_, "UIGetLanguageRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 20435d788..cba85d91e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ UIGetLanguageResponse::~UIGetLanguageResponse() {
}
void UIGetLanguageResponse::Run() {
- LOG4CXX_INFO(logger_, "UIGetLanguageResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
HMICapabilities& hmi_capabilities =
ApplicationManagerImpl::instance()->hmi_capabilities();
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
index 455486ef6..5cd0c09e6 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ UIGetSupportedLanguagesRequest::~UIGetSupportedLanguagesRequest() {
}
void UIGetSupportedLanguagesRequest::Run() {
- LOG4CXX_INFO(logger_, "UIGetSupportedLanguagesRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 8492cfca5..2057f3cbb 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ UIGetSupportedLanguagesResponse::~UIGetSupportedLanguagesResponse() {
}
void UIGetSupportedLanguagesResponse::Run() {
- LOG4CXX_INFO(logger_, "UIGetSupportedLanguagesResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
const hmi_apis::Common_Result::eType code =
static_cast<hmi_apis::Common_Result::eType>(
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
index 50d0ddd95..94df3cec7 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UIIsReadyRequest::~UIIsReadyRequest() {
}
void UIIsReadyRequest::Run() {
- LOG4CXX_INFO(logger_, "UIIsReadyRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 97d11b602..9edf77080 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UIIsReadyResponse::~UIIsReadyResponse() {
}
void UIIsReadyResponse::Run() {
- LOG4CXX_INFO(logger_, "UIIsReadyResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject& object = *message_;
bool is_available = false;
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
index cf77703a9..3cf7722b2 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ UIPerformAudioPassThruRequest::~UIPerformAudioPassThruRequest() {
}
void UIPerformAudioPassThruRequest::Run() {
- LOG4CXX_INFO(logger_, "UIPerformAudioPassThruRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 36d4c507b..c8a488e44 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ UIPerformAudioPassThruResponse::~UIPerformAudioPassThruResponse() {
}
void UIPerformAudioPassThruResponse::Run() {
- LOG4CXX_INFO(logger_, "UIPerformAudioPassThruResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
event.set_smart_object(*message_);
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
index 09f98ec03..2b1f5ce48 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ UIPerformInteractionRequest::~UIPerformInteractionRequest() {
}
void UIPerformInteractionRequest::Run() {
- LOG4CXX_INFO(logger_, "UIPerformInteractionRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 2f5f6ead5..25237525d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ UIPerformInteractionResponse::~UIPerformInteractionResponse() {
}
void UIPerformInteractionResponse::Run() {
- LOG4CXX_INFO(logger_, "UIPerformInteractionResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_PerformInteraction);
event.set_smart_object(*message_);
event.raise();
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
index ac34dd236..911c840ce 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ UIScrollableMessageRequest::~UIScrollableMessageRequest() {
}
void UIScrollableMessageRequest::Run() {
- LOG4CXX_INFO(logger_, "UIScrollableMessageRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 182d512c8..58c793c3b 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ UIScrollableMessageResponse::~UIScrollableMessageResponse() {
}
void UIScrollableMessageResponse::Run() {
- LOG4CXX_INFO(logger_, "UIScrollableMessageResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
event.set_smart_object(*message_);
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
new file mode 100644
index 000000000..c4a3b3b3a
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_set_app_icon_request.cc
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * 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)
+ : RequestToHMI(message) {
+}
+
+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
new file mode 100644
index 000000000..46c10e8f2
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_set_app_icon_response.cc
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * 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)
+ : ResponseFromHMI(message) {
+}
+
+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();
+}
+
+} // 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
index 3dea85348..df9f6cf2a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UiSetDisplayLayoutRequest::~UiSetDisplayLayoutRequest() {
}
void UiSetDisplayLayoutRequest::Run() {
- LOG4CXX_INFO(logger_, "UiSetDisplayLayoutRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index f381a4db2..f23cc9264 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ UiSetDisplayLayoutResponse::~UiSetDisplayLayoutResponse() {
}
void UiSetDisplayLayoutResponse::Run() {
- LOG4CXX_INFO(logger_, "UiSetDisplayLayoutResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
event.set_smart_object(*message_);
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
index e538866c1..39a0e865d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ UISetGlobalPropertiesRequest::~UISetGlobalPropertiesRequest() {
}
void UISetGlobalPropertiesRequest::Run() {
- LOG4CXX_INFO(logger_, "UISetGlobalPropertiesRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 67023533c..23173961f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ UISetGlobalPropertiesResponse::~UISetGlobalPropertiesResponse() {
}
void UISetGlobalPropertiesResponse::Run() {
- LOG4CXX_INFO(logger_, "UISetGlobalPropertiesResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
event.set_smart_object(*message_);
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
index 1eb218013..272ff561a 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ UISetMediaClockTimerRequest::~UISetMediaClockTimerRequest() {
}
void UISetMediaClockTimerRequest::Run() {
- LOG4CXX_INFO(logger_, "UISetMediaClockTimerRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index ee67862a1..ae878bd69 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ UISetMediaClockTimerResponse::~UISetMediaClockTimerResponse() {
}
void UISetMediaClockTimerResponse::Run() {
- LOG4CXX_INFO(logger_, "UISetMediaClockTimerResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
event.set_smart_object(*message_);
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
index 841c8a62f..65b989490 100644
--- a/src/components/application_manager/src/commands/hmi/ui_show_request.cc
+++ b/src/components/application_manager/src/commands/hmi/ui_show_request.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UIShowRequest::~UIShowRequest() {
}
void UIShowRequest::Run() {
- LOG4CXX_INFO(logger_, "UIShowRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index c95cbbd2b..8d348e608 100644
--- a/src/components/application_manager/src/commands/hmi/ui_show_response.cc
+++ b/src/components/application_manager/src/commands/hmi/ui_show_response.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UIShowResponse::~UIShowResponse() {
}
void UIShowResponse::Run() {
- LOG4CXX_INFO(logger_, "UIShowResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_Show);
event.set_smart_object(*message_);
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
index fc7203c0e..c8d3242d9 100644
--- a/src/components/application_manager/src/commands/hmi/ui_slider_request.cc
+++ b/src/components/application_manager/src/commands/hmi/ui_slider_request.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UISliderRequest::~UISliderRequest() {
}
void UISliderRequest::Run() {
- LOG4CXX_INFO(logger_, "UISliderRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 8d2522e22..7837117eb 100644
--- a/src/components/application_manager/src/commands/hmi/ui_slider_response.cc
+++ b/src/components/application_manager/src/commands/hmi/ui_slider_response.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ UISliderResponse::~UISliderResponse() {
}
void UISliderResponse::Run() {
- LOG4CXX_INFO(logger_, "UISliderResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::UI_Slider);
event.set_smart_object(*message_);
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
index 955f4b19c..72f65d1a2 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UpdateAppListRequest::~UpdateAppListRequest() {
}
void UpdateAppListRequest::Run() {
- LOG4CXX_INFO(logger_, "UpdateAppListRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index d5db0b4ea..308bce3ad 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UpdateAppListResponse::~UpdateAppListResponse() {
}
void UpdateAppListResponse::Run() {
- LOG4CXX_INFO(logger_, "UpdateAppListResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// TODO(PV): add check
}
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
index 1f632378b..696e2f85c 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -50,17 +50,17 @@ UpdateDeviceListRequest::~UpdateDeviceListRequest() {
}
void UpdateDeviceListRequest::Run() {
- LOG4CXX_INFO(logger_, "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 "CUSTOMER_PASA" is used in order to exclude
+ // Flag conditional compilation for specific customer is used in order to exclude
// hit code to RTC
if (true == profile::Profile::instance()->launch_hmi()) {
if (!ApplicationManagerImpl::instance()->IsHMICooperating()) {
- LOG4CXX_INFO(logger_, "MY Wait for HMI Cooperation");
+ LOG4CXX_INFO(logger_, "Wait for HMI Cooperation");
subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_OnReady);
termination_condition_.Wait(auto_lock);
- LOG4CXX_INFO(logger_, "MY HMI Cooperation OK");
+ LOG4CXX_DEBUG(logger_, "HMI Cooperation OK");
}
}
@@ -68,7 +68,7 @@ void UpdateDeviceListRequest::Run() {
}
void UpdateDeviceListRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "UpdateDeviceListRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock auto_lock(wait_hmi_lock);
switch (event.id()) {
case hmi_apis::FunctionID::BasicCommunication_OnReady : {
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
index 85ef57404..b3e0f9a30 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UpdateDeviceListResponse::~UpdateDeviceListResponse() {
}
void UpdateDeviceListResponse::Run() {
- LOG4CXX_INFO(logger_, "UpdateDeviceListResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// TODO(PV): add check for correctness.
}
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
index 7d47f84ce..b03e595e9 100644
--- a/src/components/application_manager/src/commands/hmi/update_sdl_request.cc
+++ b/src/components/application_manager/src/commands/hmi/update_sdl_request.cc
@@ -46,7 +46,7 @@ UpdateSDLRequest::~UpdateSDLRequest() {
}
void UpdateSDLRequest::Run() {
- LOG4CXX_INFO(logger_, "UpdateSDLRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
policy::PolicyHandler::instance()->PTExchangeAtUserRequest(
(*message_)[strings::params][strings::correlation_id].asInt());
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
index d2be2c655..d9c8b6102 100644
--- a/src/components/application_manager/src/commands/hmi/update_sdl_response.cc
+++ b/src/components/application_manager/src/commands/hmi/update_sdl_response.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ UpdateSDLResponse::~UpdateSDLResponse() {
}
void UpdateSDLResponse::Run() {
- LOG4CXX_INFO(logger_, "UpdateSDLResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
(*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
(*message_)[strings::params][strings::protocol_version] = protocol_version_;
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
index 45d44e447..eb9a9841b 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ VIDiagnosticMessageRequest::~VIDiagnosticMessageRequest() {
}
void VIDiagnosticMessageRequest::Run() {
- LOG4CXX_INFO(logger_, "VIDiagnosticMessageRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index d83869b27..4183395e9 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VIDiagnosticMessageResponse::~VIDiagnosticMessageResponse() {
}
void VIDiagnosticMessageResponse::Run() {
- LOG4CXX_INFO(logger_, "VIDiagnosticMessageResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage);
event.set_smart_object(*message_);
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
index 5289816fb..a89252ada 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ VIGetDTCsRequest::~VIGetDTCsRequest() {
}
void VIGetDTCsRequest::Run() {
- LOG4CXX_INFO(logger_, "VIGetDTCsRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 0cacc51d6..c44f5213d 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VIGetDTCsResponse::~VIGetDTCsResponse() {
}
void VIGetDTCsResponse::Run() {
- LOG4CXX_INFO(logger_, "VIGetDTCsResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetDTCs);
event.set_smart_object(*message_);
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
index 40b2ca9fe..37d5ede4b 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VIGetVehicleDataRequest::~VIGetVehicleDataRequest() {
}
void VIGetVehicleDataRequest::Run() {
- LOG4CXX_INFO(logger_, "VIGetVehicleDataRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 73444a19b..0ed0f7f51 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -35,7 +35,6 @@
#include "interfaces/HMI_API.h"
namespace application_manager {
-
namespace commands {
VIGetVehicleDataResponse::VIGetVehicleDataResponse(
@@ -47,22 +46,14 @@ VIGetVehicleDataResponse::~VIGetVehicleDataResponse() {
}
void VIGetVehicleDataResponse::Run() {
- LOG4CXX_INFO(logger_, "VIGetVehicleDataResponse::Run");
- smart_objects::SmartObject* result_so = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
- if (!result_so) {
- // TODO(PV): add response with out of memory.
- LOG4CXX_ERROR(logger_,
- "Failed to create new Smart Object on get vehicle response.");
- return;
- }
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
- smart_objects::SmartObject& result = *result_so;
-
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] =
@@ -79,17 +70,14 @@ void VIGetVehicleDataResponse::Run() {
(*message_)[strings::params][strings::protocol_version];
}
-
- event.set_smart_object(*result_so);
+ event.set_smart_object(result);
} else {
event.set_smart_object(*message_);
policy::PolicyHandler::instance()->OnVehicleDataUpdated(*message_);
}
-
event.raise();
}
} // 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
index 4c46de950..11dd26dfa 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VIGetVehicleTypeRequest::~VIGetVehicleTypeRequest() {
}
void VIGetVehicleTypeRequest::Run() {
- LOG4CXX_INFO(logger_, "VIGetVehicleTypeRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 18c0136d1..2b5f6b96b 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VIGetVehicleTypeResponse::~VIGetVehicleTypeResponse() {
}
void VIGetVehicleTypeResponse::Run() {
- LOG4CXX_INFO(logger_, "VIGetVehicleTypeResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
HMICapabilities& hmi_capabilities =
ApplicationManagerImpl::instance()->hmi_capabilities();
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
index 074d6f602..aae05e0fc 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ VIIsReadyRequest::~VIIsReadyRequest() {
}
void VIIsReadyRequest::Run() {
- LOG4CXX_INFO(logger_, "VIIsReadyRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index e7c9c180c..4a79a6d9b 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VIIsReadyResponse::~VIIsReadyResponse() {
}
void VIIsReadyResponse::Run() {
- LOG4CXX_INFO(logger_, "VIIsReadyResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject& object = *message_;
bool is_available = false;
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
index 1485b471c..92a105dde 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ VIReadDIDRequest::~VIReadDIDRequest() {
}
void VIReadDIDRequest::Run() {
- LOG4CXX_INFO(logger_, "VIReadDIDRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index ddd9f3c54..675b94427 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ VIReadDIDResponse::~VIReadDIDResponse() {
}
void VIReadDIDResponse::Run() {
- LOG4CXX_INFO(logger_, "VIReadDIDResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_ReadDID);
event.set_smart_object(*message_);
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
index 38950a2a2..5ad4daea9 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VISubscribeVehicleDataRequest::~VISubscribeVehicleDataRequest() {
}
void VISubscribeVehicleDataRequest::Run() {
- LOG4CXX_INFO(logger_, "VISubscribeVehicleDataRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index bd67294fb..91d9c8538 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VISubscribeVehicleDataResponse::~VISubscribeVehicleDataResponse() {
}
void VISubscribeVehicleDataResponse::Run() {
- LOG4CXX_INFO(logger_, "VISubscribeVehicleDataResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(
hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData
);
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
index 0af87c2a2..7c12cbe6f 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VIUnsubscribeVehicleDataRequest::~VIUnsubscribeVehicleDataRequest() {
}
void VIUnsubscribeVehicleDataRequest::Run() {
- LOG4CXX_INFO(logger_, "VIUnsubscribeVehicleDataRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 22231b4a6..124b7dacb 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VIUnsubscribeVehicleDataResponse::~VIUnsubscribeVehicleDataResponse() {
}
void VIUnsubscribeVehicleDataResponse::Run() {
- LOG4CXX_INFO(logger_, "VIUnsubscribeVehicleDataResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(
hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData
);
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
index a74ece95d..c900df167 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ VRAddCommandRequest::~VRAddCommandRequest() {
}
void VRAddCommandRequest::Run() {
- LOG4CXX_INFO(logger_, "VRAddCommandRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 513ccdace..3d34b5c65 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VRAddCommandResponse::~VRAddCommandResponse() {
}
void VRAddCommandResponse::Run() {
- LOG4CXX_INFO(logger_, "VRAddCommandResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::VR_AddCommand);
event.set_smart_object(*message_);
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
index bd7c1e784..fe8ee6902 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VRChangeRegistrationRequest::~VRChangeRegistrationRequest() {
}
void VRChangeRegistrationRequest::Run() {
- LOG4CXX_INFO(logger_, "VRChangeRegistrationRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 92a36d23f..5bd2fb853 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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
index 0241be630..e3052ae20 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ VRDeleteCommandRequest::~VRDeleteCommandRequest() {
}
void VRDeleteCommandRequest::Run() {
- LOG4CXX_INFO(logger_, "VRDeleteCommandRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index c5a13126b..8954b1d1b 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,7 @@ VRDeleteCommandResponse::~VRDeleteCommandResponse() {
}
void VRDeleteCommandResponse::Run() {
- LOG4CXX_INFO(logger_, "VRDeleteCommandResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::VR_DeleteCommand);
event.set_smart_object(*message_);
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
index 8b1d4ae0b..58d0a4b3e 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VRGetCapabilitiesRequest::~VRGetCapabilitiesRequest() {
}
void VRGetCapabilitiesRequest::Run() {
- LOG4CXX_INFO(logger_, "VRGetCapabilitiesRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index de6fdd7a9..5ca1d8619 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VRGetCapabilitiesResponse::~VRGetCapabilitiesResponse() {
}
void VRGetCapabilitiesResponse::Run() {
- LOG4CXX_INFO(logger_, "VRGetCapabilitiesResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
HMICapabilities& hmi_capabilities =
ApplicationManagerImpl::instance()->hmi_capabilities();
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
index 9f4aeb979..0b9897941 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ VRGetLanguageRequest::~VRGetLanguageRequest() {
}
void VRGetLanguageRequest::Run() {
- LOG4CXX_INFO(logger_, "VRGetLanguageRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index acbd24fbb..62127bdf9 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VRGetLanguageResponse::~VRGetLanguageResponse() {
}
void VRGetLanguageResponse::Run() {
- LOG4CXX_INFO(logger_, "VRGetLanguageResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
HMICapabilities& hmi_capabilities =
ApplicationManagerImpl::instance()->hmi_capabilities();
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
index e43d88430..aea97da02 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VRGetSupportedLanguagesRequest::~VRGetSupportedLanguagesRequest() {
}
void VRGetSupportedLanguagesRequest::Run() {
- LOG4CXX_INFO(logger_, "VRGetSupportedLanguagesRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index d2cc148a0..b1ea89a46 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -47,7 +47,7 @@ VRGetSupportedLanguagesResponse::~VRGetSupportedLanguagesResponse() {
}
void VRGetSupportedLanguagesResponse::Run() {
- LOG4CXX_INFO(logger_, "VRGetSupportedLanguagesResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
const hmi_apis::Common_Result::eType code =
static_cast<hmi_apis::Common_Result::eType>(
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
index 944cfcbb3..a5a3a2b62 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ VRIsReadyRequest::~VRIsReadyRequest() {
}
void VRIsReadyRequest::Run() {
- LOG4CXX_INFO(logger_, "VRIsReadyRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index 8cf5e66ee..a0de7ae33 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -44,7 +44,7 @@ VRIsReadyResponse::~VRIsReadyResponse() {
}
void VRIsReadyResponse::Run() {
- LOG4CXX_INFO(logger_, "VRIsReadyResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject& object = *message_;
bool is_available = false;
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
index 6de32dc5b..1791bab57 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VRPerformInteractionRequest::~VRPerformInteractionRequest() {
}
void VRPerformInteractionRequest::Run() {
- LOG4CXX_INFO(logger_, "VRPerformInteractionRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
}
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
index fea09b9f2..8fc22ce87 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -45,7 +45,7 @@ VRPerformInteractionResponse::~VRPerformInteractionResponse() {
}
void VRPerformInteractionResponse::Run() {
- LOG4CXX_INFO(logger_, "VRPerformInteractionResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
event_engine::Event event(hmi_apis::FunctionID::VR_PerformInteraction);
event.set_smart_object(*message_);
event.raise();
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
index 35cc61989..da44d0e7c 100644
--- a/src/components/application_manager/src/commands/mobile/add_command_request.cc
+++ b/src/components/application_manager/src/commands/mobile/add_command_request.cc
@@ -56,13 +56,13 @@ AddCommandRequest::~AddCommandRequest() {
}
void AddCommandRequest::onTimeOut() {
- LOG4CXX_INFO(logger_, "AddCommandRequest::onTimeOut");
+ LOG4CXX_AUTO_TRACE(logger_);
RemoveCommand();
CommandRequestImpl::onTimeOut();
}
void AddCommandRequest::Run() {
- LOG4CXX_INFO(logger_, "AddCommandRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
(*message_)[strings::params][strings::connection_key].asUInt());
@@ -198,7 +198,8 @@ bool AddCommandRequest::CheckCommandName(ApplicationConstSharedPtr app) {
return false;
}
- const CommandsMap& commands = app->commands_map();
+ 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;
@@ -235,7 +236,8 @@ bool AddCommandRequest::CheckCommandVRSynonym(ApplicationConstSharedPtr app) {
return false;
}
- const CommandsMap& commands = app->commands_map();
+ const DataAccessor<CommandsMap> accessor = app->commands_map();
+ const CommandsMap& commands = accessor.GetData();
CommandsMap::const_iterator it = commands.begin();
for (; commands.end() != it; ++it) {
@@ -284,10 +286,22 @@ bool AddCommandRequest::CheckCommandParentId(ApplicationConstSharedPtr app) {
}
void AddCommandRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "AddCommandRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->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");
@@ -296,8 +310,8 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
message[strings::params][hmi_response::code].asInt());
if (hmi_apis::Common_Result::SUCCESS != ui_result_) {
- (*message_)[strings::msg_params].erase(strings::menu_params);
- }
+ (*message_)[strings::msg_params].erase(strings::menu_params);
+ }
break;
}
case hmi_apis::FunctionID::VR_AddCommand: {
@@ -318,18 +332,18 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
}
if (!IsPendingResponseExist()) {
+
ApplicationSharedPtr application =
ApplicationManagerImpl::instance()->application(connection_key());
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
if (hmi_apis::Common_Result::REJECTED == ui_result_) {
RemoveCommand();
}
+ 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;
bool result = ((hmi_apis::Common_Result::SUCCESS == ui_result_) &&
@@ -348,6 +362,39 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
std::max(ui_result_, vr_result_));
}
+ if (BothSend() && hmi_apis::Common_Result::SUCCESS == vr_result_) {
+ if (hmi_apis::Common_Result::SUCCESS != ui_result_ &&
+ hmi_apis::Common_Result::WARNINGS != ui_result_ &&
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != ui_result_) {
+
+ 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;
+ }
+ }
+
+ if(BothSend() && hmi_apis::Common_Result::SUCCESS == ui_result_ &&
+ hmi_apis::Common_Result::SUCCESS != 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;
+ }
+
SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
if (true == result) {
application->UpdateHash();
@@ -360,7 +407,7 @@ bool AddCommandRequest::IsPendingResponseExist() {
}
bool AddCommandRequest::IsWhiteSpaceExist() {
- LOG4CXX_INFO(logger_, "AddCommandRequest::IsWhiteSpaceExist");
+ LOG4CXX_AUTO_TRACE(logger_);
const char* str = NULL;
if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
@@ -397,16 +444,42 @@ bool AddCommandRequest::IsWhiteSpaceExist() {
return false;
}
+bool AddCommandRequest::BothSend() const {
+ return send_vr_ && send_ui_;
+}
+
void AddCommandRequest::RemoveCommand() {
- LOG4CXX_INFO(logger_, "AddCommandRequest::RemoveCommand");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->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
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
index 0c135af07..51684c065 100644
--- a/src/components/application_manager/src/commands/mobile/add_command_response.cc
+++ b/src/components/application_manager/src/commands/mobile/add_command_response.cc
@@ -46,7 +46,7 @@ AddCommandResponse::~AddCommandResponse() {
}
void AddCommandResponse::Run() {
- LOG4CXX_INFO(logger_, "AddCommandResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index ce6fa3fc5..f01645079 100644
--- 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
@@ -47,7 +47,7 @@ AddSubMenuRequest::~AddSubMenuRequest() {
}
void AddSubMenuRequest::Run() {
- LOG4CXX_INFO(logger_, "AddSubMenuRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
(*message_)[strings::params][strings::connection_key].asUInt());
@@ -95,7 +95,7 @@ void AddSubMenuRequest::Run() {
}
void AddSubMenuRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "AddSubMenuRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
@@ -120,7 +120,9 @@ void AddSubMenuRequest::on_event(const event_engine::Event& event) {
(*message_)[strings::msg_params]);
}
SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
- application->UpdateHash();
+ if (result) {
+ application->UpdateHash();
+ }
break;
}
default: {
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
index bcd7df288..ff37a6a99 100644
--- 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
@@ -47,7 +47,7 @@ AddSubMenuResponse::~AddSubMenuResponse() {
}
void AddSubMenuResponse::Run() {
- LOG4CXX_INFO(logger_, "AddSubMenuResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index abb5bc7f3..f1575a1a4 100644
--- a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc
+++ b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc
@@ -52,7 +52,7 @@ AlertManeuverRequest::~AlertManeuverRequest() {
}
void AlertManeuverRequest::Run() {
- LOG4CXX_INFO(logger_, "AlertManeuverRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
if ((!(*message_)[strings::msg_params].keyExists(strings::soft_buttons)) &&
(!(*message_)[strings::msg_params].keyExists(strings::tts_chunks))) {
@@ -103,6 +103,8 @@ void AlertManeuverRequest::Run() {
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];
@@ -120,14 +122,15 @@ void AlertManeuverRequest::Run() {
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;
- msg_params[strings::app_id] = app->app_id();
SendHMIRequest(hmi_apis::FunctionID::TTS_Speak, &msg_params, true);
}
}
void AlertManeuverRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "AlertManeuverRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
@@ -206,7 +209,7 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) {
}
bool AlertManeuverRequest::IsWhiteSpaceExist() {
- LOG4CXX_INFO(logger_, "AlertManeuverRequest::IsWhiteSpaceExist");
+ LOG4CXX_AUTO_TRACE(logger_);
const char* str = NULL;
if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
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
index 99fcde69a..8f9c73267 100644
--- a/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc
+++ b/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc
@@ -47,7 +47,7 @@ AlertManeuverResponse::~AlertManeuverResponse() {
}
void AlertManeuverResponse::Run() {
- LOG4CXX_INFO(logger_, "AlertManeuverResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
diff --git a/src/components/application_manager/src/commands/mobile/alert_request.cc b/src/components/application_manager/src/commands/mobile/alert_request.cc
index c08b7c32d..ccabe4e17 100644
--- a/src/components/application_manager/src/commands/mobile/alert_request.cc
+++ b/src/components/application_manager/src/commands/mobile/alert_request.cc
@@ -84,7 +84,7 @@ bool AlertRequest::Init() {
}
void AlertRequest::Run() {
- LOG4CXX_INFO(logger_, "AlertRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
uint32_t app_id = (*message_)[strings::params][strings::connection_key]
.asInt();
@@ -116,7 +116,7 @@ void AlertRequest::onTimeOut() {
}
void AlertRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "AlertRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
@@ -198,20 +198,12 @@ void AlertRequest::on_event(const event_engine::Event& event) {
response_success_ = true;
}
- // If timeout is not set, watchdog will not track request timeout and
- // HMI is responsible for response returning. In this case, if ABORTED will
- // be rerurned from HMI, success should be sent to mobile.
- if (mobile_apis::Result::ABORTED == response_result_ &&
- 0 == default_timeout_) {
- response_success_ = true;
- }
-
- if (mobile_apis::Result::ABORTED == tts_speak_response_ &&
+ if (((mobile_apis::Result::ABORTED == tts_speak_response_ )||
+ (mobile_apis::Result::REJECTED == tts_speak_response_)) &&
(!flag_other_component_sent_)) {
response_success_ = false;
response_result_ = tts_speak_response_;
}
-
SendResponse(response_success_, response_result_,
response_info.empty() ? NULL : response_info.c_str(),
&response_params_);
@@ -332,39 +324,38 @@ void AlertRequest::SendAlertRequest(int32_t app_id) {
}
void AlertRequest::SendSpeakRequest(int32_t app_id) {
-
+ using namespace hmi_apis;
+ using namespace smart_objects;
// crate HMI speak request
- smart_objects::SmartObject msg_params = smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ SmartObject msg_params = smart_objects::SmartObject(SmartType_Map);
- msg_params[hmi_request::tts_chunks] = smart_objects::SmartObject(
- smart_objects::SmartType_Array);
+ msg_params[hmi_request::tts_chunks] = smart_objects::SmartObject(SmartType_Array);
msg_params[hmi_request::tts_chunks] =
(*message_)[strings::msg_params][strings::tts_chunks];
msg_params[strings::app_id] = app_id;
- msg_params[hmi_request::speak_type] =
- hmi_apis::Common_SpeakType::ALERT;
- SendHMIRequest(hmi_apis::FunctionID::TTS_Speak, &msg_params, true);
+ msg_params[hmi_request::speak_type] = Common_MethodName::ALERT;
+ SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
}
void AlertRequest::SendPlayToneNotification(int32_t app_id) {
- LOG4CXX_INFO(logger_, "AlertRequest::SendPlayToneNotification");
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+ using namespace smart_objects;
// check playtone parameter
if ((*message_)[strings::msg_params].keyExists(strings::play_tone)) {
if ((*message_)[strings::msg_params][strings::play_tone].asBool()) {
// crate HMI basic communication playtone request
- smart_objects::SmartObject msg_params = smart_objects::SmartObject(
- smart_objects::SmartType_Map);
-
- CreateHMINotification(hmi_apis::FunctionID::BasicCommunication_PlayTone,
- msg_params);
+ SmartObject msg_params = smart_objects::SmartObject(SmartType_Map);
+ msg_params[strings::app_id] = app_id;
+ msg_params[strings::method_name] = Common_MethodName::ALERT;
+ CreateHMINotification(FunctionID::BasicCommunication_PlayTone, msg_params);
}
}
}
bool AlertRequest::CheckStringsOfAlertRequest() {
- LOG4CXX_INFO(logger_, "AlertRequest::CheckStringsOfAlertRequest");
+ LOG4CXX_AUTO_TRACE(logger_);
const char* str = NULL;
if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) {
diff --git a/src/components/application_manager/src/commands/mobile/alert_response.cc b/src/components/application_manager/src/commands/mobile/alert_response.cc
index 5b8cd6557..dac086a8b 100644
--- a/src/components/application_manager/src/commands/mobile/alert_response.cc
+++ b/src/components/application_manager/src/commands/mobile/alert_response.cc
@@ -49,7 +49,7 @@ AlertResponse::~AlertResponse() {
}
void AlertResponse::Run() {
- LOG4CXX_INFO(logger_, "AlertResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index 9780aad7b..89b2dbaf0 100644
--- a/src/components/application_manager/src/commands/mobile/change_registration_request.cc
+++ b/src/components/application_manager/src/commands/mobile/change_registration_request.cc
@@ -55,7 +55,7 @@ ChangeRegistrationRequest::~ChangeRegistrationRequest() {
}
void ChangeRegistrationRequest::Run() {
- LOG4CXX_INFO(logger_, "ChangeRegistrationRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl* instance = ApplicationManagerImpl::instance();
const HMICapabilities& hmi_capabilities = instance->hmi_capabilities();
@@ -166,19 +166,19 @@ void ChangeRegistrationRequest::Run() {
&tts_params, true);
}
-bool ChangeRegistrationRequest::WasAnySuccess(
+bool ChangeRegistrationRequest::AllHmiResponsesSuccess(
const hmi_apis::Common_Result::eType ui,
const hmi_apis::Common_Result::eType vr,
const hmi_apis::Common_Result::eType tts) {
return
- hmi_apis::Common_Result::SUCCESS == ui ||
- hmi_apis::Common_Result::SUCCESS == vr ||
+ hmi_apis::Common_Result::SUCCESS == ui &&
+ hmi_apis::Common_Result::SUCCESS == vr &&
hmi_apis::Common_Result::SUCCESS == tts;
}
void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "ChangeRegistrationRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
hmi_apis::FunctionID::eType event_id = event.id();
@@ -237,7 +237,7 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
(*message_)[strings::params][strings::function_id] =
mobile_apis::FunctionID::eType::ChangeRegistrationID;
- SendResponse(WasAnySuccess(ui_result_, vr_result_, tts_result_),
+ SendResponse(AllHmiResponsesSuccess(ui_result_, vr_result_, tts_result_),
static_cast<mobile_apis::Result::eType>(greates_result_code),
NULL, &(message[strings::msg_params]));
} else {
@@ -374,21 +374,20 @@ bool ChangeRegistrationRequest::IsWhiteSpaceExist() {
}
mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence() {
- LOG4CXX_INFO(logger_, "ChangeRegistrationRequest::CheckCoincidence");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& msg_params =
(*message_)[strings::msg_params];
ApplicationManagerImpl::ApplicationListAccessor accessor;
- const std::set<ApplicationSharedPtr> applications = accessor.applications();
- std::set<ApplicationSharedPtr>::const_iterator it = applications.begin();
std::string app_name;
uint32_t app_id = connection_key();
if (msg_params.keyExists(strings::app_name)) {
app_name = msg_params[strings::app_name].asString();
}
- for (; applications.end() != it; ++it) {
+ ApplicationManagerImpl::ApplictionSetConstIt it = accessor.begin();
+ for (; accessor.end() != it; ++it) {
if (app_id == (*it)->app_id()) {
continue;
}
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
index 13c926ec8..557614f17 100644
--- a/src/components/application_manager/src/commands/mobile/change_registration_response.cc
+++ b/src/components/application_manager/src/commands/mobile/change_registration_response.cc
@@ -47,7 +47,7 @@ ChangeRegistrationResponse::~ChangeRegistrationResponse() {
}
void ChangeRegistrationResponse::Run() {
- LOG4CXX_INFO(logger_, "ChangeRegistrationResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index 583f0a046..813f55091 100644
--- 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
@@ -45,18 +45,22 @@ namespace application_manager {
namespace commands {
CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest(
- const MessageSharedPtr& message)
- : CommandRequestImpl(message) {
+ const MessageSharedPtr& message)
+ : CommandRequestImpl(message),
+ expected_chs_count_(0),
+ received_chs_count_(0),
+ error_from_hmi_(false) {
}
CreateInteractionChoiceSetRequest::~CreateInteractionChoiceSetRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
}
void CreateInteractionChoiceSetRequest::Run() {
- LOG4CXX_INFO(logger_, "CreateInteractionChoiceSetRequest::Run");
-
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis;
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
- (*message_)[strings::params][strings::connection_key].asUInt());
+ (*message_)[strings::params][strings::connection_key].asUInt());
if (!app) {
LOG4CXX_ERROR(logger_, "NULL pointer");
@@ -64,97 +68,91 @@ void CreateInteractionChoiceSetRequest::Run() {
return;
}
for (uint32_t i = 0;
- i < (*message_)[strings::msg_params][strings::choice_set].length();
- ++i) {
- mobile_apis::Result::eType verification_result_image =
- mobile_apis::Result::SUCCESS;
- mobile_apis::Result::eType verification_result_secondary_image =
- mobile_apis::Result::SUCCESS;
+ 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)) {
+ [strings::choice_set][i].keyExists(strings::image)) {
verification_result_image = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::choice_set]
- [i][strings::image], app);
+ (*message_)[strings::msg_params][strings::choice_set]
+ [i][strings::image], app);
}
if ((*message_)[strings::msg_params]
- [strings::choice_set][i].keyExists(strings::secondary_image)) {
+ [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);
+ (*message_)[strings::msg_params][strings::choice_set]
+ [i][strings::secondary_image], app);
}
- if (verification_result_image == mobile_apis::Result::INVALID_DATA ||
- verification_result_secondary_image == mobile_apis::Result::INVALID_DATA) {
+ if (verification_result_image == Result::INVALID_DATA ||
+ verification_result_secondary_image == Result::INVALID_DATA) {
LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ SendResponse(false, Result::INVALID_DATA);
return;
}
}
- const int32_t choice_set_id = (*message_)[strings::msg_params]
- [strings::interaction_choice_set_id].asInt();
+ choice_set_id_ = (*message_)[strings::msg_params]
+ [strings::interaction_choice_set_id].asInt();
- if (app->FindChoiceSet(choice_set_id)) {
+ if (app->FindChoiceSet(choice_set_id_)) {
LOG4CXX_ERROR(logger_, "Invalid ID");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
+ SendResponse(false, Result::INVALID_ID);
return;
}
- mobile_apis::Result::eType result = CheckChoiceSet(app);
- if (mobile_apis::Result::SUCCESS != result) {
+ Result::eType result = CheckChoiceSet(app);
+ if (Result::SUCCESS != result) {
SendResponse(false, result);
return;
}
uint32_t grammar_id = ApplicationManagerImpl::instance()->GenerateGrammarID();
(*message_)[strings::msg_params][strings::grammar_id] = grammar_id;
- app->AddChoiceSet(choice_set_id, (*message_)[strings::msg_params]);
- SendVRAddCommandRequest(app);
- SendResponse(true, mobile_apis::Result::SUCCESS);
- app->UpdateHash();
+ app->AddChoiceSet(choice_set_id_, (*message_)[strings::msg_params]);
+ SendVRAddCommandRequests(app);
}
mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
- ApplicationConstSharedPtr app) {
- LOG4CXX_INFO(logger_, "CreateInteractionChoiceSetRequest::CheckChoiceSet");
+ ApplicationConstSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartArray* new_choice_set_array =
(*message_)[strings::msg_params][strings::choice_set].asArray();
smart_objects::SmartArray::const_iterator it_array =
- new_choice_set_array->begin();
+ new_choice_set_array->begin();
smart_objects::SmartArray::const_iterator it_array_end =
- new_choice_set_array->end();
+ new_choice_set_array->end();
// Self check of new choice set for params coincidence
for (; it_array != it_array_end; ++it_array) {
const smart_objects::SmartArray* vr_array =
- (*it_array)[strings::vr_commands].asArray();
+ (*it_array)[strings::vr_commands].asArray();
CoincidencePredicateChoiceID c((*it_array)[strings::choice_id].asInt());
if (1 != std::count_if(
- new_choice_set_array->begin(),
- new_choice_set_array->end(),
- c)) {
-
+ new_choice_set_array->begin(),
+ new_choice_set_array->end(), c)) {
LOG4CXX_ERROR(logger_, "Incoming choice set has duplicate IDs.");
return mobile_apis::Result::INVALID_ID;
}
// Check new choice set params along with already registered choice sets
- const ChoiceSetMap& app_choice_set_map = app->choice_set_map();
+ const DataAccessor<ChoiceSetMap> accessor = app->choice_set_map();
+ const ChoiceSetMap& app_choice_set_map = accessor.GetData();
ChoiceSetMap::const_iterator it = app_choice_set_map.begin();
ChoiceSetMap::const_iterator itEnd = app_choice_set_map.end();
for (; it != itEnd; ++it) {
const smart_objects::SmartObject* app_choice_set = it->second;
if (NULL != app_choice_set) {
-
const smart_objects::SmartArray* curr_choice_set =
- (*app_choice_set)[strings::choice_set].asArray();
+ (*app_choice_set)[strings::choice_set].asArray();
if (0 != std::count_if(
- curr_choice_set->begin(),
- curr_choice_set->end(),
- c)) {
+ curr_choice_set->begin(),
+ curr_choice_set->end(),
+ c)) {
LOG4CXX_ERROR(logger_, "Incoming choice ID already exists.");
return mobile_apis::Result::INVALID_ID;
}
@@ -163,10 +161,9 @@ mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
CoincidencePredicateMenuName m((*it_array)[strings::menu_name].asString());
if (1 != std::count_if(
- new_choice_set_array->begin(),
- new_choice_set_array->end(),
- m)) {
-
+ new_choice_set_array->begin(),
+ new_choice_set_array->end(),
+ m)) {
LOG4CXX_ERROR(logger_, "Incoming choice set has duplicate menu names.");
return mobile_apis::Result::DUPLICATE_NAME;
}
@@ -179,7 +176,6 @@ mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
for (; it_vr != it_vr_end; ++it_vr) {
CoincidencePredicateVRCommands v((*it_vr));
if (1 != std::count_if(vr_array->begin(), vr_array->end(), v)) {
-
LOG4CXX_ERROR(logger_,
"Incoming choice set has duplicate VR command(s)");
@@ -189,22 +185,19 @@ mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
// Check along with VR commands in other choices in the new set
smart_objects::SmartArray::const_iterator it_same_array =
- new_choice_set_array->begin();
+ new_choice_set_array->begin();
smart_objects::SmartArray::const_iterator it_same_array_end =
- new_choice_set_array->end();
+ new_choice_set_array->end();
for (; it_same_array != it_same_array_end; ++it_same_array) {
-
// Skip check for itself
if ((*it_array)[strings::choice_id] ==
(*it_same_array)[strings::choice_id]) {
-
continue;
}
if (compareSynonyms((*it_array), (*it_same_array))) {
-
LOG4CXX_ERROR(logger_,
"Incoming choice set has duplicate VR command(s).");
@@ -223,14 +216,13 @@ mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
}
bool CreateInteractionChoiceSetRequest::compareSynonyms(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2) {
-
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1,
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2) {
smart_objects::SmartArray* vr_cmds_1 =
- choice1[strings::vr_commands].asArray();
+ choice1[strings::vr_commands].asArray();
DCHECK(vr_cmds_1 != NULL);
smart_objects::SmartArray* vr_cmds_2 =
- choice2[strings::vr_commands].asArray();
+ choice2[strings::vr_commands].asArray();
DCHECK(vr_cmds_2 != NULL);
smart_objects::SmartArray::iterator it;
@@ -249,15 +241,14 @@ bool CreateInteractionChoiceSetRequest::compareSynonyms(
}
bool CreateInteractionChoiceSetRequest::compareStr(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& str1,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& str2) {
-
+ 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_INFO(logger_, "CreateInteractionChoiceSetRequest::IsWhiteSpaceExist");
+ const smart_objects::SmartObject& choice_set) {
+ LOG4CXX_AUTO_TRACE(logger_);
const char* str = NULL;
str = choice_set[strings::menu_name].asCharArray();
@@ -284,7 +275,7 @@ bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist(
if (choice_set.keyExists(strings::vr_commands)) {
const size_t len =
- choice_set[strings::vr_commands].length();
+ choice_set[strings::vr_commands].length();
for (size_t i = 0; i < len; ++i) {
str = choice_set[strings::vr_commands][i].asCharArray();
@@ -306,37 +297,175 @@ bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist(
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");
+ LOG4CXX_ERROR(logger_, "Invalid secondary_image value. "
+ "Syntax check failed");
return true;
}
}
return false;
}
-void CreateInteractionChoiceSetRequest::SendVRAddCommandRequest(
- application_manager::ApplicationSharedPtr const app) {
-
- smart_objects::SmartObject* choice_set = &(*message_)[strings::msg_params];
+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;
+ }
+ }
- for (size_t j = 0; j < (*choice_set)[strings::choice_set].length(); ++j) {
- 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] =
- (*choice_set)[strings::choice_set][j][strings::choice_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][j][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();
+ 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::on_event(
+ const event_engine::Event& event) {
+ using namespace hmi_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ if (event.id() == hmi_apis::FunctionID::VR_AddCommand) {
+ received_chs_count_++;
+ LOG4CXX_DEBUG(logger_, "Got VR.AddCommand response, there are "
+ << expected_chs_count_ - received_chs_count_
+ << " more to wait.");
+
+ uint32_t corr_id = static_cast<uint32_t>(message[strings::params]
+ [strings::correlation_id].asUInt());
+ 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;
+ }
+
+ Common_Result::eType vr_result_ = static_cast<Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ if (Common_Result::SUCCESS == vr_result_) {
+ VRCommandInfo& vr_command = it->second;
+ vr_command.succesful_response_received_ = true;
+ } else {
+ LOG4CXX_DEBUG(logger_, "Hmi response is not Success: " << vr_result_
+ << ". Stop sending VRAddCommand requests");
+ sync_primitives::AutoLock error_lock(error_from_hmi_lock_);
+ if (!error_from_hmi_) {
+ error_from_hmi_ = true;
+ SendResponse(false, GetMobileResultCode(vr_result_));
+ }
+ }
+
+ // update request timeout for case we send many VR add command requests
+ // and HMI has no time to send responses for all of them
+ LOG4CXX_DEBUG(logger_, "expected_chs_count_ = " << expected_chs_count_
+ << "received_chs_count_ = " << received_chs_count_);
+ if (received_chs_count_ < expected_chs_count_) {
+ sync_primitives::AutoLock timeout_lock_(is_timed_out_lock_);
+ if (!is_timed_out_) {
+ ApplicationManagerImpl::instance()->updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ }
+ } else {
+ OnAllHMIResponsesReceived();
+ }
+ }
+}
- msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
- msg_params[strings::grammar_id] = (*choice_set)[strings::grammar_id];
+void CreateInteractionChoiceSetRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
- SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &msg_params);
+ sync_primitives::AutoLock error_lock(error_from_hmi_lock_);
+ if (!error_from_hmi_) {
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
}
+ // 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;
+ ApplicationManagerImpl::instance()->updateRequestTimeout(
+ connection_key(), correlation_id(), 0);
}
+void CreateInteractionChoiceSetRequest::DeleteChoices() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->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_, "Succesfull 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);
+
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+ application->UpdateHash();
+ } else {
+ DeleteChoices();
+ }
+ ApplicationManagerImpl::instance()->TerminateRequest(connection_key(),
+ correlation_id());
+}
} // namespace commands
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
index 8d6ea1b34..bc8120608 100644
--- 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
@@ -49,7 +49,7 @@ CreateInteractionChoiceSetResponse::~CreateInteractionChoiceSetResponse() {
}
void CreateInteractionChoiceSetResponse::Run() {
- LOG4CXX_INFO(logger_, "CreateInteractionChoiceSetResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// check if response false
if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
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
index 3c3ee8820..99dd53d17 100644
--- a/src/components/application_manager/src/commands/mobile/delete_command_request.cc
+++ b/src/components/application_manager/src/commands/mobile/delete_command_request.cc
@@ -55,7 +55,7 @@ DeleteCommandRequest::~DeleteCommandRequest() {
}
void DeleteCommandRequest::Run() {
- LOG4CXX_INFO(logger_, "DeleteCommandRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr application = ApplicationManagerImpl::instance()->application(
(*message_)[strings::params][strings::connection_key].asUInt());
@@ -109,7 +109,7 @@ void DeleteCommandRequest::Run() {
}
void DeleteCommandRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "DeleteCommandRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
@@ -170,6 +170,9 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) {
}
SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ if (result) {
+ application->UpdateHash();
+ }
}
}
}
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
index 812e58743..75178bcb4 100644
--- a/src/components/application_manager/src/commands/mobile/delete_command_response.cc
+++ b/src/components/application_manager/src/commands/mobile/delete_command_response.cc
@@ -46,7 +46,7 @@ DeleteCommandResponse::~DeleteCommandResponse() {
}
void DeleteCommandResponse::Run() {
- LOG4CXX_INFO(logger_, "DeleteCommandResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index ca5a4395f..4c753871c 100644
--- a/src/components/application_manager/src/commands/mobile/delete_file_request.cc
+++ b/src/components/application_manager/src/commands/mobile/delete_file_request.cc
@@ -49,7 +49,7 @@ DeleteFileRequest::~DeleteFileRequest() {
}
void DeleteFileRequest::Run() {
- LOG4CXX_INFO(logger_, "DeleteFileRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr application =
ApplicationManagerImpl::instance()->application(connection_key());
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
index 81470ccf6..1bbb18313 100644
--- a/src/components/application_manager/src/commands/mobile/delete_file_response.cc
+++ b/src/components/application_manager/src/commands/mobile/delete_file_response.cc
@@ -47,7 +47,7 @@ DeleteFileResponse::~DeleteFileResponse() {
}
void DeleteFileResponse::Run() {
- LOG4CXX_INFO(logger_, "DeleteFileResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
uint32_t app_id = (*message_)[strings::params][strings::connection_key]
.asUInt();
ApplicationSharedPtr app =
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
index 1fcd4b33d..18c6b3b08 100644
--- 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
@@ -50,7 +50,7 @@ DeleteInteractionChoiceSetRequest::~DeleteInteractionChoiceSetRequest() {
}
void DeleteInteractionChoiceSetRequest::Run() {
- LOG4CXX_INFO(logger_, "DeleteInteractionChoiceSetRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
(*message_)[strings::params][strings::connection_key].asUInt());
@@ -86,25 +86,32 @@ void DeleteInteractionChoiceSetRequest::Run() {
app->RemoveChoiceSet(choise_set_id);
- SendResponse(true, mobile_apis::Result::SUCCESS);
- /*CreateHMIRequest(hmi_apis::FunctionID::UI_DeleteInteractionChoiceSet,
- msg_params, true);*/
+ // Checking of HMI responses will be implemented with APPLINK-14600
+ const bool result = true;
+ SendResponse(result, mobile_apis::Result::SUCCESS);
+ if (result) {
+ app->UpdateHash();
+ }
}
bool DeleteInteractionChoiceSetRequest::ChoiceSetInUse(ApplicationConstSharedPtr app) {
if (app->is_perform_interaction_active()) {
// retrieve stored choice sets for perform interaction
- const PerformChoiceSetMap& choice_set_map = app
- ->performinteraction_choice_set_map();
+ const DataAccessor<PerformChoiceSetMap> accessor =
+ app->performinteraction_choice_set_map();
+ const PerformChoiceSetMap& choice_set_map = accessor.GetData();
PerformChoiceSetMap::const_iterator it = choice_set_map.begin();
for (; choice_set_map.end() != it; ++it) {
- if (it->first
- == (*message_)[strings::msg_params]
- [strings::interaction_choice_set_id].asUInt()) {
- LOG4CXX_ERROR_EXT(logger_,
- "DeleteInteractionChoiceSetRequest::ChoiceSetInUse");
- return true;
+ const PerformChoice& choice = it->second;
+ PerformChoice::const_iterator choice_it = choice.begin();
+ for (; choice.end() != choice_it; ++choice_it) {
+ if (choice_it->first == (*message_)[strings::msg_params]
+ [strings::interaction_choice_set_id].asUInt()) {
+ LOG4CXX_ERROR_EXT(logger_,
+ "DeleteInteractionChoiceSetRequest::ChoiceSetInUse");
+ return true;
+ }
}
}
}
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
index d260add7c..f9ee513b9 100644
--- 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
@@ -50,7 +50,7 @@ DeleteInteractionChoiceSetResponse::~DeleteInteractionChoiceSetResponse() {
}
void DeleteInteractionChoiceSetResponse::Run() {
- LOG4CXX_INFO(logger_, "DeleteInteractionChoiceSetResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// check if response false
if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
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
index d91e74268..6b6bd3fbd 100644
--- 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
@@ -48,7 +48,7 @@ DeleteSubMenuRequest::~DeleteSubMenuRequest() {
}
void DeleteSubMenuRequest::Run() {
- LOG4CXX_INFO(logger_, "DeleteSubMenuRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
(*message_)[strings::params][strings::connection_key].asUInt());
@@ -77,9 +77,10 @@ void DeleteSubMenuRequest::Run() {
}
void DeleteSubMenuRequest::DeleteSubMenuVRCommands(ApplicationConstSharedPtr app) {
- LOG4CXX_INFO(logger_, "DeleteSubMenuRequest::DeleteSubMenuVRCommands");
+ LOG4CXX_AUTO_TRACE(logger_);
- const CommandsMap& commands = app->commands_map();
+ const DataAccessor<CommandsMap> accessor = app->commands_map();
+ const CommandsMap& commands = accessor.GetData();
CommandsMap::const_iterator it = commands.begin();
for (; commands.end() != it; ++it) {
@@ -104,14 +105,16 @@ void DeleteSubMenuRequest::DeleteSubMenuVRCommands(ApplicationConstSharedPtr app
}
void DeleteSubMenuRequest::DeleteSubMenuUICommands(ApplicationSharedPtr const app) {
- LOG4CXX_INFO(logger_, "DeleteSubMenuRequest::DeleteSubMenuUICommands");
+ LOG4CXX_AUTO_TRACE(logger_);
- const CommandsMap& commands = app->commands_map();
+ 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;
}
@@ -122,9 +125,7 @@ void DeleteSubMenuRequest::DeleteSubMenuUICommands(ApplicationSharedPtr const ap
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
@@ -136,7 +137,7 @@ void DeleteSubMenuRequest::DeleteSubMenuUICommands(ApplicationSharedPtr const ap
}
void DeleteSubMenuRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "DeleteSubMenuRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
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
index 0a25a1161..05795e590 100644
--- 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
@@ -46,7 +46,7 @@ DeleteSubMenuResponse::~DeleteSubMenuResponse() {
}
void DeleteSubMenuResponse::Run() {
- LOG4CXX_INFO(logger_, "DeleteSubMenuResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
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
index 75016c05f..f5e8808d3 100644
--- a/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc
+++ b/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc
@@ -31,9 +31,11 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include <algorithm>
#include "application_manager/commands/mobile/diagnostic_message_request.h"
#include "application_manager/application_manager_impl.h"
#include "application_manager/application_impl.h"
+#include "config_profile/profile.h"
#include "interfaces/HMI_API.h"
namespace application_manager {
@@ -48,17 +50,36 @@ DiagnosticMessageRequest::~DiagnosticMessageRequest() {
}
void DiagnosticMessageRequest::Run() {
- LOG4CXX_INFO(logger_, "DiagnosticMessageRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
- connection_key());
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(connection_key());
if (!app) {
- LOG4CXX_ERROR_EXT(logger_, "An application is not registered.");
+ LOG4CXX_ERROR(logger_, "Application is not registered.");
SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
return;
}
+ const std::vector<uint32_t>& supported_diag_modes =
+ profile::Profile::instance()->supported_diag_modes();
+
+ uint32_t message_data_length =
+ (*message_)[strings::msg_params][strings::message_data].length();
+ for (uint32_t i = 0; i < message_data_length; ++i) {
+ uint32_t message_data =
+ (*message_)[strings::msg_params][strings::message_data][i].asUInt();
+ if (supported_diag_modes.end() == std::find(supported_diag_modes.begin(),
+ supported_diag_modes.end(),
+ message_data)) {
+ LOG4CXX_ERROR(logger_, "Received message data " << message_data <<
+ " not supported");
+ SendResponse(false, mobile_apis::Result::REJECTED,
+ "Received message data not supported");
+ return;
+ }
+ }
+
// Add app_id for HMI request
(*message_)[strings::msg_params][strings::app_id] = app->app_id();
@@ -68,7 +89,7 @@ void DiagnosticMessageRequest::Run() {
}
void DiagnosticMessageRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "DiagnosticMessageRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
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
index 2a8b234ff..9c399a00c 100644
--- a/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc
+++ b/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc
@@ -46,7 +46,7 @@ DiagnosticMessageResponse::~DiagnosticMessageResponse() {
}
void DiagnosticMessageResponse::Run() {
- LOG4CXX_INFO(logger_, "DiagnosticMessageResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index 140f43128..749b19a52 100644
--- a/src/components/application_manager/src/commands/mobile/dial_number_request.cc
+++ b/src/components/application_manager/src/commands/mobile/dial_number_request.cc
@@ -47,7 +47,7 @@ DialNumberRequest::~DialNumberRequest() {
}
void DialNumberRequest::Run() {
- LOG4CXX_INFO(logger_, "DialNumberRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendResponse(false, mobile_apis::Result::UNSUPPORTED_REQUEST);
}
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
index eedc9f813..78a867a6d 100644
--- 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
@@ -47,13 +47,13 @@ EndAudioPassThruRequest::~EndAudioPassThruRequest() {
}
void EndAudioPassThruRequest::Run() {
- LOG4CXX_INFO(logger_, "EndAudioPassThruRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendHMIRequest(hmi_apis::FunctionID::UI_EndAudioPassThru, NULL, true);
}
void EndAudioPassThruRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "EndAudioPassThruRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
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
index 128d921f9..0ac1a00bd 100644
--- 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
@@ -47,7 +47,7 @@ EndAudioPassThruResponse::~EndAudioPassThruResponse() {
}
void EndAudioPassThruResponse::Run() {
- LOG4CXX_INFO(logger_, "EndAudioPassThruResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index 9a81f94db..f6791759a 100644
--- a/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc
+++ b/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc
@@ -48,7 +48,7 @@ GetDTCsRequest::~GetDTCsRequest() {
}
void GetDTCsRequest::Run() {
- LOG4CXX_INFO(logger_, "GetDTCsRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
(*message_)[strings::params][strings::connection_key].asUInt());
@@ -59,12 +59,6 @@ void GetDTCsRequest::Run() {
return;
}
- if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) {
- LOG4CXX_ERROR(logger_, "App has not been activated");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
smart_objects::SmartObject msg_params = smart_objects::SmartObject(
smart_objects::SmartType_Map);
@@ -82,7 +76,7 @@ void GetDTCsRequest::Run() {
}
void GetDTCsRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "GetDTCsRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
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
index 2ed7a9295..523711c97 100644
--- a/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc
+++ b/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc
@@ -46,7 +46,7 @@ GetDTCsResponse::~GetDTCsResponse() {
}
void GetDTCsResponse::Run() {
- LOG4CXX_INFO(logger_, "GetDTCsResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index a3d08a15f..ed75e62c0 100644
--- 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
@@ -54,7 +54,7 @@ GetVehicleDataRequest::~GetVehicleDataRequest() {
}
void GetVehicleDataRequest::Run() {
- LOG4CXX_INFO(logger_, "GetVehicleDataRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
int32_t app_id = (*message_)[strings::params][strings::connection_key].asUInt();
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
@@ -65,12 +65,6 @@ void GetVehicleDataRequest::Run() {
return;
}
- if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) {
- LOG4CXX_ERROR(logger_, "app in HMI level HMI_NONE");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
const VehicleData& vehicle_data = MessageHelper::vehicle_data();
VehicleData::const_iterator it = vehicle_data.begin();
@@ -181,7 +175,7 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
}
LOG4CXX_TRACE(logger_, "Status from HMI: " << it->status << ", so response status become " << status);
} else {
- any_arg_success = true;
+ any_arg_success = true;
}
}
@@ -213,7 +207,7 @@ GetVehicleDataRequest::~GetVehicleDataRequest() {
}
void GetVehicleDataRequest::Run() {
- LOG4CXX_INFO(logger_, "GetVehicleDataRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
int32_t app_id = (*message_)[strings::params][strings::connection_key].asUInt();
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
@@ -224,16 +218,11 @@ void GetVehicleDataRequest::Run() {
return;
}
- if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) {
- LOG4CXX_ERROR(logger_, "app in HMI level HMI_NONE.");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
if (app->IsCommandLimitsExceeded(
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);
+ SendResponse(false, mobile_apis::Result::REJECTED);
return;
}
const VehicleData& vehicle_data = MessageHelper::vehicle_data();
@@ -260,7 +249,7 @@ void GetVehicleDataRequest::Run() {
}
void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "GetVehicleDataRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject message = event.smart_object();
switch (event.id()) {
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
index d9087fdc6..5491e9b1a 100644
--- 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
@@ -47,7 +47,7 @@ GetVehicleDataResponse::~GetVehicleDataResponse() {
}
void GetVehicleDataResponse::Run() {
- LOG4CXX_INFO(logger_, "GetVehicleDataResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index d0fa71d46..427443e3e 100644
--- a/src/components/application_manager/src/commands/mobile/list_files_request.cc
+++ b/src/components/application_manager/src/commands/mobile/list_files_request.cc
@@ -50,7 +50,7 @@ ListFilesRequest::~ListFilesRequest() {
}
void ListFilesRequest::Run() {
- LOG4CXX_INFO(logger_, "ListFilesRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr application =
ApplicationManagerImpl::instance()->application(connection_key());
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
index 6ffbec1ac..42bd1e6f0 100644
--- a/src/components/application_manager/src/commands/mobile/list_files_response.cc
+++ b/src/components/application_manager/src/commands/mobile/list_files_response.cc
@@ -47,7 +47,7 @@ ListFilesResponse::~ListFilesResponse() {
}
void ListFilesResponse::Run() {
- LOG4CXX_INFO(logger_, "ListFilesResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index ebd0d6aac..e3e51faa6 100644
--- 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
@@ -47,7 +47,7 @@ OnAppInterfaceUnregisteredNotification::~OnAppInterfaceUnregisteredNotification(
}
void OnAppInterfaceUnregisteredNotification::Run() {
- LOG4CXX_INFO(logger_, "OnAppInterfaceUnregisteredNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendNotification();
}
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
index 2515f591b..d1329bf8e 100644
--- 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
@@ -45,7 +45,7 @@ OnAudioPassThruNotification::~OnAudioPassThruNotification() {
}
void OnAudioPassThruNotification::Run() {
- LOG4CXX_INFO(logger_, "OnAudioPassThruNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendNotification();
}
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
index 55b9b8818..54575080c 100644
--- 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
@@ -51,7 +51,7 @@ OnButtonEventNotification::~OnButtonEventNotification() {
}
void OnButtonEventNotification::Run() {
- LOG4CXX_INFO(logger_, "OnButtonEventNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
const uint32_t btn_id =
static_cast<uint32_t>(
@@ -115,7 +115,7 @@ void OnButtonEventNotification::Run() {
//Send ButtonEvent notification for OK button only in HMI_FULL mode
if ((static_cast<uint32_t>(mobile_apis::ButtonName::OK) == btn_id) &&
- (mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level())) {
+ (subscribed_app->IsFullscreen())) {
continue;
}
@@ -124,18 +124,19 @@ void OnButtonEventNotification::Run() {
}
void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) {
- smart_objects::SmartObject* on_btn_event = new smart_objects::SmartObject();
-
- if (!on_btn_event) {
+ if (!app) {
LOG4CXX_ERROR_EXT(logger_, "OnButtonEvent NULL pointer");
return;
}
- if (!app) {
+ smart_objects::SmartObjectSPtr on_btn_event = new smart_objects::SmartObject();
+
+ if (!on_btn_event) {
LOG4CXX_ERROR_EXT(logger_, "OnButtonEvent NULL pointer");
return;
}
+
(*on_btn_event)[strings::params][strings::connection_key] = app->app_id();
(*on_btn_event)[strings::params][strings::function_id] =
@@ -152,7 +153,7 @@ void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) {
(*message_)[strings::msg_params][strings::custom_button_id];
}
- message_.reset(on_btn_event);
+ message_ = on_btn_event;
SendNotification();
}
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
index cfafc7af1..86fe664f8 100644
--- 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
@@ -51,7 +51,7 @@ OnButtonPressNotification::~OnButtonPressNotification() {
}
void OnButtonPressNotification::Run() {
- LOG4CXX_INFO(logger_, "OnButtonPressNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
const uint32_t btn_id =
static_cast<uint32_t>(
@@ -124,18 +124,19 @@ void OnButtonPressNotification::Run() {
}
void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
- smart_objects::SmartObject* on_btn_press = new smart_objects::SmartObject();
-
- if (!on_btn_press) {
+ if (!app) {
LOG4CXX_ERROR_EXT(logger_, "OnButtonPress NULL pointer");
return;
}
- if (!app) {
+ smart_objects::SmartObjectSPtr on_btn_press = new smart_objects::SmartObject();
+
+ if (!on_btn_press) {
LOG4CXX_ERROR_EXT(logger_, "OnButtonPress NULL pointer");
return;
}
+
(*on_btn_press)[strings::params][strings::connection_key] = app->app_id();
(*on_btn_press)[strings::params][strings::function_id] =
@@ -152,7 +153,7 @@ void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
(*message_)[strings::msg_params][strings::custom_button_id];
}
- message_.reset(on_btn_press);
+ message_ = on_btn_press;
SendNotification();
}
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
index 8342d05a4..9bba1851f 100644
--- a/src/components/application_manager/src/commands/mobile/on_command_notification.cc
+++ b/src/components/application_manager/src/commands/mobile/on_command_notification.cc
@@ -47,7 +47,7 @@ OnCommandNotification::~OnCommandNotification() {
}
void OnCommandNotification::Run() {
- LOG4CXX_INFO(logger_, "OnCommandNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
(*message_)[strings::msg_params][strings::app_id].asInt());
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
index fc92c17e9..e9145520f 100644
--- 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
@@ -51,7 +51,7 @@ OnDriverDistractionNotification::~OnDriverDistractionNotification() {
}
void OnDriverDistractionNotification::Run() {
- LOG4CXX_INFO(logger_, "OnDriverDistractionNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendNotification();
}
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
index b9ee1339b..10f3eb1ab 100644
--- 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
@@ -37,7 +37,6 @@
#include "application_manager/application_impl.h"
#include "interfaces/MOBILE_API.h"
#include <string>
-#include <sstream>
namespace application_manager {
@@ -54,7 +53,7 @@ OnHashChangeNotification::~OnHashChangeNotification() {
}
void OnHashChangeNotification::Run() {
- LOG4CXX_INFO(logger_, "OnHashChangeNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
(*message_)[strings::params][strings::message_type] =
static_cast<int32_t>(application_manager::MessageType::kNotification);
@@ -62,10 +61,13 @@ void OnHashChangeNotification::Run() {
int32_t app_id;
app_id = (*message_)[strings::params][strings::connection_key].asInt();
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
- std::stringstream stream;
- stream << app->curHash();
- (*message_)[strings::msg_params][strings::hash_id] = stream.str();
- SendNotification();
+ 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
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
index 9c03c0f62..e4a2d7c34 100644
--- 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
@@ -49,16 +49,17 @@ OnHMIStatusNotification::~OnHMIStatusNotification() {
}
void OnHMIStatusNotification::Run() {
- LOG4CXX_INFO(logger_, "OnHMIStatusNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
(*message_)[strings::params][strings::message_type] = static_cast<int32_t> (
application_manager::MessageType::kNotification);
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
- (*message_)[strings::params][strings::connection_key].asUInt());
+ 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());
@@ -74,7 +75,8 @@ void OnHMIStatusNotification::Run() {
(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");
+ LOG4CXX_INFO(logger_,
+ "OnHMIStatusNotification AddAppToTTSGlobalPropertiesList");
ApplicationManagerImpl::instance()->AddAppToTTSGlobalPropertiesList(
app->app_id());
}
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
new file mode 100644
index 000000000..02b4b64aa
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
@@ -0,0 +1,121 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ 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/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/message.h"
+
+namespace application_manager {
+namespace commands {
+
+OnHMIStatusNotificationFromMobile::OnHMIStatusNotificationFromMobile(
+ const MessageSharedPtr& message)
+ : CommandNotificationFromMobileImpl(message) {
+}
+
+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 = ApplicationManagerImpl::instance()->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::ApplicationManagerImpl::instance()->
+ IsAppsQueriedFrom(handle);
+
+ LOG4CXX_DEBUG(logger_, "Mobile HMI state notication came for connection key:"
+ << connection_key() << " and handle: " << handle);
+
+ if (!is_apps_requested_before &&
+ ProtocolVersion::kV4 == 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());
+ return;
+ }
+
+ if (is_apps_requested_before) {
+ LOG4CXX_DEBUG(logger_, "Remote apps list had been requested already "
+ " for handle: " << handle);
+
+ if (ProtocolVersion::kV4 == app->protocol_version()) {
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+
+ bool is_another_foreground_sdl4_app = false;
+ ApplicationManagerImpl::ApplictionSetIt it = accessor.begin();
+ for (;accessor.end() != it; ++it) {
+ if (connection_key() != (*it)->app_id() &&
+ ProtocolVersion::kV4 == (*it)->protocol_version() &&
+ (*it)->is_foreground()) {
+ is_another_foreground_sdl4_app = true;
+ break;
+ }
+ }
+
+ if (!is_another_foreground_sdl4_app) {
+ application_manager::ApplicationManagerImpl::instance()->
+ MarkAppsGreyOut(handle, !is_current_state_foreground);
+ application_manager::ApplicationManagerImpl::instance()->
+ 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
index 969885ab1..6285d684e 100644
--- 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
@@ -51,19 +51,30 @@ OnKeyBoardInputNotification::~OnKeyBoardInputNotification() {
}
void OnKeyBoardInputNotification::Run() {
- LOG4CXX_INFO(logger_, "OnKeyBoardInputNotification::Run");
-
- const std::vector<ApplicationSharedPtr>& applications =
- ApplicationManagerImpl::instance()->applications_with_navi();
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app_to_notify;
+
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ ApplicationManagerImpl::ApplictionSetIt it = accessor.begin();
+ for (; accessor.end() != it; ++it) {
+ // if there is app with active perform interaction use it for notification
+ if ((*it)->is_perform_interaction_active()) {
+ LOG4CXX_INFO(logger_, "There is application with active PerformInteraction");
+ app_to_notify = *it;
+ break;
+ }
- 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();
+ if (mobile_apis::HMILevel::eType::HMI_FULL == (*it)->hmi_level()) {
+ LOG4CXX_INFO(logger_, "There is application in HMI_FULL level");
+ app_to_notify = *it;
}
}
+
+ if (app_to_notify.valid()) {
+ (*message_)[strings::params][strings::connection_key] = app_to_notify->app_id();
+ SendNotification();
+ }
}
} // namespace mobile
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
index f550df874..43b1b5b92 100644
--- 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
@@ -46,7 +46,7 @@ OnLanguageChangeNotification::~OnLanguageChangeNotification() {
}
void OnLanguageChangeNotification::Run() {
- LOG4CXX_INFO(logger_, "OnLanguageChangeNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendNotification();
}
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
index 37c81085e..62ea1af1f 100644
--- 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
@@ -48,7 +48,7 @@ OnPermissionsChangeNotification::~OnPermissionsChangeNotification() {
}
void OnPermissionsChangeNotification::Run() {
- LOG4CXX_INFO(logger_, "OnPermissionsChangeNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
(*message_)[strings::params][strings::message_type] =
static_cast<int32_t>(application_manager::MessageType::kNotification);
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
index ebf98cd7e..4e7354776 100644
--- 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
@@ -34,6 +34,8 @@
#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_impl.h"
+#include "application_manager/policies/policy_handler.h"
namespace application_manager {
@@ -50,24 +52,39 @@ OnSystemRequestNotification::~OnSystemRequestNotification() {
}
void OnSystemRequestNotification::Run() {
- LOG4CXX_INFO(logger_, "OnSystemRequestNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace application_manager;
+ using namespace mobile_apis;
- mobile_apis::RequestType::eType request_type = static_cast<mobile_apis::RequestType::eType>
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->
+ 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());
- if (mobile_apis::RequestType::PROPRIETARY == request_type) {
- std::string filename = (*message_)[strings::msg_params][strings::file_name].asString();
+ if (!policy::PolicyHandler::instance()->IsRequestTypeAllowed(
+ app->mobile_app_id(), request_type)) {
+ LOG4CXX_WARN(logger_, "Request type " << request_type
+ <<" is not allowed by policies");
+ return;
+ }
+
+ if (RequestType::PROPRIETARY == request_type) {
+ std::string filename =
+ (*message_)[strings::msg_params][strings::file_name].asString();
std::vector<uint8_t> binary_data;
file_system::ReadBinaryFile(filename, binary_data);
(*message_)[strings::params][strings::binary_data] = binary_data;
- (*message_)[strings::msg_params][strings::file_type] =
- mobile_apis::FileType::JSON;
- } else if (mobile_apis::RequestType::HTTP == request_type) {
- (*message_)[strings::msg_params][strings::file_type] =
- mobile_apis::FileType::BINARY;
- // TODO(PV): if needed for HTTP HMI case to be changed.
- //(*message_)[strings::params][strings::binary_data] = binary_data;
+ (*message_)[strings::msg_params][strings::file_type] = FileType::JSON;
+ } else if (RequestType::HTTP == request_type) {
+ (*message_)[strings::msg_params][strings::file_type] = FileType::BINARY;
}
SendNotification();
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
index 05494c614..99a5d665d 100644
--- 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
@@ -49,7 +49,7 @@ OnTBTClientStateNotification::~OnTBTClientStateNotification() {
}
void OnTBTClientStateNotification::Run() {
- LOG4CXX_INFO(logger_, "OnTBTClientStateNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
(*message_)[strings::params][strings::message_type] =
static_cast<int32_t>(application_manager::MessageType::kNotification);
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
index 250faa8f3..8780ab1b6 100644
--- 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
@@ -50,7 +50,7 @@ OnTouchEventNotification::~OnTouchEventNotification() {
}
void OnTouchEventNotification::Run() {
- LOG4CXX_INFO(logger_, "OnTouchEventNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
const std::vector<ApplicationSharedPtr>& applications =
ApplicationManagerImpl::instance()->applications_with_navi();
@@ -58,7 +58,7 @@ void OnTouchEventNotification::Run() {
std::vector<ApplicationSharedPtr>::const_iterator it = applications.begin();
for (; applications.end() != it; ++it) {
ApplicationSharedPtr app = *it;
- if (mobile_apis::HMILevel::HMI_FULL == app->hmi_level()) {
+ if (app->IsFullscreen()) {
(*message_)[strings::params][strings::connection_key] = app->app_id();
SendNotification();
}
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
index 420c42f30..68755bef5 100644
--- 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
@@ -50,38 +50,55 @@ OnVehicleDataNotification::~OnVehicleDataNotification() {
}
void OnVehicleDataNotification::Run() {
- LOG4CXX_INFO(logger_, "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<utils::SharedPtr<Application>>& applications =
- ApplicationManagerImpl::instance()->IviInfoUpdated(it->second,
- (*message_)[strings::msg_params][it->first].asInt());
-
- std::vector<utils::SharedPtr<Application>>::const_iterator it = applications.begin();
- for (; applications.end() != it; ++it) {
- utils::SharedPtr<Application> app = *it;
- if (!app) {
- LOG4CXX_ERROR_EXT(logger_, "NULL pointer");
- continue;
+ const std::vector<ApplicationSharedPtr>& applications =
+ ApplicationManagerImpl::instance()->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;
+ DCHECK(app);
+
+ 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_INFO(
- logger_,
- "Send OnVehicleData PRNDL notification to " << app->name()
- << " application id " << app->app_id());
-
- (*message_)[strings::params][strings::connection_key] = app->app_id();
-
- SendNotification();
}
-
- return;
}
}
+
+ 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()
+ << " 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
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
index a730995f5..02d7520ea 100644
--- 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
@@ -55,7 +55,7 @@ PerformAudioPassThruRequest::~PerformAudioPassThruRequest() {
}
void PerformAudioPassThruRequest::onTimeOut() {
- LOG4CXX_INFO(logger_, "PerformAudioPassThruRequest::onTimeOut");
+ LOG4CXX_AUTO_TRACE(logger_);
if (ApplicationManagerImpl::instance()->end_audio_pass_thru()) {
ApplicationManagerImpl::instance()->StopAudioPassThru(connection_key());
@@ -73,7 +73,7 @@ bool PerformAudioPassThruRequest::Init() {
}
void PerformAudioPassThruRequest::Run() {
- LOG4CXX_INFO(logger_, "PerformAudioPassThruRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app =
ApplicationManagerImpl::instance()->application(connection_key());
@@ -111,7 +111,7 @@ void PerformAudioPassThruRequest::Run() {
}
void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "PerformAudioPassThruRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
@@ -153,12 +153,16 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
result_tts_speak_ = GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asUInt()));
is_active_tts_speak_ = false;
- SendRecordStartNotification();
- StartMicrophoneRecording();
- ApplicationManagerImpl::instance()->
- updateRequestTimeout(connection_key(),
- correlation_id(),
- default_timeout());
+ if (mobile_apis::Result::SUCCESS == result_tts_speak_) {
+ SendRecordStartNotification();
+ StartMicrophoneRecording();
+
+ // update request timeout to get time for perform audio recording
+ ApplicationManagerImpl::instance()->
+ updateRequestTimeout(connection_key(),
+ correlation_id(),
+ default_timeout());
+ }
break;
}
case hmi_apis::FunctionID::TTS_OnResetTimeout: {
@@ -177,8 +181,10 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
void PerformAudioPassThruRequest::SendSpeakRequest() {
// crate HMI TTS speak request
- smart_objects::SmartObject msg_params = smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ using namespace hmi_apis;
+ using namespace smart_objects;
+
+ SmartObject msg_params = smart_objects::SmartObject(SmartType_Map);
if ((*message_)[str::msg_params].keyExists(str::initial_prompt) &&
(0 < (*message_)[str::msg_params][str::initial_prompt].length())) {
@@ -192,8 +198,9 @@ void PerformAudioPassThruRequest::SendSpeakRequest() {
}
// app_id
msg_params[strings::app_id] = connection_key();
+ msg_params[hmi_request::speak_type] = Common_MethodName::AUDIO_PASS_THRU;
is_active_tts_speak_ = true;
- SendHMIRequest(hmi_apis::FunctionID::TTS_Speak, &msg_params, true);
+ SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
}
}
@@ -260,7 +267,7 @@ void PerformAudioPassThruRequest::StartMicrophoneRecording() {
}
bool PerformAudioPassThruRequest::IsWhiteSpaceExist() {
- LOG4CXX_INFO(logger_, "PerformAudioPassThruRequest::IsWhiteSpaceExist");
+ LOG4CXX_AUTO_TRACE(logger_);
const char* str = NULL;
if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
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
index a10eaac9f..585383889 100644
--- 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
@@ -48,7 +48,7 @@ PerformAudioPassThruResponse::~PerformAudioPassThruResponse() {
}
void PerformAudioPassThruResponse::Run() {
- LOG4CXX_INFO(logger_, "PerformAudioPassThruResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index 12514626a..54edc8e51 100644
--- a/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc
+++ b/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc
@@ -46,14 +46,16 @@ namespace application_manager {
namespace commands {
+uint32_t PerformInteractionRequest::pi_requests_count_ = 0;
+
PerformInteractionRequest::PerformInteractionRequest(
const MessageSharedPtr& message)
: CommandRequestImpl(message),
- timer_("PerformInteractionReq", this, &PerformInteractionRequest::onTimer),
vr_perform_interaction_code_(mobile_apis::Result::INVALID_ENUM),
interaction_mode_(mobile_apis::InteractionMode::INVALID_ENUM),
- ui_response_recived(false),
- vr_response_recived(false) {
+ ui_response_recived_(false),
+ vr_response_recived_(false),
+ app_pi_was_active_before_(false) {
subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
subscribe_on_event(hmi_apis::FunctionID::VR_OnCommand);
@@ -63,10 +65,6 @@ PerformInteractionRequest::PerformInteractionRequest(
PerformInteractionRequest::~PerformInteractionRequest() {
}
-void PerformInteractionRequest::onTimer() {
- LOG4CXX_INFO(logger_, "PerformInteractionRequest::onTimer");
-}
-
bool PerformInteractionRequest::Init() {
/* Timeout in milliseconds.
@@ -75,19 +73,19 @@ bool PerformInteractionRequest::Init() {
default_timeout_ =
(*message_)[strings::msg_params][strings::timeout].asUInt();
}
- mobile_apis::InteractionMode::eType mode =
- static_cast<mobile_apis::InteractionMode::eType>(
+
+ interaction_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) {
- default_timeout_ *= 2;
- }
+ if (mobile_apis::InteractionMode::BOTH == interaction_mode_ ||
+ mobile_apis::InteractionMode::MANUAL_ONLY == interaction_mode_) {
+ default_timeout_ *= 2;
+ }
return true;
}
void PerformInteractionRequest::Run() {
- LOG4CXX_INFO(logger_, "PerformInteractionRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app =
ApplicationManagerImpl::instance()->application(connection_key());
@@ -98,52 +96,51 @@ void PerformInteractionRequest::Run() {
return;
}
+ if (app->is_perform_interaction_active()) {
+ LOG4CXX_INFO(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 ((*message_)[strings::msg_params].keyExists(
- hmi_request::interaction_layout)) {
+
+ if (msg_params.keyExists(hmi_request::interaction_layout)) {
interaction_layout = static_cast<mobile_apis::LayoutMode::eType>(
- (*message_)[strings::msg_params][hmi_request::interaction_layout].asInt());
+ msg_params[hmi_request::interaction_layout].asInt());
}
- if ((mobile_apis::InteractionMode::VR_ONLY ==
- static_cast<mobile_apis::InteractionMode::eType>(
- (*message_)[strings::msg_params][strings::interaction_mode].asInt())) &&
+ if ((mobile_apis::InteractionMode::VR_ONLY == interaction_mode_) &&
(mobile_apis::LayoutMode::KEYBOARD == interaction_layout)) {
- LOG4CXX_ERROR_EXT(
- logger_,
- "PerformInteraction contains InteractionMode = VR_ONLY and "
- "interactionLayout=KEYBOARD");
+ LOG4CXX_ERROR_EXT(logger_, "PerformInteraction contains InteractionMode"
+ "=VR_ONLY and interactionLayout=KEYBOARD");
SendResponse(false, mobile_apis::Result::INVALID_DATA);
return;
}
- if ((0 == (*message_)
- [strings::msg_params][strings::interaction_choice_set_id_list].length()) &&
- (mobile_apis::InteractionMode::BOTH ==
- static_cast<mobile_apis::InteractionMode::eType>(
- (*message_)[strings::msg_params][strings::interaction_mode].asInt()))) {
- LOG4CXX_ERROR_EXT(
- logger_,
- "interactionChoiceSetIDList is empty and InteractionMode=BOTH");
- 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 == (*message_)
- [strings::msg_params][strings::interaction_choice_set_id_list].length()) &&
- (mobile_apis::LayoutMode::KEYBOARD != interaction_layout)) {
- LOG4CXX_ERROR_EXT(
- logger_,
- "interactionChoiceSetIDList is empty and without parameter"
- "interactionLayout=KEYBOARD");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
+ if (0 == choice_set_id_list_length) {
+ if (mobile_apis::LayoutMode::KEYBOARD == interaction_layout) {
+ if (mobile_apis::InteractionMode::BOTH == interaction_mode_) {
+ LOG4CXX_ERROR_EXT(logger_,"interactionChoiceSetIDList is empty,"
+ " InteractionMode=BOTH and"
+ " interactionLayout=KEYBOARD");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ } else {
+ LOG4CXX_ERROR_EXT(logger_,"interactionChoiceSetIDList is empty"
+ " and interactionLayout!=KEYBOARD");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
}
- if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ if (msg_params.keyExists(strings::vr_help)) {
if (mobile_apis::Result::SUCCESS != MessageHelper::VerifyImageVrHelpItems(
- (*message_)[strings::msg_params][strings::vr_help], app)) {
+ msg_params[strings::vr_help], app)) {
LOG4CXX_ERROR_EXT(
logger_,
"MessageHelper::VerifyImageVrHelpItems return INVALID_DATA!");
@@ -153,7 +150,7 @@ void PerformInteractionRequest::Run() {
}
smart_objects::SmartObject& choice_list =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+ msg_params[strings::interaction_choice_set_id_list];
for (size_t i = 0; i < choice_list.length(); ++i) {
if (!app->FindChoiceSet(choice_list[i].asInt())) {
@@ -170,67 +167,31 @@ void PerformInteractionRequest::Run() {
return;
}
- int32_t mode =
- (*message_)[strings::msg_params][strings::interaction_mode].asInt();
-
- app->set_perform_interaction_mode(mode);
-
- interaction_mode_ = static_cast<mobile_apis::InteractionMode::eType>(mode);
-
switch (interaction_mode_) {
case mobile_apis::InteractionMode::BOTH: {
LOG4CXX_INFO(logger_, "Interaction Mode: BOTH");
- if (!CheckChoiceSetVRSynonyms(app)) {
- return;
- }
-
- if (!CheckChoiceSetMenuNames(app)) {
+ if (!CheckChoiceSetVRSynonyms(app) ||
+ !CheckChoiceSetMenuNames(app) ||
+ !CheckVrHelpItemPositions(app)) {
return;
}
-
- if (!CheckVrHelpItemPositions(app)) {
- return;
- }
-
- app->set_perform_interaction_active(correlation_id());
- SendVRPerformInteractionRequest(app);
- SendUIPerformInteractionRequest(app);
break;
}
case mobile_apis::InteractionMode::MANUAL_ONLY: {
LOG4CXX_INFO(logger_, "Interaction Mode: MANUAL_ONLY");
-
- if (!CheckChoiceSetVRSynonyms(app)) {
- return;
- }
-
- if (!CheckChoiceSetMenuNames(app)) {
+ if (!CheckChoiceSetVRSynonyms(app) ||
+ !CheckChoiceSetMenuNames(app) ||
+ !CheckVrHelpItemPositions(app)) {
return;
}
-
- if (!CheckVrHelpItemPositions(app)) {
- return;
- }
-
- app->set_perform_interaction_active(correlation_id());
- SendVRPerformInteractionRequest(app);
- SendUIPerformInteractionRequest(app);
break;
}
case mobile_apis::InteractionMode::VR_ONLY: {
LOG4CXX_INFO(logger_, "Interaction Mode: VR_ONLY");
- if (!CheckChoiceSetVRSynonyms(app)) {
+ if (!CheckChoiceSetVRSynonyms(app) ||
+ !CheckVrHelpItemPositions(app)) {
return;
}
-
- if (!CheckVrHelpItemPositions(app)) {
- return;
- }
-
- // TODO(DK): need to implement timeout
- app->set_perform_interaction_active(correlation_id());
- SendVRPerformInteractionRequest(app);
- SendUIPerformInteractionRequest(app);
break;
}
default: {
@@ -239,27 +200,34 @@ void PerformInteractionRequest::Run() {
}
}
- // TODO(DK): need to implement timeout TTS speak request.
+ app->set_perform_interaction_mode(static_cast<int32_t>(interaction_mode_));
+ app->set_perform_interaction_active(true);
+ // increment amount of active requests
+ ++pi_requests_count_;
+ SendVRPerformInteractionRequest(app);
+ SendUIPerformInteractionRequest(app);
}
void PerformInteractionRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "PerformInteractionRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
switch (event.id()) {
case hmi_apis::FunctionID::UI_OnResetTimeout: {
LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
ApplicationManagerImpl::instance()->updateRequestTimeout(connection_key(),
- correlation_id(),
- default_timeout());
+ correlation_id(),
+ default_timeout());
break;
}
case hmi_apis::FunctionID::UI_PerformInteraction: {
LOG4CXX_INFO(logger_, "Received UI_PerformInteraction event");
+ ui_response_recived_ = true;
ProcessPerformInteractionResponse(event.smart_object());
break;
}
case hmi_apis::FunctionID::VR_PerformInteraction: {
- LOG4CXX_INFO(logger_, "Received TTS_PerformInteraction");
+ LOG4CXX_INFO(logger_, "Received VR_PerformInteraction");
+ vr_response_recived_ = true;
ProcessVRResponse(event.smart_object());
break;
}
@@ -271,11 +239,11 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) {
}
void PerformInteractionRequest::onTimeOut() {
- LOG4CXX_INFO(logger_, "PerformInteractionRequest::onTimeOut");
+ LOG4CXX_AUTO_TRACE(logger_);
switch (interaction_mode_) {
case mobile_apis::InteractionMode::BOTH: {
- if (true == vr_response_recived) {
+ if (true == vr_response_recived_) {
unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
DisablePerformInteraction();
CommandRequestImpl::onTimeOut();
@@ -308,37 +276,56 @@ void PerformInteractionRequest::onTimeOut() {
void PerformInteractionRequest::ProcessVRResponse(
const smart_objects::SmartObject& message) {
- LOG4CXX_INFO(logger_, "PerformInteractionRequest::ProcessVRResponse");
- const uint32_t app_id = connection_key();
- ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis;
+ using namespace mobile_apis::Result;
+ using namespace smart_objects;
+
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
if (!app.get()) {
LOG4CXX_ERROR(logger_, "NULL pointer");
return;
}
- vr_response_recived = true;
- vr_perform_interaction_code_ = static_cast<mobile_apis::Result::eType>(
+ vr_perform_interaction_code_ = static_cast<eType>(
message[strings::params][hmi_response::code].asInt());
- if (mobile_apis::Result::ABORTED == vr_perform_interaction_code_ ||
- mobile_apis::Result::TIMED_OUT == vr_perform_interaction_code_) {
+ if (ABORTED == vr_perform_interaction_code_ ||
+ TIMED_OUT == vr_perform_interaction_code_) {
LOG4CXX_INFO(logger_, "VR response aborted");
- if (mobile_apis::InteractionMode::VR_ONLY == interaction_mode_) {
+ if (InteractionMode::VR_ONLY == interaction_mode_) {
LOG4CXX_INFO(logger_, "Aborted or Timeout Send Close Popup");
TerminatePerformInteraction();
SendResponse(false, vr_perform_interaction_code_);
return;
} else {
LOG4CXX_INFO(logger_, "Update timeout for UI");
- ApplicationManagerImpl::instance()->updateRequestTimeout(connection_key(),
- correlation_id(),
- default_timeout());
+ ApplicationManagerImpl::instance()->
+ updateRequestTimeout(connection_key(),
+ correlation_id(),
+ default_timeout());
return;
}
}
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- smart_objects::SmartObject* ptr_msg_params = NULL;
+ if (REJECTED == vr_perform_interaction_code_) {
+ LOG4CXX_INFO(logger_, "VR had been rejected.");
+ TerminatePerformInteraction();
+ SendResponse(false, vr_perform_interaction_code_);
+ return;
+ }
+
+ if (SUCCESS == vr_perform_interaction_code_ &&
+ InteractionMode::MANUAL_ONLY == interaction_mode_) {
+ LOG4CXX_INFO(logger_, "VR response SUCCESS in MANUAL_ONLY mode " <<
+ "Wait for UI response");
+ // in case MANUAL_ONLY mode VR.PI SUCCESS just return
+ return;
+ }
+
+ SmartObject msg_params = SmartObject(SmartType_Map);
+ SmartObject* ptr_msg_params = NULL;
if (message[strings::msg_params].keyExists(strings::choice_id)) {
if (CheckChoiceIDFromResponse(
app, message[strings::msg_params][strings::choice_id].asInt())) {
@@ -348,22 +335,21 @@ void PerformInteractionRequest::ProcessVRResponse(
} else {
LOG4CXX_ERROR(logger_, "Wrong choiceID was received from HMI");
TerminatePerformInteraction();
- SendResponse(false, mobile_apis::Result::GENERIC_ERROR,
- "Wrong choiceID was received from HMI");
+ SendResponse(false, GENERIC_ERROR,"Wrong choiceID was received from HMI");
return;
}
}
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- if (mobile_apis::Result::UNSUPPORTED_RESOURCE ==
- vr_perform_interaction_code_) {
+ eType result_code = INVALID_ENUM;
+
+ if (UNSUPPORTED_RESOURCE == vr_perform_interaction_code_) {
LOG4CXX_INFO(logger_, "VR response WARNINGS");
- result_code = mobile_apis::Result::WARNINGS;
+ result_code = WARNINGS;
} else {
LOG4CXX_INFO(logger_, "VR response SUCCESS");
- result_code = mobile_apis::Result::SUCCESS;
+ result_code = SUCCESS;
msg_params[strings::trigger_source] =
- static_cast<int32_t>(mobile_apis::TriggerSource::TS_VR);
+ static_cast<int32_t>(TriggerSource::TS_VR);
ptr_msg_params = &msg_params;
}
TerminatePerformInteraction();
@@ -372,60 +358,57 @@ void PerformInteractionRequest::ProcessVRResponse(
void PerformInteractionRequest::ProcessPerformInteractionResponse(
const smart_objects::SmartObject& message) {
- LOG4CXX_INFO(logger_,
- "PerformInteractionRequest::ProcessPerformInteractionResponse");
- const uint32_t app_id = connection_key();
- ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(connection_key());
if (!app.get()) {
LOG4CXX_ERROR(logger_, "NULL pointer");
return;
}
- ui_response_recived = true;
+
+ bool result = false;
+ std::string info;
smart_objects::SmartObject msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params = message[strings::msg_params];
- bool result = false;
mobile_apis::Result::eType result_code =
GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asUInt()));
- if ((mobile_apis::Result::SUCCESS == result_code) ||
- (mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code)) {
- if (message[strings::msg_params].keyExists(strings::choice_id) &&
- !(CheckChoiceIDFromResponse(
- app, message[strings::msg_params][strings::choice_id].asInt()))) {
- DisablePerformInteraction();
- SendResponse(false, mobile_apis::Result::GENERIC_ERROR,
- "Wrong choiceID was received from HMI");
- return;
- }
- if (message[strings::msg_params].keyExists(strings::manual_text_entry)) {
- msg_params[strings::trigger_source] = mobile_apis::TriggerSource::TS_KEYBOARD;
- } else {
- msg_params[strings::trigger_source] = mobile_apis::TriggerSource::TS_MENU;
- }
- DisablePerformInteraction();
+ if (mobile_apis::Result::SUCCESS == result_code) {
result = true;
- } else if (mobile_apis::Result::REJECTED == result_code) {
- LOG4CXX_ERROR(logger_, "Request was rejected");
}
- const char* return_info = NULL;
+ if (mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) {
+ result = true;
+ result_code = mobile_apis::Result::WARNINGS;
+ info = "Unsupported phoneme type was sent in an item";
+ }
+
if (result) {
- if (mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) {
- result_code = mobile_apis::Result::WARNINGS;
- return_info =
- std::string("Unsupported phoneme type sent in any item").c_str();
+ // result code must be GENERIC_ERROR in case wrong choice_id
+ if (message[strings::msg_params].keyExists(strings::choice_id)) {
+ if (!CheckChoiceIDFromResponse(app, message[strings::msg_params]
+ [strings::choice_id].asInt())) {
+ result_code = mobile_apis::Result::GENERIC_ERROR;
+ info = "Wrong choiceID was received from HMI";
+ } else {
+ msg_params = message[strings::msg_params];
+ msg_params[strings::trigger_source] = mobile_apis::TriggerSource::TS_MENU;
+ }
+ } else if (message[strings::msg_params].keyExists(strings::manual_text_entry)) {
+ msg_params = message[strings::msg_params];
+ msg_params[strings::trigger_source] = mobile_apis::TriggerSource::TS_KEYBOARD;
}
}
- if (mobile_apis::Result::TIMED_OUT == result_code) {
- DisablePerformInteraction();
- }
+ DisablePerformInteraction();
- SendResponse(result, result_code, return_info, &(msg_params));
+ const char* return_info = (info.empty()) ? NULL : info.c_str();
+ const smart_objects::SmartObject* response_params = (msg_params.empty()) ? NULL : &msg_params;
+ SendResponse(result, result_code, return_info, response_params);
}
void PerformInteractionRequest::SendUIPerformInteractionRequest(
@@ -475,7 +458,8 @@ void PerformInteractionRequest::SendUIPerformInteractionRequest(
choice_set_id_list[i].asInt());
if (choice_set) {
// save perform interaction choice set
- app->AddPerformInteractionChoiceSet(choice_set_id_list[i].asInt(),
+ 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) {
@@ -565,6 +549,7 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest(
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() +
profile::Profile::instance()->tts_delimiter();
msg_params[strings::help_prompt][index++] = item;
@@ -745,14 +730,18 @@ void PerformInteractionRequest::DisablePerformInteraction() {
}
if (app->is_perform_interaction_active()) {
- app->set_perform_interaction_active(0);
- app->set_perform_interaction_mode(-1);
- app->DeletePerformInteractionChoiceSetMap();
+ // 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_INFO(logger_, "PerformInteractionRequest::IsWhiteSpaceExist");
+ LOG4CXX_AUTO_TRACE(logger_);
const char* str = NULL;
str = (*message_)[strings::msg_params][strings::initial_text].asCharArray();
@@ -847,18 +836,24 @@ void PerformInteractionRequest::TerminatePerformInteraction() {
bool PerformInteractionRequest::CheckChoiceIDFromResponse(
ApplicationSharedPtr app, int32_t choice_id) {
- LOG4CXX_INFO(logger_, "PerformInteractionRequest::CheckChoiceIDFromResponse");
- const PerformChoiceSetMap& choice_set_map = app
- ->performinteraction_choice_set_map();
-
- for (PerformChoiceSetMap::const_iterator it = choice_set_map.begin();
- choice_set_map.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;
+ 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;
+ }
}
}
}
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
index 4ceb4ce3b..59d706926 100644
--- a/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc
+++ b/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc
@@ -47,7 +47,7 @@ PerformInteractionResponse::~PerformInteractionResponse() {
}
void PerformInteractionResponse::Run() {
- LOG4CXX_INFO(logger_, "PerformInteractionResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index 1da7e08e4..88743e366 100644
--- a/src/components/application_manager/src/commands/mobile/put_file_request.cc
+++ b/src/components/application_manager/src/commands/mobile/put_file_request.cc
@@ -55,7 +55,7 @@ PutFileRequest::~PutFileRequest() {
}
void PutFileRequest::Run() {
- LOG4CXX_INFO(logger_, "PutFileRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr application =
ApplicationManagerImpl::instance()->application(connection_key());
@@ -224,7 +224,7 @@ void PutFileRequest::Run() {
break;
}
default:
- LOG4CXX_INFO(logger_, "Save in unsuccessful. Result = " << save_result);
+ LOG4CXX_WARN(logger_, "Save in unsuccessful. Result = " << save_result);
SendResponse(false, save_result, "Can't save file", &response_params);
break;
}
@@ -232,7 +232,7 @@ void PutFileRequest::Run() {
void PutFileRequest::SendOnPutFileNotification() {
LOG4CXX_INFO(logger_, "SendOnPutFileNotification" );
- smart_objects::SmartObject* notification = new smart_objects::SmartObject(
+ smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject(
smart_objects::SmartType_Map);
smart_objects::SmartObject& message = *notification;
@@ -250,7 +250,7 @@ void PutFileRequest::SendOnPutFileNotification() {
message[strings::msg_params][strings::length] = length_;
message[strings::msg_params][strings::persistent_file] = is_persistent_file_;
message[strings::msg_params][strings::file_type] = file_type_;
- ApplicationManagerImpl::instance()->ManageHMICommand(&message);
+ ApplicationManagerImpl::instance()->ManageHMICommand(notification);
}
} // namespace commands
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
index 4ab950d7a..52598fda1 100644
--- a/src/components/application_manager/src/commands/mobile/put_file_response.cc
+++ b/src/components/application_manager/src/commands/mobile/put_file_response.cc
@@ -48,7 +48,7 @@ PutFileResponse::~PutFileResponse() {
}
void PutFileResponse::Run() {
- LOG4CXX_INFO(logger_, "PutFileResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
uint32_t app_id = (*message_)[strings::params][strings::connection_key]
.asUInt();
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
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
index 1de080df4..18f43f12c 100644
--- a/src/components/application_manager/src/commands/mobile/read_did_request.cc
+++ b/src/components/application_manager/src/commands/mobile/read_did_request.cc
@@ -49,7 +49,7 @@ ReadDIDRequest::~ReadDIDRequest() {
}
void ReadDIDRequest::Run() {
- LOG4CXX_INFO(logger_, "ReadDIDRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
uint32_t app_id = (*message_)[strings::params][strings::connection_key]
.asUInt();
@@ -64,12 +64,6 @@ void ReadDIDRequest::Run() {
return;
}
- if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) {
- SendResponse(false, mobile_apis::Result::REJECTED);
- LOG4CXX_ERROR(logger_, "Rejected");
- return;
- }
-
if (app->IsCommandLimitsExceeded(
static_cast<mobile_apis::FunctionID::eType>(function_id()),
application_manager::TLimitSource::CONFIG_FILE)) {
@@ -96,7 +90,7 @@ void ReadDIDRequest::Run() {
}
void ReadDIDRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "ReadDIDRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
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
index 888b59075..1133fe89e 100644
--- a/src/components/application_manager/src/commands/mobile/read_did_response.cc
+++ b/src/components/application_manager/src/commands/mobile/read_did_response.cc
@@ -46,7 +46,7 @@ ReadDIDResponse::~ReadDIDResponse() {
}
void ReadDIDResponse::Run() {
- LOG4CXX_INFO(logger_, "ReadDIDResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index a035e86f2..36b2c27f7 100644
--- 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
@@ -1,6 +1,6 @@
-/*
+/*
- Copyright (c) 2013, Ford Motor Company
+ Copyright (c) 2015, Ford Motor Company
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -116,6 +116,18 @@ struct CheckMissedTypes {
const policy::StringArray& policy_app_types_;
std::string& log_;
};
+
+struct IsSameNickname {
+ IsSameNickname(const std::string& app_id):
+ app_id_(app_id) {
+ }
+ bool operator()(const policy::StringArray::value_type nickname) const {
+ return !strcasecmp(app_id_.c_str(), nickname.c_str());
+ }
+
+private:
+ const std::string& app_id_;
+};
}
namespace application_manager {
@@ -124,14 +136,15 @@ namespace commands {
RegisterAppInterfaceRequest::RegisterAppInterfaceRequest(
const MessageSharedPtr& message)
- : CommandRequestImpl(message) {
+ : CommandRequestImpl(message),
+ result_checking_app_hmi_type_(mobile_apis::Result::INVALID_ENUM) {
}
RegisterAppInterfaceRequest::~RegisterAppInterfaceRequest() {
}
bool RegisterAppInterfaceRequest::Init() {
- LOG4CXX_INFO(logger_, "RegisterAppInterfaceRequest::Init");
+ LOG4CXX_AUTO_TRACE(logger_);
return true;
}
@@ -139,17 +152,31 @@ void RegisterAppInterfaceRequest::Run() {
LOG4CXX_INFO(logger_, "RegisterAppInterfaceRequest::Run " << connection_key());
// Fix problem with SDL and HMI HTML. This problem is not actual for HMI PASA.
- // Flag conditional compilation "CUSTOMER_PASA" is used in order to exclude hit code
+ // Flag conditional compilation specific to customer is used in order to exclude hit code
// to RTC
- if (true == profile::Profile::instance()->launch_hmi()) {
- // wait till HMI started
- while (!ApplicationManagerImpl::instance()->IsHMICooperating()) {
- sleep(1);
- // TODO(DK): timer_->StartWait(1);
- ApplicationManagerImpl::instance()->updateRequestTimeout(connection_key(),
- correlation_id(),
- default_timeout());
- }
+ // FIXME(EZamakhov): on shutdown - get freez
+
+ // wait till HMI started
+ while (ApplicationManagerImpl::exists() &&
+ !ApplicationManagerImpl::instance()->IsStopping() &&
+ !ApplicationManagerImpl::instance()->IsHMICooperating()) {
+ LOG4CXX_DEBUG(logger_, "Waiting for the HMI... conn_key="
+ << connection_key() << ", correlation_id=" << correlation_id()
+ << ", default_timeout=" << default_timeout()
+ << ", thread=" << pthread_self());
+ ApplicationManagerImpl::instance()->updateRequestTimeout(connection_key(),
+ correlation_id(),
+ default_timeout());
+ sleep(1);
+ // TODO(DK): timer_->StartWait(1);
+ }
+
+ if (!ApplicationManagerImpl::exists()) {
+ LOG4CXX_WARN(logger_, "The ApplicationManager doesn't exist!");
+ return;
+ } else if (ApplicationManagerImpl::instance()->IsStopping()) {
+ LOG4CXX_WARN(logger_, "The ApplicationManager is stopping!");
+ return;
}
const std::string mobile_app_id = (*message_)[strings::msg_params][strings::app_id]
@@ -189,13 +216,6 @@ void RegisterAppInterfaceRequest::Run() {
return;
}
- mobile_apis::Result::eType restriction_result = CheckRestrictions();
- if (mobile_apis::Result::SUCCESS != restriction_result) {
- LOG4CXX_ERROR_EXT(logger_, "Param names restrictions check failed.");
- SendResponse(false, restriction_result);
- return;
- }
-
if (IsWhiteSpaceExist()) {
LOG4CXX_INFO(logger_,
"Incoming register app interface has contains \t\n \\t \\n");
@@ -214,19 +234,6 @@ void RegisterAppInterfaceRequest::Run() {
msg_params[strings::app_name].asString() <<
" hasn't been registered!");
} else {
-
- // For resuming application need to restore hmi_app_id from resumeCtrl
- const std::string mobile_app_id = msg_params[strings::app_id].asString();
- ResumeCtrl& resumer = ApplicationManagerImpl::instance()->resume_controller();
-
- // there is side affect with 2 mobile app with the same mobile app_id
- if (resumer.IsApplicationSaved(mobile_app_id)) {
- app->set_hmi_application_id(resumer.GetHMIApplicationID(mobile_app_id));
- } else {
- app->set_hmi_application_id(
- ApplicationManagerImpl::instance()->GenerateNewHMIAppID());
- }
-
app->set_is_media_application(
msg_params[strings::is_media_application].asBool());
@@ -254,7 +261,7 @@ void RegisterAppInterfaceRequest::Run() {
if (mobile_apis::AppHMIType::NAVIGATION ==
static_cast<mobile_apis::AppHMIType::eType>(
app_type.getElement(i).asUInt())) {
- app->set_allowed_support_navigation(true);
+ app->set_is_navi(true);
}
if (mobile_apis::AppHMIType::COMMUNICATION ==
static_cast<mobile_apis::AppHMIType::eType>(
@@ -272,7 +279,7 @@ void RegisterAppInterfaceRequest::Run() {
application_manager::MessageHelper::GetDeviceInfoForHandle(handle,
&dev_params);
policy::DeviceInfo device_info;
- device_info.connection_type = dev_params.device_connection_type;
+ device_info.AdoptDeviceType(dev_params.device_connection_type);
if (msg_params.keyExists(strings::device_info)) {
FillDeviceInfo(&device_info);
}
@@ -281,34 +288,15 @@ void RegisterAppInterfaceRequest::Run() {
device_info);
SendRegisterAppInterfaceResponseToMobile();
- policy::PolicyHandler::instance()->PTExchangeAtRegistration(mobile_app_id);
- }
-}
-
-void RegisterAppInterfaceRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "RegisterAppInterfaceRequest::on_event");
- switch (event.id()) {
- case hmi_apis::FunctionID::TTS_Speak: {
- const smart_objects::SmartObject& message = event.smart_object();
-
- mobile_apis::Result::eType tts_result =
- static_cast<mobile_apis::Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- SendRegisterAppInterfaceResponseToMobile(tts_result);
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
+ MessageHelper::SendLockScreenIconUrlNotification(
+ (*message_)[strings::params][strings::connection_key].asInt());
}
}
void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
mobile_apis::Result::eType result) {
- smart_objects::SmartObject* params = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
ApplicationManagerImpl* app_manager = ApplicationManagerImpl::instance();
const HMICapabilities& hmi_capabilities = app_manager->hmi_capabilities();
@@ -316,14 +304,12 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
ApplicationSharedPtr application =
ApplicationManagerImpl::instance()->application(key);
- if (!application.valid()) {
+ if (!application) {
LOG4CXX_ERROR(logger_, "There is no application for such connection key" <<
key);
return;
}
- smart_objects::SmartObject& response_params = *params;
-
response_params[strings::sync_msg_version][strings::major_version] =
APIVersion::kAPIV3;
response_params[strings::sync_msg_version][strings::minor_version] =
@@ -427,8 +413,15 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
*hmi_capabilities.preset_bank_capabilities();
}
if (hmi_capabilities.hmi_zone_capabilities()) {
- response_params[hmi_response::hmi_zone_capabilities] =
- *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.speech_capabilities()) {
response_params[strings::speech_capabilities] =
@@ -439,8 +432,15 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
*hmi_capabilities.vr_capabilities();
}
if (hmi_capabilities.audio_pass_thru_capabilities()) {
- response_params[strings::audio_pass_thru_capabilities] =
- *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();
+ }
}
if (hmi_capabilities.vehicle_type()) {
response_params[hmi_response::vehicle_type] =
@@ -462,18 +462,29 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
}
}
+ 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::sdl_version] =
+ profile::Profile::instance()->sdl_version();
+ response_params[strings::system_software_version] =
+ hmi_capabilities.ccpu_version();
+
ResumeCtrl& resumer = ApplicationManagerImpl::instance()->resume_controller();
- uint32_t hash_id = 0;
+ std::string hash_id = "";
- const char* add_info = "";
- const bool resumption = (*message_)[strings::msg_params].keyExists(strings::hash_id);
+ std::string add_info("");
+ bool resumption = (*message_)[strings::msg_params].keyExists(strings::hash_id);
bool need_restore_vr = resumption;
if (resumption) {
- hash_id = (*message_)[strings::msg_params][strings::hash_id].asUInt();
+ hash_id = (*message_)[strings::msg_params][strings::hash_id].asString();
if (!resumer.CheckApplicationHash(application, hash_id)) {
- LOG4CXX_WARN(logger_, "Hash does not matches");
+ LOG4CXX_WARN(logger_, "Hash does not match");
result = mobile_apis::Result::RESUME_FAILED;
- add_info = "Hash does not matches";
+ add_info = "Hash does not match";
need_restore_vr = false;
} else if (!resumer.CheckPersistenceFilesForResumption(application)) {
LOG4CXX_WARN(logger_, "Persistent data is missed");
@@ -484,35 +495,53 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
add_info = " Resume Succeed";
}
}
+ if ((mobile_apis::Result::SUCCESS == result) &&
+ (mobile_apis::Result::INVALID_ENUM != result_checking_app_hmi_type_)) {
+ add_info += response_info_;
+ result = result_checking_app_hmi_type_;
+ }
+
+ // in case application exist in resumption we need to send resumeVrgrammars
+ if (false == resumption) {
+ resumption = resumer.IsApplicationSaved(application->mobile_app_id());
+ }
- SendResponse(true, result, add_info, params);
MessageHelper::SendOnAppRegisteredNotificationToHMI(*(application.get()),
resumption,
need_restore_vr);
- MessageHelper::SendChangeRegistrationRequestToHMI(application);
+ SendResponse(true, result, add_info.c_str(), &response_params);
+
+ // Default HMI level should be set before any permissions validation, since it
+ // relies on HMI level.
+ resumer.SetupDefaultHMILevel(application);
if (result != mobile_apis::Result::RESUME_FAILED) {
resumer.StartResumption(application, hash_id);
} else {
resumer.StartResumptionOnlyHMILevel(application);
}
+
+ // By default app subscribed to CUSTOM_BUTTON
+ // Need to send notification to HMI
+ SendSubscribeCustomButtonNotification();
+ MessageHelper::SendChangeRegistrationRequestToHMI(application);
}
mobile_apis::Result::eType
RegisterAppInterfaceRequest::CheckCoincidence() {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& msg_params =
(*message_)[strings::msg_params];
ApplicationManagerImpl::ApplicationListAccessor accessor;
- const std::set<ApplicationSharedPtr> applications = accessor.applications();
- std::set<ApplicationSharedPtr>::const_iterator it = applications.begin();
+ ApplicationManagerImpl::ApplictionSetConstIt it =
+ accessor.begin();
const std::string app_name = msg_params[strings::app_name].asString();
- for (; applications.end() != it; ++it) {
+ for (; accessor.end() != it; ++it) {
// name check
const std::string& cur_name = (*it)->name();
@@ -573,9 +602,10 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() {
}
if (!app_nicknames.empty()) {
- policy::StringArray::const_iterator it = std::find(
- app_nicknames.begin(), app_nicknames.end(),
+ IsSameNickname compare(
message[strings::msg_params][strings::app_name].asString());
+ 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.");
@@ -604,7 +634,7 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() {
if (!log.empty()) {
response_info_ = "Following AppHMITypes are not present in policy "
"table:" + log;
- result = mobile_apis::Result::WARNINGS;
+ result_checking_app_hmi_type_ = mobile_apis::Result::WARNINGS;
}
}
// Replace AppHMITypes in request with values allowed by policy table
@@ -657,91 +687,22 @@ void RegisterAppInterfaceRequest::FillDeviceInfo(
}
}
-mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckRestrictions() const {
-
- LOG4CXX_INFO(logger_, "RegisterAppInterfaceRequest::CheckRestrictions");
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- const std::string& app_name = msg_params[strings::app_name].asString();
-
- if (ClearParamName(app_name).empty()) {
- printf("Application name is empty.\n");
- return mobile_apis::Result::INVALID_DATA;
- }
-
- if ((app_name[0] == '\n') ||
- ((app_name[0] == '\\') && (app_name[1] == 'n'))) {
-
- printf("Application name has invalid characters.");
- return mobile_apis::Result::INVALID_DATA;
- }
-
- if (msg_params.keyExists(strings::tts_name)) {
-
- const smart_objects::SmartArray* tts =
- msg_params[strings::tts_name].asArray();
-
- smart_objects::SmartArray::const_iterator it = tts->begin();
- smart_objects::SmartArray::const_iterator it_end = tts->end();
-
- for (; it != it_end; ++it) {
-
- const std::string& tts_name = (*it)[strings::text].asString();
-
- if (ClearParamName(tts_name).empty()) {
- printf("TTS value is empty.");
- return mobile_apis::Result::INVALID_DATA;
- }
-
- if ((tts_name[0] == '\n') ||
- ((tts_name[0] == '\\') && (tts_name[1] == 'n'))) {
-
- printf("TTS value(s) has invalid characters.");
- return mobile_apis::Result::INVALID_DATA;
- }
- }
- }
-
- return mobile_apis::Result::SUCCESS;
-}
-
-std::string
-RegisterAppInterfaceRequest::ClearParamName(std::string param_name) const {
-
- // Expecting for chars different from newlines and spaces in the appName
- //
- // There is an agreement, that "\n" is not allowed symbols, so we have to
- // check for this case also
-
- std::string newline = "\\n";
- while (std::string::npos != param_name.find(newline)) {
- param_name.erase(param_name.find(newline), newline.length());
- }
-
- std::string::iterator param_name_new_end =
- std::remove_if(param_name.begin(), param_name.end(), ::isspace);
-
- return std::string(param_name.begin(), param_name_new_end);
-}
-
bool RegisterAppInterfaceRequest::IsApplicationWithSameAppIdRegistered() {
LOG4CXX_INFO(logger_, "RegisterAppInterfaceRequest::"
"IsApplicationWithSameAppIdRegistered");
const std::string mobile_app_id = (*message_)[strings::msg_params]
- [strings::app_id].asString();
+ [strings::app_id].asString();
ApplicationManagerImpl::ApplicationListAccessor accessor;
- const std::set<ApplicationSharedPtr> applications = accessor.applications();
+ const ApplicationManagerImpl::ApplictionSet applications = accessor.applications();
- std::set<ApplicationSharedPtr>::const_iterator it = applications.begin();
- std::set<ApplicationSharedPtr>::const_iterator it_end = applications.end();
+ ApplicationManagerImpl::ApplictionSetConstIt it = applications.begin();
+ ApplicationManagerImpl::ApplictionSetConstIt it_end = applications.end();
for (; it != it_end; ++it) {
- if (mobile_app_id == (*it)->mobile_app_id()->asString()) {
+ if (!strcasecmp(mobile_app_id.c_str(),(*it)->mobile_app_id().c_str())) {
return true;
}
}
@@ -750,7 +711,7 @@ bool RegisterAppInterfaceRequest::IsApplicationWithSameAppIdRegistered() {
}
bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() {
- LOG4CXX_INFO(logger_, "RegisterAppInterfaceRequest::IsWhiteSpaceExist");
+ LOG4CXX_AUTO_TRACE(logger_);
const char* str = NULL;
str = (*message_)[strings::msg_params][strings::app_name].asCharArray();
@@ -880,6 +841,35 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() {
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);
+}
+
} // 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
index fe6f3a925..b31879585 100644
--- 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
@@ -42,7 +42,7 @@ namespace application_manager {
namespace commands {
void RegisterAppInterfaceResponse::Run() {
- LOG4CXX_INFO(logger_, "RegisterAppInterfaceResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
bool success = (*message_)[strings::msg_params][strings::success].asBool();
@@ -60,25 +60,24 @@ void RegisterAppInterfaceResponse::Run() {
// 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
- uint32_t connection_key =
- (*message_)[strings::params][strings::connection_key].asUInt();
application_manager::ApplicationConstSharedPtr app =
application_manager::ApplicationManagerImpl::instance()->
- application(connection_key);
+ application(connection_key());
if (app.valid()) {
policy::PolicyHandler *policy_handler = policy::PolicyHandler::instance();
- std::string mobile_app_id = app->mobile_app_id()->asString();
+ std::string mobile_app_id = app->mobile_app_id();
policy_handler->AddApplication(mobile_app_id);
- SetHeartBeatTimeout(connection_key, mobile_app_id);
+ SetHeartBeatTimeout(connection_key(), mobile_app_id);
}
}
void RegisterAppInterfaceResponse::SetHeartBeatTimeout(
uint32_t connection_key, const std::string& mobile_app_id) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
policy::PolicyHandler *policy_handler = policy::PolicyHandler::instance();
if (policy_handler->PolicyEnabled()) {
- const int32_t timeout = policy_handler->HeartBeatTimeout(mobile_app_id);
+ const int32_t timeout = policy_handler->HeartBeatTimeout(mobile_app_id) /
+ date_time::DateTime::MILLISECONDS_IN_SECOND;
if (timeout > 0) {
application_manager::ApplicationManagerImpl::instance()->
connection_handler()->SetHeartBeatTimeout(connection_key, timeout);
@@ -86,7 +85,6 @@ void RegisterAppInterfaceResponse::SetHeartBeatTimeout(
} else {
LOG4CXX_INFO(logger_, "Policy is turn off");
}
- LOG4CXX_TRACE_EXIT(logger_);
}
} // namespace commands
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
index 5e62b789d..2e1483eff 100644
--- 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
@@ -58,7 +58,7 @@ ResetGlobalPropertiesRequest::~ResetGlobalPropertiesRequest() {
}
void ResetGlobalPropertiesRequest::Run() {
- LOG4CXX_INFO(logger_, "ResetGlobalPropertiesRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
uint32_t app_id = (*message_)[strings::params][strings::connection_key].asUInt();
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
@@ -125,7 +125,7 @@ void ResetGlobalPropertiesRequest::Run() {
smart_objects::SmartType_Map);
if (vr_help_title_items) {
- smart_objects::SmartObject* vr_help = MessageHelper::CreateAppVrHelp(app);
+ smart_objects::SmartObjectSPtr vr_help = MessageHelper::CreateAppVrHelp(app);
if (!vr_help) {
return;
}
@@ -236,38 +236,41 @@ bool ResetGlobalPropertiesRequest::ResetVrHelpTitleItems(
}
void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "ResetGlobalPropertiesRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetGlobalProperties: {
- LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
- is_ui_received_ = true;
- ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- break;
- }
- case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
- LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event");
- is_tts_received_ = true;
- tts_result_ = 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;
- }
+ case hmi_apis::FunctionID::UI_SetGlobalProperties: {
+ LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
+ is_ui_received_ = true;
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
+ LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event");
+ is_tts_received_ = true;
+ tts_result_ = 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;
+ }
}
if (!IsPendingResponseExist()) {
bool result = ((hmi_apis::Common_Result::SUCCESS == ui_result_)
- && (hmi_apis::Common_Result::SUCCESS == tts_result_ ||
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_))
- || ((hmi_apis::Common_Result::SUCCESS == ui_result_)
- && (hmi_apis::Common_Result::INVALID_ENUM == tts_result_))
- || ((hmi_apis::Common_Result::INVALID_ENUM == ui_result_)
- && (hmi_apis::Common_Result::SUCCESS == tts_result_));
+ && (hmi_apis::Common_Result::SUCCESS == tts_result_ ||
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_))
+ || ((hmi_apis::Common_Result::SUCCESS == ui_result_)
+ && (hmi_apis::Common_Result::INVALID_ENUM == tts_result_))
+ || ((hmi_apis::Common_Result::INVALID_ENUM == ui_result_)
+ && (hmi_apis::Common_Result::SUCCESS == tts_result_));
mobile_apis::Result::eType result_code;
const char* return_info = NULL;
@@ -278,21 +281,30 @@ void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
return_info = std::string("Unsupported phoneme type sent in a prompt").c_str();
} else {
result_code = static_cast<mobile_apis::Result::eType>(
- std::max(ui_result_, tts_result_));
+ std::max(ui_result_, tts_result_));
}
} else {
result_code = static_cast<mobile_apis::Result::eType>(
- std::max(ui_result_, tts_result_));
+ std::max(ui_result_, tts_result_));
}
- ApplicationSharedPtr application =
- ApplicationManagerImpl::instance()->application(connection_key());
SendResponse(result, static_cast<mobile_apis::Result::eType>(result_code),
- return_info, &(message[strings::msg_params]));
- application->UpdateHash();
+ return_info, &(message[strings::msg_params]));
+
+ if (!application) {
+ LOG4CXX_DEBUG(logger_, "NULL pointer");
+ return;
+ }
+
+ if (result) {
+ application->UpdateHash();
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "unable to find application: " << connection_key());
}
}
+
bool ResetGlobalPropertiesRequest::IsPendingResponseExist() {
return is_ui_send_ != is_ui_received_ || is_tts_send_ != is_tts_received_;
}
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
index aeacabf9d..8e562956a 100644
--- 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
@@ -47,7 +47,7 @@ ResetGlobalPropertiesResponse::~ResetGlobalPropertiesResponse() {
}
void ResetGlobalPropertiesResponse::Run() {
- LOG4CXX_INFO(logger_, "ResetGlobalPropertiesResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index 5b3cfa67a..10f080e0e 100644
--- a/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc
+++ b/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc
@@ -68,7 +68,7 @@ bool ScrollableMessageRequest::Init() {
}
void ScrollableMessageRequest::Run() {
- LOG4CXX_INFO(logger_, "ScrollableMessageRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application_manager::ApplicationManagerImpl::instance()
->application((*message_)[strings::params][strings::connection_key].asUInt());
@@ -113,7 +113,7 @@ void ScrollableMessageRequest::Run() {
}
void ScrollableMessageRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "ScrollableMessageRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
@@ -133,8 +133,7 @@ void ScrollableMessageRequest::on_event(const event_engine::Event& event) {
HMICapabilities& hmi_capabilities =
ApplicationManagerImpl::instance()->hmi_capabilities();
bool result = false;
- if (mobile_apis::Result::SUCCESS == result_code ||
- mobile_apis::Result::ABORTED == result_code) {
+ if (mobile_apis::Result::SUCCESS == result_code) {
result = true;
} else if ((mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) &&
hmi_capabilities.is_ui_cooperating()) {
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
index d9692359d..212a3ba91 100644
--- a/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc
+++ b/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc
@@ -46,7 +46,7 @@ ScrollableMessageResponse::ScrollableMessageResponse(
}
void ScrollableMessageResponse::Run() {
- LOG4CXX_INFO(logger_, "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 =
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
index b5c2e8a9a..b1c96ebb9 100644
--- a/src/components/application_manager/src/commands/mobile/send_location_request.cc
+++ b/src/components/application_manager/src/commands/mobile/send_location_request.cc
@@ -46,18 +46,41 @@ SendLocationRequest::~SendLocationRequest() {
}
void SendLocationRequest::Run() {
- LOG4CXX_INFO(logger_, "SendLocationRequest::Run");
+ using namespace hmi_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application_manager::ApplicationManagerImpl::instance()
->application(connection_key());
if (!app) {
- LOG4CXX_ERROR_EXT(
- logger_, "An application " << app->name() << " is not registered.");
+ LOG4CXX_ERROR_EXT(logger_,
+ "An application with connection key " << connection_key()
+ << " is not registered.");
SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
return;
}
+ const smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+ std::list<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);
@@ -76,9 +99,13 @@ void SendLocationRequest::Run() {
}
}
+ smart_objects::SmartObject request_msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ request_msg_params = (*message_)[strings::msg_params];
+ request_msg_params[strings::app_id] = app->hmi_app_id();
+
SendHMIRequest(hmi_apis::FunctionID::Navigation_SendLocation,
- &((*message_)[strings::msg_params]),
- true);
+ &request_msg_params, true);
}
void SendLocationRequest::on_event(const event_engine::Event& event) {
@@ -90,7 +117,10 @@ void SendLocationRequest::on_event(const event_engine::Event& event) {
mobile_apis::Result::eType result_code = GetMobileResultCode(
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asUInt()));
- bool result = mobile_apis::Result::SUCCESS == result_code;
+ bool result =
+ mobile_apis::Result::SUCCESS == result_code ||
+ mobile_apis::Result::WARNINGS == result_code ||
+ mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code ;
SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
break;
}
@@ -161,6 +191,44 @@ bool SendLocationRequest::IsWhiteSpaceExist() {
return false;
}
+bool SendLocationRequest::CheckHMICapabilities(std::list<hmi_apis::Common_TextFieldName::eType>& fields_names) {
+ using namespace smart_objects;
+ using namespace hmi_apis;
+
+ if (fields_names.empty()) {
+ return true;
+ }
+
+ ApplicationManagerImpl* instance = ApplicationManagerImpl::instance();
+ const HMICapabilities& hmi_capabilities = instance->hmi_capabilities();
+ if (!hmi_capabilities.is_ui_cooperating()) {
+ LOG4CXX_ERROR_EXT(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::list<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_EXT(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
index a13b67dc0..32756c999 100644
--- a/src/components/application_manager/src/commands/mobile/send_location_response.cc
+++ b/src/components/application_manager/src/commands/mobile/send_location_response.cc
@@ -48,7 +48,7 @@ SendLocationResponse::~SendLocationResponse() {
}
void SendLocationResponse::Run() {
- LOG4CXX_INFO(logger_, "SendLocationResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
new file mode 100644
index 000000000..bd9c9fa0c
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc
@@ -0,0 +1,273 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ 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_request.h"
+#include "application_manager/application_manager_impl.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 {
+
+int8_t SetAppIconRequest::is_icons_saving_enabled_ = -1;
+
+SetAppIconRequest::SetAppIconRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+ if (-1 == is_icons_saving_enabled_) {
+ const std::string path = profile::Profile::instance()->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 =
+ ApplicationManagerImpl::instance()->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 =
+ profile::Profile::instance()->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];
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_SetAppIcon, &msg_params, true);
+}
+
+void SetAppIconRequest::CopyToIconStorage(
+ const std::string& path_to_file) const {
+ if (!profile::Profile::instance()->enable_protocol_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 =
+ profile::Profile::instance()->app_icons_folder();
+ const uint64_t storage_max_size =
+ static_cast<uint64_t>(
+ profile::Profile::instance()->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 =
+ profile::Profile::instance()->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::ApplicationManagerImpl::instance()->
+ 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->mobile_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 =
+ profile::Profile::instance()->app_icons_folder();
+ const uint64_t storage_max_size =
+ static_cast<uint64_t>(
+ profile::Profile::instance()->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& event_message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetAppIcon: {
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ event_message[strings::params][hmi_response::code].asInt());
+
+ bool result = mobile_apis::Result::SUCCESS == result_code;
+
+ if (result) {
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->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, result_code, NULL, &(event_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
new file mode 100644
index 000000000..563490bd4
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/set_app_icon_response.cc
@@ -0,0 +1,56 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ 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"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SetAppIconResponse::SetAppIconResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+SetAppIconResponse::~SetAppIconResponse() {
+}
+
+void SetAppIconResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationManagerImpl::instance()->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
index 60a258328..f3d9e28c0 100644
--- 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
@@ -49,9 +49,9 @@ SetDisplayLayoutRequest::~SetDisplayLayoutRequest() {
}
void SetDisplayLayoutRequest::Run() {
- LOG4CXX_INFO(logger_, "SetDisplayLayoutRequest::Run");
- ApplicationConstSharedPtr app = ApplicationManagerImpl::instance()
- ->application(connection_key());
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationConstSharedPtr app =
+ ApplicationManagerImpl::instance()->application(connection_key());
if (!app) {
LOG4CXX_ERROR(logger_, "Application is not registered");
@@ -66,7 +66,7 @@ void SetDisplayLayoutRequest::Run() {
}
void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "SetDisplayLayoutRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
@@ -77,38 +77,22 @@ void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) {
static_cast<mobile_apis::Result::eType>(
message[strings::params][hmi_response::code].asInt());
bool response_success = mobile_apis::Result::SUCCESS == result_code;
+
+ smart_objects::SmartObject msg_params = message[strings::msg_params];
+
if (response_success) {
HMICapabilities& hmi_capabilities =
ApplicationManagerImpl::instance()->hmi_capabilities();
- if (message[strings::msg_params].keyExists(hmi_response::display_capabilities)) {
- hmi_capabilities.set_display_capabilities(
- message[strings::msg_params][hmi_response::display_capabilities]);
- }
- if (message[strings::msg_params].keyExists(
- hmi_response::soft_button_capabilities)) {
- if (message[strings::msg_params][hmi_response::soft_button_capabilities].getType() ==
- smart_objects::SmartType_Array) {
- hmi_capabilities.set_soft_button_capabilities(
- message[strings::msg_params][hmi_response::soft_button_capabilities][0]);
- } else {
- hmi_capabilities.set_soft_button_capabilities(
- message[strings::msg_params][hmi_response::soft_button_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);
}
}
-
- if (message[strings::msg_params].keyExists(hmi_response::button_capabilities)) {
- hmi_capabilities.set_button_capabilities(
- message[strings::msg_params][hmi_response::button_capabilities]);
- }
-
- if (message[strings::msg_params].keyExists(hmi_response::preset_bank_capabilities)) {
- hmi_capabilities.set_preset_bank_capabilities(
- message[strings::msg_params][hmi_response::preset_bank_capabilities]);
- }
-
}
- SendResponse(response_success, result_code, NULL, &(message[strings::msg_params]));
+ SendResponse(response_success, result_code, NULL, &msg_params);
break;
}
default: {
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
index 51f8c1f35..3844b3bf0 100644
--- 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
@@ -48,7 +48,7 @@ SetDisplayLayoutResponse::~SetDisplayLayoutResponse() {
}
void SetDisplayLayoutResponse::Run() {
- LOG4CXX_INFO(logger_, "SetDisplayLayoutResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
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
index f7216c818..1c0948d07 100644
--- 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
@@ -59,7 +59,7 @@ SetGlobalPropertiesRequest::~SetGlobalPropertiesRequest() {
}
void SetGlobalPropertiesRequest::Run() {
- LOG4CXX_INFO(logger_, "SetGlobalPropertiesRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& msg_params =
(*message_)[strings::msg_params];
@@ -197,7 +197,8 @@ void SetGlobalPropertiesRequest::Run() {
SendHMIRequest(hmi_apis::FunctionID::UI_SetGlobalProperties,
&params, true);
} else if (!is_vr_help_title_present && !is_vr_help_present) {
- const CommandsMap& cmdMap = app->commands_map();
+ const DataAccessor<CommandsMap> accessor = app->commands_map();
+ const CommandsMap& cmdMap = accessor.GetData();
CommandsMap::const_iterator command_it = cmdMap.begin();
int32_t index = 0;
@@ -304,7 +305,7 @@ bool SetGlobalPropertiesRequest::CheckVrHelpItemsOrder() {
}
void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "SetGlobalPropertiesRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(CommandRequestImpl::connection_key());
@@ -332,14 +333,14 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
if (!IsPendingResponseExist()) {
bool result = ((hmi_apis::Common_Result::SUCCESS == ui_result_)
- && (hmi_apis::Common_Result::SUCCESS == tts_result_ ||
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_))
- || ((hmi_apis::Common_Result::SUCCESS == ui_result_ ||
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_)
- && (hmi_apis::Common_Result::INVALID_ENUM == tts_result_))
- || ((hmi_apis::Common_Result::INVALID_ENUM == ui_result_ ||
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_)
- && (hmi_apis::Common_Result::SUCCESS == tts_result_));
+ && (hmi_apis::Common_Result::SUCCESS == tts_result_ ||
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_))
+ || ((hmi_apis::Common_Result::SUCCESS == ui_result_ ||
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_)
+ && (hmi_apis::Common_Result::INVALID_ENUM == tts_result_))
+ || ((hmi_apis::Common_Result::INVALID_ENUM == ui_result_ ||
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_)
+ && (hmi_apis::Common_Result::SUCCESS == tts_result_));
mobile_apis::Result::eType result_code;
const char* return_info = NULL;
@@ -351,18 +352,28 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
std::string("Unsupported phoneme type sent in a prompt").c_str();
} else {
result_code = static_cast<mobile_apis::Result::eType>(
- std::max(ui_result_, tts_result_));
+ std::max(ui_result_, tts_result_));
}
} else {
result_code = static_cast<mobile_apis::Result::eType>(
- std::max(ui_result_, tts_result_));
+ std::max(ui_result_, tts_result_));
}
+ // TODO(AOleynik): APPLINK-15858
ApplicationSharedPtr application =
ApplicationManagerImpl::instance()->application(connection_key());
- SendResponse(result, static_cast<mobile_apis::Result::eType>(result_code),
- return_info, &(message[strings::msg_params]));
- application->UpdateHash();
+
+ SendResponse(result, result_code, return_info,
+ &(message[strings::msg_params]));
+
+ if (!application) {
+ LOG4CXX_DEBUG(logger_, "NULL pointer.");
+ return;
+ }
+
+ if (result) {
+ application->UpdateHash();
+ }
}
}
@@ -383,7 +394,7 @@ bool SetGlobalPropertiesRequest::ValidateConditionalMandatoryParameters(
}
bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
- LOG4CXX_INFO(logger_, "SetGlobalPropertiesRequest::IsWhiteSpaceExist");
+ LOG4CXX_AUTO_TRACE(logger_);
const char* str;
const smart_objects::SmartObject& msg_params =
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
index 5f0b62fb4..759333385 100644
--- 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
@@ -48,7 +48,7 @@ SetGlobalPropertiesResponse::~SetGlobalPropertiesResponse() {
}
void SetGlobalPropertiesResponse::Run() {
- LOG4CXX_INFO(logger_, "SetGlobalPropertiesResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index c9b2eb5ef..536bb755e 100644
--- 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
@@ -49,7 +49,7 @@ SetMediaClockRequest::~SetMediaClockRequest() {
}
void SetMediaClockRequest::Run() {
- LOG4CXX_INFO(logger_, "SetMediaClockRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app =
ApplicationManagerImpl::instance()->application(connection_key());
@@ -81,7 +81,7 @@ void SetMediaClockRequest::Run() {
}
void SetMediaClockRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "SetMediaClockRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
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
index 73923b002..da6f204da 100644
--- 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
@@ -47,7 +47,7 @@ SetMediaClockTimerResponse::~SetMediaClockTimerResponse() {
}
void SetMediaClockTimerResponse::Run() {
- LOG4CXX_INFO(logger_, "SetMediaClockTimerResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index f4e70c53a..1e861d14c 100644
--- 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
@@ -51,7 +51,7 @@ ShowConstantTBTRequest::~ShowConstantTBTRequest() {
}
void ShowConstantTBTRequest::Run() {
- LOG4CXX_INFO(logger_, "ShowConstantTBTRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
(*message_)[strings::params][strings::connection_key].asUInt());
@@ -175,7 +175,7 @@ void ShowConstantTBTRequest::Run() {
void ShowConstantTBTRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "ShowConstantTBTRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
@@ -206,7 +206,7 @@ void ShowConstantTBTRequest::on_event(const event_engine::Event& event) {
}
bool ShowConstantTBTRequest::IsWhiteSpaceExist() {
- LOG4CXX_INFO(logger_, "ShowConstantTBTRequest::IsWhiteSpaceExist");
+ LOG4CXX_AUTO_TRACE(logger_);
const char* str = NULL;
if ((*message_)[strings::msg_params].keyExists(strings::turn_icon)) {
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
index d5539d148..e45cd760d 100644
--- 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
@@ -48,7 +48,7 @@ ShowConstantTBTResponse::~ShowConstantTBTResponse() {
}
void ShowConstantTBTResponse::Run() {
- LOG4CXX_INFO(logger_, "ShowConstantTBTResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
diff --git a/src/components/application_manager/src/commands/mobile/show_request.cc b/src/components/application_manager/src/commands/mobile/show_request.cc
index eeef60101..0a136e0ac 100644
--- a/src/components/application_manager/src/commands/mobile/show_request.cc
+++ b/src/components/application_manager/src/commands/mobile/show_request.cc
@@ -50,7 +50,7 @@ ShowRequest::~ShowRequest() {
}
void ShowRequest::Run() {
- LOG4CXX_INFO(logger_, "ShowRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application_manager::ApplicationManagerImpl::instance()
->application(
@@ -216,7 +216,7 @@ void ShowRequest::Run() {
}
void ShowRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "ShowRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
@@ -251,7 +251,7 @@ void ShowRequest::on_event(const event_engine::Event& event) {
}
bool ShowRequest::CheckStringsOfShowRequest() {
- LOG4CXX_INFO(logger_, "ShowRequest::CheckStringsOfShowRequest");
+ LOG4CXX_AUTO_TRACE(logger_);
const char* str;
if ((*message_)[strings::msg_params].keyExists(strings::main_field_4)) {
diff --git a/src/components/application_manager/src/commands/mobile/show_response.cc b/src/components/application_manager/src/commands/mobile/show_response.cc
index 1f9c59c6f..0c46cdd83 100644
--- a/src/components/application_manager/src/commands/mobile/show_response.cc
+++ b/src/components/application_manager/src/commands/mobile/show_response.cc
@@ -48,7 +48,7 @@ ShowResponse::~ShowResponse() {
}
void ShowResponse::Run() {
- LOG4CXX_INFO(logger_, "ShowResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
diff --git a/src/components/application_manager/src/commands/mobile/slider_request.cc b/src/components/application_manager/src/commands/mobile/slider_request.cc
index 52f3c7dee..78a9bb6aa 100644
--- a/src/components/application_manager/src/commands/mobile/slider_request.cc
+++ b/src/components/application_manager/src/commands/mobile/slider_request.cc
@@ -60,7 +60,7 @@ bool SliderRequest::Init() {
}
void SliderRequest::Run() {
- LOG4CXX_INFO(logger_, "SliderRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr application =
application_manager::ApplicationManagerImpl::instance()->application(
@@ -110,7 +110,7 @@ void SliderRequest::Run() {
}
void SliderRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "SliderRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
const event_engine::Event::EventID event_id = event.id();
@@ -131,18 +131,16 @@ void SliderRequest::on_event(const event_engine::Event& event) {
const int response_code =
message[strings::params][hmi_response::code].asInt();
-
smart_objects::SmartObject response_msg_params = message[strings::msg_params];
- if (response_code == hmi_apis::Common_Result::ABORTED) {
+ if (response_code == hmi_apis::Common_Result::ABORTED &&
+ message[strings::params][strings::data].keyExists(strings::slider_position)) {
//Copy slider_position info to msg_params section
- response_msg_params[strings::slider_position] =
+ response_msg_params[strings::slider_position] =
message[strings::params][strings::data][strings::slider_position];
}
const bool is_response_success =
- (mobile_apis::Result::SUCCESS == response_code) ||
- //Aborted has slider_position data
- (mobile_apis::Result::ABORTED == response_code);
+ (mobile_apis::Result::SUCCESS == response_code);
SendResponse(is_response_success,
mobile_apis::Result::eType(response_code),
diff --git a/src/components/application_manager/src/commands/mobile/slider_response.cc b/src/components/application_manager/src/commands/mobile/slider_response.cc
index bfb6b0a1e..7f0c10b06 100644
--- a/src/components/application_manager/src/commands/mobile/slider_response.cc
+++ b/src/components/application_manager/src/commands/mobile/slider_response.cc
@@ -46,7 +46,7 @@ SliderResponse::~SliderResponse() {
}
void SliderResponse::Run() {
- LOG4CXX_INFO(logger_, "SliderResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
diff --git a/src/components/application_manager/src/commands/mobile/speak_request.cc b/src/components/application_manager/src/commands/mobile/speak_request.cc
index de37e8b49..b2f112a64 100644
--- a/src/components/application_manager/src/commands/mobile/speak_request.cc
+++ b/src/components/application_manager/src/commands/mobile/speak_request.cc
@@ -49,7 +49,7 @@ SpeakRequest::~SpeakRequest() {
}
void SpeakRequest::Run() {
- LOG4CXX_INFO(logger_, "SpeakRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application_manager::ApplicationManagerImpl::instance()
->application(connection_key());
@@ -70,13 +70,13 @@ void SpeakRequest::Run() {
(*message_)[strings::msg_params][strings::app_id] = app->app_id();
(*message_)[strings::msg_params][hmi_request::speak_type] =
- hmi_apis::Common_SpeakType::SPEAK;
+ hmi_apis::Common_MethodName::SPEAK;
SendHMIRequest(hmi_apis::FunctionID::TTS_Speak,
&message_->getElement(strings::msg_params), true);
}
void SpeakRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "SpeakRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
switch (event.id()) {
case hmi_apis::FunctionID::TTS_Speak: {
LOG4CXX_INFO(logger_, "Received TTS_Speak event");
@@ -100,7 +100,7 @@ void SpeakRequest::on_event(const event_engine::Event& event) {
void SpeakRequest::ProcessTTSSpeakResponse(
const smart_objects::SmartObject& message) {
- LOG4CXX_INFO(logger_, "SpeakRequest::ProcessTTSSpeakResponse");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr application = ApplicationManagerImpl::instance()->application(
connection_key());
@@ -134,7 +134,7 @@ void SpeakRequest::ProcessTTSSpeakResponse(
}
bool SpeakRequest::IsWhiteSpaceExist() {
- LOG4CXX_INFO(logger_, "SpeakRequest::IsWhiteSpaceExist");
+ LOG4CXX_AUTO_TRACE(logger_);
const char* str = NULL;
if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
diff --git a/src/components/application_manager/src/commands/mobile/speak_response.cc b/src/components/application_manager/src/commands/mobile/speak_response.cc
index 92b85bbb8..d99b1d095 100644
--- a/src/components/application_manager/src/commands/mobile/speak_response.cc
+++ b/src/components/application_manager/src/commands/mobile/speak_response.cc
@@ -48,7 +48,7 @@ SpeakResponse::~SpeakResponse() {
}
void SpeakResponse::Run() {
- LOG4CXX_INFO(logger_, "SpeakResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index b6a4d8a28..22bc57620 100644
--- a/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc
+++ b/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc
@@ -48,7 +48,7 @@ SubscribeButtonRequest::~SubscribeButtonRequest() {
}
void SubscribeButtonRequest::Run() {
- LOG4CXX_INFO(logger_, "SubscribeButtonRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app =
ApplicationManagerImpl::instance()->application(connection_key());
@@ -63,13 +63,20 @@ void SubscribeButtonRequest::Run() {
static_cast<mobile_apis::ButtonName::eType>(
(*message_)[str::msg_params][str::button_name].asUInt());
- if (!IsSubscribtionAllowed(app, btn_id)) {
+ if (!IsSubscriptionAllowed(app, btn_id)) {
LOG4CXX_ERROR_EXT(logger_, "Subscribe on button " << btn_id
<< " isn't allowed");
SendResponse(false, mobile_apis::Result::REJECTED);
return;
}
+ if (!CheckHMICapabilities(btn_id)) {
+ LOG4CXX_ERROR_EXT(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_EXT(logger_, "Already subscribed to button " << btn_id);
SendResponse(false, mobile_apis::Result::IGNORED);
@@ -77,12 +84,17 @@ void SubscribeButtonRequest::Run() {
}
app->SubscribeToButton(static_cast<mobile_apis::ButtonName::eType>(btn_id));
- SendResponse(true, mobile_apis::Result::SUCCESS);
+ SendSubscribeButtonNotification();
- app->UpdateHash();
+ const bool is_succedeed = true;
+ SendResponse(is_succedeed, mobile_apis::Result::SUCCESS);
+
+ if (is_succedeed) {
+ app->UpdateHash();
+ }
}
-bool SubscribeButtonRequest::IsSubscribtionAllowed(
+bool SubscribeButtonRequest::IsSubscriptionAllowed(
ApplicationSharedPtr app, mobile_apis::ButtonName::eType btn_id) {
if (!app->is_media_application() &&
@@ -96,6 +108,50 @@ bool SubscribeButtonRequest::IsSubscribtionAllowed(
return true;
}
+bool SubscribeButtonRequest::CheckHMICapabilities(
+ mobile_apis::ButtonName::eType button) {
+ using namespace smart_objects;
+ using namespace mobile_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationManagerImpl* app_mgr = ApplicationManagerImpl::instance();
+ DCHECK_OR_RETURN(app_mgr, false);
+
+ const HMICapabilities& hmi_caps = app_mgr->hmi_capabilities();
+ if (!hmi_caps.is_ui_cooperating()) {
+ LOG4CXX_ERROR_EXT(logger_, "UI is not supported by HMI.");
+ return false;
+ }
+
+ const SmartObject* button_caps_ptr = hmi_caps.button_capabilities();
+ if (button_caps_ptr) {
+ const SmartObject& button_caps = *button_caps_ptr;
+ const size_t length = button_caps.length();
+ for (size_t i = 0; i < length; ++i) {
+ const SmartObject& caps = button_caps[i];
+ const ButtonName::eType name =
+ static_cast<ButtonName::eType>(caps.getElement(hmi_response::button_name).asInt());
+ if (name == button) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+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
index 6253f8ca3..a3452ef19 100644
--- a/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc
+++ b/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc
@@ -46,7 +46,7 @@ SubscribeButtonResponse::~SubscribeButtonResponse() {
}
void SubscribeButtonResponse::Run() {
- LOG4CXX_INFO(logger_, "SubscribeButtonResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
// check if response false
if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
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
index 35595c2df..f00527037 100644
--- 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
@@ -84,7 +84,7 @@ namespace {
#endif // #ifdef HMI_DBUS_API
void SubscribeVehicleDataRequest::Run() {
- LOG4CXX_INFO(logger_, "SubscribeVehicleDataRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
CommandRequestImpl::connection_key());
@@ -172,13 +172,18 @@ void SubscribeVehicleDataRequest::Run() {
}
void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "SubscribeVehicleDataRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->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) {
@@ -224,9 +229,12 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
response_params[it->str] = it->value;
}
}
- LOG4CXX_INFO(logger_, "All HMI requests are complete");
+ LOG4CXX_DEBUG(logger_, "All HMI requests are complete");
+ const bool result = any_arg_success;
SendResponse(any_arg_success, status, NULL, &response_params);
- app->UpdateHash();
+ if (result) {
+ app->UpdateHash();
+ }
}
#else
hmi_apis::Common_Result::eType hmi_result =
@@ -255,7 +263,10 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
result_code,
return_info,
&(message[strings::msg_params]));
- app->UpdateHash();
+
+ if (result) {
+ app->UpdateHash();
+ }
#endif // #ifdef HMI_DBUS_API
}
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
index 972a65418..c0554c62e 100644
--- 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
@@ -48,7 +48,7 @@ SubscribeVehicleDataResponse::~SubscribeVehicleDataResponse() {
}
void SubscribeVehicleDataResponse::Run() {
- LOG4CXX_INFO(logger_, "SubscribeVehicleDataResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
diff --git a/src/components/application_manager/src/commands/mobile/system_request.cc b/src/components/application_manager/src/commands/mobile/system_request.cc
index 2765aad8d..ec66f325d 100644
--- a/src/components/application_manager/src/commands/mobile/system_request.cc
+++ b/src/components/application_manager/src/commands/mobile/system_request.cc
@@ -37,9 +37,12 @@ Copyright (c) 2013, Ford Motor Company
#include "application_manager/commands/mobile/system_request.h"
#include "application_manager/application_manager_impl.h"
#include "application_manager/application_impl.h"
+#include "application_manager/policies/policy_handler.h"
#include "interfaces/MOBILE_API.h"
#include "config_profile/profile.h"
#include "utils/file_system.h"
+#include "formatters/CFormatterJsonBase.hpp"
+#include "json/json.h"
namespace application_manager {
@@ -47,6 +50,9 @@ namespace commands {
uint32_t SystemRequest::index = 0;
+const std::string kSYNC = "SYNC";
+const std::string kIVSU = "IVSU";
+
SystemRequest::SystemRequest(const MessageSharedPtr& message)
: CommandRequestImpl(message) {
}
@@ -55,7 +61,7 @@ SystemRequest::~SystemRequest() {
}
void SystemRequest::Run() {
- LOG4CXX_INFO(logger_, "SystemRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr application =
ApplicationManagerImpl::instance()->application(connection_key());
@@ -66,66 +72,116 @@ void SystemRequest::Run() {
return;
}
- mobile_apis::RequestType::eType request_type =
+ const mobile_apis::RequestType::eType request_type =
static_cast<mobile_apis::RequestType::eType>(
(*message_)[strings::msg_params][strings::request_type].asInt());
- if (!(*message_)[strings::params].keyExists(strings::binary_data) &&
- mobile_apis::RequestType::PROPRIETARY == request_type) {
- LOG4CXX_ERROR(logger_, "Binary data empty");
-
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- std::vector<uint8_t> binary_data;
- if ((*message_)[strings::params].keyExists(strings::binary_data)) {
- binary_data = (*message_)[strings::params][strings::binary_data].asBinary();
- }
-
- std::string file_path = profile::Profile::instance()->system_files_path();
- if (!file_system::CreateDirectoryRecursively(file_path)) {
- LOG4CXX_ERROR(logger_, "Cann't create folder.");
- SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ if (!policy::PolicyHandler::instance()->IsRequestTypeAllowed(
+ application->mobile_app_id(), request_type)) {
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
return;
}
- std::string file_name = "SYNC";
+ 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;
}
+ bool is_system_file =
+ std::string::npos != file_name.find(kSYNC) ||
+ std::string::npos != file_name.find(kIVSU);
+
// to avoid override existing file
- const uint8_t max_size = 255;
- char buf[max_size] = {'\0'};
- snprintf(buf, sizeof(buf)/sizeof(buf[0]), "%d%s", index++, file_name.c_str());
- file_name = buf;
+ if (is_system_file) {
+ const uint8_t max_size = 255;
+ char buf[max_size] = {'\0'};
+ snprintf(buf, sizeof(buf)/sizeof(buf[0]), "%d%s", index++, file_name.c_str());
+ file_name = buf;
+ }
- std::string full_file_path = file_path + "/" + file_name;
- if (binary_data.size()) {
+ 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 = profile::Profile::instance()->system_files_path();
+ } else {
+ binary_data_folder = profile::Profile::instance()->app_storage_folder();
+ binary_data_folder += "/";
+ binary_data_folder += application->folder_name();
+ binary_data_folder += "/";
+ }
+
+ std::string file_dst_path = profile::Profile::instance()->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 !=
(ApplicationManagerImpl::instance()->SaveBinary(
- binary_data, file_path, file_name, 0))) {
+ 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 {
- if (!(file_system::CreateFile(full_file_path))) {
- SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ 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::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::INVALID_DATA);
+ return;
+ }
+
+ ApplicationManagerImpl::instance()->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("IVSU")) {
+ if (std::string::npos != file_name.find(kIVSU)) {
msg_params[strings::file_name] = file_name.c_str();
} else {
- msg_params[strings::file_name] = full_file_path;
+ msg_params[strings::file_name] = file_dst_path;
}
if (mobile_apis::RequestType::PROPRIETARY != request_type) {
- msg_params[strings::app_id] = (application->mobile_app_id())->asString();
+ msg_params[strings::app_id] = (application->mobile_app_id());
}
msg_params[strings::request_type] =
(*message_)[strings::msg_params][strings::request_type];
@@ -153,6 +209,10 @@ void SystemRequest::on_event(const event_engine::Event& event) {
return;
}
+ if (!processing_file_.empty()) {
+ file_system::DeleteFile(processing_file_);
+ processing_file_.clear();
+ }
SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
break;
}
@@ -163,6 +223,66 @@ void SystemRequest::on_event(const event_engine::Event& event) {
}
}
+bool SystemRequest::ValidateQueryAppData(
+ const smart_objects::SmartObject& data) const {
+ if (!data.isValid()) {
+ LOG4CXX_ERROR(logger_, "QueryApps response is not valid.");
+ return false;
+ }
+ if (!data.keyExists(json::response)) {
+ LOG4CXX_ERROR(logger_,
+ "QueryApps response does not contain '"
+ << json::response << "' parameter.");
+ return false;
+ }
+ smart_objects::SmartArray* obj_array = data[json::response].asArray();
+ if (NULL == obj_array) {
+ return false;
+ }
+
+ const std::size_t arr_size(obj_array->size());
+ for (std::size_t idx = 0; idx < arr_size; ++idx) {
+ const smart_objects::SmartObject& app_data = (*obj_array)[idx];
+ if (!app_data.isValid()) {
+ LOG4CXX_ERROR(logger_, "Wrong application data in json file.");
+ continue;
+ }
+ std::string os_type;
+ if (app_data.keyExists(json::ios)) {
+ os_type = json::ios;
+ if (!app_data[os_type].keyExists(json::urlScheme)) {
+ LOG4CXX_ERROR(logger_, "Can't find URL scheme in json file.");
+ continue;
+ }
+ } else if (app_data.keyExists(json::android)) {
+ os_type = json::android;
+ if (!app_data[os_type].keyExists(json::packageName)) {
+ LOG4CXX_ERROR(logger_, "Can't find package name in json file.");
+ continue;
+ }
+ }
+
+ if (os_type.empty()) {
+ LOG4CXX_ERROR(logger_, "Can't find mobile OS type in json file.");
+ continue;
+ }
+
+ if (!app_data.keyExists(json::appId)) {
+ LOG4CXX_ERROR(logger_, "Can't find app ID in json file.");
+ continue;
+ }
+
+ if (!app_data.keyExists(json::name)) {
+ LOG4CXX_ERROR(logger_, "Can't find app name in json file.");
+ continue;
+ }
+
+ return true;
+ }
+
+ return false;
+}
+
} // 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
index e77ab0845..8b4fdafd1 100644
--- a/src/components/application_manager/src/commands/mobile/system_response.cc
+++ b/src/components/application_manager/src/commands/mobile/system_response.cc
@@ -46,7 +46,7 @@ SystemResponse::~SystemResponse() {
}
void SystemResponse::Run() {
- LOG4CXX_INFO(logger_, "SystemResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
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
index a07cfcd8f..dc63a1194 100644
--- 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
@@ -40,7 +40,7 @@ namespace application_manager {
namespace commands {
void UnregisterAppInterfaceRequest::Run() {
- LOG4CXX_INFO(logger_, "UnregisterAppInterfaceRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl* app_manager = ApplicationManagerImpl::instance();
@@ -50,6 +50,9 @@ void UnregisterAppInterfaceRequest::Run() {
return;
}
+ MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
+ connection_key(),
+ mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM);
app_manager->UnregisterApplication(connection_key(),
mobile_apis::Result::SUCCESS);
SendResponse(true, mobile_apis::Result::SUCCESS);
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
index 8ef0eb3ed..49d9276d3 100644
--- 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
@@ -38,7 +38,7 @@ namespace application_manager {
namespace commands {
void UnregisterAppInterfaceResponse::Run() {
- LOG4CXX_INFO(logger_, "UnregisterAppInterfaceResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
SendResponse((*message_)[strings::msg_params][strings::success].asBool());
}
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
index f22d1c0a2..a2958342e 100644
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc
+++ b/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc
@@ -50,10 +50,10 @@ UnsubscribeButtonRequest::~UnsubscribeButtonRequest() {
}
void UnsubscribeButtonRequest::Run() {
- LOG4CXX_INFO(logger_, "UnsubscribeButtonRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
- (*message_)[str::params][str::connection_key].asUInt());
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(connection_key());
if (!app) {
LOG4CXX_ERROR_EXT(logger_, "APPLICATION_NOT_REGISTERED");
@@ -61,8 +61,8 @@ void UnsubscribeButtonRequest::Run() {
return;
}
- const uint32_t btn_id = (*message_)[str::msg_params][str::button_name]
- .asUInt();
+ const uint32_t btn_id =
+ (*message_)[str::msg_params][str::button_name].asUInt();
if (!app->IsSubscribedToButton(static_cast<mobile_apis::ButtonName::eType>(btn_id))) {
LOG4CXX_ERROR_EXT(logger_, "App doesn't subscibe to button " << btn_id);
@@ -71,7 +71,26 @@ void UnsubscribeButtonRequest::Run() {
}
app->UnsubscribeFromButton(static_cast<mobile_apis::ButtonName::eType>(btn_id));
- SendResponse(true, mobile_apis::Result::SUCCESS);
+
+ SendUnsubscribeButtonNotification();
+ const bool is_succedeed = true;
+ SendResponse(is_succedeed, mobile_apis::Result::SUCCESS);
+ if (is_succedeed) {
+ app->UpdateHash();
+ }
+}
+
+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].asUInt());
+ msg_params[strings::is_suscribed] = false;
+ CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
}
} // namespace commands
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
index 1331eac27..8bece6615 100644
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc
+++ b/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc
@@ -47,7 +47,7 @@ UnsubscribeButtonResponse::~UnsubscribeButtonResponse() {
}
void UnsubscribeButtonResponse::Run() {
- LOG4CXX_INFO(logger_, "UnsubscribeButtonResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
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
index fc7145078..7d05ce328 100644
--- 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
@@ -88,7 +88,7 @@ namespace {
#endif // #ifdef HMI_DBUS_API
void UnsubscribeVehicleDataRequest::Run() {
- LOG4CXX_INFO(logger_, "UnsubscribeVehicleDataRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
CommandRequestImpl::connection_key());
@@ -176,7 +176,7 @@ void UnsubscribeVehicleDataRequest::Run() {
}
void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "UnsubscribeVehicleDataRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
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
index 60f7077da..87b2e6e5e 100644
--- 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
@@ -45,7 +45,7 @@ UnsubscribeVehicleDataResponse::~UnsubscribeVehicleDataResponse() {
}
void UnsubscribeVehicleDataResponse::Run() {
- LOG4CXX_INFO(logger_, "UnsubscribeVehicleDataResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
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
index 944777256..650e698bf 100644
--- 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
@@ -51,7 +51,7 @@ UpdateTurnListRequest::~UpdateTurnListRequest() {
}
void UpdateTurnListRequest::Run() {
- LOG4CXX_INFO(logger_, "UpdateTurnListRequest::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
(*message_)[strings::params][strings::connection_key].asUInt());
@@ -141,7 +141,7 @@ void UpdateTurnListRequest::Run() {
}
void UpdateTurnListRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "UpdateTurnListRequest::on_event");
+ LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
@@ -188,7 +188,7 @@ bool UpdateTurnListRequest::CheckTurnListArray() {
}
bool UpdateTurnListRequest::IsWhiteSpaceExist() {
- LOG4CXX_INFO(logger_, "UpdateTurnListRequest::IsWhiteSpaceExist");
+ LOG4CXX_AUTO_TRACE(logger_);
const char* str = NULL;
if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
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
index ec1e0bce8..26e5c460d 100644
--- 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
@@ -47,7 +47,7 @@ UpdateTurnListResponse::~UpdateTurnListResponse() {
}
void UpdateTurnListResponse::Run() {
- LOG4CXX_INFO(logger_, "UpdateTurnListResponse::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
}
diff --git a/src/components/application_manager/src/event_engine/event.cc b/src/components/application_manager/src/event_engine/event.cc
index e454025df..561e8a841 100644
--- a/src/components/application_manager/src/event_engine/event.cc
+++ b/src/components/application_manager/src/event_engine/event.cc
@@ -48,7 +48,7 @@ void Event::raise() {
EventDispatcher::instance()->raise_event(*this);
}
-void Event::set_smart_object(smart_objects::SmartObject& so) {
+void Event::set_smart_object(const smart_objects::SmartObject& so) {
response_so_ = so;
}
diff --git a/src/components/application_manager/src/event_engine/event_dispatcher.cc b/src/components/application_manager/src/event_engine/event_dispatcher.cc
index a552ef622..bac94431f 100644
--- a/src/components/application_manager/src/event_engine/event_dispatcher.cc
+++ b/src/components/application_manager/src/event_engine/event_dispatcher.cc
@@ -39,37 +39,38 @@ namespace event_engine {
using namespace sync_primitives;
EventDispatcher::EventDispatcher()
- : observers_() {
+ : observer_list_lock_(true),
+ observers_() {
}
EventDispatcher::~EventDispatcher() {
}
void EventDispatcher::raise_event(const Event& event) {
- // create local list
- ObserverList list;
{
AutoLock auto_lock(state_lock_);
// check if event is notification
if (hmi_apis::messageType::notification == event.smart_object_type()) {
-
- //ObserversMap iterator
- ObserversMap::iterator it = observers_[event.id()].begin();
- for (; observers_[event.id()].end() != it; ++it) {
- list = it->second;
- }
+ const uint32_t notification_correlation_id = 0;
+ observers_list_ = observers_[event.id()][notification_correlation_id];
}
if (hmi_apis::messageType::response == event.smart_object_type()
|| hmi_apis::messageType::error_response == event.smart_object_type()) {
- list = observers_[event.id()][event.smart_object_correlation_id()];
+ observers_list_ = observers_[event.id()][event.smart_object_correlation_id()];
}
}
// Call observers
- ObserverList::iterator observers = list.begin();
- for (; list.end() != observers; ++observers) {
- (*observers)->on_event(event);
+ EventObserver* temp;
+ while (observers_list_.size() > 0) {
+ observer_list_lock_.Acquire();
+ if (!observers_list_.empty()) {
+ temp = observers_list_.front();
+ observers_list_.pop_front();
+ temp->on_event(event);
+ }
+ observer_list_lock_.Release();
}
}
@@ -81,43 +82,57 @@ void EventDispatcher::add_observer(const Event::EventID& event_id,
}
void EventDispatcher::remove_observer(const Event::EventID& event_id,
- EventObserver* const observer) {
+ EventObserver* const observer) {
+ remove_observer_from_list(observer);
AutoLock auto_lock(state_lock_);
ObserversMap::iterator it = observers_[event_id].begin();
for (; observers_[event_id].end() != it; ++it) {
//ObserverList iterator
- 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;
- }
- }
+ 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;
+ }
+ }
}
}
void EventDispatcher::remove_observer(EventObserver* const observer) {
+ remove_observer_from_list(observer);
AutoLock auto_lock(state_lock_);
EventObserverMap::iterator event_map = observers_.begin();
for (; observers_.end() != event_map; ++event_map) {
-
ObserversMap::iterator it = event_map->second.begin();
- for (; event_map->second.end() != it; ++it) {
-
- //ObserverList iterator
- 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;
- }
+ for (; event_map->second.end() != it; ++it) {
+
+ //ObserverList iterator
+ 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;
+ }
+ }
+ }
+ }
+}
+
+void EventDispatcher::remove_observer_from_list(EventObserver* const observer) {
+ AutoLock auto_lock(observer_list_lock_);
+ if (!observers_list_.empty()) {
+ ObserverList::iterator it_begin = observers_list_.begin();
+ for(; it_begin != observers_list_.end(); ++it_begin) {
+ if ((*it_begin)->id() == observer->id()) {
+ it_begin = observers_list_.erase(it_begin);
}
}
}
}
-}
-}
+} // namespace event_engine
+
+}// namespace application_manager
diff --git a/src/components/application_manager/src/hmi_capabilities.cc b/src/components/application_manager/src/hmi_capabilities.cc
index 5a3ce71ec..5cdce194a 100644
--- a/src/components/application_manager/src/hmi_capabilities.cc
+++ b/src/components/application_manager/src/hmi_capabilities.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -49,34 +49,6 @@
namespace application_manager {
namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
-std::map<std::string, hmi_apis::Common_Language::eType> languages_enum_values =
-{
- {"EN_US", hmi_apis::Common_Language::EN_US},
- {"ES_MX", hmi_apis::Common_Language::ES_MX},
- {"FR_CA", hmi_apis::Common_Language::FR_CA},
- {"DE_DE", hmi_apis::Common_Language::DE_DE},
- {"ES_ES", hmi_apis::Common_Language::ES_ES},
- {"EN_GB", hmi_apis::Common_Language::EN_GB},
- {"RU_RU", hmi_apis::Common_Language::RU_RU},
- {"TR_TR", hmi_apis::Common_Language::TR_TR},
- {"PL_PL", hmi_apis::Common_Language::PL_PL},
- {"FR_FR", hmi_apis::Common_Language::FR_FR},
- {"IT_IT", hmi_apis::Common_Language::IT_IT},
- {"SV_SE", hmi_apis::Common_Language::SV_SE},
- {"PT_PT", hmi_apis::Common_Language::PT_PT},
- {"NL_NL", hmi_apis::Common_Language::NL_NL},
- {"EN_AU", hmi_apis::Common_Language::EN_AU},
- {"ZH_CN", hmi_apis::Common_Language::ZH_CN},
- {"ZH_TW", hmi_apis::Common_Language::ZH_TW},
- {"JA_JP", hmi_apis::Common_Language::JA_JP},
- {"AR_SA", hmi_apis::Common_Language::AR_SA},
- {"KO_KR", hmi_apis::Common_Language::KO_KR},
- {"PT_BR", hmi_apis::Common_Language::PT_BR},
- {"CS_CZ", hmi_apis::Common_Language::CS_CZ},
- {"DA_DK", hmi_apis::Common_Language::DA_DK},
- {"NO_NO", hmi_apis::Common_Language::NO_NO}
-};
-
CREATE_LOGGERPTR_GLOBAL(logger_, "HMICapabilities")
std::map<std::string, hmi_apis::Common_VrCapabilities::eType> vr_enum_capabilities =
@@ -133,6 +105,11 @@ std::map<std::string, hmi_apis::Common_TextFieldName::eType> text_fields_enum_na
{"secondaryText" , hmi_apis::Common_TextFieldName::secondaryText},
{"tertiaryText" , hmi_apis::Common_TextFieldName::tertiaryText},
{"timeToDestination", hmi_apis::Common_TextFieldName::timeToDestination},
+ {"locationName" , hmi_apis::Common_TextFieldName::locationName},
+ {"locationDescription", hmi_apis::Common_TextFieldName::locationDescription},
+ {"addressLines" , hmi_apis::Common_TextFieldName::turnText},
+ {"turnText" , hmi_apis::Common_TextFieldName::addressLines},
+ {"phoneNumber" , hmi_apis::Common_TextFieldName::phoneNumber},
{"turnText" , hmi_apis::Common_TextFieldName::turnText},
{"menuTitle" , hmi_apis::Common_TextFieldName::menuTitle},
};
@@ -258,6 +235,8 @@ HMICapabilities::HMICapabilities(ApplicationManagerImpl* const app_mngr)
speech_capabilities_(NULL),
audio_pass_thru_capabilities_(NULL),
prerecorded_speech_(NULL),
+ is_navigation_supported_(false),
+ is_phone_call_supported_(false),
app_mngr_(app_mngr) {
if (false == load_capabilities_from_file()) {
@@ -553,6 +532,18 @@ void HMICapabilities::set_prerecorded_speech(
prerecorded_speech_ = new smart_objects::SmartObject(prerecorded_speech);
}
+void HMICapabilities::set_navigation_supported(bool supported) {
+ is_navigation_supported_ = supported;
+}
+
+void HMICapabilities::set_phone_call_supported(bool supported) {
+ is_phone_call_supported_ = supported;
+}
+
+void HMICapabilities::set_ccpu_version(const std::string& ccpu_version) {
+ ccpu_version_ = ccpu_version;
+}
+
bool HMICapabilities::load_capabilities_from_file() {
std::string json_string;
std::string file_name =
@@ -580,12 +571,8 @@ bool HMICapabilities::load_capabilities_from_file() {
Json::Value ui = root_json.get("UI", Json::Value::null);
if (check_existing_json_member(ui, "language")) {
- std::string lang = ui.get("language", "EN_US").asString();
- std::map<std::string, hmi_apis::Common_Language::eType>::const_iterator
- it = languages_enum_values.find(lang);
- if (it != languages_enum_values.end()) {
- set_active_ui_language(it->second);
- }
+ const std::string lang = ui.get("language", "EN_US").asString();
+ set_active_ui_language(MessageHelper::CommonLanguageFromString(lang));
}
if (check_existing_json_member(ui, "languages")) {
@@ -765,8 +752,8 @@ bool HMICapabilities::load_capabilities_from_file() {
if (check_existing_json_member(root_json, "VR")) {
Json::Value vr = root_json.get("VR", "");
if (check_existing_json_member(vr, "language")) {
- set_active_vr_language(
- languages_enum_values.find(vr.get("language", "").asString())->second);
+ const std::string lang = vr.get("language", "").asString();
+ set_active_vr_language(MessageHelper::CommonLanguageFromString(lang));
}
if (check_existing_json_member(vr, "languages")) {
@@ -794,8 +781,8 @@ bool HMICapabilities::load_capabilities_from_file() {
Json::Value tts = root_json.get("TTS", "");
if (check_existing_json_member(tts, "language")) {
- set_active_tts_language(
- languages_enum_values.find(tts.get("language", "").asString())->second);
+ const std::string lang = tts.get("language", "").asString();
+ set_active_tts_language(MessageHelper::CommonLanguageFromString(lang));
}
if (check_existing_json_member(tts, "languages")) {
@@ -867,11 +854,8 @@ bool HMICapabilities::check_existing_json_member(
void HMICapabilities::convert_json_languages_to_obj(Json::Value& json_languages,
smart_objects::SmartObject& languages) {
for (uint32_t i = 0, j = 0; i < json_languages.size(); ++i) {
- std::map<std::string, hmi_apis::Common_Language::eType>::const_iterator it =
- languages_enum_values.find(json_languages[i].asString());
- if (languages_enum_values.end() != it) {
- languages[j++] = it->second;
- }
+ languages[j++] = MessageHelper::CommonLanguageFromString(
+ json_languages[i].asString());
}
}
diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc
index c9d241a9a..f8bf47bb7 100644
--- a/src/components/application_manager/src/hmi_command_factory.cc
+++ b/src/components/application_manager/src/hmi_command_factory.cc
@@ -63,6 +63,8 @@
#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"
@@ -70,6 +72,7 @@
#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/on_emergency_event_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"
@@ -106,8 +109,8 @@
#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_icon_request.h"
-#include "application_manager/commands/hmi/ui_set_icon_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"
@@ -227,6 +230,7 @@
#include "application_manager/commands/hmi/on_navi_tbt_client_state_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"
@@ -266,7 +270,7 @@ namespace application_manager {
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
CommandSharedPtr HMICommandFactory::CreateCommand(
- const MessageSharedPtr& message) {
+ const commands::MessageSharedPtr& message) {
const int function_id = (*message)[strings::params][strings::function_id]
.asInt();
LOG4CXX_INFO(logger_,
@@ -455,9 +459,9 @@ CommandSharedPtr HMICommandFactory::CreateCommand(
}
case hmi_apis::FunctionID::UI_SetAppIcon: {
if (is_response) {
- command.reset(new commands::UISetIconResponse(message));
+ command.reset(new commands::UISetAppIconResponse(message));
} else {
- command.reset(new commands::UISetIconRequest(message));
+ command.reset(new commands::UISetAppIconRequest(message));
}
break;
}
@@ -1085,6 +1089,10 @@ CommandSharedPtr HMICommandFactory::CreateCommand(
command.reset(new commands::OnSystemInfoChangedNotification(message));
break;
}
+ case hmi_apis::FunctionID::BasicCommunication_OnEmergencyEvent: {
+ command.reset(new commands::OnEmergencyEventNotification(message));
+ break;
+ }
case hmi_apis::FunctionID::BasicCommunication_PlayTone: {
command.reset(new commands::OnPlayToneNotification(message));
break;
@@ -1170,6 +1178,10 @@ CommandSharedPtr HMICommandFactory::CreateCommand(
command.reset(new commands::hmi::OnButtonPressNotification(message));
break;
}
+ case hmi_apis::FunctionID::Buttons_OnButtonSubscription: {
+ command.reset(new commands::hmi::OnButtonSubscriptionNotification(message));
+ break;
+ }
#ifdef HMI_DBUS_API
case hmi_apis::FunctionID::VehicleInfo_SubscribeGps: {
if (is_response)
@@ -1952,6 +1964,14 @@ CommandSharedPtr HMICommandFactory::CreateCommand(
}
break;
}
+ case hmi_apis::FunctionID::Navigation_OnAudioDataStreaming: {
+ command.reset(new commands::OnAudioDataStreamingNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::Navigation_OnVideoDataStreaming: {
+ command.reset(new commands::OnVideoDataStreamingNotification(message));
+ break;
+ }
case hmi_apis::FunctionID::VR_PerformInteraction: {
if (is_response) {
command.reset(new commands::VRPerformInteractionResponse(message));
diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc
new file mode 100644
index 000000000..2b165c106
--- /dev/null
+++ b/src/components/application_manager/src/hmi_state.cc
@@ -0,0 +1,99 @@
+#include "application_manager/hmi_state.h"
+#include "utils/helpers.h"
+
+namespace application_manager {
+
+HmiState::HmiState(uint32_t app_id, const StateContext& state_context_,
+ StateID state_id):
+ app_id_(app_id),
+ state_id_(state_id),
+ state_context_(state_context_),
+ hmi_level_(mobile_apis::HMILevel::INVALID_ENUM),
+ audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM),
+ system_context_(mobile_apis::SystemContext::INVALID_ENUM) {
+}
+
+
+HmiState::HmiState(uint32_t app_id, const StateContext& state_context):
+ app_id_(app_id),
+ state_id_(STATE_ID_REGULAR),
+ state_context_(state_context),
+ hmi_level_(mobile_apis::HMILevel::INVALID_ENUM),
+ audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM),
+ system_context_(mobile_apis::SystemContext::INVALID_ENUM) {
+}
+
+void HmiState::set_parent(HmiStatePtr parent) {
+ DCHECK_OR_RETURN_VOID(parent);
+ parent_ = parent;
+}
+
+mobile_apis::AudioStreamingState::eType
+VRHmiState::audio_streaming_state() const {
+ using namespace mobile_apis;
+ return AudioStreamingState::NOT_AUDIBLE;
+}
+
+VRHmiState::VRHmiState(uint32_t app_id, StateContext& state_context):
+ HmiState(app_id, state_context, STATE_ID_VR_SESSION) {
+}
+
+TTSHmiState::TTSHmiState(uint32_t app_id, StateContext& state_context):
+ HmiState(app_id, state_context, STATE_ID_TTS_SESSION) {
+}
+
+mobile_apis::AudioStreamingState::eType
+TTSHmiState::audio_streaming_state() const {
+ using namespace helpers;
+ using namespace mobile_apis;
+
+ AudioStreamingState::eType expected_state = AudioStreamingState::NOT_AUDIBLE;
+ if (state_context_.is_attenuated_supported() &&
+ AudioStreamingState::NOT_AUDIBLE != parent()->audio_streaming_state() &&
+ Compare<HMILevel::eType, EQ, ONE> (hmi_level(), HMILevel::HMI_FULL,
+ HMILevel::HMI_LIMITED)) {
+ expected_state = AudioStreamingState::ATTENUATED;
+ }
+ return expected_state;
+}
+
+NaviStreamingHmiState::NaviStreamingHmiState(uint32_t app_id, StateContext& state_context):
+ HmiState(app_id, state_context, STATE_ID_NAVI_STREAMING) {
+}
+
+mobile_apis::AudioStreamingState::eType
+NaviStreamingHmiState::audio_streaming_state() const {
+ using namespace helpers;
+ using namespace mobile_apis;
+
+ AudioStreamingState::eType expected_state = parent()->audio_streaming_state();
+ if (!state_context_.is_navi_app(app_id_) &&
+ AudioStreamingState::AUDIBLE == expected_state) {
+ if (state_context_.is_attenuated_supported()) {
+ expected_state = AudioStreamingState::ATTENUATED;
+ } else {
+ expected_state = AudioStreamingState::NOT_AUDIBLE;
+ }
+ }
+ return expected_state;
+}
+
+PhoneCallHmiState::PhoneCallHmiState(uint32_t app_id, StateContext& state_context):
+ HmiState(app_id, state_context, STATE_ID_PHONE_CALL) {
+}
+
+mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const {
+ using namespace mobile_apis;
+ HMILevel::eType expected_level(HMILevel::HMI_BACKGROUND);
+ if (parent()->hmi_level() == HMILevel::HMI_FULL
+ && state_context_.is_navi_app(app_id_)) {
+ expected_level = HMILevel::HMI_LIMITED;
+ }
+ return expected_level;
+}
+
+SafetyModeHmiState::SafetyModeHmiState(uint32_t app_id, StateContext& state_context):
+ HmiState(app_id, state_context, STATE_ID_SAFETY_MODE) {
+}
+
+}
diff --git a/src/components/application_manager/src/message.cc b/src/components/application_manager/src/message.cc
index 832016e87..bb500687d 100644
--- a/src/components/application_manager/src/message.cc
+++ b/src/components/application_manager/src/message.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/application_manager/src/message_helper.cc b/src/components/application_manager/src/message_helper.cc
index ffde928db..ee41ce5bf 100644
--- a/src/components/application_manager/src/message_helper.cc
+++ b/src/components/application_manager/src/message_helper.cc
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (c) 2013, Ford Motor Company
All rights reserved.
@@ -30,6 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "application_manager/message_helper.h"
+
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#undef __STDC_FORMAT_MACROS
@@ -43,7 +45,6 @@
#include "application_manager/application.h"
#include "application_manager/application_manager_impl.h"
#include "application_manager/commands/command_impl.h"
-#include "application_manager/message_helper.h"
#include "application_manager/policies/policy_handler.h"
#include "config_profile/profile.h"
#include "connection_handler/connection_handler_impl.h"
@@ -51,7 +52,13 @@
#include "smart_objects/enum_schema_item.h"
#include "utils/file_system.h"
#include "utils/macro.h"
+#include "utils/make_shared.h"
#include "utils/logger.h"
+#include "utils/make_shared.h"
+
+#include "formatters/formatter_json_rpc.h"
+#include "formatters/CFormatterJsonSDLRPCv2.hpp"
+#include "formatters/CFormatterJsonSDLRPCv1.hpp"
namespace application_manager {
@@ -59,24 +66,6 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
namespace {
-hmi_apis::Common_Language::eType ToCommonLanguage(
- mobile_apis::Language::eType mobile_language) {
- // Update this check if mobile_api::Language
- // or hmi_apis::Common_Language changes.
- // Or, better, generate functions like this from XML
- long lang_val = long(mobile_language);
- long max_common_lang_val = long(hmi_apis::Common_Language::NO_NO);
- long max_mobile_lang = long(mobile_apis::Language::NO_NO);
- if (max_common_lang_val != max_mobile_lang) {
- LOG4CXX_ERROR(logger_, "Mapping between Common_Language and Language"
- " has changed! Please update converter function");
- }
- if (lang_val > max_common_lang_val) {
- LOG4CXX_ERROR(logger_, "Non-convertable language ID");
- }
- return hmi_apis::Common_Language::eType(lang_val);
-}
-
typedef
std::map<std::string, hmi_apis::Common_AppPriority::eType> CommonAppPriorityMap;
@@ -196,58 +185,24 @@ static VehicleInfo_Requests ivi_subrequests[] = {
std::string MessageHelper::CommonLanguageToString(
hmi_apis::Common_Language::eType language) {
- switch (language) {
- case hmi_apis::Common_Language::EN_US:
- return "en-us";
- case hmi_apis::Common_Language::ES_MX:
- return "es-mx";
- case hmi_apis::Common_Language::FR_CA:
- return "fr-ca";
- case hmi_apis::Common_Language::DE_DE:
- return "de-de";
- case hmi_apis::Common_Language::ES_ES:
- return "es-es";
- case hmi_apis::Common_Language::EN_GB:
- return "en-gb";
- case hmi_apis::Common_Language::RU_RU:
- return "ru-ru";
- case hmi_apis::Common_Language::TR_TR:
- return "tr-tr";
- case hmi_apis::Common_Language::PL_PL:
- return "pl-pl";
- case hmi_apis::Common_Language::FR_FR:
- return "fr-fr";
- case hmi_apis::Common_Language::IT_IT:
- return "it-it";
- case hmi_apis::Common_Language::SV_SE:
- return "sv-se";
- case hmi_apis::Common_Language::PT_PT:
- return "pt-pt";
- case hmi_apis::Common_Language::NL_NL:
- return "nl-nl";
- case hmi_apis::Common_Language::EN_AU:
- return "en-au";
- case hmi_apis::Common_Language::ZH_CN:
- return "zh-cn";
- case hmi_apis::Common_Language::ZH_TW:
- return "zh-tw";
- case hmi_apis::Common_Language::JA_JP:
- return "ja-jp";
- case hmi_apis::Common_Language::AR_SA:
- return "as-sa";
- case hmi_apis::Common_Language::KO_KR:
- return "ko-kr";
- case hmi_apis::Common_Language::PT_BR:
- return "pt-br";
- case hmi_apis::Common_Language::CS_CZ:
- return "cs-cz";
- case hmi_apis::Common_Language::DA_DK:
- return "da-dk";
- case hmi_apis::Common_Language::NO_NO:
- return "no-no";
- default:
- return "";
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ const char* str = 0;
+ if (EnumConversionHelper<hmi_apis::Common_Language::eType>::EnumToCString(
+ language, &str)) {
+ return str ? str : "";
}
+ return std::string();
+}
+
+hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString(
+ const std::string& language) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ hmi_apis::Common_Language::eType value;
+ if (EnumConversionHelper<hmi_apis::Common_Language::eType>::StringToEnum(
+ language, &value)) {
+ return value;
+ }
+ return hmi_apis::Common_Language::INVALID_ENUM;
}
uint32_t MessageHelper::GetAppCommandLimit(const std::string& policy_app_id) {
@@ -259,7 +214,8 @@ uint32_t MessageHelper::GetAppCommandLimit(const std::string& policy_app_id) {
void MessageHelper::SendHMIStatusNotification(
const Application& application_impl) {
- smart_objects::SmartObject* notification = new smart_objects::SmartObject;
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject;
if (!notification) {
// TODO(VS): please add logger.
return;
@@ -289,108 +245,168 @@ void MessageHelper::SendHMIStatusNotification(
void MessageHelper::SendOnAppRegisteredNotificationToHMI(
const Application& application_impl, bool resumption, bool need_restore_vr) {
- smart_objects::SmartObject* notification = new smart_objects::SmartObject;
+ using namespace smart_objects;
+
+ SmartObjectSPtr notification = utils::MakeShared<SmartObject>(SmartType_Map);
if (!notification) {
- // TODO(VS): please add logger.
+ LOG4CXX_ERROR(logger_, "Failed to create smart object");
return;
}
- smart_objects::SmartObject& message = *notification;
- message[strings::params][strings::function_id] =
- static_cast<int32_t>(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
-
- message[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
- message[strings::msg_params][strings::application][strings::app_name] =
- application_impl.name();
-
- const smart_objects::SmartObject* ngn_media_screen_name = application_impl
- .ngn_media_screen_name();
+ (*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) {
- message[strings::msg_params][strings::resume_vr_grammars] = need_restore_vr;
+ msg_params[strings::resume_vr_grammars] = need_restore_vr;
}
- if (ngn_media_screen_name) {
- message[strings::msg_params][strings::application][strings::ngn_media_screen_app_name] =
- *ngn_media_screen_name;
+ if (application_impl.vr_synonyms()) {
+ msg_params[strings::vr_synonyms] = *(application_impl.vr_synonyms());
}
- message[strings::msg_params][strings::application][strings::icon] =
- application_impl.app_icon_path();
+ if (application_impl.tts_name()) {
+ msg_params[strings::tts_name] = *(application_impl.tts_name());
+ }
- std::string dev_name = ApplicationManagerImpl::instance()->GetDeviceName(
- application_impl.device());
- message[strings::msg_params][strings::application][strings::device_name] =
- dev_name;
+ std::string priority;
+ policy::PolicyHandler::instance()->GetPriority(
+ application_impl.mobile_app_id(), &priority);
+ if (!priority.empty()) {
+ msg_params[strings::priority] = GetPriorityCode(priority);
+ }
- message[strings::msg_params][strings::application][strings::app_id] =
- application_impl.app_id();
+ 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.mobile_app_id();
+ application[strings::icon] = application_impl.app_icon_path();
- message[strings::msg_params][strings::application][strings::hmi_display_language_desired] =
- static_cast<int32_t>(application_impl.ui_language());
+ 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;
+ }
- message[strings::msg_params][strings::application][strings::is_media_application] =
- application_impl.is_media_application();
+ 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) {
- message[strings::msg_params][strings::application][strings::app_type] =
- *app_type;
- }
- if (application_impl.vr_synonyms()) {
- message[strings::msg_params][strings::vr_synonyms] = *(application_impl
- .vr_synonyms());
+ application[strings::app_type] = *app_type;
}
- if (application_impl.tts_name()) {
- message[strings::msg_params][strings::tts_name] = *(application_impl
- .tts_name());
+ if (application_impl.IsRegistered()) {
+ std::vector<std::string> request_types =
+ policy::PolicyHandler::instance()->GetAppRequestTypes(
+ application_impl.mobile_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;
+ }
}
- std::string priority;
- policy::PolicyHandler::instance()->GetPriority(
- application_impl.mobile_app_id()->asString(), &priority);
- if (!priority.empty()) {
- message[strings::msg_params][strings::priority] = GetPriorityCode(priority);
+ application[strings::device_info] = SmartObject(SmartType_Map);
+ smart_objects::SmartObject& device_info = application[strings::device_info];
+ std::string device_name;
+ std::string mac_address;
+ std::string transport_type;
+ if (-1 == connection_handler::ConnectionHandlerImpl::instance()->
+ GetDataOnDeviceID(application_impl.device(), &device_name,
+ NULL, &mac_address, &transport_type)) {
+ LOG4CXX_ERROR(logger_, "Failed to extract information for device "
+ << application_impl.device());
}
+ device_info[strings::name] = device_name;
+ device_info[strings::id] = mac_address;
+
+ const policy::DeviceConsent device_consent =
+ policy::PolicyHandler::instance()->GetUserConsentForDevice(mac_address);
+ device_info[strings::isSDLAllowed] =
+ policy::DeviceConsent::kDeviceAllowed == device_consent;
+
+ device_info[strings::transport_type] =
+ ApplicationManagerImpl::instance()->GetDeviceTransportType(transport_type);
DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(notification));
}
-smart_objects::SmartObject* MessageHelper::GetHashUpdateNotification(
+smart_objects::SmartObjectSPtr MessageHelper::GetHashUpdateNotification(
const uint32_t app_id) {
LOG4CXX_INFO(logger_, "GetHashUpdateNotification" << app_id);
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
app_id);
- smart_objects::SmartObject* message = NULL;
- if (NULL == app.get()) {
- return message;
+ if (!app) {
+ return NULL;
}
- message = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::OnHashChangeID;
+ mobile_apis::FunctionID::OnHashChangeID;
(*message)[strings::params][strings::connection_key] = app_id;
(*message)[strings::params][strings::message_type] =
- static_cast<int32_t>(kNotification);;
+ static_cast<int32_t>(kNotification);
+
+ return message;
+}
+
+smart_objects::SmartObject* MessageHelper::GetLockScreenIconUrlNotification(const uint32_t connection_key) {
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(connection_key);
+ DCHECK(app.get());
+
+ smart_objects::SmartObject* message = new 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] = policy::PolicyHandler::instance()->GetLockScreenIconUrl();
+
return message;
}
+void MessageHelper::SendLockScreenIconUrlNotification(const uint32_t connection_key) {
+ LOG4CXX_INFO(logger_, "SendLockScreenIconUrlNotification");
+
+ smart_objects::SmartObject* so = GetLockScreenIconUrlNotification(connection_key);
+ PrintSmartObject(*so);
+ DCHECK(ApplicationManagerImpl::instance()->ManageMobileCommand(so));
+}
+
void MessageHelper::SendHashUpdateNotification(const uint32_t app_id) {
- LOG4CXX_INFO(logger_, "SendHashUpdateNotification");
+ LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject* so = GetHashUpdateNotification(app_id);
+ smart_objects::SmartObjectSPtr so = GetHashUpdateNotification(app_id);
if (so) {
PrintSmartObject(*so);
if (!ApplicationManagerImpl::instance()->ManageMobileCommand(so)) {
LOG4CXX_ERROR_EXT(logger_, "Failed to send HashUpdate notification.");
+ } else {
+ ApplicationManagerImpl::instance()->resume_controller().ApplicationsDataUpdated();
}
}
}
@@ -398,11 +414,11 @@ void MessageHelper::SendHashUpdateNotification(const uint32_t app_id) {
void MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
int32_t connection_key,
mobile_api::AppInterfaceUnregisteredReason::eType reason) {
- smart_objects::SmartObject* notification = new smart_objects::SmartObject;
- if (!notification) {
- // TODO(VS): please add logger.
- return;
- }
+
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject;
+ DCHECK(notification);
smart_objects::SmartObject& message = *notification;
message[strings::params][strings::function_id] =
@@ -415,7 +431,12 @@ void MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
message[strings::msg_params][strings::reason] = static_cast<int32_t>(reason);
- DCHECK(ApplicationManagerImpl::instance()->ManageMobileCommand(notification));
+ if (ApplicationManagerImpl::instance()->ManageMobileCommand(notification)) {
+ LOG4CXX_DEBUG(logger_, "Mobile command sent");
+ }
+ else {
+ LOG4CXX_WARN(logger_, "Cannot send mobile command");
+ }
}
const VehicleData& MessageHelper::vehicle_data() {
@@ -446,6 +467,7 @@ std::string MessageHelper::StringifiedHMILevel(
std::string MessageHelper::StringifiedFunctionID(
mobile_apis::FunctionID::eType function_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
using namespace NsSmartDeviceLink::NsSmartObjects;
const char* str = 0;
if (EnumConversionHelper<mobile_apis::FunctionID::eType>::EnumToCString(
@@ -494,11 +516,13 @@ static std::map<std::string, uint16_t> vehicle_data_args = create_get_vehicle_da
}
#endif
-void MessageHelper::CreateGetVehicleDataRequest(uint32_t correlation_id, const std::vector<std::string>& params) {
+void MessageHelper::CreateGetVehicleDataRequest(
+ uint32_t correlation_id, const std::vector<std::string>& params) {
+ LOG4CXX_AUTO_TRACE(logger_);
#ifdef HMI_DBUS_API
for (std::vector<std::string>::const_iterator it = params.begin();
it != params.end(); it++) {
- smart_objects::SmartObject* request = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr request = new smart_objects::SmartObject;
(*request)[strings::params][strings::message_type] = static_cast<int>(kRequest);
(*request)[strings::params][strings::correlation_id] = correlation_id;
@@ -511,7 +535,7 @@ void MessageHelper::CreateGetVehicleDataRequest(uint32_t correlation_id, const s
ApplicationManagerImpl::instance()->ManageHMICommand(request);
}
#else
- smart_objects::SmartObject* request = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr request = new smart_objects::SmartObject;
(*request)[strings::params][strings::message_type] = static_cast<int>(kRequest);
(*request)[strings::params][strings::function_id] =
@@ -530,14 +554,12 @@ void MessageHelper::CreateGetVehicleDataRequest(uint32_t correlation_id, const s
#endif
}
-smart_objects::SmartObject* MessageHelper::CreateBlockedByPoliciesResponse(
- mobile_apis::FunctionID::eType function_id,
- mobile_apis::Result::eType result, uint32_t correlation_id,
- uint32_t connection_key) {
- smart_objects::SmartObject* response = new smart_objects::SmartObject;
- if (!response) {
- return NULL;
- }
+smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse(
+ mobile_apis::FunctionID::eType function_id,
+ mobile_apis::Result::eType result, uint32_t correlation_id,
+ uint32_t connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr response = new smart_objects::SmartObject;
(*response)[strings::params][strings::function_id] =
static_cast<int>(function_id);
@@ -555,14 +577,11 @@ smart_objects::SmartObject* MessageHelper::CreateBlockedByPoliciesResponse(
return response;
}
-smart_objects::SmartObject* MessageHelper::CreateDeviceListSO(
+smart_objects::SmartObjectSPtr MessageHelper::CreateDeviceListSO(
const connection_handler::DeviceMap& devices) {
- smart_objects::SmartObject* device_list_so = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
-
- if (NULL == device_list_so) {
- return NULL;
- }
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr device_list_so =
+ new smart_objects::SmartObject(smart_objects::SmartType_Map);
(*device_list_so)[strings::device_list] = smart_objects::SmartObject(
smart_objects::SmartType_Array);
@@ -574,21 +593,24 @@ smart_objects::SmartObject* MessageHelper::CreateDeviceListSO(
const connection_handler::Device& d =
static_cast<connection_handler::Device>(it->second);
list_so[index][strings::name] = d.user_friendly_name();
- list_so[index][strings::id] = it->second.device_handle();
+ list_so[index][strings::id] = it->second.mac_address();
const policy::DeviceConsent device_consent =
policy::PolicyHandler::instance()->GetUserConsentForDevice(it->second.mac_address());
list_so[index][strings::isSDLAllowed] =
policy::DeviceConsent::kDeviceAllowed == device_consent;
+ list_so[index][strings::transport_type] =
+ ApplicationManagerImpl::instance()->GetDeviceTransportType(d.connection_type());
+ ++index;
}
- ++index;
return device_list_so;
}
-smart_objects::SmartObject* MessageHelper::CreateModuleInfoSO(
- uint32_t function_id) {
- smart_objects::SmartObject* module_info = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO(
+ uint32_t function_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr module_info = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
smart_objects::SmartObject& object = *module_info;
object[strings::params][strings::message_type] = static_cast<int>(kRequest);
object[strings::params][strings::function_id] = static_cast<int>(function_id);
@@ -599,10 +621,11 @@ smart_objects::SmartObject* MessageHelper::CreateModuleInfoSO(
return module_info;
}
-smart_objects::SmartObject* MessageHelper::CreateSetAppIcon(
+smart_objects::SmartObjectSPtr MessageHelper::CreateSetAppIcon(
const std::string& path_to_icon, uint32_t app_id) {
- smart_objects::SmartObject* set_icon = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr set_icon = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!set_icon) {
return NULL;
@@ -619,34 +642,40 @@ smart_objects::SmartObject* MessageHelper::CreateSetAppIcon(
}
bool MessageHelper::SendIVISubscribtions(const uint32_t app_id) {
- LOG4CXX_INFO(logger_, " MessageHelper::SendIVISubscribtions ");
+ LOG4CXX_AUTO_TRACE(logger_);
- bool succes = true;
+ bool result = true;
ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
app_id);
- DCHECK(app.get());
- SmartObjectList requests = GetIVISubscribtionRequests(app_id);
- for (SmartObjectList::const_iterator it = requests.begin();
+ if (!app.valid()) {
+ LOG4CXX_ERROR(logger_, "Invalid application " << app_id);
+ return result;
+ }
+
+ smart_objects::SmartObjectList requests = GetIVISubscriptionRequests(app);
+ for (smart_objects::SmartObjectList::const_iterator it = requests.begin();
it != requests.end(); ++it) {
if (!ApplicationManagerImpl::instance()->ManageHMICommand(*it)) {
- succes = false;
+ result = false;
}
}
- return succes;
+ return result;
}
-MessageHelper::SmartObjectList MessageHelper::GetIVISubscribtionRequests(
- const uint32_t app_id) {
- LOG4CXX_INFO(logger_, " MessageHelper::GetIVISubscribtionRequests ");
+smart_objects::SmartObjectList MessageHelper::GetIVISubscriptionRequests(
+ ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
- app_id);
- DCHECK(app);
+ 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_id;
+ msg_params[strings::app_id] = app->app_id();
const VehicleData& vehicle_data = MessageHelper::vehicle_data_;
VehicleData::const_iterator ivi_it = vehicle_data.begin();
const std::set<uint32_t>& subscribes = app->SubscribesIVI();
@@ -659,10 +688,9 @@ MessageHelper::SmartObjectList MessageHelper::GetIVISubscribtionRequests(
}
}
- SmartObjectList hmi_requests;
#ifdef HMI_JSON_API
- smart_objects::SmartObject* request = MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData);
+ smart_objects::SmartObjectSPtr request = MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData);
(*request)[strings::msg_params] = msg_params;
hmi_requests.push_back(request);
#endif // #ifdef HMI_JSON_API
@@ -672,7 +700,7 @@ MessageHelper::SmartObjectList MessageHelper::GetIVISubscribtionRequests(
const VehicleInfo_Requests& sr = ivi_subrequests[i];
if (true == msg_params.keyExists(sr.str)
&& true == msg_params[sr.str].asBool()) {
- smart_objects::SmartObject* request = MessageHelper::CreateModuleInfoSO(
+ smart_objects::SmartObjectSPtr request = MessageHelper::CreateModuleInfoSO(
sr.func_id);
(*request)[strings::msg_params] = msg_params;
hmi_requests.push_back(request);
@@ -682,13 +710,65 @@ MessageHelper::SmartObjectList MessageHelper::GetIVISubscribtionRequests(
return hmi_requests;
}
-void MessageHelper::SendAppDataToHMI(ApplicationConstSharedPtr app) {
- uint32_t id = app->app_id();
+void MessageHelper::SendOnButtonSubscriptionNotification(
+ uint32_t app_id, hmi_apis::Common_ButtonName::eType button, bool is_subscribed) {
+ using namespace smart_objects;
+ using namespace hmi_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SmartObjectSPtr notification_ptr = utils::MakeShared<SmartObject>(SmartType_Map);
+ if (!notification_ptr) {
+ LOG4CXX_ERROR(logger_, "Memory allocation failed.");
+ return;
+ }
+ SmartObject& notification = *notification_ptr;
+
+ SmartObject msg_params = SmartObject(SmartType_Map);
+ msg_params[strings::app_id] = app_id;
+ msg_params[strings::name] = button;
+ msg_params[strings::is_suscribed] = is_subscribed;
+
+ notification[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ notification[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ notification[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ notification[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription;
+ notification[strings::msg_params] = msg_params;
+
+ if (!ApplicationManagerImpl::instance()->ManageHMICommand(notification_ptr)) {
+ LOG4CXX_ERROR(logger_, "Unable to send HMI notification");
+ }
+}
- utils::SharedPtr<smart_objects::SmartObject> set_app_icon(
- new smart_objects::SmartObject);
+void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(
+ ApplicationConstSharedPtr app) {
+ using namespace smart_objects;
+ using namespace hmi_apis;
+ using namespace mobile_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!app.valid()) {
+ LOG4CXX_ERROR(logger_, "Invalid application pointer ");
+ return;
+ }
+
+ std::set<ButtonName::eType> subscriptions = app->SubscribedButtons();
+ std::set<ButtonName::eType>::iterator it = subscriptions.begin();
+ for (; subscriptions.end() != it; ++it) {
+ SendOnButtonSubscriptionNotification(
+ app->hmi_app_id(), static_cast<Common_ButtonName::eType>(*it), true);
+ }
+}
+
+void MessageHelper::SendSetAppIcon(uint32_t app_id,
+ const std::string& icon_path) {
+ using namespace smart_objects;
+ SmartObjectSPtr set_app_icon(new smart_objects::SmartObject);
if (set_app_icon) {
- smart_objects::SmartObject& so_to_send = *set_app_icon;
+ SmartObject& so_to_send = *set_app_icon;
so_to_send[strings::params][strings::function_id] =
static_cast<int>(hmi_apis::FunctionID::UI_SetAppIcon);
so_to_send[strings::params][strings::message_type] =
@@ -702,41 +782,52 @@ void MessageHelper::SendAppDataToHMI(ApplicationConstSharedPtr app) {
so_to_send[strings::msg_params] = smart_objects::SmartObject(
smart_objects::SmartType_Map);
- smart_objects::SmartObject* msg_params = MessageHelper::CreateSetAppIcon(
- app->app_icon_path(), id);
+ SmartObjectSPtr msg_params(MessageHelper::CreateSetAppIcon(icon_path, app_id));
if (msg_params) {
so_to_send[strings::msg_params] = *msg_params;
}
- // TODO(PV): appropriate handling of result
- DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(set_app_icon));
+ ApplicationManagerImpl::instance()->ManageHMICommand(set_app_icon);
}
+}
- SendGlobalPropertiesToHMI(app);
- SendShowRequestToHMI(app);
+void MessageHelper::SendAppDataToHMI(ApplicationConstSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (app) {
+ SendSetAppIcon(app, app->app_icon_path());
+ SendGlobalPropertiesToHMI(app);
+ SendShowRequestToHMI(app);
+ }
}
void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app) {
- DCHECK(app.get());
+ if (!app.valid()) {
+ LOG4CXX_ERROR(logger_, "Invalid application");
+ return;
+ }
- SmartObjectList requests = CreateGlobalPropertiesRequestsToHMI(app);
- for (SmartObjectList::const_iterator it = requests.begin();
+ smart_objects::SmartObjectList requests = CreateGlobalPropertiesRequestsToHMI(app);
+ for (smart_objects::SmartObjectList::const_iterator it = requests.begin();
it != requests.end(); ++it) {
DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(*it))
}
}
-MessageHelper::SmartObjectList MessageHelper::CreateGlobalPropertiesRequestsToHMI(
+smart_objects::SmartObjectList MessageHelper::CreateGlobalPropertiesRequestsToHMI(
ApplicationConstSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
- SmartObjectList requests;
- DCHECK(app.get());
+ smart_objects::SmartObjectList requests;
+ if (!app.valid()) {
+ LOG4CXX_ERROR(logger_, "Invalid application");
+ return requests;
+ }
// UI global properties
if (app->vr_help_title() || app->vr_help()) {
- smart_objects::SmartObject* ui_global_properties =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr ui_global_properties =
+ new smart_objects::SmartObject(smart_objects::SmartType_Map);
if (!ui_global_properties) {
return requests;
@@ -779,8 +870,8 @@ MessageHelper::SmartObjectList MessageHelper::CreateGlobalPropertiesRequestsToHM
// TTS global properties
if (app->help_prompt() || app->timeout_prompt()) {
- smart_objects::SmartObject* tts_global_properties =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr tts_global_properties =
+ new smart_objects::SmartObject(smart_objects::SmartType_Map);
if (!tts_global_properties) {
return requests;
@@ -816,10 +907,11 @@ MessageHelper::SmartObjectList MessageHelper::CreateGlobalPropertiesRequestsToHM
void MessageHelper::SendTTSGlobalProperties(
ApplicationSharedPtr app, bool default_help_prompt) {
- if (!app.valid()) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app) {
return;
}
- utils::SharedPtr<smart_objects::SmartObject> tts_global_properties(
+ smart_objects::SmartObjectSPtr tts_global_properties(
new smart_objects::SmartObject);
if (tts_global_properties) {
smart_objects::SmartObject& so_to_send = *tts_global_properties;
@@ -838,7 +930,8 @@ void MessageHelper::SendTTSGlobalProperties(
msg_params[strings::help_prompt] = smart_objects::SmartObject(
smart_objects::SmartType_Array);
if (default_help_prompt) {
- const CommandsMap& commands = app->commands_map();
+ const DataAccessor<CommandsMap> accessor = app->commands_map();
+ const CommandsMap& commands = accessor.GetData();
CommandsMap::const_iterator it = commands.begin();
uint32_t index = 0;
for (; commands.end() != it; ++it) {
@@ -859,32 +952,27 @@ void MessageHelper::SendTTSGlobalProperties(
}
}
-smart_objects::SmartObject* MessageHelper::CreateAppVrHelp(
+smart_objects::SmartObjectSPtr MessageHelper::CreateAppVrHelp(
ApplicationConstSharedPtr app) {
- smart_objects::SmartObject* result = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!result) {
return NULL;
}
smart_objects::SmartObject& vr_help = *result;
vr_help[strings::vr_help_title] = app->name();
- ApplicationManagerImpl::ApplicationListAccessor accessor;
- const std::set<ApplicationSharedPtr> apps = accessor.applications();
-
int32_t index = 0;
- std::set<ApplicationSharedPtr>::const_iterator it_app = apps.begin();
- for (; apps.end() != it_app; ++it_app) {
- if ((*it_app)->vr_synonyms()) {
- smart_objects::SmartObject item(smart_objects::SmartType_Map);
- item[strings::text] = (*((*it_app)->vr_synonyms())).getElement(0);
- item[strings::position] = index + 1;
- vr_help[strings::vr_help][index++] = item;
- }
+ if (app->vr_synonyms()) {
+ smart_objects::SmartObject item(smart_objects::SmartType_Map);
+ item[strings::text] = (*(app->vr_synonyms())).getElement(0);
+ item[strings::position] = index + 1;
+ vr_help[strings::vr_help][index++] = item;
}
// copy all app VR commands
- const CommandsMap& commands = app->commands_map();
+ const DataAccessor<CommandsMap> cmd_accessor = app->commands_map();
+ const CommandsMap& commands = cmd_accessor.GetData();
CommandsMap::const_iterator it = commands.begin();
for (; commands.end() != it; ++it) {
@@ -896,14 +984,18 @@ smart_objects::SmartObject* MessageHelper::CreateAppVrHelp(
return result;
}
-MessageHelper::SmartObjectList MessageHelper::CreateShowRequestToHMI(
- ApplicationConstSharedPtr app) {
- DCHECK(app.get());
+smart_objects::SmartObjectList MessageHelper::CreateShowRequestToHMI(
+ ApplicationConstSharedPtr app) {
+
+ smart_objects::SmartObjectList requests;
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Invalid application");
+ return requests;
+ }
- SmartObjectList requests;
- smart_objects::SmartObject* ui_show = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
if (app->show_command()) {
+ smart_objects::SmartObjectSPtr ui_show = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
(*ui_show)[strings::params][strings::function_id] =
static_cast<int>(hmi_apis::FunctionID::UI_Show);
(*ui_show)[strings::params][strings::message_type] =
@@ -924,10 +1016,10 @@ void MessageHelper::SendShowRequestToHMI(ApplicationConstSharedPtr app) {
if (!app) {
return;
}
- SmartObjectList shows = CreateShowRequestToHMI(app);
+ smart_objects::SmartObjectList shows = CreateShowRequestToHMI(app);
- for (SmartObjectList::const_iterator it = shows.begin(); it != shows.end();
- ++it) {
+ for (smart_objects::SmartObjectList::const_iterator it = shows.begin();
+ it != shows.end(); ++it) {
DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(*it));
}
@@ -939,14 +1031,12 @@ void MessageHelper::SendShowConstantTBTRequestToHMI(
return;
}
- smart_objects::SmartObject* navi_show_tbt = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
-
- if (!navi_show_tbt) {
- return;
- }
-
if (app->tbt_show_command()) {
+ utils::SharedPtr<smart_objects::SmartObject> navi_show_tbt =
+ new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ if (!navi_show_tbt) {
+ return;
+ }
(*navi_show_tbt)[strings::params][strings::function_id] =
static_cast<int>(hmi_apis::FunctionID::Navigation_ShowConstantTBT);
(*navi_show_tbt)[strings::params][strings::message_type] =
@@ -966,25 +1056,30 @@ void MessageHelper::SendAddCommandRequestToHMI(ApplicationConstSharedPtr app) {
if (!app) {
return;
}
- SmartObjectList requests = CreateAddCommandRequestToHMI(app);
- for (SmartObjectList::iterator it = requests.begin(); it != requests.end();
+ smart_objects::SmartObjectList requests = CreateAddCommandRequestToHMI(app);
+ for (smart_objects::SmartObjectList::iterator it = requests.begin(); it != requests.end();
++it) {
DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(*it));
}
}
-MessageHelper::SmartObjectList MessageHelper::CreateAddCommandRequestToHMI(
+smart_objects::SmartObjectList MessageHelper::CreateAddCommandRequestToHMI(
ApplicationConstSharedPtr app) {
- DCHECK(app.get());
- SmartObjectList requests;
- const CommandsMap& commands = app->commands_map();
+ smart_objects::SmartObjectList requests;
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Invalid application");
+ return requests;
+ }
+
+ const DataAccessor<CommandsMap> accessor = app->commands_map();
+ const CommandsMap& commands = accessor.GetData();
CommandsMap::const_iterator i = commands.begin();
for (; commands.end() != i; ++i) {
// UI Interface
if ((*i->second).keyExists(strings::menu_params)) {
- smart_objects::SmartObject* ui_command = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr ui_command = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!ui_command) {
return requests;
@@ -1026,10 +1121,11 @@ MessageHelper::SmartObjectList MessageHelper::CreateAddCommandRequestToHMI(
return requests;
}
-smart_objects::SmartObject* MessageHelper::CreateChangeRegistration(
- int32_t function_id, int32_t language, uint32_t app_id) {
- smart_objects::SmartObject* command = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+smart_objects::SmartObjectSPtr MessageHelper::CreateChangeRegistration(
+ int32_t function_id, int32_t language, uint32_t app_id,
+ const smart_objects::SmartObject* app_types) {
+ smart_objects::SmartObjectSPtr command = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!command) {
return NULL;
}
@@ -1052,16 +1148,37 @@ smart_objects::SmartObject* MessageHelper::CreateChangeRegistration(
msg_params[strings::language] = language;
msg_params[strings::app_id] = app_id;
+ if (app_types != NULL) {
+ msg_params[strings::app_hmi_type] = *app_types;
+ }
+
params[strings::msg_params] = msg_params;
return command;
}
+void MessageHelper::SendUIChangeRegistrationRequestToHMI(ApplicationConstSharedPtr app) {
+ if (!app.valid()) {
+ LOG4CXX_ERROR(logger_, "Application is not valid");
+ return;
+ }
+
+ if (NULL != app->app_types()) {
+ smart_objects::SmartObjectSPtr ui_command = CreateChangeRegistration(
+ hmi_apis::FunctionID::UI_ChangeRegistration, app->ui_language(),
+ app->app_id(), app->app_types());
+
+ if (ui_command) {
+ ApplicationManagerImpl::instance()->ManageHMICommand(ui_command);
+ }
+ }
+}
+
void MessageHelper::SendChangeRegistrationRequestToHMI(ApplicationConstSharedPtr app) {
if (!app.valid()) {
return;
}
if (mobile_apis::Language::INVALID_ENUM != app->language()) {
- smart_objects::SmartObject* vr_command = CreateChangeRegistration(
+ smart_objects::SmartObjectSPtr vr_command = CreateChangeRegistration(
hmi_apis::FunctionID::VR_ChangeRegistration, app->language(),
app->app_id());
@@ -1071,7 +1188,7 @@ void MessageHelper::SendChangeRegistrationRequestToHMI(ApplicationConstSharedPtr
}
if (mobile_apis::Language::INVALID_ENUM != app->language()) {
- smart_objects::SmartObject* tts_command = CreateChangeRegistration(
+ smart_objects::SmartObjectSPtr tts_command = CreateChangeRegistration(
hmi_apis::FunctionID::TTS_ChangeRegistration, app->language(),
app->app_id());
@@ -1081,7 +1198,7 @@ void MessageHelper::SendChangeRegistrationRequestToHMI(ApplicationConstSharedPtr
}
if (mobile_apis::Language::INVALID_ENUM != app->ui_language()) {
- smart_objects::SmartObject* ui_command = CreateChangeRegistration(
+ smart_objects::SmartObjectSPtr ui_command = CreateChangeRegistration(
hmi_apis::FunctionID::UI_ChangeRegistration, app->ui_language(),
app->app_id());
@@ -1095,18 +1212,17 @@ void MessageHelper::SendChangeRegistrationRequestToHMI(ApplicationConstSharedPtr
void MessageHelper::SendAddVRCommandToHMI(
uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
uint32_t app_id) {
- smart_objects::SmartObject* request = CreateAddVRCommandToHMI(cmd_id,
+ smart_objects::SmartObjectSPtr request = CreateAddVRCommandToHMI(cmd_id,
vr_commands,
app_id);
DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(request));
}
-smart_objects::SmartObject* MessageHelper::CreateAddVRCommandToHMI(
- uint32_t cmd_id,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& vr_commands,
- uint32_t app_id) {
- smart_objects::SmartObject* vr_command = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+smart_objects::SmartObjectSPtr MessageHelper::CreateAddVRCommandToHMI(
+ uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
+ uint32_t app_id) {
+ smart_objects::SmartObjectSPtr vr_command = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!vr_command) {
return NULL;
@@ -1143,50 +1259,97 @@ smart_objects::SmartObject* MessageHelper::CreateAddVRCommandToHMI(
bool MessageHelper::CreateHMIApplicationStruct(ApplicationConstSharedPtr app,
smart_objects::SmartObject& output) {
+ using namespace smart_objects;
+ LOG4CXX_AUTO_TRACE(logger_);
- if (false == app.valid()) {
+ if (!app) {
+ LOG4CXX_WARN(logger_, "Application is not valid");
return false;
}
- const smart_objects::SmartObject* app_types = app->app_types();
- const smart_objects::SmartObject* ngn_media_screen_name = app->ngn_media_screen_name();
+ const SmartObject* app_types = app->app_types();
+ DCHECK_OR_RETURN(app_types, false);
+ const SmartObject* ngn_media_screen_name = app->ngn_media_screen_name();
+ DCHECK_OR_RETURN(ngn_media_screen_name, false);
const connection_handler::DeviceHandle handle = app->device();
std::string device_name = ApplicationManagerImpl::instance()->GetDeviceName(handle);
- output = smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::string mac_address;
+ std::string transport_type;
+ if (-1 == connection_handler::ConnectionHandlerImpl::instance()->
+ GetDataOnDeviceID(app->device(), &device_name,
+ NULL, &mac_address, &transport_type)) {
+ LOG4CXX_ERROR(logger_, "Failed to extract information for device "
+ << app->device());
+ }
+
+ output = SmartObject(SmartType_Map);
output[strings::app_name] = app->name();
output[strings::icon] = app->app_icon_path();
- output[strings::device_name] = device_name;
- output[strings::app_id] = app->app_id();
- output[strings::hmi_display_language_desired] = app->ui_language();
- output[strings::is_media_application] = app->is_media_application();
+ output[strings::app_id] = app->hmi_app_id();
+
+ if (app->IsRegistered()) {
+ output[strings::hmi_display_language_desired] = app->ui_language();
+ output[strings::is_media_application] = app->is_media_application();
+ }
+
+ if (!app->IsRegistered()) {
+ output[strings::greyOut] = app->is_greyed_out();
+ const SmartObject* app_tts_name = app->tts_name();
+ DCHECK_OR_RETURN(app_tts_name, false);
+ if (!app_tts_name->empty()) {
+ SmartObject output_tts_name = SmartObject(SmartType_Array);
+ output_tts_name[0][strings::text] = *(app->tts_name());
+ output_tts_name[0][strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT;
+ output[json::ttsName] = output_tts_name;
+ }
+ if (!app->vr_synonyms()->empty()) {
+ output[json::vrSynonyms] = *(app->vr_synonyms());
+ }
+ }
- if (NULL != ngn_media_screen_name) {
+ if (ngn_media_screen_name) {
output[strings::ngn_media_screen_app_name] = ngn_media_screen_name->asString();
}
- if (NULL != app_types) {
+ if (app_types) {
output[strings::app_type] = *app_types;
}
+
+ output[strings::device_info] = smart_objects::SmartObject(smart_objects::SmartType_Map);
+ output[strings::device_info][strings::name] = device_name;
+ output[strings::device_info][strings::id] = mac_address;
+ const policy::DeviceConsent device_consent =
+ policy::PolicyHandler::instance()->GetUserConsentForDevice(mac_address);
+ output[strings::device_info][strings::isSDLAllowed] =
+ policy::DeviceConsent::kDeviceAllowed == device_consent;
+
+ output[strings::device_info][strings::transport_type] =
+ ApplicationManagerImpl::instance()->GetDeviceTransportType(transport_type);
return true;
}
void MessageHelper::SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app) {
- DCHECK(app.get());
- SmartObjectList requests = CreateAddSubMenuRequestToHMI(app);
- for (SmartObjectList::iterator it = requests.begin(); it != requests.end();
- ++it) {
+ if (!app.valid()) {
+ LOG4CXX_ERROR(logger_, "Invalid application");
+ return;
+ }
+
+ smart_objects::SmartObjectList requests = CreateAddSubMenuRequestToHMI(app);
+ for (smart_objects::SmartObjectList::iterator it = requests.begin();
+ it != requests.end(); ++it) {
DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(*it));
}
}
-MessageHelper::SmartObjectList MessageHelper::CreateAddSubMenuRequestToHMI(
+smart_objects::SmartObjectList MessageHelper::CreateAddSubMenuRequestToHMI(
ApplicationConstSharedPtr app) {
- SmartObjectList requsets;
- const SubMenuMap& sub_menu = app->sub_menu_map();
+ smart_objects::SmartObjectList requsets;
+ const DataAccessor<SubMenuMap> accessor = app->sub_menu_map();
+ const SubMenuMap& sub_menu = accessor.GetData();
SubMenuMap::const_iterator i = sub_menu.begin();
for (; sub_menu.end() != i; ++i) {
- smart_objects::SmartObject* ui_sub_menu = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr ui_sub_menu = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!ui_sub_menu) {
return requsets;
@@ -1220,8 +1383,8 @@ MessageHelper::SmartObjectList MessageHelper::CreateAddSubMenuRequestToHMI(
void MessageHelper::SendOnAppUnregNotificationToHMI(
ApplicationConstSharedPtr app, bool is_unexpected_disconnect) {
- smart_objects::SmartObject* notification = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!notification) {
return;
}
@@ -1237,46 +1400,50 @@ void MessageHelper::SendOnAppUnregNotificationToHMI(
message[strings::msg_params][strings::app_id] = app->hmi_app_id();
message[strings::msg_params][strings::unexpected_disconnect] =
is_unexpected_disconnect;
- ApplicationManagerImpl::instance()->ManageHMICommand(&message);
+ ApplicationManagerImpl::instance()->ManageHMICommand(notification);
}
-void MessageHelper::SendActivateAppToHMI(uint32_t const app_id,
- hmi_apis::Common_HMILevel::eType level) {
- smart_objects::SmartObject* message = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
-
+uint32_t MessageHelper::SendActivateAppToHMI(uint32_t const app_id,
+ hmi_apis::Common_HMILevel::eType level,
+ bool send_policy_priority) {
+ uint32_t correlation_id = 0;
application_manager::ApplicationConstSharedPtr app =
application_manager::ApplicationManagerImpl::instance()
->application(app_id);
- if (!app.valid()) {
+ if (!app) {
LOG4CXX_WARN(logger_, "Invalid app_id: " << app_id);
- return;
+ return correlation_id;
}
+ correlation_id =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+ utils::SharedPtr<smart_objects::SmartObject> message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_ActivateApp;
(*message)[strings::params][strings::message_type] = MessageType::kRequest;
- (*message)[strings::params][strings::correlation_id] =
- ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+ (*message)[strings::params][strings::correlation_id] = correlation_id;
(*message)[strings::msg_params][strings::app_id] = app_id;
- std::string priority;
- // TODO(KKolodiy): need remove method policy_manager
-
- policy::PolicyHandler::instance()->GetPriority(
- app->mobile_app_id()->asString(), &priority);
- // According SDLAQ-CRS-2794
- // SDL have to send ActivateApp without "proirity" parameter to HMI.
- // in case of unconsented device
- std::string mac_adress;
- connection_handler::DeviceHandle device_handle = app->device();
- connection_handler::ConnectionHandlerImpl::instance()->
- GetDataOnDeviceID(device_handle, NULL, NULL, &mac_adress, NULL);
-
- policy::DeviceConsent consent =
- policy::PolicyHandler::instance()->GetUserConsentForDevice(mac_adress);
- if (!priority.empty() && (policy::DeviceConsent::kDeviceAllowed == consent)) {
- (*message)[strings::msg_params]["priority"] = GetPriorityCode(priority);
+ if (send_policy_priority) {
+ std::string priority;
+ // TODO(KKolodiy): need remove method policy_manager
+
+ policy::PolicyHandler::instance()->GetPriority(
+ app->mobile_app_id(), &priority);
+ // According SDLAQ-CRS-2794
+ // SDL have to send ActivateApp without "proirity" parameter to HMI.
+ // in case of unconsented device
+ std::string mac_adress;
+ connection_handler::DeviceHandle device_handle = app->device();
+ connection_handler::ConnectionHandlerImpl::instance()->
+ GetDataOnDeviceID(device_handle, NULL, NULL, &mac_adress, NULL);
+
+ policy::DeviceConsent consent =
+ policy::PolicyHandler::instance()->GetUserConsentForDevice(mac_adress);
+ if (!priority.empty() && (policy::DeviceConsent::kDeviceAllowed == consent)) {
+ (*message)[strings::msg_params][strings::priority] = GetPriorityCode(priority);
+ }
}
// We haven't send HMI level to HMI in case it FULL.
@@ -1286,21 +1453,22 @@ void MessageHelper::SendActivateAppToHMI(uint32_t const app_id,
}
ApplicationManagerImpl::instance()->ManageHMICommand(message);
+ return correlation_id;
}
void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id) {
LOG4CXX_WARN(logger_, "SendOnResumeAudioSourceToHMI app_id: " << app_id);
-
- smart_objects::SmartObject* message = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
application_manager::ApplicationConstSharedPtr app =
application_manager::ApplicationManagerImpl::instance()
->application(app_id);
- if (!app.valid()) {
+ if (!app) {
LOG4CXX_WARN(logger_, "Invalid app_id: " << app_id);
return;
}
+ utils::SharedPtr<smart_objects::SmartObject> message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
(*message)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_OnResumeAudioSource;
(*message)[strings::params][strings::message_type] = MessageType::kNotification;
@@ -1317,7 +1485,7 @@ std::string MessageHelper::GetDeviceMacAddressForHandle(
std::string device_mac_address = "";
connection_handler::ConnectionHandlerImpl::instance()->GetDataOnDeviceID(
device_handle, NULL, NULL, &device_mac_address);
-
+ LOG4CXX_DEBUG(logger_, "result : " << device_handle);
return device_mac_address;
}
@@ -1345,8 +1513,8 @@ void MessageHelper::GetDeviceInfoForApp(uint32_t connection_key,
void MessageHelper::SendSDLActivateAppResponse(policy::AppPermissions& permissions,
uint32_t correlation_id) {
- smart_objects::SmartObject* message = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!message) {
return;
}
@@ -1366,7 +1534,7 @@ void MessageHelper::SendSDLActivateAppResponse(policy::AppPermissions& permissio
(*message)[strings::msg_params]["device"]["name"] = permissions.deviceInfo
.device_name;
(*message)[strings::msg_params]["device"]["id"] = permissions.deviceInfo
- .device_handle;
+ .device_mac_address;
}
(*message)[strings::msg_params]["isAppRevoked"] = permissions.appRevoked;
@@ -1391,21 +1559,12 @@ void MessageHelper::SendSDLActivateAppResponse(policy::AppPermissions& permissio
if (permissions.appRevoked || !permissions.isSDLAllowed) {
return;
}
-
- // Send HMI status notification to mobile
- ApplicationSharedPtr app = ApplicationManagerImpl::instance()
- ->application_by_policy_id(permissions.application_id);
- if (app) {
- ApplicationManagerImpl::instance()->ActivateApplication(app);
- } else {
- LOG4CXX_WARN(logger_, "Unable to find app_id: " << permissions.application_id);
- }
}
void MessageHelper::SendOnSDLConsentNeeded(
const policy::DeviceParams& device_info) {
- smart_objects::SmartObject* message = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!message) {
return;
}
@@ -1415,7 +1574,7 @@ void MessageHelper::SendOnSDLConsentNeeded(
(*message)[strings::params][strings::message_type] =
MessageType::kNotification;
- (*message)[strings::msg_params]["device"]["id"] = device_info.device_handle;
+ (*message)[strings::msg_params]["device"]["id"] = device_info.device_mac_address;
(*message)[strings::msg_params]["device"]["name"] = device_info.device_name;
ApplicationManagerImpl::instance()->ManageHMICommand(message);
@@ -1425,8 +1584,8 @@ void MessageHelper::SendPolicyUpdate(
const std::string& file_path,
int timeout,
const std::vector<int>& retries) {
- smart_objects::SmartObject* message = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
smart_objects::SmartObject& object = *message;
object[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_PolicyUpdate;
@@ -1451,8 +1610,8 @@ void MessageHelper::SendPolicyUpdate(
void MessageHelper::SendGetUserFriendlyMessageResponse(
const std::vector<policy::UserFriendlyMessage>& msg,
uint32_t correlation_id) {
- smart_objects::SmartObject* message = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!message) {
return;
}
@@ -1476,12 +1635,6 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
smart_objects::SmartObject& user_friendly_messages =
(*message)[strings::msg_params][messages];
-
- const std::string tts = "ttsString";
- const std::string label = "label";
- const std::string line1 = "line1";
- const std::string line2 = "line2";
- const std::string textBody = "textBody";
const std::string message_code = "messageCode";
std::vector<policy::UserFriendlyMessage>::const_iterator it = msg.begin();
@@ -1492,22 +1645,6 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
smart_objects::SmartObject& obj = user_friendly_messages[index];
obj[message_code] = it->message_code;
-
- if (!it->tts.empty()) {
- obj[tts] = it->tts;
- }
- if (!it->label.empty()) {
- obj[label] = it->label;
- }
- if (!it->line1.empty()) {
- obj[line1] = it->line1;
- }
- if (!it->line2.empty()) {
- obj[line2] = it->line2;
- }
- if (!it->text_body.empty()) {
- obj[textBody] = it->text_body;
- }
}
ApplicationManagerImpl::instance()->ManageHMICommand(message);
@@ -1516,8 +1653,8 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
void MessageHelper::SendGetListOfPermissionsResponse(
const std::vector<policy::FunctionalGroupPermission>& permissions,
uint32_t correlation_id) {
- smart_objects::SmartObject* message = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!message) {
return;
}
@@ -1557,11 +1694,11 @@ void MessageHelper::SendGetListOfPermissionsResponse(
ApplicationManagerImpl::instance()->ManageHMICommand(message);
}
-smart_objects::SmartObject* MessageHelper::CreateNegativeResponse(
- uint32_t connection_key, int32_t function_id, uint32_t correlation_id,
- int32_t result_code) {
- smart_objects::SmartObject* response = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+smart_objects::SmartObjectSPtr MessageHelper::CreateNegativeResponse(
+ uint32_t connection_key, int32_t function_id, uint32_t correlation_id,
+ int32_t result_code) {
+ smart_objects::SmartObjectSPtr response = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
smart_objects::SmartObject& response_data = *response;
response_data[strings::params][strings::function_id] = function_id;
response_data[strings::params][strings::message_type] =
@@ -1579,9 +1716,9 @@ smart_objects::SmartObject* MessageHelper::CreateNegativeResponse(
}
void MessageHelper::SendNaviStartStream(int32_t connection_key) {
- LOG4CXX_INFO(logger_, "MessageHelper::SendNaviStartStream");
- smart_objects::SmartObject* start_stream = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr start_stream = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!start_stream) {
return;
@@ -1628,8 +1765,8 @@ void MessageHelper::SendNaviStartStream(int32_t connection_key) {
}
void MessageHelper::SendNaviStopStream(int32_t connection_key) {
- smart_objects::SmartObject* stop_stream = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr stop_stream = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!stop_stream) {
return;
@@ -1662,8 +1799,8 @@ void MessageHelper::SendNaviStopStream(int32_t connection_key) {
void MessageHelper::SendAudioStartStream(int32_t connection_key) {
- smart_objects::SmartObject* start_stream = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr start_stream = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!start_stream) {
return;
@@ -1711,8 +1848,8 @@ void MessageHelper::SendAudioStartStream(int32_t connection_key) {
}
void MessageHelper::SendAudioStopStream(int32_t connection_key) {
- smart_objects::SmartObject* stop_stream = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr stop_stream = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!stop_stream) {
return;
@@ -1743,14 +1880,43 @@ void MessageHelper::SendAudioStopStream(int32_t connection_key) {
ApplicationManagerImpl::instance()->ManageHMICommand(stop_stream);
}
+void MessageHelper::SendOnDataStreaming(protocol_handler::ServiceType service,
+ bool available) {
+ using namespace protocol_handler;
+ smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if (!notification) {
+ return;
+ }
+
+ if (ServiceType::kAudio != service && ServiceType::kMobileNav != service) {
+ return;
+ }
+
+ (*notification)[strings::params][strings::function_id] =
+ ServiceType::kAudio == service
+ ? hmi_apis::FunctionID::Navigation_OnAudioDataStreaming
+ : hmi_apis::FunctionID::Navigation_OnVideoDataStreaming;
+ (*notification)[strings::params][strings::message_type] =
+ hmi_apis::messageType::notification;
+ (*notification)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*notification)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+
+ (*notification)[strings::msg_params]["available"] = available;
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(notification);
+}
+
bool MessageHelper::SendStopAudioPathThru() {
LOG4CXX_INFO(logger_, "MessageHelper::SendAudioStopAudioPathThru");
- NsSmartDeviceLink::NsSmartObjects::SmartObject* result =
- new NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
const uint32_t hmi_correlation_id = ApplicationManagerImpl::instance()
->GetNextHMICorrelationID();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result;
+ smart_objects::SmartObject& request = *result;
request[strings::params][strings::message_type] = MessageType::kRequest;
request[strings::params][strings::function_id] =
hmi_apis::FunctionID::UI_EndAudioPassThru;
@@ -1765,40 +1931,102 @@ bool MessageHelper::SendStopAudioPathThru() {
void MessageHelper::SendPolicySnapshotNotification(
unsigned int connection_key, const std::vector<uint8_t>& policy_data,
const std::string& url, int timeout) {
- smart_objects::SmartObject* pt_notification = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
- smart_objects::SmartObject& content = *pt_notification;
- ;
- content[strings::params][strings::function_id] =
- mobile_apis::FunctionID::OnSystemRequestID;
- content[strings::params][strings::message_type] =
- mobile_apis::messageType::notification;
- content[strings::params][strings::protocol_type] =
- commands::CommandImpl::mobile_protocol_type_;
- content[strings::params][strings::protocol_version] =
- commands::CommandImpl::protocol_version_;
- content[strings::params][strings::connection_key] = connection_key;
+
+ using namespace mobile_apis;
+ using namespace smart_objects;
+
+ SmartObject content (SmartType_Map);
if (!url.empty()) {
content[strings::msg_params][mobile_notification::syncp_url] = url;
}
- content[strings::msg_params][strings::file_type] =
- mobile_apis::FileType::BINARY;
- content[strings::msg_params][strings::request_type] =
- mobile_apis::RequestType::HTTP;
- /*if (-1 != timeout) {
- content[strings::msg_params][mobile_notification::syncp_timeout] = timeout;
- }*/
- content[strings::params][strings::binary_data] = smart_objects::SmartObject(
- policy_data);
- ApplicationManagerImpl::instance()->ManageMobileCommand(pt_notification);
+
+ content[strings::msg_params][strings::request_type] = RequestType::HTTP;
+ content[strings::params][strings::binary_data] = SmartObject(policy_data);
+ content[strings::msg_params][strings::file_type] = FileType::BINARY;
+
+ SendSystemRequestNotification(connection_key, content);
+}
+
+void MessageHelper::SendSystemRequestNotification (uint32_t connection_key,
+ smart_objects::SmartObject& content) {
+
+ using namespace mobile_apis;
+ using namespace commands;
+ using namespace smart_objects;
+
+ content[strings::params][strings::function_id] = FunctionID::OnSystemRequestID;
+ content[strings::params][strings::message_type] = messageType::notification;
+ content[strings::params][strings::protocol_type] = CommandImpl::mobile_protocol_type_;
+ content[strings::params][strings::protocol_version] = CommandImpl::protocol_version_;
+
+ content[strings::params][strings::connection_key] = connection_key;
+
+ ApplicationManagerImpl::instance()->ManageMobileCommand(new SmartObject(content));
+}
+
+void MessageHelper::SendLaunchApp(uint32_t connection_key,
+ const std::string& urlSchema,
+ const std::string& packageName) {
+
+ using namespace mobile_apis;
+ using namespace smart_objects;
+
+ SmartObject content (SmartType_Map);
+ content[strings::msg_params][strings::request_type] = RequestType::LAUNCH_APP;
+ content[strings::msg_params][strings::app_id] = connection_key;
+ if (!urlSchema.empty()) {
+ content[strings::msg_params][strings::url] = urlSchema;
+ } else if (!packageName.empty()) {
+ content[strings::msg_params][strings::url] = packageName;
+ }
+
+ SendSystemRequestNotification(connection_key, content);
+}
+
+void application_manager::MessageHelper::SendQueryApps(
+ uint32_t connection_key) {
+ using namespace mobile_apis;
+ using namespace smart_objects;
+
+ policy::PolicyHandler* policy_handler = policy::PolicyHandler::instance();
+
+ SmartObject content (SmartType_Map);
+ content[strings::msg_params][strings::request_type] = RequestType::QUERY_APPS;
+ content[strings::msg_params][strings::url] = policy_handler->RemoteAppsUrl();
+ content[strings::msg_params][strings::timeout] =
+ policy_handler->TimeoutExchange();
+
+ Json::Value http;
+ Json::Value& http_header = http[http_request::httpRequest][http_request::headers];
+
+ const int timeout = policy_handler->TimeoutExchange();
+
+ http_header[http_request::content_type] = "application/json";
+ http_header[http_request::connect_timeout] = timeout;
+ http_header[http_request::do_output] = true;
+ http_header[http_request::do_input] = true;
+ http_header[http_request::use_caches] = false;
+ http_header[http_request::request_method] = http_request::GET;
+ http_header[http_request::read_timeout] = timeout;
+ http_header[http_request::instance_follow_redirect] = false;
+ http_header[http_request::charset] = "utf-8";
+ http_header[http_request::content_lenght] = 0;
+
+ std::string data = http_header.toStyledString();
+ std::vector<uint8_t> binary_data(data.begin(), data.end());
+
+ content[strings::params][strings::binary_data] = SmartObject(binary_data);
+ content[strings::msg_params][strings::file_type] = FileType::BINARY;
+
+ SendSystemRequestNotification(connection_key, content);
}
void MessageHelper::SendOnPermissionsChangeNotification(
uint32_t connection_key, const policy::Permissions& permissions) {
- smart_objects::SmartObject* notification = new smart_objects::SmartObject(
+ utils::SharedPtr<smart_objects::SmartObject> notification = new smart_objects::SmartObject(
smart_objects::SmartType_Map);
smart_objects::SmartObject& content = *notification;
- ;
+
content[strings::params][strings::function_id] =
mobile_apis::FunctionID::OnPermissionsChangeID;
content[strings::params][strings::message_type] =
@@ -1809,7 +2037,7 @@ void MessageHelper::SendOnPermissionsChangeNotification(
commands::CommandImpl::protocol_version_;
content[strings::params][strings::connection_key] = connection_key;
- smart_objects::SmartObject* p_msg_params = new smart_objects::SmartObject(
+ utils::SharedPtr<smart_objects::SmartObject> p_msg_params = new smart_objects::SmartObject(
smart_objects::SmartType_Map);
smart_objects::SmartObject& msg_params = *p_msg_params;
@@ -1937,13 +2165,13 @@ void MessageHelper::FillAppRevokedPermissions(
void MessageHelper::SendOnAppPermissionsChangedNotification(
uint32_t connection_key, const policy::AppPermissions& permissions) {
- smart_objects::SmartObject* notification = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ using namespace smart_objects;
+ SmartObjectSPtr notification = new SmartObject(SmartType_Map);
if (!notification) {
return;
}
- smart_objects::SmartObject& message = *notification;
+ SmartObject& message = *notification;
message[strings::params][strings::function_id] =
hmi_apis::FunctionID::SDL_OnAppPermissionChanged;
@@ -1974,14 +2202,22 @@ void MessageHelper::SendOnAppPermissionsChangedNotification(
message[strings::msg_params]["priority"] = GetPriorityCode(
permissions.priority);
}
+ if (permissions.requestTypeChanged) {
+ SmartObject request_types_array = SmartObject(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;
+ }
- ApplicationManagerImpl::instance()->ManageHMICommand(&message);
+ ApplicationManagerImpl::instance()->ManageHMICommand(notification);
}
void MessageHelper::SendGetStatusUpdateResponse(const std::string& status,
uint32_t correlation_id) {
- smart_objects::SmartObject* message = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!message) {
return;
}
@@ -1998,9 +2234,10 @@ void MessageHelper::SendGetStatusUpdateResponse(const std::string& status,
ApplicationManagerImpl::instance()->ManageHMICommand(message);
}
-void MessageHelper::SendUpdateSDLResponse(const std::string& result, uint32_t correlation_id) {
- smart_objects::SmartObject* message = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+void MessageHelper::SendUpdateSDLResponse(const std::string& result,
+ uint32_t correlation_id) {
+ smart_objects::SmartObjectSPtr message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!message) {
return;
}
@@ -2017,11 +2254,9 @@ void MessageHelper::SendUpdateSDLResponse(const std::string& result, uint32_t co
ApplicationManagerImpl::instance()->ManageHMICommand(message);
}
-
-
void MessageHelper::SendOnStatusUpdate(const std::string& status) {
- smart_objects::SmartObject* message = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!message) {
return;
}
@@ -2037,8 +2272,8 @@ void MessageHelper::SendOnStatusUpdate(const std::string& status) {
}
void MessageHelper::SendGetSystemInfoRequest() {
- smart_objects::SmartObject* message = new smart_objects::SmartObject(
- smart_objects::SmartType_Map);
+ smart_objects::SmartObjectSPtr message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
if (!message) {
return;
}
@@ -2063,6 +2298,7 @@ mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
for (uint32_t i = 0; i < message.length(); ++i) {
mobile_apis::Result::eType res = VerifyImageFiles(message[i], app);
if (mobile_apis::Result::SUCCESS != res) {
+ LOG4CXX_DEBUG(logger_, "VerifyImageFiles result:" << res);
return res;
}
}
@@ -2073,6 +2309,7 @@ mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
app);
if (mobile_apis::Result::SUCCESS != verification_result) {
+ LOG4CXX_DEBUG(logger_, "VerifyImageFiles result:" << verification_result);
return verification_result; // exit point
}
} else {
@@ -2083,6 +2320,7 @@ mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
if (strings::soft_buttons != (*key)) {
mobile_apis::Result::eType res = VerifyImageFiles(message[*key], app);
if (mobile_apis::Result::SUCCESS != res) {
+ LOG4CXX_DEBUG(logger_, "VerifyImageFiles result:" << res);
return res;
}
}
@@ -2112,12 +2350,25 @@ mobile_apis::Result::eType MessageHelper::VerifyImage(
return mobile_apis::Result::INVALID_DATA;
}
- std::string full_file_path =
- profile::Profile::instance()->app_storage_folder() + "/";
-
+ std::string full_file_path;
if (file_name.size() > 0 && file_name[0] == '/') {
full_file_path = file_name;
} else {
+ const std::string& app_storage_folder =
+ profile::Profile::instance()->app_storage_folder();
+ if (!app_storage_folder.empty()) {
+// TODO(nvaganov@luxoft.com): APPLINK-11293
+ if (app_storage_folder[0] == '/') { // absolute path
+ full_file_path = app_storage_folder + "/";
+ }
+ else { // relative path
+ full_file_path = file_system::CurrentWorkingDirectory() + "/" +
+ app_storage_folder + "/";
+ }
+ }
+ else { // empty app storage folder
+ full_file_path = file_system::CurrentWorkingDirectory() + "/";
+ }
full_file_path += app->folder_name();
full_file_path += "/";
@@ -2161,15 +2412,31 @@ bool MessageHelper::VerifySoftButtonString(const std::string& str) {
return true;
}
+bool MessageHelper::CheckWithPolicy(
+ mobile_api::SystemAction::eType system_action,
+ const std::string& app_mobile_id) {
+ using namespace mobile_apis;
+ bool result = true;
+ policy::PolicyHandler* policy_handler = policy::PolicyHandler::instance();
+ if (NULL != policy_handler && policy_handler->PolicyEnabled()) {
+ result = policy_handler->CheckSystemAction(system_action, app_mobile_id);
+ }
+
+ return result;
+}
+
mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
smart_objects::SmartObject& message_params, ApplicationConstSharedPtr app) {
+ using namespace mobile_apis;
+ using namespace smart_objects;
+
if (!message_params.keyExists(strings::soft_buttons)) {
return mobile_apis::Result::SUCCESS;
}
const HMICapabilities& hmi_capabilities = ApplicationManagerImpl::instance()
->hmi_capabilities();
- const smart_objects::SmartObject* soft_button_capabilities = hmi_capabilities
+ const SmartObject* soft_button_capabilities = hmi_capabilities
.soft_button_capabilities();
bool image_supported = false;
if (soft_button_capabilities) {
@@ -2177,31 +2444,27 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
.asBool();
}
- smart_objects::SmartObject& request_soft_buttons =
- message_params[strings::soft_buttons];
+ SmartObject& request_soft_buttons = message_params[strings::soft_buttons];
// Check whether soft buttons request is well-formed
if (!ValidateSoftButtons(request_soft_buttons)) {
- return mobile_apis::Result::INVALID_DATA;
+ return Result::INVALID_DATA;
}
- smart_objects::SmartObject soft_buttons = smart_objects::SmartObject(
- smart_objects::SmartType_Array);
-
- policy::PolicyHandler* policy_handler = policy::PolicyHandler::instance();
- std::string app_mobile_id = app->mobile_app_id()->asString();
+ SmartObject soft_buttons(SmartType_Array);
uint32_t j = 0;
size_t size = request_soft_buttons.length();
for (uint32_t i = 0; i < size; ++i) {
- int system_action = request_soft_buttons[i][strings::system_action].asInt();
- if (!policy_handler->CheckKeepContext(system_action, app_mobile_id) ||
- !policy_handler->CheckStealFocus(system_action, app_mobile_id)) {
- return mobile_apis::Result::DISALLOWED;
+ const int system_action = request_soft_buttons[i][strings::system_action].asInt();
+
+ if (!CheckWithPolicy(static_cast<SystemAction::eType>(system_action),
+ app->mobile_app_id())) {
+ return Result::DISALLOWED;
}
switch (request_soft_buttons[i][strings::type].asInt()) {
- case mobile_apis::SoftButtonType::SBT_IMAGE: {
+ case SoftButtonType::SBT_IMAGE: {
if (!image_supported) {
continue;
}
@@ -2210,46 +2473,46 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
request_soft_buttons[i].erase(strings::text);
}
if (request_soft_buttons[i].keyExists(strings::image)) {
- mobile_apis::Result::eType verification_result = VerifyImage(
+ Result::eType verification_result = VerifyImage(
request_soft_buttons[i][strings::image], app);
- if (mobile_apis::Result::SUCCESS != verification_result) {
- return mobile_apis::Result::INVALID_DATA;
+ if (Result::SUCCESS != verification_result) {
+ return Result::INVALID_DATA;
}
} else {
- return mobile_apis::Result::INVALID_DATA;
+ return Result::INVALID_DATA;
}
break;
}
- case mobile_apis::SoftButtonType::SBT_TEXT: {
+ case SoftButtonType::SBT_TEXT: {
if ((!request_soft_buttons[i].keyExists(strings::text)) ||
(!VerifySoftButtonString(
request_soft_buttons[i][strings::text].asString()))) {
- return mobile_apis::Result::INVALID_DATA;
+ return Result::INVALID_DATA;
}
break;
}
- case mobile_apis::SoftButtonType::SBT_BOTH: {
+ case SoftButtonType::SBT_BOTH: {
if ((!request_soft_buttons[i].keyExists(strings::text)) ||
((request_soft_buttons[i][strings::text].length())
&& (!VerifySoftButtonString(
request_soft_buttons[i][strings::text].asString())))) {
- return mobile_apis::Result::INVALID_DATA;
+ return Result::INVALID_DATA;
}
bool image_exist = false;
if (image_supported) {
image_exist = request_soft_buttons[i].keyExists(strings::image);
if (!image_exist) {
- return mobile_apis::Result::INVALID_DATA;
+ return Result::INVALID_DATA;
}
}
if (image_exist) {
- mobile_apis::Result::eType verification_result = VerifyImage(
+ Result::eType verification_result = VerifyImage(
request_soft_buttons[i][strings::image], app);
- if (mobile_apis::Result::SUCCESS != verification_result) {
- return mobile_apis::Result::INVALID_DATA;
+ if (Result::SUCCESS != verification_result) {
+ return Result::INVALID_DATA;
}
}
@@ -2270,7 +2533,7 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
if (0 == request_soft_buttons.length()) {
message_params.erase(strings::soft_buttons);
}
- return mobile_apis::Result::SUCCESS;
+ return Result::SUCCESS;
}
void MessageHelper::SubscribeApplicationToSoftButton(
diff --git a/src/components/application_manager/src/mobile_command_factory.cc b/src/components/application_manager/src/mobile_command_factory.cc
index 2d2e31f73..0d592e956 100644
--- a/src/components/application_manager/src/mobile_command_factory.cc
+++ b/src/components/application_manager/src/mobile_command_factory.cc
@@ -67,6 +67,7 @@
#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"
@@ -91,8 +92,8 @@
#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_icon_request.h"
-#include "application_manager/commands/mobile/set_icon_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"
@@ -129,7 +130,8 @@
namespace application_manager {
commands::Command *MobileCommandFactory::CreateCommand(
- const MessageSharedPtr& message) {
+ const commands::MessageSharedPtr& message,
+ commands::Command::CommandOrigin origin) {
switch ((*message)[strings::params][strings::function_id].asInt()) {
case mobile_apis::FunctionID::RegisterAppInterfaceID: {
@@ -398,9 +400,9 @@ commands::Command *MobileCommandFactory::CreateCommand(
case mobile_apis::FunctionID::SetAppIconID: {
if ((*message)[strings::params][strings::message_type]
== static_cast<int>(application_manager::MessageType::kResponse)) {
- return new commands::SetIconResponse(message);
+ return new commands::SetAppIconResponse(message);
} else {
- return new commands::SetIconRequest(message);
+ return new commands::SetAppIconRequest(message);
}
break;
}
@@ -519,6 +521,9 @@ commands::Command *MobileCommandFactory::CreateCommand(
break;
}
case mobile_apis::FunctionID::OnHMIStatusID: {
+ if (origin == commands::Command::ORIGIN_MOBILE) {
+ return new commands::OnHMIStatusNotificationFromMobile(message);
+ }
return new commands::OnHMIStatusNotification(message);
break;
}
diff --git a/src/components/application_manager/src/mobile_message_handler.cc b/src/components/application_manager/src/mobile_message_handler.cc
index 22260e214..732faf8a5 100644
--- a/src/components/application_manager/src/mobile_message_handler.cc
+++ b/src/components/application_manager/src/mobile_message_handler.cc
@@ -50,9 +50,36 @@ const uint8_t kUnknown = 0xF;
}
namespace application_manager {
+using protocol_handler::Extract;
CREATE_LOGGERPTR_GLOBAL(logger_, "MobileMessageHandler")
+application_manager::Message* MobileMessageHandler::HandleIncomingMessageProtocol(
+ const protocol_handler::RawMessagePtr message) {
+ if (message->protocol_version() == ProtocolVersion::kV1) {
+ return MobileMessageHandler::HandleIncomingMessageProtocolV1(message);
+ }
+ if ((message->protocol_version() == ProtocolVersion::kV2) ||
+ (message->protocol_version() == ProtocolVersion::kV3) ||
+ (message->protocol_version() == ProtocolVersion::kV4)) {
+ return MobileMessageHandler::HandleIncomingMessageProtocolV2(message);
+ }
+ return NULL;
+}
+
+protocol_handler::RawMessage* MobileMessageHandler::HandleOutgoingMessageProtocol(
+ const MobileMessage& message) {
+ if (message->protocol_version() == application_manager::kV1) {
+ return MobileMessageHandler::HandleOutgoingMessageProtocolV1(message);
+ }
+ if ((message->protocol_version() == application_manager::kV2) ||
+ (message->protocol_version() == application_manager::kV3) ||
+ (message->protocol_version() == application_manager::kV4)) {
+ return MobileMessageHandler::HandleOutgoingMessageProtocolV2(message);
+ }
+ return NULL;
+}
+
application_manager::Message*
MobileMessageHandler::HandleIncomingMessageProtocolV1(
@@ -78,6 +105,7 @@ MobileMessageHandler::HandleIncomingMessageProtocolV1(
message->data_size()));
if (outgoing_message->json_message().empty()) {
+ delete outgoing_message;
return NULL;
}
@@ -112,7 +140,7 @@ MobileMessageHandler::HandleIncomingMessageProtocolV2(
outgoing_message->set_function_id(payload.header.rpc_function_id);
outgoing_message->set_message_type(
MessageTypeFromRpcType(payload.header.rpc_type));
- outgoing_message->set_correlation_id(int32_t(payload.header.corellation_id));
+ outgoing_message->set_correlation_id(int32_t(payload.header.correlation_id));
outgoing_message->set_connection_key(message->connection_key());
outgoing_message->set_protocol_version(
static_cast<application_manager::ProtocolVersion>(message
@@ -145,6 +173,8 @@ MobileMessageHandler::HandleOutgoingMessageProtocolV1(
protocol_handler::RawMessage* result = new protocol_handler::RawMessage(
message->connection_key(), 1, rawMessage, messageString.length() + 1);
+ delete [] rawMessage;
+
return result;
}
@@ -201,8 +231,13 @@ MobileMessageHandler::HandleOutgoingMessageProtocolV2(
dataForSending[offset++] = jsonSize;
memcpy(dataForSending + offset, message->json_message().c_str(), jsonSize);
-
+
+ // Default the service type to RPC Service
+ uint8_t type = 0x07;
+
if (message->has_binary_data()) {
+ // Change the service type to Hybrid Service
+ type = 0x0F;
const std::vector<uint8_t>& binaryData = *(message->binary_data());
uint8_t* currentPointer = dataForSending + offset + jsonSize;
for (uint32_t i = 0; i < binarySize; ++i) {
@@ -214,7 +249,10 @@ MobileMessageHandler::HandleOutgoingMessageProtocolV2(
new protocol_handler::RawMessage(message->connection_key(),
message->protocol_version(),
dataForSending,
- dataForSendingSize);
+ dataForSendingSize,
+ type);
+
+ delete [] dataForSending;
return msgToProtocolHandler;
}
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 488097761..09f97dd3f 100644
--- a/src/components/application_manager/src/policies/policy_event_observer.cc
+++ b/src/components/application_manager/src/policies/policy_event_observer.cc
@@ -32,20 +32,31 @@
#include "application_manager/policies/policy_event_observer.h"
#include "application_manager/smart_object_keys.h"
+#include "application_manager/policies/policy_handler.h"
#include "utils/date_time.h"
-#include "policy/policy_manager.h"
#include "smart_objects/smart_object.h"
namespace policy {
namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
using namespace application_manager;
+class PolicyHandler;
-PolicyEventObserver::PolicyEventObserver(utils::SharedPtr<PolicyManager> policy_manager)
- : policy_manager_(policy_manager) {
+CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler")
+
+PolicyEventObserver::PolicyEventObserver(PolicyHandler* const policy_handler)
+ : policy_handler_(policy_handler) {
+}
+
+void PolicyEventObserver::set_policy_handler(policy::PolicyHandler* const policy_handler) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(policy_handler_lock_);
+ LOG4CXX_DEBUG(logger_, "Set policy handler " << policy_handler);
+ policy_handler_ = policy_handler;
}
void PolicyEventObserver::on_event(const event_engine::Event& event) {
- if (!policy_manager_) {
+ sync_primitives::AutoLock auto_lock(policy_handler_lock_);
+ if (!policy_handler_) {
return;
}
const smart_objects::SmartObject& message = event.smart_object();
@@ -67,7 +78,7 @@ void PolicyEventObserver::on_event(const event_engine::Event& event) {
break;
}
case hmi_apis::FunctionID::BasicCommunication_OnReady: {
- policy_manager_->OnSystemReady();
+ policy_handler_->OnSystemReady();
unsubscribe_from_event(hmi_apis::FunctionID::BasicCommunication_OnReady);
break;
}
@@ -88,8 +99,8 @@ void PolicyEventObserver::ProcessOdometerEvent(const smart_objects::SmartObject&
const int kSecondsInDay = 60 * 60 * 24;
int days_after_epoch = current_time.tv_sec / kSecondsInDay;
- if(policy_manager_) {
- policy_manager_->PTUpdatedAt(
+ if (policy_handler_) {
+ policy_handler_->PTUpdatedAt(
message[strings::msg_params][strings::odometer].asInt(),
days_after_epoch);
}
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index 0033743e7..6497ebf2e 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -1,5 +1,5 @@
-/*
- Copyright (c) 2013, Ford Motor Company
+/*
+ Copyright (c) 2014, Ford Motor Company
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -30,14 +30,16 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "application_manager/policies/policy_handler.h"
+
#include <unistd.h>
#include <dlfcn.h>
#include <algorithm>
#include <vector>
#include "application_manager/smart_object_keys.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/policies/pt_exchange_handler_impl.h"
-#include "application_manager/policies/pt_exchange_handler_ext.h"
+
+#include "application_manager/policies/delegates/app_permission_delegate.h"
+
#include "application_manager/application_manager_impl.h"
#include "application_manager/message_helper.h"
#include "policy/policy_manager_impl.h"
@@ -54,34 +56,91 @@
namespace policy {
+using namespace application_manager;
+
+namespace {
+using namespace mobile_apis;
+typedef std::map<RequestType::eType, std::string> RequestTypeMap;
+RequestTypeMap TypeToString = {
+ {RequestType::INVALID_ENUM, "INVALID_ENUM"},
+ {RequestType::HTTP, "HTTP"},
+ {RequestType::FILE_RESUME, "FILE_RESUME"},
+ {RequestType::AUTH_REQUEST, "AUTH_REQUEST"},
+ {RequestType::AUTH_CHALLENGE, "AUTH_CHALLENGE"},
+ {RequestType::AUTH_ACK, "AUTH_ACK"},
+ {RequestType::PROPRIETARY, "PROPRIETARY"},
+ {RequestType::QUERY_APPS, "QUERY_APPS"},
+ {RequestType::LAUNCH_APP, "LAUNCH_APP"},
+ {RequestType::LOCK_SCREEN_ICON_URL, "LOCK_SCREEN_ICON_URL"},
+ {RequestType::TRAFFIC_MESSAGE_CHANNEL, "TRAFFIC_MESSAGE_CHANNEL"},
+ {RequestType::DRIVER_PROFILE, "DRIVER_PROFILE"},
+ {RequestType::VOICE_SEARCH, "VOICE_SEARCH"},
+ {RequestType::NAVIGATION, "NAVIGATION"},
+ {RequestType::PHONE,"PHONE"},
+ {RequestType::CLIMATE, "CLIMATE"},
+ {RequestType::SETTINGS, "SETTINGS"},
+ {RequestType::VEHICLE_DIAGNOSTICS, "VEHICLE_DIAGNOSTICS"},
+ {RequestType::EMERGENCY, "EMERGENCY"},
+ {RequestType::MEDIA, "MEDIA"},
+ {RequestType::FOTA, "FOTA"}
+};
+
+const std::string RequestTypeToString(RequestType::eType type) {
+ RequestTypeMap::const_iterator it = TypeToString.find(type);
+ if (TypeToString.end() != it) {
+ return (*it).second;
+ }
+ return "";
+}
+}
#define POLICY_LIB_CHECK(return_value) {\
+ sync_primitives::AutoReadLock lock(policy_manager_lock_); \
if (!policy_manager_) {\
- LOG4CXX_WARN(logger_, "The shared library of policy is not loaded");\
+ LOG4CXX_DEBUG(logger_, "The shared library of policy is not loaded");\
return return_value;\
}\
}
#define POLICY_LIB_CHECK_VOID() {\
+ sync_primitives::AutoReadLock lock(policy_manager_lock_); \
if (!policy_manager_) {\
- LOG4CXX_WARN(logger_, "The shared library of policy is not loaded");\
+ LOG4CXX_DEBUG(logger_, "The shared library of policy is not loaded");\
return;\
}\
}
CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler")
-typedef std::set<application_manager::ApplicationSharedPtr> ApplicationList;
+
+struct ApplicationListHmiLevelSorter {
+ bool operator() (const application_manager::ApplicationSharedPtr& lhs,
+ const application_manager::ApplicationSharedPtr& rhs) {
+ if (lhs && rhs) {
+ mobile_apis::HMILevel::eType lhs_hmi_level = lhs->hmi_level();
+ mobile_apis::HMILevel::eType rhs_hmi_level = rhs->hmi_level();
+
+ if (lhs_hmi_level == rhs_hmi_level) {
+ return lhs->app_id() < rhs->app_id();
+ }
+ return lhs_hmi_level < rhs_hmi_level;
+ }
+ return false;
+ }
+};
+
+typedef std::set<application_manager::ApplicationSharedPtr, ApplicationListHmiLevelSorter>
+HmiLevelOrderedApplicationList;
struct DeactivateApplication {
explicit DeactivateApplication(
const connection_handler::DeviceHandle& device_id)
: device_id_(device_id) {}
- void operator()(const application_manager::ApplicationSharedPtr& app) {
+ void operator()(const ApplicationSharedPtr& app) {
if (device_id_ == app->device()) {
- app->set_hmi_level(mobile_apis::HMILevel::HMI_NONE);
- application_manager::MessageHelper::SendActivateAppToHMI(
- app->app_id(), hmi_apis::Common_HMILevel::NONE);
+ ApplicationManagerImpl::instance()->SetState<true>(app->app_id(),
+ mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE);
}
}
@@ -90,48 +149,38 @@ struct DeactivateApplication {
};
struct SDLAlowedNotification {
- explicit SDLAlowedNotification(
- const connection_handler::DeviceHandle& device_id,
- utils::SharedPtr<PolicyManager> policy_manager)
+ SDLAlowedNotification(const connection_handler::DeviceHandle& device_id,
+ PolicyManager* policy_manager)
: device_id_(device_id),
policy_manager_(policy_manager){}
- void operator()(const application_manager::ApplicationSharedPtr& app) {
+ void operator()(const ApplicationSharedPtr& app) {
if (!policy_manager_) {
return;
}
if (device_id_ == app->device()) {
std::string hmi_level;
- hmi_apis::Common_HMILevel::eType default_hmi;
mobile_apis::HMILevel::eType default_mobile_hmi;
- policy_manager_->GetDefaultHmi(app->mobile_app_id()->asString(), &hmi_level);
+ policy_manager_->GetDefaultHmi(app->mobile_app_id(), &hmi_level);
if ("BACKGROUND" == hmi_level) {
- default_hmi = hmi_apis::Common_HMILevel::BACKGROUND;
default_mobile_hmi = mobile_apis::HMILevel::HMI_BACKGROUND;
} else if ("FULL" == hmi_level) {
- default_hmi = hmi_apis::Common_HMILevel::FULL;
default_mobile_hmi = mobile_apis::HMILevel::HMI_FULL;
} else if ("LIMITED" == hmi_level) {
- default_hmi = hmi_apis::Common_HMILevel::LIMITED;
default_mobile_hmi = mobile_apis::HMILevel::HMI_LIMITED;
} else if ("NONE" == hmi_level) {
- default_hmi = hmi_apis::Common_HMILevel::NONE;
default_mobile_hmi = mobile_apis::HMILevel::HMI_NONE;
} else {
return ;
}
- if (app->hmi_level() == default_mobile_hmi) {
- LOG4CXX_INFO(logger_, "Application already in default hmi state.");
- } else {
- app->set_hmi_level(default_mobile_hmi);
- application_manager::MessageHelper::SendHMIStatusNotification(*app);
- }
- application_manager::MessageHelper::SendActivateAppToHMI(app->app_id(), default_hmi);
+ ApplicationManagerImpl::instance()->SetState<true>(app->app_id(),
+ default_mobile_hmi
+ );
}
}
private:
connection_handler::DeviceHandle device_id_;
- utils::SharedPtr<PolicyManager> policy_manager_;
+ PolicyManager* policy_manager_;
};
struct LinkAppToDevice {
@@ -141,17 +190,17 @@ struct LinkAppToDevice {
app_to_device_link_.clear();
}
- void operator()(const application_manager::ApplicationSharedPtr& app) {
+ void operator()(const ApplicationSharedPtr& app) {
if (!app.valid()) {
LOG4CXX_WARN(logger_, "Invalid pointer to application was passed."
"Skip current application.");
return;
}
DeviceParams device_params;
- application_manager::MessageHelper::GetDeviceInfoForApp(
+ MessageHelper::GetDeviceInfoForApp(
app->app_id(),
&device_params);
- const std::string app_id = app->mobile_app_id()->asString();
+ const std::string app_id = app->mobile_app_id();
if (device_params.device_mac_address.empty()) {
LOG4CXX_WARN(logger_, "Couldn't find device, which hosts application "
<< app_id);
@@ -208,13 +257,10 @@ const std::string PolicyHandler::kLibrary = "libPolicy.so";
PolicyHandler::PolicyHandler()
- : dl_handle_(0),
-// EXTENDED_POLICY
- exchange_handler_(new PTExchangeHandlerImpl(this)),
- on_ignition_check_done_(false),
+ : AsyncRunner("PolicyHandler async runner thread"),
+ dl_handle_(0),
last_activated_app_id_(0),
- registration_in_progress(false),
- is_user_requested_policy_table_update_(false),
+ app_to_device_link_lock_(true),
statistic_manager_impl_(new StatisticManagerImpl()) {
}
@@ -223,6 +269,8 @@ PolicyHandler::~PolicyHandler() {
}
bool PolicyHandler::LoadPolicyLibrary() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoWriteLock lock(policy_manager_lock_);
if (!PolicyEnabled()) {
LOG4CXX_WARN(logger_, "System is configured to work without policy "
"functionality.");
@@ -235,7 +283,7 @@ bool PolicyHandler::LoadPolicyLibrary() {
if (error_string == NULL) {
if (CreateManager()) {
policy_manager_->set_listener(this);
- event_observer_= new PolicyEventObserver(policy_manager_);
+ event_observer_= new PolicyEventObserver(this);
}
} else {
LOG4CXX_ERROR(logger_, error_string);
@@ -257,22 +305,22 @@ bool PolicyHandler::CreateManager() {
} else {
LOG4CXX_WARN(logger_, error_string);
}
- return policy_manager_;
+ return policy_manager_.valid();
}
bool PolicyHandler::InitPolicyTable() {
- LOG4CXX_TRACE(logger_, "Init policy table from preloaded.");
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK(false);
// Subscribing to notification for system readiness to be able to get system
// info necessary for policy table
- event_observer_.get()->subscribe_on_event(
+ event_observer_->subscribe_on_event(
hmi_apis::FunctionID::BasicCommunication_OnReady);
std::string preloaded_file =
profile::Profile::instance()->preloaded_pt_file();
if (file_system::FileExists(preloaded_file)) {
return policy_manager_->InitPT(preloaded_file);
}
- LOG4CXX_WARN(logger_, "The file which contains preloaded PT is not exist");
+ LOG4CXX_FATAL(logger_, "The file which contains preloaded PT is not exist");
return false;
}
@@ -289,148 +337,60 @@ bool PolicyHandler::ResetPolicyTable() {
}
bool PolicyHandler::ClearUserConsent() {
- LOG4CXX_INFO(logger_, "Removing user consent records in policy table.");
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK(false);
return policy_manager_->ResetUserConsent();
}
uint32_t PolicyHandler::GetAppIdForSending() {
- // Get app.list
- application_manager::ApplicationManagerImpl::ApplicationListAccessor accessor;
- const ApplicationList app_list = accessor.applications();
-
- if (app_list.empty()) {
- return 0;
- }
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ HmiLevelOrderedApplicationList app_list(accessor.begin(), accessor.end());
- // Choose application
- uint32_t selected_app_id = 0;
- AppIds app_ids_last_resort;
- AppIds app_ids_preferred;
+ LOG4CXX_INFO(logger_, "Apps size: " << app_list.size());
- ApplicationList::const_iterator it_app_list = app_list.begin();
- ApplicationList::const_iterator it_app_list_end = app_list.end();
- for (; it_app_list != it_app_list_end; ++it_app_list) {
- switch ((*it_app_list)->hmi_level()) {
- case mobile_apis::HMILevel::HMI_NONE:
- app_ids_last_resort.push_back((*it_app_list)->app_id());
- break;
- default:
- app_ids_preferred.push_back((*it_app_list)->app_id());
- break;
+ DeviceParams device_param;
+ for (HmiLevelOrderedApplicationList::const_iterator first = app_list.begin();
+ first != app_list.end(); ++first) {
+ if ((*first)->IsRegistered()) {
+ const uint32_t app_id = (*first)->app_id();
+ MessageHelper::GetDeviceInfoForApp(app_id, &device_param);
+ if (kDeviceAllowed ==
+ policy_manager_->GetUserConsentForDevice(device_param.device_mac_address)) {
+ return app_id;
+ }
}
}
- AppIds& app_ids_to_use =
- app_ids_preferred.empty() ? app_ids_last_resort : app_ids_preferred;
-
- // Checking, if some of currently known apps was not used already
- std::sort(last_used_app_ids_.begin(), last_used_app_ids_.end());
- std::sort(app_ids_to_use.begin(), app_ids_to_use.end());
-
- bool is_all_used = std::includes(last_used_app_ids_.begin(),
- last_used_app_ids_.end(),
- app_ids_to_use.begin(),
- app_ids_to_use.end());
-
- if (is_all_used) {
- last_used_app_ids_.clear();
- }
-
- // Leave only unused apps
- AppIds::iterator it_apps_to_use = app_ids_to_use.begin();
- AppIds::iterator it_apps_to_use_end = app_ids_to_use.end();
-
- AppIds::const_iterator it_last_used_app_ids = last_used_app_ids_.begin();
- AppIds::const_iterator it_last_used_app_ids_end = last_used_app_ids_.end();
-
- for (; it_last_used_app_ids != it_last_used_app_ids_end;
- ++it_last_used_app_ids) {
-
- std::remove(it_apps_to_use, it_apps_to_use_end, *it_last_used_app_ids);
- }
-
- // Random selection of filtered apps
- std::srand(time(0));
- selected_app_id =
- *(app_ids_to_use.begin() + (rand() % app_ids_to_use.size()));
-
- last_used_app_ids_.push_back(selected_app_id);
- return selected_app_id;
-}
-
-DeviceConsent PolicyHandler::GetDeviceForSending(DeviceParams& device_params) {
- POLICY_LIB_CHECK(kDeviceDisallowed);
- uint32_t app_id = 0;
- uint32_t app_id_previous = 0;
- while (true) {
- app_id = GetAppIdForSending();
- if (!app_id) {
- LOG4CXX_WARN(logger_,
- "There is no appropriate application for sending PTS.");
- return kDeviceDisallowed;
- }
-
- // If only one application is available, return its device params
- if (app_id == app_id_previous) {
- return kDeviceDisallowed;
- }
-
- app_id_previous = app_id;
- application_manager::MessageHelper::GetDeviceInfoForApp(app_id,
- &device_params);
-
- DeviceConsent consent = policy_manager_->GetUserConsentForDevice(
- device_params.device_mac_address);
- switch (consent) {
- case kDeviceAllowed:
- return consent;
- case kDeviceDisallowed:
- continue;
- case kDeviceHasNoConsent:
- return consent;
- default:
- LOG4CXX_WARN(logger_, "Consent result is not impelemented.");
- return consent;
- }
- }
- return kDeviceDisallowed;
+ return 0;
}
-const std::string PolicyHandler::ConvertUpdateStatus(PolicyTableStatus status) {
- switch (status) {
- case policy::StatusUpdatePending:
- return "UPDATING";
- case policy::StatusUpdateRequired:
- return "UPDATE_NEEDED";
- case policy::StatusUpToDate:
- return "UP_TO_DATE";
- default: {
- return "UNKNOWN";
- }
- }
+void PolicyHandler::OnAppPermissionConsent(const uint32_t connection_key,
+ const PermissionConsent& permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ AsyncRun(new AppPermissionDelegate(connection_key, permissions));
}
void PolicyHandler::OnDeviceConsentChanged(const std::string& device_id,
bool is_allowed) {
POLICY_LIB_CHECK_VOID();
connection_handler::DeviceHandle device_handle;
- application_manager::ApplicationManagerImpl::instance()->connection_handler()
+ ApplicationManagerImpl::instance()->connection_handler()
->GetDeviceID(device_id, &device_handle);
// In case of changed consent for device, related applications will be
// limited to pre_DataConsent permissions, if device disallowed, or switch
// back to their own permissions, if device allowed again, and must be
// notified about these changes
- application_manager::ApplicationManagerImpl::ApplicationListAccessor accessor;
- ApplicationList app_list = accessor.applications();
- ApplicationList::const_iterator it_app_list = app_list.begin();
- ApplicationList::const_iterator it_app_list_end = app_list.end();
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ ApplicationManagerImpl::ApplictionSetConstIt it_app_list =
+ accessor.begin();
+ ApplicationManagerImpl::ApplictionSetConstIt it_app_list_end =
+ accessor.end();
for (; it_app_list != it_app_list_end; ++it_app_list) {
if (device_handle == (*it_app_list).get()->device()) {
const std::string policy_app_id =
- (*it_app_list)->mobile_app_id()->asString();
+ (*it_app_list)->mobile_app_id();
// If app has predata policy, which is assigned without device consent or
// with negative data consent, there no necessity to change smth and send
@@ -448,33 +408,48 @@ void PolicyHandler::OnDeviceConsentChanged(const std::string& device_id,
}
}
+void PolicyHandler::OnPTExchangeNeeded() {
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->ForcePTExchange();
+}
+
+void PolicyHandler::GetAvailableApps(std::queue<std::string>& apps) {
+ LOG4CXX_INFO(logger_, "GetAvailable apps");
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ const ApplicationManagerImpl::ApplictionSet app_list = accessor.applications();
+ ApplicationManagerImpl::ApplictionSetConstIt iter = app_list.begin();
+
+ for (;app_list.end() != iter; ++iter) {
+ LOG4CXX_INFO(logger_, "one more app");
+ apps.push((*iter)->mobile_app_id());
+ }
+}
+
void PolicyHandler::AddApplication(const std::string& application_id) {
- // TODO (AGaliuzov): remove this workaround during refactoring.
- registration_in_progress = true;
POLICY_LIB_CHECK_VOID();
policy_manager_->AddApplication(application_id);
}
void PolicyHandler::SetDeviceInfo(std::string& device_id,
const DeviceInfo& device_info) {
- LOG4CXX_INFO(logger_, "SetDeviceInfo");
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
policy_manager_->SetDeviceInfo(device_id, device_info);
}
-void PolicyHandler::OnAppPermissionConsent(const uint32_t connection_key,
- PermissionConsent &permissions) {
- LOG4CXX_INFO(logger_, "OnAppPermissionConsent");
+void PolicyHandler::OnAppPermissionConsentInternal(
+ const uint32_t connection_key, PermissionConsent &permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
if (connection_key) {
- application_manager::ApplicationSharedPtr app =
- application_manager::ApplicationManagerImpl::instance()
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()
->application(connection_key);
if (app.valid()) {
- permissions.policy_app_id = app->mobile_app_id()->asString();
+ permissions.policy_app_id = app->mobile_app_id();
policy::DeviceParams device_params;
- application_manager::MessageHelper::GetDeviceInfoForHandle(
+ MessageHelper::GetDeviceInfoForHandle(
app->device(),
&device_params);
@@ -488,6 +463,7 @@ void PolicyHandler::OnAppPermissionConsent(const uint32_t connection_key,
return;
}
+ sync_primitives::AutoLock lock(app_to_device_link_lock_);
if (!app_to_device_link_.size()) {
LOG4CXX_WARN(logger_, "There are no applications previously stored for "
"setting common permissions.");
@@ -499,8 +475,8 @@ void PolicyHandler::OnAppPermissionConsent(const uint32_t connection_key,
std::map<std::string, std::string>::const_iterator it_end =
app_to_device_link_.end();
for (;it != it_end; ++it) {
- application_manager::ApplicationSharedPtr app =
- application_manager::ApplicationManagerImpl::instance()->
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->
application_by_policy_id(it->first);
// If list of apps sent to HMI for user consents is not the same as current,
@@ -512,7 +488,7 @@ void PolicyHandler::OnAppPermissionConsent(const uint32_t connection_key,
}
policy::DeviceParams device_params;
- application_manager::MessageHelper::GetDeviceInfoForHandle(
+ MessageHelper::GetDeviceInfoForHandle(
app->device(),
&device_params);
@@ -531,29 +507,29 @@ void PolicyHandler::OnAppPermissionConsent(const uint32_t connection_key,
void PolicyHandler::OnGetUserFriendlyMessage(
const std::vector<std::string>& message_codes, const std::string& language,
uint32_t correlation_id) {
- LOG4CXX_INFO(logger_, "OnGetUserFriendlyMessage");
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
std::vector<UserFriendlyMessage> result = policy_manager_
->GetUserFriendlyMessages(message_codes, language);
// Send response to HMI with gathered data
- application_manager::MessageHelper::SendGetUserFriendlyMessageResponse(
+ MessageHelper::SendGetUserFriendlyMessageResponse(
result, correlation_id);
}
void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key,
const uint32_t correlation_id) {
- LOG4CXX_INFO(logger_, "OnGetListOfPermissions");
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
// If no specific app was passed, get permissions for all currently registered
// applications
if (!connection_key) {
+ sync_primitives::AutoLock lock(app_to_device_link_lock_);
LinkAppToDevice linker(app_to_device_link_);
- application_manager::ApplicationManagerImpl::ApplicationListAccessor accessor;
- const ApplicationList app_list = accessor.applications();
- std::set<application_manager::ApplicationSharedPtr>::const_iterator it_app =
- app_list.begin();
- std::set<application_manager::ApplicationSharedPtr>::const_iterator
- it_app_end = app_list.end();
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ ApplicationManagerImpl::ApplictionSetConstIt it_app
+ = accessor.begin();
+ ApplicationManagerImpl::ApplictionSetConstIt it_app_end
+ = accessor.end();
// Add all currently registered applications
std::for_each(it_app, it_app_end, linker);
@@ -568,15 +544,15 @@ void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key,
consolidator.Consolidate(group_permissions);
}
- application_manager::MessageHelper::SendGetListOfPermissionsResponse(
+ MessageHelper::SendGetListOfPermissionsResponse(
consolidator.GetConsolidatedPermissions(), correlation_id);
return;
}
// Single app only
- application_manager::ApplicationSharedPtr app =
- application_manager::ApplicationManagerImpl::instance()->application(
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(
connection_key);
if (!app.valid()) {
@@ -586,7 +562,7 @@ void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key,
}
DeviceParams device_params;
- application_manager::MessageHelper::GetDeviceInfoForApp(connection_key,
+ MessageHelper::GetDeviceInfoForApp(connection_key,
&device_params);
std::vector<FunctionalGroupPermission> group_permissions;
if (device_params.device_mac_address.empty()) {
@@ -595,33 +571,31 @@ void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key,
LOG4CXX_WARN(logger_, "Couldn't find application to get permissions.");
} else {
policy_manager_->GetUserConsentForApp(device_params.device_mac_address,
- app->mobile_app_id()->asString(),
+ app->mobile_app_id(),
group_permissions);
- application_manager::MessageHelper::SendGetListOfPermissionsResponse(
+ MessageHelper::SendGetListOfPermissionsResponse(
group_permissions, correlation_id);
}
}
void PolicyHandler::OnGetStatusUpdate(const uint32_t correlation_id) {
- LOG4CXX_INFO(logger_, "OnGetStatusUpdate");
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
- policy::PolicyTableStatus status = policy_manager_->GetPolicyTableStatus();
- application_manager::MessageHelper::SendGetStatusUpdateResponse(
- ConvertUpdateStatus(status), correlation_id);
+ MessageHelper::SendGetStatusUpdateResponse(
+ policy_manager_->GetPolicyTableStatus(), correlation_id);
}
-void PolicyHandler::OnUpdateStatusChanged(PolicyTableStatus status) {
- LOG4CXX_INFO(logger_, "OnUpdateStatusChanged");
- application_manager::MessageHelper::SendOnStatusUpdate(
- ConvertUpdateStatus(status));
+void PolicyHandler::OnUpdateStatusChanged(const std::string& status) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ MessageHelper::SendOnStatusUpdate(status);
}
std::string PolicyHandler::OnCurrentDeviceIdUpdateRequired(
const std::string& policy_app_id) {
- LOG4CXX_INFO(logger_, "OnCurrentDeviceIdUpdateRequired");
- application_manager::ApplicationSharedPtr app =
- application_manager::ApplicationManagerImpl::instance()
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()
->application_by_policy_id(policy_app_id);
if (!app.valid()) {
@@ -630,13 +604,13 @@ std::string PolicyHandler::OnCurrentDeviceIdUpdateRequired(
return "";
}
DeviceParams device_param;
- application_manager::MessageHelper::GetDeviceInfoForApp(app->app_id(),
+ MessageHelper::GetDeviceInfoForApp(app->app_id(),
&device_param);
return device_param.device_mac_address;
}
void PolicyHandler::OnSystemInfoChanged(const std::string& language) {
- LOG4CXX_INFO(logger_, "OnSystemInfoChanged");
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
policy_manager_->SetSystemLanguage(language);
}
@@ -644,25 +618,25 @@ void PolicyHandler::OnSystemInfoChanged(const std::string& language) {
void PolicyHandler::OnGetSystemInfo(const std::string& ccpu_version,
const std::string& wers_country_code,
const std::string& language) {
- LOG4CXX_INFO(logger_, "OnGetSystemInfo");
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
policy_manager_->SetSystemInfo(ccpu_version, wers_country_code, language);
}
void PolicyHandler::OnSystemInfoUpdateRequired() {
- LOG4CXX_INFO(logger_, "OnSystemInfoUpdateRequired");
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
- application_manager::MessageHelper::SendGetSystemInfoRequest();
+ MessageHelper::SendGetSystemInfoRequest();
}
void PolicyHandler::OnVIIsReady() {
- const uint32_t correlation_id = application_manager::
+ const uint32_t correlation_id =
ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
std::vector<std::string> params;
- params.push_back(application_manager::strings::vin);
+ params.push_back(strings::vin);
- application_manager::MessageHelper::CreateGetVehicleDataRequest(
+ MessageHelper::CreateGetVehicleDataRequest(
correlation_id, params);
}
@@ -672,38 +646,13 @@ void PolicyHandler::OnVehicleDataUpdated(
POLICY_LIB_CHECK_VOID();
}
-void PolicyHandler::OnAppRevoked(const std::string& policy_app_id) {
- LOG4CXX_TRACE(logger_, "OnAppRevoked with policy_app_id " << policy_app_id << " is revoked.");
- POLICY_LIB_CHECK_VOID();
- application_manager::ApplicationSharedPtr app =
- application_manager::ApplicationManagerImpl::instance()
- ->application_by_policy_id(policy_app_id);
- if (app.valid()) {
- DeviceParams device_params;
- application_manager::MessageHelper::GetDeviceInfoForApp(app->app_id(),
- &device_params);
- AppPermissions permissions = policy_manager_->GetAppPermissionsChanges(
- device_params.device_mac_address,
- policy_app_id);
- permissions.appRevoked = true;
- application_manager::MessageHelper::SendOnAppPermissionsChangedNotification(
- app->app_id(), permissions);
- app->set_hmi_level(mobile_apis::HMILevel::HMI_NONE);
- application_manager::MessageHelper::SendActivateAppToHMI(
- app->app_id(), hmi_apis::Common_HMILevel::NONE);
- application_manager::MessageHelper::SendHMIStatusNotification(*app);
- policy_manager_->RemovePendingPermissionChanges(policy_app_id);
- return;
- }
-}
-
void PolicyHandler::OnPendingPermissionChange(
const std::string& policy_app_id) {
- LOG4CXX_INFO(logger_, "PolicyHandler::OnPendingPermissionChange for "
+ LOG4CXX_DEBUG(logger_, "PolicyHandler::OnPendingPermissionChange for "
<< policy_app_id);
POLICY_LIB_CHECK_VOID();
- application_manager::ApplicationSharedPtr app =
- application_manager::ApplicationManagerImpl::instance()
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()
->application_by_policy_id(policy_app_id);
if (!app.valid()) {
LOG4CXX_WARN(logger_,
@@ -711,32 +660,42 @@ void PolicyHandler::OnPendingPermissionChange(
return;
}
- DeviceParams device_params;
- application_manager::MessageHelper::GetDeviceInfoForApp(app->app_id(),
- &device_params);
AppPermissions permissions = policy_manager_->GetAppPermissionsChanges(
- device_params.device_mac_address,
policy_app_id);
+ const uint32_t app_id = app->app_id();
+
+ if (permissions.appRevoked) {
+ application_manager::MessageHelper::SendOnAppPermissionsChangedNotification(
+ app_id, permissions);
+ ApplicationManagerImpl::instance()->SetState<true>(app->app_id(),
+ mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE);
+ policy_manager_->RemovePendingPermissionChanges(policy_app_id);
+ return;
+ }
+
mobile_apis::HMILevel::eType app_hmi_level = app->hmi_level();
switch (app_hmi_level) {
- case mobile_apis::HMILevel::HMI_FULL:
- case mobile_apis::HMILevel::HMI_LIMITED: {
+ case mobile_apis::HMILevel::eType::HMI_FULL:
+ case mobile_apis::HMILevel::eType::HMI_LIMITED: {
if (permissions.appPermissionsConsentNeeded) {
- application_manager::MessageHelper::
+ MessageHelper::
SendOnAppPermissionsChangedNotification(app->app_id(), permissions);
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;
}
- break;
}
- case mobile_apis::HMILevel::HMI_BACKGROUND: {
+ case mobile_apis::HMILevel::eType::HMI_BACKGROUND: {
if (permissions.isAppPermissionsRevoked) {
- application_manager::MessageHelper::
+ MessageHelper::
SendOnAppPermissionsChangedNotification(app->app_id(), permissions);
- policy_manager_->RemovePendingPermissionChanges(policy_app_id);
+ policy_manager_->RemovePendingPermissionChanges(policy_app_id);
}
break;
}
@@ -747,32 +706,38 @@ void PolicyHandler::OnPendingPermissionChange(
if (permissions.appUnauthorized) {
if (mobile_apis::HMILevel::HMI_FULL == app_hmi_level ||
mobile_apis::HMILevel::HMI_LIMITED == app_hmi_level) {
- application_manager::MessageHelper::
+ MessageHelper::
SendOnAppPermissionsChangedNotification(app->app_id(), permissions);
}
- application_manager::MessageHelper::
+ MessageHelper::
SendOnAppInterfaceUnregisteredNotificationToMobile(
app->app_id(),
- mobile_apis::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED);
+ mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED);
- application_manager::ApplicationManagerImpl::instance()->
- UnregisterRevokedApplication(app->app_id(),
- mobile_apis::Result::INVALID_ENUM);
+ ApplicationManagerImpl::instance()->OnAppUnauthorized(app->app_id());
policy_manager_->RemovePendingPermissionChanges(policy_app_id);
}
+ if (permissions.requestTypeChanged) {
+ MessageHelper::
+ SendOnAppPermissionsChangedNotification(app->app_id(), permissions);
+ policy_manager_->RemovePendingPermissionChanges(policy_app_id);
+ }
}
-bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string) {
- LOG4CXX_INFO(logger_, "PolicyHandler::SendMessageToSDK");
+bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string,
+ const std::string& url) {
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK(false);
- std::string url;
+ if (last_used_app_ids_.empty()) {
+ LOG4CXX_WARN(logger_, "last_used_app_ids_ is empty");
+ return false;
+ }
uint32_t app_id = last_used_app_ids_.back();
- application_manager::ApplicationSharedPtr app =
- application_manager::ApplicationManagerImpl::instance()
- ->application(app_id);
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(app_id);
if (!app.valid()) {
LOG4CXX_WARN(logger_, "There is no registered application with "
@@ -780,21 +745,19 @@ bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string) {
return false;
}
- const std::string& mobile_app_id = app->mobile_app_id()->asString();
+ const std::string& mobile_app_id = app->mobile_app_id();
if (mobile_app_id.empty()) {
LOG4CXX_WARN(logger_, "Application with connection key '" << app_id << "'"
" has no application id.");
return false;
}
- url = policy_manager_->GetUpdateUrl(PolicyServiceTypes::POLICY);
- LOG4CXX_INFO(logger_, "Update url is " << url << " for application "
- << application_manager::ApplicationManagerImpl::instance()
+ LOG4CXX_DEBUG(logger_, "Update url is " << url << " for application "
+ << ApplicationManagerImpl::instance()
->application(app_id)->name());
- application_manager::MessageHelper::SendPolicySnapshotNotification(app_id,
- pt_string,
- url, 0);
+ MessageHelper::SendPolicySnapshotNotification(
+ app_id, pt_string, url, 0);
return true;
}
@@ -803,24 +766,16 @@ bool PolicyHandler::ReceiveMessageFromSDK(const std::string& file,
const BinaryMessage& pt_string) {
POLICY_LIB_CHECK(false);
- if (policy_manager_->GetPolicyTableStatus() !=
- PolicyTableStatus::StatusUpdatePending) {
- LOG4CXX_WARN(logger_, "PTU processing skipped, since current status is "
- "different from pending.");
- return false;
- }
-
bool ret = policy_manager_->LoadPT(file, pt_string);
LOG4CXX_INFO(logger_, "Policy table is saved: " << std::boolalpha << ret);
if (ret) {
LOG4CXX_INFO(logger_, "PTU was successful.");
- exchange_handler_->Stop();
policy_manager_->CleanupUnpairedDevices();
int32_t correlation_id =
- application_manager::ApplicationManagerImpl::instance()
+ ApplicationManagerImpl::instance()
->GetNextHMICorrelationID();
- event_observer_.get()->subscribe_on_event(
+ event_observer_->subscribe_on_event(
#ifdef HMI_DBUS_API
hmi_apis::FunctionID::VehicleInfo_GetOdometer, correlation_id
#else
@@ -828,8 +783,8 @@ bool PolicyHandler::ReceiveMessageFromSDK(const std::string& file,
#endif
);
std::vector<std::string> vehicle_data_args;
- vehicle_data_args.push_back(application_manager::strings::odometer);
- application_manager::MessageHelper::CreateGetVehicleDataRequest(
+ vehicle_data_args.push_back(strings::odometer);
+ MessageHelper::CreateGetVehicleDataRequest(
correlation_id, vehicle_data_args);
} else {
LOG4CXX_WARN(logger_, "Exchange wasn't successful, trying another one.");
@@ -839,68 +794,36 @@ bool PolicyHandler::ReceiveMessageFromSDK(const std::string& file,
}
bool PolicyHandler::UnloadPolicyLibrary() {
- LOG4CXX_TRACE(logger_, "enter. policy_manager_ = " << policy_manager_);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "policy_manager_ = " << policy_manager_);
bool ret = true;
+ AsyncRunner::Stop();
+ sync_primitives::AutoWriteLock lock(policy_manager_lock_);
if (policy_manager_) {
- policy_manager_.release();
+ policy_manager_.reset();
}
if (dl_handle_) {
ret = (dlclose(dl_handle_) == 0);
dl_handle_ = 0;
}
- exchange_handler_->Stop();
LOG4CXX_TRACE(logger_, "exit");
return ret;
}
-void PolicyHandler::StartPTExchange(bool skip_device_selection) {
- LOG4CXX_INFO(logger_, "PolicyHandler::StartPTExchange");
- POLICY_LIB_CHECK_VOID();
-
- if (policy_manager_->GetPolicyTableStatus() ==
- PolicyTableStatus::StatusUpdatePending) {
- LOG4CXX_INFO(logger_, "Starting exchange skipped, since another exchange "
- "is in progress.");
- return;
- }
-
- if (!skip_device_selection) {
- DeviceParams device_params;
- DeviceConsent consent = GetDeviceForSending(device_params);
- switch (consent) {
- case kDeviceHasNoConsent:
- // Send OnSDLConsentNeeded to HMI for user consent on device usage
- pending_device_handles_.push_back(device_params.device_handle);
- application_manager::MessageHelper::SendOnSDLConsentNeeded(
- device_params);
- return;
- case kDeviceDisallowed:
- return;
- default:
- break;
- }
- }
-
- exchange_handler_->Start();
-}
-
void PolicyHandler::OnAllowSDLFunctionalityNotification(bool is_allowed,
uint32_t device_id) {
- LOG4CXX_INFO(logger_, "OnAllowSDLFunctionalityNotification");
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
// Device ids, need to be changed
std::set<uint32_t> device_ids;
bool device_specific = device_id != 0;
// Common devices consents change
if (!device_specific) {
- application_manager::ApplicationManagerImpl::ApplicationListAccessor accessor;
- const std::set<application_manager::ApplicationSharedPtr> app_list =
- accessor.applications();
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ const ApplicationManagerImpl::ApplictionSet app_list = accessor.applications();
- std::set<application_manager::ApplicationSharedPtr>::const_iterator
- it_app_list = app_list.begin();
- std::set<application_manager::ApplicationSharedPtr>::const_iterator
- it_app_end = app_list.end();
+ ApplicationManagerImpl::ApplictionSetConstIt it_app_list = app_list.begin();
+ ApplicationManagerImpl::ApplictionSetConstIt it_app_end = app_list.end();
for (;it_app_list != it_app_end; ++it_app_list) {
if (!(*it_app_list).valid()) {
@@ -918,7 +841,7 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification(bool is_allowed,
const uint32_t device_id = *it_ids;
DeviceParams device_params;
- application_manager::MessageHelper::GetDeviceInfoForHandle(device_id,
+ MessageHelper::GetDeviceInfoForHandle(device_id,
&device_params);
device_params.device_handle = device_id;
if (kDefaultDeviceMacAddress == device_params.device_mac_address) {
@@ -944,139 +867,79 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification(bool is_allowed,
pending_device_handles_.erase(it);
}
-// EXTENDED_POLICY
- // Skip device selection, since user already consented device usage
- StartPTExchange(true);
}
void PolicyHandler::OnIgnitionCycleOver() {
- LOG4CXX_INFO(logger_, "OnIgnitionCycleOver");
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
policy_manager_->IncrementIgnitionCycles();
}
-void PolicyHandler::KmsChanged(int kms) {
- LOG4CXX_INFO(logger_, "PolicyHandler::KmsChanged " << kms << " kilometers");
- POLICY_LIB_CHECK_VOID();
- PTExchangeAtOdometer(kms);
-}
-
void PolicyHandler::OnActivateApp(uint32_t connection_key,
uint32_t correlation_id) {
- LOG4CXX_INFO(logger_, "OnActivateApp");
+ LOG4CXX_AUTO_TRACE(logger_);
- application_manager::ApplicationSharedPtr app =
- application_manager::ApplicationManagerImpl::instance()->application(
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(
connection_key);
if (!app.valid()) {
LOG4CXX_WARN(logger_, "Activated App failed: no app found.");
return;
}
- std::string policy_app_id = app->mobile_app_id()->asString();
+ std::string policy_app_id = app->mobile_app_id();
AppPermissions permissions(policy_app_id);
+ sync_primitives::AutoReadLock lock(policy_manager_lock_);
if (!policy_manager_) {
- LOG4CXX_WARN(logger_, "The shared library of policy is not loaded");
+ LOG4CXX_DEBUG(logger_, "The shared library of policy is not loaded");
if (!PolicyEnabled()) {
permissions.isSDLAllowed = true;
}
} else {
- DeviceParams device_params;
- application_manager::MessageHelper::GetDeviceInfoForApp(connection_key,
- &device_params);
permissions = policy_manager_->GetAppPermissionsChanges(
- device_params.device_mac_address,
policy_app_id);
permissions.isSDLAllowed = true;
-
- if (permissions.isSDLAllowed &&
- PolicyTableStatus::StatusUpdateRequired ==
- policy_manager_->GetPolicyTableStatus()) {
- StartPTExchange();
- }
policy_manager_->RemovePendingPermissionChanges(policy_app_id);
}
-
- bool is_app_activated = false;
// If application is revoked it should not be activated
// In this case we need to activate application
if (false == permissions.appRevoked && true == permissions.isSDLAllowed) {
- is_app_activated =
- application_manager::ApplicationManagerImpl::instance()->
- ActivateApplication(app);
- }
-
- last_activated_app_id_ = connection_key;
- application_manager::MessageHelper::SendSDLActivateAppResponse(permissions,
- correlation_id);
- if (is_app_activated) {
- application_manager::MessageHelper::SendHMIStatusNotification(*app.get());
+ LOG4CXX_INFO(logger_, "Application will be activated");
+ if (ApplicationManagerImpl::instance()->ActivateApplication(app)) {
+ last_activated_app_id_ = 0;
+ }
+ } else {
+ LOG4CXX_INFO(logger_, "Application should not be activated");
}
-}
-
-void PolicyHandler::PTExchangeAtRegistration(const std::string& app_id) {
- LOG4CXX_INFO(logger_, "PTExchangeAtIgnition");
- POLICY_LIB_CHECK_VOID();
-
- if (policy_manager_->IsAppInUpdateList(app_id)) {
- StartPTExchange();
- } else if (false == on_ignition_check_done_) { // TODO(AG): add cond. var to handle this case.
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
- const int kSecondsInDay = 60 * 60 * 24;
- int days = current_time.tv_sec / kSecondsInDay;
- LOG4CXX_INFO(
- logger_,
- "\nIgnition cycles exceeded: " << std::boolalpha <<
- policy_manager_->ExceededIgnitionCycles()
- << "\nDays exceeded: " << std::boolalpha
- << policy_manager_->ExceededDays(days)
- << "\nStatusUpdateRequired: " << std::boolalpha
- << (policy_manager_->GetPolicyTableStatus() == StatusUpdateRequired));
- if (policy_manager_->ExceededIgnitionCycles()
- || policy_manager_->ExceededDays(days)
- || policy_manager_->GetPolicyTableStatus() == StatusUpdateRequired) {
- StartPTExchange();
- }
- }
- on_ignition_check_done_ = true;
+ MessageHelper::SendSDLActivateAppResponse(permissions, correlation_id);
}
-void PolicyHandler::PTExchangeAtOdometer(int kilometers) {
+void PolicyHandler::KmsChanged(int kilometers) {
+ LOG4CXX_DEBUG(logger_, "PolicyHandler::KmsChanged " << kilometers << " kilometers");
POLICY_LIB_CHECK_VOID();
- if (policy_manager_->ExceededKilometers(kilometers)) {
- LOG4CXX_INFO(logger_, "Enough kilometers passed to send for PT update.");
- StartPTExchange();
- }
+ policy_manager_->KmsChanged(kilometers);
}
void PolicyHandler::PTExchangeAtUserRequest(uint32_t correlation_id) {
LOG4CXX_TRACE(logger_, "PT exchange at user request");
POLICY_LIB_CHECK_VOID();
- policy::PolicyTableStatus status = policy_manager_->GetPolicyTableStatus();
- if (status != policy::StatusUpdatePending) {
- OnPTExchangeNeeded();
- status = policy::StatusUpdatePending;
- } else {
- is_user_requested_policy_table_update_ = true;
- }
- application_manager::MessageHelper::SendUpdateSDLResponse(
- ConvertUpdateStatus(status), correlation_id);
-}
-
-void PolicyHandler::OnPTExchangeNeeded() {
- StartPTExchange();
+ std::string update_status = policy_manager_->ForcePTExchange();
+ MessageHelper::SendUpdateSDLResponse(update_status,
+ correlation_id);
}
void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
const Permissions& permissions,
const HMILevel& default_hmi) {
- application_manager::ApplicationSharedPtr app =
- application_manager::ApplicationManagerImpl::instance()
- ->application_by_policy_id(policy_app_id);
+ LOG4CXX_AUTO_TRACE(logger_);
+ OnPermissionsUpdated(policy_app_id, permissions);
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()
+ ->application_by_policy_id(policy_app_id);
if (!app.valid()) {
LOG4CXX_WARN(
logger_,
@@ -1084,19 +947,11 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
return;
}
- application_manager::MessageHelper::SendOnPermissionsChangeNotification(
- app->app_id(), permissions);
-
- LOG4CXX_INFO(
- logger_,
- "Notification sent for application_id:" << policy_app_id
- << " and connection_key " << app->app_id());
-
// The application currently not running (i.e. in NONE) should change HMI
// level to default
mobile_apis::HMILevel::eType current_hmi_level = app->hmi_level();
mobile_apis::HMILevel::eType hmi_level =
- application_manager::MessageHelper::StringToHMILevel(default_hmi);
+ MessageHelper::StringToHMILevel(default_hmi);
if (mobile_apis::HMILevel::INVALID_ENUM == hmi_level) {
LOG4CXX_WARN(logger_, "Couldn't convert default hmi level "
@@ -1104,7 +959,7 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
return;
}
if (current_hmi_level == hmi_level) {
- LOG4CXX_INFO(logger_, "Application already in default hmi state.");
+ LOG4CXX_DEBUG(logger_, "Application already in default hmi state.");
return;
}
switch (current_hmi_level) {
@@ -1112,20 +967,11 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
LOG4CXX_INFO(logger_, "Changing hmi level of application "
<< policy_app_id
<< " to default hmi level " << default_hmi);
- // If default is FULL, send request to HMI. Notification to mobile will be
- // sent on response receiving.
- if (mobile_apis::HMILevel::HMI_FULL == hmi_level) {
- application_manager::MessageHelper::SendActivateAppToHMI(app->app_id());
- break;
- }
-
- // Set application hmi level
- app->set_hmi_level(hmi_level);
-
- // Send notification to mobile
- application_manager::MessageHelper::SendHMIStatusNotification(*app.get());
- }
+ ApplicationManagerImpl::instance()->SetState<true>(app->app_id(),
+ mobile_apis::HMILevel::HMI_FULL
+ );
break;
+ }
default:
LOG4CXX_WARN(logger_, "Application " << policy_app_id << " is running."
"HMI level won't be changed.");
@@ -1133,6 +979,56 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
}
}
+void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
+ const Permissions& permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()
+ ->application_by_policy_id(policy_app_id);
+ if (!app.valid()) {
+ LOG4CXX_WARN(
+ logger_,
+ "Connection_key not found for application_id:" << policy_app_id);
+ return;
+ }
+
+ MessageHelper::SendOnPermissionsChangeNotification(
+ app->app_id(), permissions);
+
+ LOG4CXX_DEBUG(
+ logger_,
+ "Notification sent for application_id:" << policy_app_id
+ << " and connection_key " << app->app_id());
+}
+
+bool PolicyHandler::SaveSnapshot(const BinaryMessage& pt_string,
+ std::string& snap_path) {
+ using namespace profile;
+
+ const std::string& policy_snapshot_file_name = Profile::instance()->policies_snapshot_file_name();
+ const std::string& system_files_path = Profile::instance()->system_files_path();
+ snap_path = system_files_path + '/' + policy_snapshot_file_name;
+
+ bool result = false;
+ if (file_system::CreateDirectoryRecursively(system_files_path)) {
+ result = file_system::WriteBinaryFile(snap_path, pt_string);
+ }
+
+ if (!result) {
+ LOG4CXX_ERROR(logger_, "Failed to write snapshot file to " << snap_path);
+ }
+
+ return result;
+}
+
+void PolicyHandler::OnSnapshotCreated(const BinaryMessage& pt_string,
+ const std::vector<int>& retry_delay_seconds,
+ int timeout_exchange) {
+ EndpointUrls urls;
+ policy_manager_->GetServiceUrls("0x07", urls);
+ SendMessageToSDK(pt_string, urls.front().url.front());
+}
+
bool PolicyHandler::GetPriority(const std::string& policy_app_id,
std::string* priority) {
POLICY_LIB_CHECK(false);
@@ -1172,9 +1068,14 @@ bool PolicyHandler::GetInitialAppData(const std::string& application_id,
return policy_manager_->GetInitialAppData(application_id, nicknames, app_hmi_types);
}
-EndpointUrls PolicyHandler::GetUpdateUrls(int service_type) {
- POLICY_LIB_CHECK(EndpointUrls());
- return policy_manager_->GetUpdateUrls(service_type);
+void PolicyHandler::GetServiceUrls(const std::string& service_type, EndpointUrls& end_points) {
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->GetServiceUrls(service_type, end_points);
+}
+
+std::string PolicyHandler::GetLockScreenIconUrl() const {
+ POLICY_LIB_CHECK(std::string(""));
+ return policy_manager_->GetLockScreenIconUrl();
}
void PolicyHandler::ResetRetrySequence() {
@@ -1197,14 +1098,24 @@ void PolicyHandler::OnExceededTimeout() {
policy_manager_->OnExceededTimeout();
}
-BinaryMessageSptr PolicyHandler::RequestPTUpdate() {
- POLICY_LIB_CHECK(BinaryMessageSptr());
- return policy_manager_->RequestPTUpdate();
+void PolicyHandler::OnSystemReady() {
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->OnSystemReady();
+}
+
+void PolicyHandler::PTUpdatedAt(int kilometers, int days_after_epoch) {
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->PTUpdatedAt(kilometers, days_after_epoch);
+}
+
+void PolicyHandler::add_listener(PolicyHandlerObserver* listener) {
+ sync_primitives::AutoLock lock(listeners_lock_);
+ listeners_.push_back(listener);
}
-const std::vector<int> PolicyHandler::RetrySequenceDelaysSeconds() {
- POLICY_LIB_CHECK(std::vector<int>());
- return policy_manager_->RetrySequenceDelaysSeconds();
+void PolicyHandler::remove_listener(PolicyHandlerObserver* listener) {
+ sync_primitives::AutoLock lock(listeners_lock_);
+ listeners_.remove(listener);
}
utils::SharedPtr<usage_statistics::StatisticsManager>
@@ -1249,8 +1160,8 @@ void PolicyHandler::OnSystemError(int code) {
}
std::string PolicyHandler::GetAppName(const std::string& policy_app_id) {
- application_manager::ApplicationSharedPtr app =
- application_manager::ApplicationManagerImpl::instance()
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()
->application_by_policy_id(policy_app_id);
if (!app.valid()) {
@@ -1262,22 +1173,30 @@ std::string PolicyHandler::GetAppName(const std::string& policy_app_id) {
return app->name();
}
-void PolicyHandler::OnUserRequestedUpdateCheckRequired() {
- LOG4CXX_INFO(logger_, "OnUserRequestedUpdateCheckRequired");
- POLICY_LIB_CHECK_VOID();
- policy::PolicyTableStatus status = policy_manager_->GetPolicyTableStatus();
- if (is_user_requested_policy_table_update_ &&
- status != policy::StatusUpdatePending) {
- is_user_requested_policy_table_update_ = false;
- OnPTExchangeNeeded();
- return;
+void PolicyHandler::OnUpdateHMIAppType(std::map<std::string, StringArray> app_hmi_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(listeners_lock_);
+ HandlersCollection::const_iterator it = listeners_.begin();
+ for (; it != listeners_.end(); ++it) {
+ (*it)->OnUpdateHMIAppType(app_hmi_types);
+ }
+}
+
+void PolicyHandler::OnCertificateUpdated(const std::string& certificate_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(listeners_lock_);
+ HandlersCollection::const_iterator it = listeners_.begin();
+ for (; it != listeners_.end(); ++it) {
+ (*it)->OnCertificateUpdated(certificate_data);
}
- LOG4CXX_WARN(logger_, "There is another pending update is present."
- "User-requested update is postponed.");
+}
+
+bool PolicyHandler::CanUpdate() {
+ return 0 != GetAppIdForSending();
}
void PolicyHandler::RemoveDevice(const std::string& device_id) {
- LOG4CXX_INFO(logger_, "PolicyHandler::RemoveDevice");
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
policy_manager_->MarkUnpairedDevice(device_id);
@@ -1292,27 +1211,38 @@ bool PolicyHandler::IsApplicationRevoked(const std::string& app_id) {
}
void PolicyHandler::OnUpdateRequestSentToMobile() {
- LOG4CXX_INFO(logger_, "OnUpdateRequestSentToMobile");
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
policy_manager_->OnUpdateStarted();
}
-bool PolicyHandler::CheckKeepContext(int system_action,
- const std::string& policy_app_id) {
+bool PolicyHandler::CheckKeepContext(const std::string& policy_app_id) {
POLICY_LIB_CHECK(false);
- const bool keep_context = system_action
- == mobile_apis::SystemAction::KEEP_CONTEXT;
- const bool allowed = policy_manager_->CanAppKeepContext(policy_app_id);
- return !(keep_context && !allowed);
+ return policy_manager_->CanAppKeepContext(policy_app_id);
}
-bool PolicyHandler::CheckStealFocus(int system_action,
- const std::string& policy_app_id) {
+bool PolicyHandler::CheckStealFocus(const std::string& policy_app_id) {
POLICY_LIB_CHECK(false);
- const bool steal_focus = system_action
- == mobile_apis::SystemAction::STEAL_FOCUS;
- const bool allowed = policy_manager_->CanAppStealFocus(policy_app_id);
- return !(steal_focus && !allowed);
+ return policy_manager_->CanAppStealFocus(policy_app_id);
+}
+
+bool PolicyHandler::CheckSystemAction(
+ mobile_apis::SystemAction::eType system_action,
+ const std::string& policy_app_id) {
+ using namespace mobile_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
+ switch (system_action) {
+ case SystemAction::STEAL_FOCUS:
+ return CheckStealFocus(policy_app_id);
+ case SystemAction::KEEP_CONTEXT:
+ return CheckKeepContext(policy_app_id);
+ case SystemAction::DEFAULT_ACTION:
+ return true;
+ default:
+ break;
+ }
+ LOG4CXX_DEBUG(logger_, "Unknown system action");
+ return false;
}
uint16_t PolicyHandler::HeartBeatTimeout(const std::string& app_id) const {
@@ -1320,6 +1250,60 @@ uint16_t PolicyHandler::HeartBeatTimeout(const std::string& app_id) const {
return policy_manager_->HeartBeatTimeout(app_id);
}
+const std::string PolicyHandler::RemoteAppsUrl() const {
+ const std::string default_url;
+ POLICY_LIB_CHECK(default_url);
+ EndpointUrls endpoints;
+ policy_manager_->GetServiceUrls("queryAppsUrl", endpoints);
+ if (endpoints.empty() || endpoints[0].url.empty()) {
+ return default_url;
+ }
+
+ return endpoints[0].url[0];
+}
+
+void policy::PolicyHandler::OnAppsSearchStarted() {
+ POLICY_LIB_CHECK();
+ policy_manager_->OnAppsSearchStarted();
+}
+
+void policy::PolicyHandler::OnAppsSearchCompleted() {
+ POLICY_LIB_CHECK();
+ policy_manager_->OnAppsSearchCompleted();
+}
+
+bool PolicyHandler::IsRequestTypeAllowed(
+ const std::string& policy_app_id,
+ mobile_apis::RequestType::eType type) const {
+ POLICY_LIB_CHECK(false);
+ using namespace mobile_apis;
+
+
+ std::string stringified_type = RequestTypeToString(type);
+ if (stringified_type.empty()) {
+ LOG4CXX_ERROR(logger_, "Unknown request type.");
+ return false;
+ }
+
+ std::vector<std::string> request_types =
+ policy_manager_->GetAppRequestTypes(policy_app_id);
+
+ // If no request types are assigned to app - any is allowed
+ if (request_types.empty()) {
+ return true;
+ }
+
+ std::vector<std::string>::const_iterator it =
+ std::find(request_types.begin(), request_types.end(), stringified_type);
+ return request_types.end() != it;
+}
+
+const std::vector<std::string> PolicyHandler::GetAppRequestTypes(
+ const std::string& policy_app_id) const {
+ POLICY_LIB_CHECK(std::vector<std::string>());
+ return policy_manager_->GetAppRequestTypes(policy_app_id);
+}
+
void PolicyHandler::Increment(usage_statistics::GlobalCounterId type) {
POLICY_LIB_CHECK();
policy_manager_->Increment(type);
diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc
index 5faabde45..098a55fa7 100644
--- a/src/components/application_manager/src/request_controller.cc
+++ b/src/components/application_manager/src/request_controller.cc
@@ -30,12 +30,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <algorithm>
#include "utils/logger.h"
#include "config_profile/profile.h"
#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"
namespace application_manager {
@@ -48,76 +48,59 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "RequestController");
RequestController::RequestController()
: pool_state_(UNDEFINED),
pool_size_(profile::Profile::instance()->thread_pool_size()),
- pending_request_set_lock_(true),
- timer_("RequestCtrlTimer", this, &RequestController::onTimer, true)
-{
- LOG4CXX_INFO(logger_, "RequestController::RequestController()");
+ timer_("RequestCtrlTimer", this, &RequestController::onTimer, true),
+ is_low_voltage_(false) {
+ LOG4CXX_AUTO_TRACE(logger_);
InitializeThreadpool();
timer_.start(dafault_sleep_time_);
- LOG4CXX_DEBUG(logger_," Create timer thread ; timer thread = " << timer_.thread_->thread_handle());
}
RequestController::~RequestController() {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
if (pool_state_ != TPoolState::STOPPED) {
DestroyThreadpool();
}
-
- pool_.clear();
- mobile_request_list_.clear();
- pending_request_set_.clear();
}
-void RequestController::InitializeThreadpool()
-{
- LOG4CXX_TRACE_ENTER(logger_);
- // TODO: Consider lazy loading threads instead of creating all at once
+void RequestController::InitializeThreadpool() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ // TODO(DK): Consider lazy loading threads instead of creating all at once
pool_state_ = TPoolState::STARTED;
+ char name[50];
for (uint32_t i = 0; i < pool_size_; i++) {
- char name [50];
- snprintf(name, sizeof(name)/sizeof(name[0]),
- "AM Pool %d", i);
+ snprintf(name, sizeof(name)/sizeof(name[0]), "AM Pool %d", i);
pool_.push_back(threads::CreateThread(name, new Worker(this)));
pool_[i]->start();
- LOG4CXX_INFO(logger_, "Request thread initialized: " << name);
+ LOG4CXX_DEBUG(logger_, "Request thread initialized: " << name);
}
}
void RequestController::DestroyThreadpool() {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
{
- sync_primitives::AutoLock auto_lock (mobile_request_list_lock_);
+ AutoLock auto_lock(mobile_request_info_list_lock_);
pool_state_ = TPoolState::STOPPED;
- LOG4CXX_INFO(logger_, "Broadcasting STOP signal to all threads...");
- cond_var_.Broadcast(); // notify all threads we are shutting down
+ LOG4CXX_DEBUG(logger_, "Broadcasting STOP signal to all threads...");
+ cond_var_.Broadcast(); // notify all threads we are shutting down
}
- for (uint32_t i = 0; i < pool_size_; i++) {
- pool_[i]->stop();
- threads::DeleteThread(pool_[i]);
+ for (size_t i = 0; i < pool_.size(); i++) {
+ threads::Thread* thread = pool_[i];
+ thread->join();
+ delete thread->delegate();
+ threads::DeleteThread(thread);
}
- LOG4CXX_INFO(logger_, "Threads exited from the thread pool " << pool_size_);
+ pool_.clear();
}
-RequestController::TResult RequestController::addMobileRequest(
- const MobileRequestPtr& request,
- const mobile_apis::HMILevel::eType& hmi_level) {
- LOG4CXX_TRACE_ENTER(logger_);
- if (!request.valid()) {
- LOG4CXX_INFO(logger_, "Null Pointer request");
- LOG4CXX_TRACE_EXIT(logger_);
- cond_var_.NotifyOne();
- return INVALID_DATA;
- }
-
- TResult result = SUCCESS;
- const commands::CommandRequestImpl* request_impl =
- static_cast<commands::CommandRequestImpl*>(request.get());
- LOG4CXX_DEBUG(logger_, "addMobileRequest " << request_impl->correlation_id());
+RequestController::TResult RequestController::CheckPosibilitytoAdd(
+ const RequestPtr request) {
+ LOG4CXX_AUTO_TRACE(logger_);
const uint32_t& app_hmi_level_none_time_scale =
profile::Profile::instance()->app_hmi_level_none_time_scale();
- const uint32_t& app_hmi_level_none_max_request_per_time_scale =
- profile::Profile::instance()->app_hmi_level_none_time_scale_max_requests();
+ // app_hmi_level_none_max_request_per_time_scale
+ const uint32_t& hmi_level_none_count =
+ profile::Profile::instance()->app_hmi_level_none_time_scale_max_requests();
const uint32_t& app_time_scale =
profile::Profile::instance()->app_time_scale();
@@ -128,244 +111,295 @@ RequestController::TResult RequestController::addMobileRequest(
const uint32_t& pending_requests_amount =
profile::Profile::instance()->pending_requests_amount();
- if (!checkHMILevelTimeScaleMaxRequest(mobile_apis::HMILevel::HMI_NONE,
- request_impl->connection_key(),
+ if (!CheckPendingRequestsAmount(pending_requests_amount)) {
+ LOG4CXX_ERROR(logger_, "Too many pending request");
+ return RequestController::TOO_MANY_PENDING_REQUESTS;
+ }
+
+ if (!waiting_for_response_.CheckHMILevelTimeScaleMaxRequest(
+ mobile_apis::HMILevel::HMI_NONE,
+ request->connection_key(),
app_hmi_level_none_time_scale,
- app_hmi_level_none_max_request_per_time_scale)) {
+ hmi_level_none_count)) {
LOG4CXX_ERROR(logger_, "Too many application requests in hmi level NONE");
- result = RequestController::NONE_HMI_LEVEL_MANY_REQUESTS;
- } else if (!checkTimeScaleMaxRequest(
- request_impl->connection_key(),
- app_time_scale, max_request_per_time_scale)) {
+ return RequestController::NONE_HMI_LEVEL_MANY_REQUESTS;
+ }
+ if (!waiting_for_response_.CheckTimeScaleMaxRequest(request->connection_key(),
+ app_time_scale,
+ max_request_per_time_scale)) {
LOG4CXX_ERROR(logger_, "Too many application requests");
- result = RequestController::TOO_MANY_REQUESTS;
- } else if (pending_requests_amount == mobile_request_list_.size()) {
- LOG4CXX_ERROR(logger_, "Too many pending request");
- result = RequestController::TOO_MANY_PENDING_REQUESTS;
+ return RequestController::TOO_MANY_REQUESTS;
}
- {
- AutoLock auto_lock(mobile_request_list_lock_);
-
- mobile_request_list_.push_back(request);
- LOG4CXX_INFO(logger_, "mobile_request_list_ size is "
- << mobile_request_list_.size()
- << " pending_request_set_ size is "
- << pending_request_set_.size()
- );
+ return SUCCESS;
+}
+
+bool RequestController::CheckPendingRequestsAmount(
+ const uint32_t& pending_requests_amount) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (pending_requests_amount > 0) {
+ const size_t pending_requests_size = mobile_request_info_list_.size();
+ const bool available_to_add =
+ pending_requests_amount > pending_requests_size;
+ if (!available_to_add) {
+ LOG4CXX_WARN(logger_, "Pending requests count " << pending_requests_size
+ << " exceed application limit " << pending_requests_amount);
+ }
+ return available_to_add;
}
+ LOG4CXX_DEBUG(logger_, "CheckPendingRequestsAmount disabled");
+ return true;
+}
+RequestController::TResult RequestController::addMobileRequest(
+ const RequestPtr request,
+ const mobile_apis::HMILevel::eType& hmi_level) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!request) {
+ LOG4CXX_ERROR(logger_, "Null Pointer request");
+ cond_var_.NotifyOne();
+ return INVALID_DATA;
+ }
+ LOG4CXX_DEBUG(logger_, "correlation_id : " << request->correlation_id()
+ << "connection_key : " << request->connection_key());
+ RequestController::TResult result = CheckPosibilitytoAdd(request);
+ if (SUCCESS ==result) {
+ // Temporary set timeout to zero. Correct value will be set at the moment
+ // of processing start - in threadMain()
+ RequestInfoPtr request_info_ptr(utils::MakeShared<MobileRequestInfo>(request, 0u));
+ request_info_ptr->set_hmi_level(hmi_level);
+ AutoLock auto_lock_list(mobile_request_info_list_lock_);
+ mobile_request_info_list_.push_back(request_info_ptr);
+ LOG4CXX_DEBUG(logger_, "Waiting for execution: "
+ << mobile_request_info_list_.size());
// wake up one thread that is waiting for a task to be available
+ }
cond_var_.NotifyOne();
- LOG4CXX_TRACE_EXIT(logger_);
return result;
}
RequestController::TResult RequestController::addHMIRequest(
const RequestPtr request) {
- LOG4CXX_TRACE_ENTER(logger_);
- DCHECK(request.valid());
- LOG4CXX_DEBUG(logger_, "addHMIRequest " << request->correlation_id());
+ LOG4CXX_AUTO_TRACE(logger_);
- uint32_t timeout_in_seconds = request->default_timeout()/date_time::DateTime::MILLISECONDS_IN_SECOND;
- RequestInfoPtr request_info_ptr =
- new HMIRequestInfo(request,
- timeout_in_seconds);
+ if (!request.valid()) {
+ LOG4CXX_ERROR(logger_, "HMI request pointer is invalid");
+ return RequestController::INVALID_DATA;
+ }
+ LOG4CXX_DEBUG(logger_, " correlation_id : " << request->correlation_id());
+
+ const uint32_t timeout_in_seconds =
+ request->default_timeout() / date_time::DateTime::MILLISECONDS_IN_SECOND;
+ RequestInfoPtr request_info_ptr(new HMIRequestInfo(request,
+ timeout_in_seconds));
if (0 != timeout_in_seconds) {
- pending_request_set_lock_.Acquire();
- pending_request_set_.insert(request_info_ptr);
- LOG4CXX_INFO(logger_, "pending_request_set_ size is "
- << pending_request_set_.size());
- UpdateTimer();
- pending_request_set_lock_.Release();
+ waiting_for_response_.Add(request_info_ptr);
+ LOG4CXX_INFO(logger_, "Waiting for response cont:"
+ << waiting_for_response_.Size());
} else {
LOG4CXX_INFO(logger_, "Default timeout was set to 0."
"RequestController will not track timeout of this request.");
}
- LOG4CXX_TRACE_EXIT(logger_);
+ UpdateTimer();
return RequestController::SUCCESS;
}
void RequestController::addNotification(const RequestPtr ptr) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
notification_list_.push_back(ptr);
- LOG4CXX_TRACE_EXIT(logger_);
}
-void RequestController::removeNotification(const commands::Command* notification) {
- LOG4CXX_TRACE_ENTER(logger_);
+void RequestController::removeNotification(
+ const commands::Command* notification) {
+ LOG4CXX_AUTO_TRACE(logger_);
std::list<RequestPtr>::iterator it = notification_list_.begin();
- for (; notification_list_.end() != it; ++it) {
+ for (; notification_list_.end() != it; ) {
if (it->get() == notification) {
- notification_list_.erase(it);
+ notification_list_.erase(it++);
+ LOG4CXX_DEBUG(logger_, "Notification removed");
break;
+ } else {
+ ++it;
}
}
- LOG4CXX_TRACE_EXIT(logger_);
+ LOG4CXX_DEBUG(logger_, "Cant find notification");
}
-void RequestController::terminateMobileRequest(
- const uint32_t& mobile_correlation_id) {
- LOG4CXX_TRACE_ENTER(logger_);
-
- AutoLock auto_lock(pending_request_set_lock_);
- RequestInfoSet::iterator it = pending_request_set_.begin();
- for (; pending_request_set_.end() != it; ++it) {
- RequestInfo* mobile_request_info = it->get();
- if (NULL == mobile_request_info) {
- continue;
- }
- if (mobile_correlation_id == mobile_request_info->requestId()) {
- mobile_request_info->request()->CleanUp();
- pending_request_set_.erase(it);
- LOG4CXX_INFO(logger_, "Mobile request terminated: " << mobile_correlation_id <<
- " pending_request_set_ size : " << pending_request_set_.size());
- UpdateTimer();
- LOG4CXX_TRACE_EXIT(logger_);
- return;
+void RequestController::terminateRequest(
+ const uint32_t& correlation_id,
+ const uint32_t& connection_key, bool force_terminate) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "correlation_id = " << correlation_id
+ << " connection_key = " << connection_key
+ << " force_terminate = " << force_terminate);
+ RequestInfoPtr request = waiting_for_response_.Find(connection_key,
+ correlation_id);
+ if (request) {
+ if (force_terminate ||
+ request->request()->AllowedToTerminate()) {
+ waiting_for_response_.RemoveRequest(request);
+ } else {
+ LOG4CXX_WARN(logger_, "Request was not terminated");
}
+ UpdateTimer();
+ } else {
+ LOG4CXX_WARN(logger_, "Request not found in waiting_for_response_");
}
- LOG4CXX_INFO(logger_, "Mobile request NOT terminated: " << mobile_correlation_id <<
- " pending_request_set_ size : " << pending_request_set_.size());
- LOG4CXX_TRACE_EXIT(logger_);
}
-void RequestController::terminateHMIRequest(const uint32_t &correlation_id) {
- LOG4CXX_TRACE_ENTER(logger_);
- AutoLock auto_lock(pending_request_set_lock_);
- RequestInfoSet::iterator it = pending_request_set_.begin();
- for (; pending_request_set_.end() != it; ++it) {
- RequestInfo* hmi_request_info = it->get();
- if (NULL == hmi_request_info) {
- continue;
- }
- if (correlation_id == hmi_request_info->requestId()) {
- hmi_request_info->request()->CleanUp();
- pending_request_set_.erase(it);
- LOG4CXX_DEBUG(logger_, "HMI request terminated: " << correlation_id);
- UpdateTimer();
- LOG4CXX_TRACE_EXIT(logger_);
- return;
- }
- }
- LOG4CXX_INFO(logger_, "HMI request NOT terminated: " << correlation_id <<
- " pending_request_set_ size : " << pending_request_set_.size());
- LOG4CXX_TRACE_EXIT(logger_);
+void RequestController::OnMobileResponse(
+ const uint32_t& mobile_correlation_id,
+ const uint32_t& connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ terminateRequest(mobile_correlation_id, connection_key);
}
-void RequestController::terminateAppRequests(
- const uint32_t& app_id) {
- LOG4CXX_TRACE_ENTER(logger_);
-
- AutoLock auto_lock(pending_request_set_lock_);
- RequestInfoSet::iterator it = pending_request_set_.begin();
- while (pending_request_set_.end() != it) {
- RequestInfo* mobile_request_info = it->get();
- if (NULL == mobile_request_info) {
- ++it;
- continue;
- }
+void RequestController::OnHMIResponse(const uint32_t &correlation_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ terminateRequest(correlation_id, RequestInfo::HmiConnectoinKey);
+}
- if (mobile_request_info->app_id() == app_id) {
- mobile_request_info->request()->CleanUp();
- pending_request_set_.erase(it++);
- LOG4CXX_INFO(logger_, "terminated all app requests : " << app_id);
+void RequestController::terminateWaitingForExecutionAppRequests(
+ const uint32_t& app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "app_id: " << app_id
+ << "Waiting for execution" << mobile_request_info_list_.size());
+ AutoLock auto_lock(mobile_request_info_list_lock_);
+ std::list<RequestInfoPtr>::iterator request_it =
+ mobile_request_info_list_.begin();
+ while (mobile_request_info_list_.end() != request_it) {
+ RequestInfoPtr request_info = (*request_it);
+ if ((request_info.valid()) &&
+ (request_info->request()->connection_key() == app_id)) {
+ mobile_request_info_list_.erase(request_it++);
} else {
- ++it;
+ ++request_it;
}
}
+ LOG4CXX_DEBUG(logger_, "Waiting for execution "
+ << mobile_request_info_list_.size());
+}
+
+void RequestController::terminateWaitingForResponseAppRequests(
+ const uint32_t& app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ waiting_for_response_.RemoveByConnectionKey(app_id);
+ LOG4CXX_DEBUG(logger_, "Waiting for response count : "
+ << waiting_for_response_.Size());
+}
+
+void RequestController::terminateAppRequests(
+ const uint32_t& app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "app_id : " << app_id
+ << "Requests waiting for execution count : "
+ << mobile_request_info_list_.size()
+ << "Requests waiting for response count : "
+ << waiting_for_response_.Size());
+
+ terminateWaitingForExecutionAppRequests(app_id);
+ terminateWaitingForResponseAppRequests(app_id);
UpdateTimer();
- LOG4CXX_TRACE_EXIT(logger_);
}
void RequestController::terminateAllHMIRequests() {
- LOG4CXX_TRACE_ENTER(logger_);
- AutoLock auto_lock(pending_request_set_lock_);
- RequestInfoSet::iterator it = pending_request_set_.begin();
- while (pending_request_set_.end() != it) {
- RequestInfo* hmi_request_info = it->get();
- if (NULL == hmi_request_info) {
- ++it;
- continue;
- }
- hmi_request_info->request()->CleanUp();
- pending_request_set_.erase(it++);
- LOG4CXX_INFO(logger_, "HMI request terminated: ");
- }
- LOG4CXX_TRACE_EXIT(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
+ terminateWaitingForResponseAppRequests(RequestInfo::HmiConnectoinKey);
+}
+
+void RequestController::terminateAllMobileRequests() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ waiting_for_response_.RemoveMobileRequests();
+ LOG4CXX_DEBUG(logger_, "Mobile Requests waiting for response cleared");
+ AutoLock waiting_execution_auto_lock(mobile_request_info_list_lock_);
+ mobile_request_info_list_.clear();
+ LOG4CXX_DEBUG(logger_, "Mobile Requests waiting for execution cleared");
+ UpdateTimer();
}
void RequestController::updateRequestTimeout(
const uint32_t& app_id,
- const uint32_t& mobile_correlation_id,
+ const uint32_t& correlation_id,
const uint32_t& new_timeout) {
-
- LOG4CXX_TRACE_ENTER(logger_);
-
- AutoLock auto_lock(pending_request_set_lock_);
- RequestInfoSet::iterator it = pending_request_set_.begin();
- RequestInfo* mobile_request_info = NULL;
- RequestInfoPtr request_info;
- for (; pending_request_set_.end() != it; ++it) {
- request_info = *it;
- if (false == request_info.valid()) {
- LOG4CXX_ERROR(logger_, "Invalid request, can't update timeout");
- continue;
- }
- mobile_request_info = request_info.get();
- if (NULL == mobile_request_info) {
- continue;
- }
- if (app_id == mobile_request_info->app_id() &&
- mobile_correlation_id == mobile_request_info->requestId()) {
- break;
- }
- }
-
- if (it != pending_request_set_.end()) {
- DCHECK(mobile_request_info);
- DCHECK(request_info.valid());
-
- uint32_t timeout_in_seconds = new_timeout/date_time::DateTime::MILLISECONDS_IN_SECOND;
- mobile_request_info->updateTimeOut(timeout_in_seconds);
- pending_request_set_.erase(it);
- pending_request_set_.insert(request_info);
- // erase and insert need to update ordering of set
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "app_id : " << app_id
+ << " mobile_correlation_id : " << correlation_id
+ << " new_timeout : " << new_timeout);
+ LOG4CXX_DEBUG(logger_, "New_timeout is NULL. RequestCtrl will "
+ "not manage this request any more");
+ RequestInfoPtr request_info =
+ waiting_for_response_.Find(app_id, correlation_id);
+ if (request_info) {
+ uint32_t timeout_in_seconds =
+ new_timeout/date_time::DateTime::MILLISECONDS_IN_SECOND;
+ waiting_for_response_.RemoveRequest(request_info);
+ request_info->updateTimeOut(timeout_in_seconds);
+ waiting_for_response_.Add(request_info);
UpdateTimer();
- LOG4CXX_ERROR(logger_, "Timeout updated for "
+ LOG4CXX_INFO(logger_, "Timeout updated for "
<< " app_id " << app_id
- << " mobile_correlation_id " << mobile_correlation_id
+ << " correlation_id " << correlation_id
<< " new_timeout " << new_timeout);
} else {
LOG4CXX_ERROR(logger_, "Can't find request with "
<< " app_id " << app_id
- << " mobile_correlation_id " << mobile_correlation_id );
+ << " correlation_id " << correlation_id);
}
}
+void RequestController::OnLowVoltage() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ is_low_voltage_ = true;
+}
+
+void RequestController::OnWakeUp() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ terminateAllHMIRequests();
+ terminateAllMobileRequests();
+ is_low_voltage_ = false;
+ LOG4CXX_DEBUG(logger_, "Terminate old requests done");
+}
+
+bool RequestController::IsLowVoltage() {
+ LOG4CXX_TRACE(logger_, "result: " << is_low_voltage_);
+ return is_low_voltage_;
+}
+
void RequestController::onTimer() {
- LOG4CXX_TRACE_ENTER(logger_);
- AutoLock auto_lock(pending_request_set_lock_);
- RequestInfoSet::iterator probably_expired = pending_request_set_.begin();
- while (pending_request_set_.end() != probably_expired) {
- RequestInfoPtr request = *probably_expired;
- if (request->timeout_sec() == 0) {
- LOG4CXX_INFO(logger_, "Ignore " << request->requestId());
- ++probably_expired;
- // This request should not be observed for TIME_OUT
- continue;
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "ENTER Waiting fore response count: "
+ << waiting_for_response_.Size());
+ RequestInfoPtr probably_expired =
+ waiting_for_response_.FrontWithNotNullTimeout();
+ while (probably_expired && probably_expired->isExpired()) {
+ LOG4CXX_INFO(logger_, "Timeout for "
+ << (RequestInfo::HMIRequest
+ == probably_expired ->requst_type() ? "HMI": "Mobile")
+ << " request id: "
+ << probably_expired ->requestId()
+ << " connection_key: " <<
+ probably_expired ->app_id() << " is expired");
+ const uint32_t experied_request_id = probably_expired->requestId();
+ const uint32_t experied_app_id = probably_expired->app_id();
+
+ probably_expired->request()->onTimeOut();
+ if (RequestInfo::HmiConnectoinKey == probably_expired ->app_id()) {
+ LOG4CXX_DEBUG(logger_, "Erase HMI request: "
+ << probably_expired ->requestId());
+ waiting_for_response_.RemoveRequest(probably_expired);
}
- if (request->isExpired()) {
- pending_request_set_.erase(probably_expired);
- request->request()->onTimeOut();
- request->request()->CleanUp();
- LOG4CXX_INFO(logger_, "Timeout for request id " << request->requestId() << " expired");
- probably_expired = pending_request_set_.begin();
- break;
+ probably_expired = waiting_for_response_.FrontWithNotNullTimeout();
+ if (probably_expired) {
+ if (experied_request_id == probably_expired->requestId() &&
+ experied_app_id == probably_expired->app_id()) {
+ LOG4CXX_DEBUG(logger_, "Expired request wasn't removed");
+ break;
+ }
}
}
UpdateTimer();
- LOG4CXX_TRACE_EXIT(logger_);
+ LOG4CXX_DEBUG(logger_, "EXIT Waiting for response count : "
+ << waiting_for_response_.Size());
}
RequestController::Worker::Worker(RequestController* requestController)
@@ -377,14 +411,14 @@ RequestController::Worker::~Worker() {
}
void RequestController::Worker::threadMain() {
- LOG4CXX_TRACE_ENTER(logger_);
- sync_primitives::AutoLock auto_lock(thread_lock_);
+ LOG4CXX_AUTO_TRACE(logger_);
+ AutoLock auto_lock(thread_lock_);
while (!stop_flag_) {
// Try to pick a request
- sync_primitives::AutoLock auto_lock(request_controller_->mobile_request_list_lock_);
+ AutoLock auto_lock(request_controller_->mobile_request_info_list_lock_);
while ((request_controller_->pool_state_ != TPoolState::STOPPED) &&
- (request_controller_->mobile_request_list_.empty())) {
+ (request_controller_->mobile_request_info_list_.empty())) {
// Wait until there is a task in the queue
// Unlock mutex while wait, then lock it back when signaled
LOG4CXX_INFO(logger_, "Unlocking and waiting");
@@ -397,117 +431,78 @@ void RequestController::Worker::threadMain() {
break;
}
- MobileRequestPtr request(request_controller_->mobile_request_list_.front());
+ if (request_controller_->mobile_request_info_list_.empty()) {
+ LOG4CXX_WARN(logger_, "Mobile request list is empty");
+ break;
+ }
- request_controller_->mobile_request_list_.pop_front();
- bool init_res = request->Init(); // to setup specific default timeout
+ RequestInfoPtr request_info_ptr(
+ request_controller_->mobile_request_info_list_.front());
+ request_controller_->mobile_request_info_list_.pop_front();
+ bool init_res = request_info_ptr->request()->Init(); // to setup specific
+ // default timeout
- uint32_t timeout_in_seconds = request->default_timeout()/date_time::DateTime::MILLISECONDS_IN_SECOND;
- RequestInfoPtr request_info_ptr(new MobileRequestInfo(request,
- timeout_in_seconds));
+ const uint32_t timeout_in_seconds =
+ request_info_ptr->request()->default_timeout() /
+ date_time::DateTime::MILLISECONDS_IN_SECOND;
+ // Start time, end time and timeout need to be updated to appropriate values
+ request_info_ptr->update_start_time(date_time::DateTime::getCurrentTime());
+ request_info_ptr->updateTimeOut(timeout_in_seconds);
- request_controller_->pending_request_set_lock_.Acquire();
- request_controller_->pending_request_set_.insert(request_info_ptr);
+ request_controller_->waiting_for_response_.Add(request_info_ptr);
if (0 != timeout_in_seconds) {
- LOG4CXX_INFO(logger_, "Add Request " << request_info_ptr->requestId() <<
- " with timeout: " << timeout_in_seconds);
request_controller_->UpdateTimer();
} else {
- LOG4CXX_INFO(logger_, "Default timeout was set to 0."
- "RequestController will not track timeout of this request.");
+ LOG4CXX_DEBUG(logger_, "Default timeout was set to 0. "
+ "RequestController will not track timeout "
+ "of this request.");
}
- request_controller_->pending_request_set_lock_.Release();
+
AutoUnlock unlock(auto_lock);
// execute
- if (request->CheckPermissions() && init_res) {
- request->Run();
+ if ((false == request_controller_->IsLowVoltage()) &&
+ request_info_ptr->request()->CheckPermissions() && init_res) {
+ LOG4CXX_DEBUG(logger_, "Execute MobileRequest corr_id = "
+ << request_info_ptr->requestId()
+ << " with timeout: " << timeout_in_seconds);
+ request_info_ptr->request()->Run();
}
}
-
}
-bool RequestController::Worker::exitThreadMain() {
+void RequestController::Worker::exitThreadMain() {
stop_flag_ = true;
- sync_primitives::AutoLock auto_lock(thread_lock_);
// setup stop flag and whit while threadMain will be finished correctly
- // FIXME (dchmerev@luxoft.com): There is no wating
- return true;
-}
-
-bool RequestController::checkTimeScaleMaxRequest(
- const uint32_t& app_id,
- const uint32_t& app_time_scale,
- const uint32_t& max_request_per_time_scale) {
- LOG4CXX_TRACE_ENTER(logger_);
- {
- AutoLock auto_lock(pending_request_set_lock_);
- TimevalStruct end = date_time::DateTime::getCurrentTime();
- TimevalStruct start;
- start.tv_sec = end.tv_sec - app_time_scale;
-
- TimeScale scale(start, end, app_id);
- uint32_t count = 0;
-
- count = count_if (pending_request_set_.begin(), pending_request_set_.end(), scale);
- if (count == max_request_per_time_scale ) {
- LOG4CXX_ERROR(logger_, "Requests count " << count <<
- " exceed application limit " << max_request_per_time_scale);
- return true;
- }
- }
- return true;
-}
-
-bool RequestController::checkHMILevelTimeScaleMaxRequest(
- const mobile_apis::HMILevel::eType& hmi_level,
- const uint32_t& app_id,
- const uint32_t& app_time_scale,
- const uint32_t& max_request_per_time_scale) {
- LOG4CXX_TRACE_ENTER(logger_);
- {
- AutoLock auto_lock(pending_request_set_lock_);
- TimevalStruct end = date_time::DateTime::getCurrentTime();
- TimevalStruct start;
- start.tv_sec = end.tv_sec - app_time_scale;
-
- HMILevelTimeScale scale(start, end, app_id, hmi_level);
- uint32_t count = 0;
-
- count = count_if (pending_request_set_.begin(), pending_request_set_.end(), scale);
- if (count == max_request_per_time_scale ) {
- LOG4CXX_ERROR(logger_, "Requests count " << count
- << " exceed application limit " << max_request_per_time_scale
- << " in hmi level " << hmi_level);
- return false;
- }
- }
- return true;
+ // FIXME (dchmerev@luxoft.com): There is no waiting
}
void RequestController::UpdateTimer() {
- LOG4CXX_TRACE_ENTER(logger_);
- uint32_t sleep_time = dafault_sleep_time_;
- RequestInfoSet::iterator it = pending_request_set_.begin();
-
- while (it != pending_request_set_.end()) {
- RequestInfoPtr request = *it;
- DCHECK(request.valid());
- if (0 == request->timeout_sec()) {
- ++it;
- // This request should not be observed for TIME_OUT
- continue;
+ LOG4CXX_AUTO_TRACE(logger_);
+ RequestInfoPtr front = waiting_for_response_.FrontWithNotNullTimeout();
+ if (front) {
+ const TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const TimevalStruct end_time = front->end_time();
+ if (current_time < end_time) {
+ const uint64_t secs = end_time.tv_sec - current_time.tv_sec;
+ LOG4CXX_DEBUG(logger_, "Sleep for " << secs << " secs");
+ // Timeout for bigger than 5 minutes is a mistake
+ timer_.updateTimeOut(secs);
+ } else {
+ LOG4CXX_WARN(logger_, "Request app_id = " << front->app_id()
+ << "correlation_id = " << front->requestId()
+ << "is expired a long time ago: "
+ << end_time.tv_sec << " - "
+ << current_time.tv_sec << " >= "
+ << front->timeout_sec());
+ timer_.updateTimeOut(0);
}
- sleep_time = request->end_time().tv_sec -
- date_time::DateTime::getCurrentTime().tv_sec;
- break;
+ } else {
+ LOG4CXX_DEBUG(logger_, "Sleep for default sleep time "
+ << dafault_sleep_time_ << " secs");
+ timer_.updateTimeOut(dafault_sleep_time_);
}
- timer_.updateTimeOut(sleep_time);
- LOG4CXX_INFO(logger_, "Sleep for: " << sleep_time);
- LOG4CXX_TRACE_EXIT(logger_);
}
-
} // namespace request_controller
-
} // namespace application_manager
diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc
index 0b448c9e4..26af81ea5 100644
--- a/src/components/application_manager/src/request_info.cc
+++ b/src/components/application_manager/src/request_info.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file request_info.h
* \brief request information structure source file.
*
@@ -29,38 +29,43 @@
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "application_manager/request_info.h"
+
+#include <algorithm>
namespace application_manager {
namespace request_controller {
+CREATE_LOGGERPTR_GLOBAL(logger_, "RequestController");
+
+uint32_t RequestInfo::HmiConnectoinKey = 0;
+
HMIRequestInfo::HMIRequestInfo(
RequestPtr request,
const uint64_t timeout_sec):
- RequestInfo(timeout_sec),
- request_(request) {
+ RequestInfo(request, HMIRequest, timeout_sec) {
correlation_id_ = request_->correlation_id();
+ app_id_ = RequestInfo::HmiConnectoinKey;
}
HMIRequestInfo::HMIRequestInfo(
RequestPtr request,
const TimevalStruct &start_time,
const uint64_t timeout_sec):
- RequestInfo(start_time, timeout_sec),
- request_(request) {
+ RequestInfo(request, HMIRequest, start_time, timeout_sec) {
correlation_id_ = request_->correlation_id();
+ app_id_ = RequestInfo::HmiConnectoinKey;
}
MobileRequestInfo::MobileRequestInfo(
RequestPtr request,
const uint64_t timeout_sec):
- RequestInfo(timeout_sec),
- request_(request) {
- mobile_correlation_id_ = request_.get()->correlation_id();
+ RequestInfo(request, MobileRequest, timeout_sec) {
+ correlation_id_ = request_.get()->correlation_id();
app_id_ = request_.get()->connection_key();
}
@@ -68,12 +73,294 @@ MobileRequestInfo::MobileRequestInfo(
RequestPtr request,
const TimevalStruct &start_time,
const uint64_t timeout_sec):
- RequestInfo(start_time, timeout_sec),
- request_(request) {
- mobile_correlation_id_ = request_.get()->correlation_id();
+ RequestInfo(request, MobileRequest, start_time, timeout_sec) {
+ correlation_id_ = request_.get()->correlation_id();
app_id_ = request_.get()->connection_key();
}
-} // namespace request_controller
+RequestInfo::RequestInfo(RequestPtr request,
+ const RequestInfo::RequestType requst_type,
+ const TimevalStruct& start_time,
+ const uint64_t timeout_sec):
+ request_(request),
+ start_time_(start_time),
+ timeout_sec_(timeout_sec) {
+ updateEndTime();
+ requst_type_ = requst_type;
+ correlation_id_ = request_->correlation_id();
+ app_id_ = request_->connection_key();
+}
+
+void application_manager::request_controller::RequestInfo::updateEndTime() {
+ end_time_ = date_time::DateTime::getCurrentTime();
+ end_time_.tv_sec += timeout_sec_;
+
+ // possible delay during IPC
+ const uint32_t hmi_delay_sec = 1;
+ end_time_.tv_sec += hmi_delay_sec;
+}
+
+void RequestInfo::updateTimeOut(const uint64_t& timeout_sec) {
+ timeout_sec_ = timeout_sec;
+ updateEndTime();
+}
+
+bool RequestInfo::isExpired() {
+ TimevalStruct curr_time = date_time::DateTime::getCurrentTime();
+ return end_time_.tv_sec <= curr_time.tv_sec;
+ // TODO(AKutsan) APPLINK-9711 Need to use compareTime method when timer will support millisecconds
+ // return date_time::GREATER == date_time::DateTime::compareTime(end_time_, curr_time);
+}
+
+uint64_t RequestInfo::hash() {
+ return GenerateHash(app_id(), requestId());
+}
+
+uint64_t RequestInfo::GenerateHash(uint32_t var1, uint32_t var2) {
+ uint64_t hash_result = 0;
+ hash_result = var1;
+ hash_result = hash_result << 32;
+ hash_result = hash_result | var2;
+ return hash_result;
+}
+
+FakeRequestInfo::FakeRequestInfo(uint32_t app_id, uint32_t correaltion_id) {
+ app_id_ = app_id;
+ correlation_id_ = correaltion_id;
+}
+
+bool RequestInfoSet::Add(RequestInfoPtr request_info) {
+ DCHECK_OR_RETURN(request_info, false);
+ LOG4CXX_DEBUG(logger_, "Add request app_id = " << request_info->app_id()
+ << "; corr_id = " << request_info->requestId());
+ sync_primitives::AutoLock lock(this_lock_);
+ CheckSetSizes();
+ const std::pair<HashSortedRequestInfoSet::iterator, bool>& insert_resilt =
+ hash_sorted_pending_requests_.insert(request_info);
+ if (insert_resilt.second == true) {
+ const std::pair<TimeSortedRequestInfoSet::iterator, bool>& insert_resilt =
+ time_sorted_pending_requests_.insert(request_info);
+ DCHECK(insert_resilt.second);
+ if (!insert_resilt.second) {
+ return false;
+ }
+ CheckSetSizes();
+ return true;
+ } else {
+ LOG4CXX_ERROR(logger_, "Request with app_id = " << request_info->app_id()
+ << "; corr_id " << request_info->requestId() << " Already exist ");
+ }
+ CheckSetSizes();
+ return false;
+}
+
+RequestInfoPtr RequestInfoSet::Find(const uint32_t connection_key,
+ const uint32_t correlation_id) {
+ RequestInfoPtr result;
+
+ // Request info for searching in request info set by log_n time
+ utils::SharedPtr<FakeRequestInfo> request_info_for_search(
+ new FakeRequestInfo(connection_key, correlation_id));
+
+ sync_primitives::AutoLock lock(this_lock_);
+ HashSortedRequestInfoSet::iterator it =
+ hash_sorted_pending_requests_.find(request_info_for_search);
+ if (it != hash_sorted_pending_requests_.end()) {
+ result = *it;
+ }
+ return result;
+}
+
+RequestInfoPtr RequestInfoSet::Front() {
+ RequestInfoPtr result;
+
+ sync_primitives::AutoLock lock(this_lock_);
+ TimeSortedRequestInfoSet::iterator it = time_sorted_pending_requests_.begin();
+ if (it != time_sorted_pending_requests_.end()) {
+ result = *it;
+ }
+ return result;
+}
+
+RequestInfoPtr RequestInfoSet::FrontWithNotNullTimeout() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(this_lock_);
+ RequestInfoPtr result;
+ TimeSortedRequestInfoSet::iterator it = time_sorted_pending_requests_.begin();
+ while (it != time_sorted_pending_requests_.end()) {
+ RequestInfoPtr tmp = *it;
+ if (0 == tmp ->timeout_sec()) {
+ ++it;
+ } else {
+ result = tmp;
+ it = time_sorted_pending_requests_.end();
+ }
+ }
+ return result;
+}
+
+bool RequestInfoSet::Erase(const RequestInfoPtr request_info) {
+ DCHECK(request_info);
+ if (!request_info) {
+ LOG4CXX_ERROR(logger_, "NULL ponter request_info");
+ return false;
+ }
+ CheckSetSizes();
+
+ size_t erased_count =
+ hash_sorted_pending_requests_.erase(request_info);
+ DCHECK((erased_count <= 1));
+ if (1 == erased_count) {
+ TimeSortedRequestInfoSet::iterator it =
+ time_sorted_pending_requests_.find(request_info);
+ DCHECK(it != time_sorted_pending_requests_.end());
+ if (it == time_sorted_pending_requests_.end()) {
+ LOG4CXX_ERROR(logger_, "Can't find request in time_sorted_requests_");
+ return false;
+ }
+ const RequestInfoPtr found = *it;
+ DCHECK(request_info == found);
+ time_sorted_pending_requests_.erase(it);
+ CheckSetSizes();
+ return 1 == erased_count;
+ }
+ CheckSetSizes();
+ return false;
+}
+
+bool RequestInfoSet::RemoveRequest(const RequestInfoPtr request_info) {
+ sync_primitives::AutoLock lock(this_lock_);
+ return Erase(request_info);
+}
+
+
+uint32_t RequestInfoSet::RemoveRequests(const RequestInfoSet::AppIdCompararator& filter) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t erased = 0;
+
+ sync_primitives::AutoLock lock(this_lock_);
+ HashSortedRequestInfoSet::iterator it = std::find_if(
+ hash_sorted_pending_requests_.begin(),
+ hash_sorted_pending_requests_.end(),
+ filter);
+ while (it != hash_sorted_pending_requests_.end()) {
+ HashSortedRequestInfoSet::iterator to_erase = it++;
+ Erase(*to_erase);
+ it = std::find_if(it, hash_sorted_pending_requests_.end(), filter);
+ erased++;
+ }
+ CheckSetSizes();
+ return erased;
+}
+
+
+uint32_t RequestInfoSet::RemoveByConnectionKey(uint32_t connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return RemoveRequests(AppIdCompararator(AppIdCompararator::Equal, connection_key));
+}
+
+uint32_t RequestInfoSet::RemoveMobileRequests() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return RemoveRequests(AppIdCompararator(AppIdCompararator::NotEqual, RequestInfo::HmiConnectoinKey));
+}
+
+const size_t RequestInfoSet::Size() {
+ CheckSetSizes();
+ return time_sorted_pending_requests_.size();
+}
+
+void RequestInfoSet::CheckSetSizes() {
+ const ssize_t time_set_size = time_sorted_pending_requests_.size();
+ const ssize_t hash_set_size = hash_sorted_pending_requests_.size();
+ const bool set_sizes_equal = (time_set_size == hash_set_size);
+ DCHECK(set_sizes_equal);
+}
+
+bool RequestInfoSet::CheckTimeScaleMaxRequest(
+ uint32_t app_id,
+ uint32_t app_time_scale,
+ uint32_t max_request_per_time_scale) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (max_request_per_time_scale > 0
+ && app_time_scale > 0) {
+ TimevalStruct end = date_time::DateTime::getCurrentTime();
+ TimevalStruct start = {0, 0};
+ start.tv_sec = end.tv_sec - app_time_scale;
+
+ sync_primitives::AutoLock lock(this_lock_);
+ TimeScale scale(start, end, app_id);
+ const uint32_t count = std::count_if(time_sorted_pending_requests_.begin(),
+ time_sorted_pending_requests_.end(), scale);
+ if (count >= max_request_per_time_scale) {
+ LOG4CXX_WARN(logger_, "Processing requests count " << count <<
+ " exceed application limit " << max_request_per_time_scale);
+ return false;
+ }
+ LOG4CXX_DEBUG(logger_, "Requests count " << count);
+ } else {
+ LOG4CXX_DEBUG(logger_, "CheckTimeScaleMaxRequest disabled");
+ }
+ return true;
+}
+
+bool RequestInfoSet::CheckHMILevelTimeScaleMaxRequest(mobile_apis::HMILevel::eType hmi_level,
+ uint32_t app_id,
+ uint32_t app_time_scale,
+ uint32_t max_request_per_time_scale) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (max_request_per_time_scale > 0 &&
+ app_time_scale > 0) {
+ TimevalStruct end = date_time::DateTime::getCurrentTime();
+ TimevalStruct start = {0, 0};
+ start.tv_sec = end.tv_sec - app_time_scale;
+
+ sync_primitives::AutoLock lock(this_lock_);
+ HMILevelTimeScale scale(start, end, app_id, hmi_level);
+ const uint32_t count = std::count_if(time_sorted_pending_requests_.begin(),
+ time_sorted_pending_requests_.end(), scale);
+ if (count >= max_request_per_time_scale) {
+ LOG4CXX_WARN(logger_, "Processing requests count " << count
+ << " exceed application limit " << max_request_per_time_scale
+ << " in hmi level " << hmi_level);
+ return false;
+ }
+ LOG4CXX_DEBUG(logger_, "Requests count " << count);
+ } else {
+ LOG4CXX_DEBUG(logger_, "CheckHMILevelTimeScaleMaxRequest disabled");
+ }
+ return true;
+}
+
+bool RequestInfoSet::AppIdCompararator::operator()(const RequestInfoPtr value_compare) const {
+ switch (compare_type_) {
+ case Equal:
+ return value_compare->app_id() == app_id_;
+ case NotEqual:
+ return value_compare->app_id() != app_id_;
+ default:
+ return false;
+ }
+}
+
+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());
+ if (compare_result == date_time::LESS) {
+ return true;
+ } else if (compare_result == date_time::GREATER) {
+ return false;
+ }
+ // compare_result == date_time::EQUAL
+ // If time is equal, sort by hash
+ return lhs->hash() < rhs->hash();
+}
+
+bool RequestInfoHashComparator::operator()(const RequestInfoPtr lhs,
+ const RequestInfoPtr rhs) const {
+ return lhs->hash() < rhs->hash();
+}
+
+} // namespace request_controller
-} // namespace application_manager
+} // namespace application_manager
diff --git a/src/components/application_manager/src/resume_ctrl.cpp b/src/components/application_manager/src/resume_ctrl.cpp
index cdbd6dc1c..19cad8013 100644
--- a/src/components/application_manager/src/resume_ctrl.cpp
+++ b/src/components/application_manager/src/resume_ctrl.cpp
@@ -1,6 +1,39 @@
-#include <fstream>
-
+/*
+ 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/resume_ctrl.h"
+
+#include <fstream>
+#include <algorithm>
+
#include "config_profile/profile.h"
#include "utils/file_system.h"
#include "connection_handler/connection_handler_impl.h"
@@ -14,6 +47,7 @@
#include "resumption/last_state.h"
#include "policy/policy_manager_impl.h"
#include "application_manager/policies/policy_handler.h"
+#include "application_manager/state_controller.h"
namespace application_manager {
@@ -22,103 +56,103 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "ResumeCtrl")
namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
ResumeCtrl::ResumeCtrl(ApplicationManagerImpl* app_mngr)
- : app_mngr_(app_mngr),
- timer_("ResumeCtrl", this, &ResumeCtrl::onTimer) {
+ : resumtion_lock_(true),
+ app_mngr_(app_mngr),
+ save_persistent_data_timer_("RsmCtrlPercist",
+ this, &ResumeCtrl::SaveDataOnTimer, true),
+ restore_hmi_level_timer_("RsmCtrlRstore",
+ this, &ResumeCtrl::ApplicationResumptiOnTimer),
+ is_resumption_active_(false),
+ is_data_saved(true),
+ launch_time_(time(NULL)) {
+ LoadResumeData();
+ save_persistent_data_timer_.start(profile::Profile::instance()->app_resumption_save_persistent_data_timeout());
}
void ResumeCtrl::SaveAllApplications() {
- LOG4CXX_INFO(logger_, "ResumeCtrl::SaveApplications()");
- DCHECK(app_mngr_);
-
- std::set<ApplicationSharedPtr>::iterator it =
- app_mngr_->application_list_.begin();
- std::set<ApplicationSharedPtr>::iterator it_end =
- app_mngr_->application_list_.end();
- for (; it != it_end; ++it) {
- SaveApplication(*it);
- }
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::set<ApplicationSharedPtr> apps(retrieve_application());
+ std::for_each(apps.begin(),
+ apps.end(),
+ std::bind1st(std::mem_fun(&ResumeCtrl::SaveApplication), this));
+ // remove old
}
void ResumeCtrl::SaveApplication(ApplicationConstSharedPtr application) {
- LOG4CXX_INFO(logger_, "ResumeCtrl::SaveApplication");
-
DCHECK(application.get());
- Json::Value* json_app = NULL;
-
- const std::string& m_app_id = application->mobile_app_id()->asString();
- Json::Value::iterator it = GetSavedApplications().begin();
- for (; it != GetSavedApplications().end(); ++it) {
- if (m_app_id == (*it)[strings::app_id].asString()) {
- json_app = &(*it);
- LOG4CXX_INFO(logger_, "ResumeCtrl Application with this id "
- "already exist ( update info )."
- "mobile app_id = " << m_app_id);
- break;
- }
- }
-
- if (json_app == NULL) {
- LOG4CXX_INFO(logger_, "ResumeCtrl Application with this ID does not"
- "exist. Add new. mobile app_id = " << m_app_id);
- json_app = &(GetSavedApplications().append(Json::Value()));
+ if (!application) {
+ LOG4CXX_FATAL(logger_, "Application object is NULL.");
+ return;
}
- uint32_t hash = application->curHash();
- uint32_t grammar_id = application->get_grammar_id();
-
- LOG4CXX_INFO(logger_, "Hash = " << hash);
- (*json_app)[strings::device_mac] =
- MessageHelper::GetDeviceMacAddressForHandle(application->device());
- (*json_app)[strings::app_id] = m_app_id;
- (*json_app)[strings::grammar_id] = grammar_id;
- (*json_app)[strings::connection_key] = application->app_id();
- (*json_app)[strings::hmi_app_id] = application->hmi_app_id();
- (*json_app)[strings::hmi_level] =
- static_cast<int32_t> (application->hmi_level());
- (*json_app)[strings::ign_off_count] = 0;
- (*json_app)[strings::hash_id] = hash;
- (*json_app)[strings::application_commands] =
- GetApplicationCommands(application);
- (*json_app)[strings::application_submenus] =
- GetApplicationSubMenus(application);
- (*json_app)[strings::application_choise_sets] =
- GetApplicationInteractionChoiseSets(application);
- (*json_app)[strings::application_global_properties] =
- GetApplicationGlobalProperties(application);
- (*json_app)[strings::application_subscribtions] =
- GetApplicationSubscriptions(application);
- (*json_app)[strings::application_files] = GetApplicationFiles(application);
- (*json_app)[strings::time_stamp] = (uint32_t)time(NULL);
- (*json_app)[strings::audio_streaming_state] = application->audio_streaming_state();
+ const std::string& m_app_id = application->mobile_app_id();
+ LOG4CXX_TRACE(logger_, "ENTER app_id : " << application->app_id()
+ << " mobile app_id : " << m_app_id);
+
+ const std::string hash = application->curHash(); // let's make a copy not to depend on application
+ const uint32_t grammar_id = application->get_grammar_id();
+ const uint32_t time_stamp = (uint32_t)time(NULL);
+
+ const mobile_apis::HMILevel::eType hmi_level = application->hmi_level();
+
+ resumtion_lock_.Acquire();
+ Json::Value& json_app = GetFromSavedOrAppend(m_app_id);
+
+ json_app[strings::device_mac] =
+ MessageHelper::GetDeviceMacAddressForHandle(application->device());
+ json_app[strings::app_id] = m_app_id;
+ json_app[strings::grammar_id] = grammar_id;
+ json_app[strings::connection_key] = application->app_id();
+ json_app[strings::hmi_app_id] = application->hmi_app_id();
+ json_app[strings::is_media_application] = application->IsAudioApplication();
+ json_app[strings::hmi_level] = static_cast<int32_t> (hmi_level);
+ json_app[strings::ign_off_count] = 0;
+ json_app[strings::suspend_count] = 0;
+ json_app[strings::hash_id] = hash;
+ json_app[strings::application_commands] =
+ GetApplicationCommands(application);
+ json_app[strings::application_submenus] =
+ GetApplicationSubMenus(application);
+ json_app[strings::application_choise_sets] =
+ GetApplicationInteractionChoiseSets(application);
+ json_app[strings::application_global_properties] =
+ GetApplicationGlobalProperties(application);
+ json_app[strings::application_subscribtions] =
+ GetApplicationSubscriptions(application);
+ json_app[strings::application_files] = GetApplicationFiles(application);
+ json_app[strings::time_stamp] = time_stamp;
+ LOG4CXX_DEBUG(logger_, "SaveApplication : " << json_app.toStyledString());
+
+ resumtion_lock_.Release();
}
void ResumeCtrl::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "ResumeCtrl::on_event ");
+ LOG4CXX_TRACE(logger_, "Response from HMI command");
}
-bool ResumeCtrl::RestoreApplicationHMILevel(ApplicationSharedPtr application) {
- if (false == application.valid()) {
+bool ResumeCtrl::RestoreAppHMIState(ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis;
+ if (!application) {
LOG4CXX_ERROR(logger_, " RestoreApplicationHMILevel() application pointer in invalid");
return false;
}
- Json::Value::iterator it = GetSavedApplications().begin();
- for (;it != GetSavedApplications().end(); ++it) {
- const std::string& saved_m_app_id = (*it)[strings::app_id].asString();
-
- if (saved_m_app_id == application->mobile_app_id()->asString()) {
-
- mobile_apis::HMILevel::eType saved_hmi_level;
- //mobile_apis::HMILevel::eType restored_hmi_level;
-
- mobile_apis::AudioStreamingState::eType audio_streaming_state =
- static_cast<mobile_apis::AudioStreamingState::eType>
- ((*it)[strings::audio_streaming_state].asInt());
- application->set_audio_streaming_state(audio_streaming_state);
- saved_hmi_level = static_cast<mobile_apis::HMILevel::eType>(
- (*it)[strings::hmi_level].asInt());
-
- return SetupHMILevel(application, saved_hmi_level, audio_streaming_state);
+ LOG4CXX_DEBUG(logger_, "ENTER app_id : " << application->app_id());
+
+ sync_primitives::AutoLock lock(resumtion_lock_);
+ const int idx = GetObjectIndex(application->mobile_app_id());
+ if (-1 != idx) {
+ const Json::Value& json_app = GetSavedApplications()[idx];
+ if (json_app.isMember(strings::hmi_level)) {
+
+ const HMILevel::eType saved_hmi_level =
+ static_cast<mobile_apis::HMILevel::eType>(
+ json_app[strings::hmi_level].asInt());
+ LOG4CXX_DEBUG(logger_, "Saved HMI Level is : " << saved_hmi_level);
+ return SetAppHMIState(application, saved_hmi_level);
+ } else {
+ LOG4CXX_FATAL(logger_, "There are some unknown keys among the stored apps");
}
}
LOG4CXX_INFO(logger_, "Failed to restore application HMILevel");
@@ -126,52 +160,26 @@ bool ResumeCtrl::RestoreApplicationHMILevel(ApplicationSharedPtr application) {
}
bool ResumeCtrl::SetupDefaultHMILevel(ApplicationSharedPtr application) {
- LOG4CXX_TRACE_ENTER(logger_);
- if (false == application.valid()) {
- LOG4CXX_ERROR(logger_, "SetupDefaultHMILevel application pointer is invalid");
- return false;
- }
-
- mobile_apis::HMILevel::eType default_hmi = mobile_apis::HMILevel::HMI_NONE;
-
- if (policy::PolicyHandler::instance()->PolicyEnabled()) {
- std::string policy_app_id = application->mobile_app_id()->asString();
- std::string default_hmi_string = "";
- bool result_get_hmi = policy::PolicyHandler::instance()->GetDefaultHmi(
- policy_app_id, &default_hmi_string);
- if (true == result_get_hmi) {
- if ("BACKGROUND" == default_hmi_string) {
- default_hmi = mobile_apis::HMILevel::HMI_BACKGROUND;
- } else if ("FULL" == default_hmi_string) {
- default_hmi = mobile_apis::HMILevel::HMI_FULL;
- } else if ("LIMITED" == default_hmi_string) {
- default_hmi = mobile_apis::HMILevel::HMI_LIMITED;
- } else if ("NONE" == default_hmi_string) {
- default_hmi = mobile_apis::HMILevel::HMI_NONE;
- } else {
- LOG4CXX_ERROR(logger_, "Unable to convert " + default_hmi_string + "to HMILevel");
- return false;
- }
- } else {
- LOG4CXX_ERROR(logger_, "SetupDefaultHMILevel() unable to get default hmi_level for "
- << policy_app_id);
- }
- }
-
- return SetupHMILevel(application, default_hmi,
- mobile_apis::AudioStreamingState::NOT_AUDIBLE, false);
+ DCHECK_OR_RETURN(application, false);
+ LOG4CXX_AUTO_TRACE(logger_);
+ mobile_apis::HMILevel::eType default_hmi =
+ ApplicationManagerImpl::instance()-> GetDefaultHmiLevel(application);
+ bool result = SetAppHMIState(application, default_hmi, false);
+ return result;
}
-bool ResumeCtrl::SetupHMILevel(ApplicationSharedPtr application,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_streaming_state,
+bool ResumeCtrl::SetAppHMIState(ApplicationSharedPtr application,
+ const mobile_apis::HMILevel::eType hmi_level,
bool check_policy) {
-
+ using namespace mobile_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
if (false == application.valid()) {
- LOG4CXX_ERROR(logger_, "SetupHMILevel() application pointer in invalid");
+ LOG4CXX_ERROR(logger_, "Application pointer in invalid");
return false;
}
-
+ LOG4CXX_TRACE(logger_, " app_id : ( " << application->app_id()
+ << ", hmi_level : " << hmi_level
+ << ", check_policy : " << check_policy << " )");
const std::string device_id =
MessageHelper::GetDeviceMacAddressForHandle(application->device());
@@ -182,336 +190,178 @@ bool ResumeCtrl::SetupHMILevel(ApplicationSharedPtr application,
SetupDefaultHMILevel(application);
return false;
}
-
+ HMILevel::eType restored_hmi_level = hmi_level;
if ((hmi_level == application->hmi_level()) &&
(hmi_level != mobile_apis::HMILevel::HMI_NONE)) {
- LOG4CXX_WARN(logger_, "Hmi level " << hmi_level << " should not be set to "
- << application->mobile_app_id()->asString() << " " << application->hmi_level());
-
+ LOG4CXX_DEBUG(logger_, "Hmi level " << hmi_level << " should not be set to "
+ << application->mobile_app_id()
+ <<" current hmi_level is " << application->hmi_level());
return false;
}
- if (mobile_apis::HMILevel::HMI_FULL == hmi_level) {
- hmi_level = app_mngr_->PutApplicationInFull(application);
-
- if ((mobile_apis::HMILevel::HMI_FULL == hmi_level ||
- mobile_apis::HMILevel::HMI_LIMITED == hmi_level) &&
- (mobile_apis::AudioStreamingState::AUDIBLE == audio_streaming_state)) {
- application->set_audio_streaming_state(audio_streaming_state);
- }
- } else if (mobile_apis::HMILevel::HMI_LIMITED == hmi_level) {
- if ((false == application->IsAudioApplication()) ||
- app_mngr_->DoesAudioAppWithSameHMITypeExistInFullOrLimited(application)) {
- hmi_level = mobile_apis::HMILevel::HMI_BACKGROUND;
- } else {
- if (audio_streaming_state == mobile_apis::AudioStreamingState::AUDIBLE) {
- //implemented SDLAQ-CRS-839
- //checking the existence of application with AudioStreamingState=AUDIBLE
- //notification resumeAudioSource is sent if only resumed application has
- //AudioStreamingState=AUDIBLE
- bool application_exist_with_audible_state = false;
- ApplicationManagerImpl::ApplicationListAccessor accessor;
- const std::set<ApplicationSharedPtr> app_list = accessor.applications();
- std::set<ApplicationSharedPtr>::const_iterator app_list_it = app_list
- .begin();
- uint32_t app_id = application->app_id();
- for (; app_list.end() != app_list_it; ++app_list_it) {
- if ((mobile_apis::AudioStreamingState::AUDIBLE ==
- (*app_list_it)->audio_streaming_state())
- && ((*app_list_it))->app_id() != app_id) {
- application_exist_with_audible_state = true;
- break;
- }
- }
- if (application_exist_with_audible_state) {
- application->set_audio_streaming_state(
- mobile_apis::AudioStreamingState::NOT_AUDIBLE);
- } else {
- MessageHelper::SendOnResumeAudioSourceToHMI(application->app_id());
+ if (HMILevel::HMI_FULL == hmi_level) {
+ restored_hmi_level = app_mngr_->IsHmiLevelFullAllowed(application);
+ } else if (HMILevel::HMI_LIMITED == hmi_level) {
+ bool allowed_limited = application->is_media_application();
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ ApplicationManagerImpl::ApplictionSetConstIt it = accessor.begin();
+ for (; accessor.end() != it && allowed_limited; ++it) {
+ const ApplicationSharedPtr curr_app = *it;
+ if (curr_app->is_media_application()) {
+ if (curr_app->hmi_level() == HMILevel::HMI_FULL ||
+ curr_app->hmi_level() == HMILevel::HMI_LIMITED) {
+ allowed_limited = false;
}
}
}
+ if (allowed_limited) {
+ restored_hmi_level = HMILevel::HMI_LIMITED;
+ } else {
+ restored_hmi_level =
+ ApplicationManagerImpl::instance()->GetDefaultHmiLevel(application);
+ }
}
-
- if (hmi_level != mobile_apis::HMILevel::HMI_FULL) {
- application->set_hmi_level(hmi_level);
+ if (HMILevel::HMI_LIMITED == restored_hmi_level) {
+ MessageHelper::SendOnResumeAudioSourceToHMI(application->app_id());
}
- MessageHelper::SendHMIStatusNotification(*(application.get()));
-
+ const AudioStreamingState::eType restored_audio_state =
+ application->is_media_application() &&
+ (HMILevel::HMI_FULL == restored_hmi_level ||
+ HMILevel::HMI_LIMITED == restored_hmi_level)
+ ? AudioStreamingState::AUDIBLE : AudioStreamingState::NOT_AUDIBLE;
+
+ if (restored_hmi_level == HMILevel::HMI_FULL) {
+ ApplicationManagerImpl::instance()->SetState<true>(application->app_id(),
+ restored_hmi_level,
+ restored_audio_state);
+ } else {
+ ApplicationManagerImpl::instance()->SetState<false>(application->app_id(),
+ restored_hmi_level,
+ restored_audio_state);
+ }
LOG4CXX_INFO(logger_, "Set up application "
- << application->mobile_app_id()->asString()
+ << application->mobile_app_id()
<< " to HMILevel " << hmi_level);
return true;
}
bool ResumeCtrl::RestoreApplicationData(ApplicationSharedPtr application) {
- LOG4CXX_INFO(logger_, "RestoreApplicationData");
- DCHECK(application.get());
-
- Json::Value::iterator it = GetSavedApplications().begin();
- for (; it != GetSavedApplications().end(); ++it) {
- const std::string& saved_m_app_id = (*it)[strings::app_id].asString();
- if (saved_m_app_id == application->mobile_app_id()->asString()) {
- break;
- }
- }
-
- if (it == GetSavedApplications().end()) {
- LOG4CXX_WARN(logger_, "Application not saved");
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!application.valid()) {
+ LOG4CXX_ERROR(logger_, "Application pointer in invalid");
return false;
}
- Json::Value& saved_app = *it;
- MessageHelper::SmartObjectList requests;
-
- LOG4CXX_INFO(logger_, saved_app.toStyledString());
- Json::Value& app_commands = saved_app[strings::application_commands];
- Json::Value& app_submenus = saved_app[strings::application_submenus];
- Json::Value& app_choise_sets = saved_app[strings::application_choise_sets];
- Json::Value& global_properties = saved_app[strings::application_global_properties];
- Json::Value& subscribtions = saved_app[strings::application_subscribtions];
- Json::Value& application_files = saved_app[strings::application_files];
- uint32_t app_grammar_id = saved_app[strings::grammar_id].asUInt();
- application->set_grammar_id(app_grammar_id);
-
-
- // files
- for (Json::Value::iterator json_it = application_files.begin();
- json_it != application_files.end(); ++json_it) {
- Json::Value& file_data = *json_it;
-
- bool is_persistent = file_data[strings::persistent_file].asBool();
- if (is_persistent) {
- AppFile file;
- file.is_persistent = is_persistent;
- file.is_download_complete = file_data[strings::is_download_complete].asBool();
- file.file_name = file_data[strings::sync_file_name].asString();
- file.file_type = static_cast<mobile_apis::FileType::eType> (
- file_data[strings::file_type].asInt());
- LOG4CXX_INFO(logger_, "RestoreApplicationData file " << file.file_name);
- application->AddFile(file);
- }
- }
-
- //add submenus
- for (Json::Value::iterator json_it = app_submenus.begin();
- json_it != app_submenus.end(); ++json_it) {
- Json::Value& json_submenu = *json_it;
- smart_objects::SmartObject message = smart_objects::SmartObject(
- smart_objects::SmartType::SmartType_Map);
- Formatters::CFormatterJsonBase::jsonValueToObj(json_submenu, message);
- application->AddSubMenu(message[strings::menu_id].asUInt(), message);
- }
- requests = MessageHelper::CreateAddSubMenuRequestToHMI(application);
-
- for (MessageHelper::SmartObjectList::iterator it = requests.begin();
- it != requests.end(); ++it) {
- ProcessHMIRequest(*it, true);
- }
-
- //add commands
- for (Json::Value::iterator json_it = app_commands.begin();
- json_it != app_commands.end(); ++json_it) {
- Json::Value& json_command = *json_it;
- smart_objects::SmartObject message = smart_objects::SmartObject(
- smart_objects::SmartType::SmartType_Map);
- Formatters::CFormatterJsonBase::jsonValueToObj(json_command, message);
- application->AddCommand(message[strings::cmd_id].asUInt(), message);
- }
-
- requests = MessageHelper::CreateAddCommandRequestToHMI(application);
+ LOG4CXX_DEBUG(logger_, "ENTER app_id : " << application->app_id());
- for (MessageHelper::SmartObjectList::iterator it = requests.begin();
- it != requests.end(); ++it) {
- ProcessHMIRequest(*it, true);
- }
-
- //add choisets
- for (Json::Value::iterator json_it = app_choise_sets.begin();
- json_it != app_choise_sets.end(); ++json_it) {
- Json::Value& json_choiset = *json_it;
- smart_objects::SmartObject msg_param = smart_objects::SmartObject(
- smart_objects::SmartType::SmartType_Map);
- Formatters::CFormatterJsonBase::jsonValueToObj(json_choiset , msg_param);
- const int32_t choice_set_id = msg_param
- [strings::interaction_choice_set_id].asInt();
- uint32_t choice_grammar_id = msg_param[strings::grammar_id].asUInt();
- application->AddChoiceSet(choice_set_id, msg_param);
-
- for (size_t j = 0; j < msg_param[strings::choice_set].length(); ++j) {
- smart_objects::SmartObject choise_params = smart_objects::SmartObject(
- smart_objects::SmartType_Map);
- choise_params[strings::app_id] = application->app_id();
- choise_params[strings::cmd_id] =
- msg_param[strings::choice_set][j][strings::choice_id];
- choise_params[strings::vr_commands] = smart_objects::SmartObject(
- smart_objects::SmartType_Array);
- choise_params[strings::vr_commands] =
- msg_param[strings::choice_set][j][strings::vr_commands];
-
- choise_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
- choise_params[strings::grammar_id] = choice_grammar_id;
- SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &choise_params);
- }
- }
-
- //setglobal properties
- if (!global_properties.isNull()) {
- smart_objects::SmartObject properties_so = smart_objects::SmartObject(
- smart_objects::SmartType::SmartType_Map);
- Formatters::CFormatterJsonBase::jsonValueToObj(global_properties , properties_so);
-
- const smart_objects::SmartObject& vr_help_title =
- properties_so.getElement(strings::vr_help_title);
- if (vr_help_title.getType() != smart_objects::SmartType::SmartType_Invalid &&
- vr_help_title.getType() != smart_objects::SmartType::SmartType_Null) {
- application->set_vr_help_title(vr_help_title);
- }
-
- const smart_objects::SmartObject& vr_help =
- properties_so.getElement(strings::vr_help);
- if (vr_help.getType() != smart_objects::SmartType::SmartType_Invalid &&
- vr_help.getType() != smart_objects::SmartType::SmartType_Null) {
- application->set_vr_help(vr_help);
- }
-
- const smart_objects::SmartObject& timeout_prompt =
- properties_so.getElement(strings::timeout_prompt);
- if (timeout_prompt.getType() != smart_objects::SmartType::SmartType_Invalid &&
- timeout_prompt.getType() != smart_objects::SmartType::SmartType_Null) {
- application->set_timeout_prompt(timeout_prompt);
- }
-
- const smart_objects::SmartObject& help_prompt =
- properties_so.getElement(strings::help_prompt);
- if (help_prompt.getType() != smart_objects::SmartType::SmartType_Invalid &&
- help_prompt.getType() != smart_objects::SmartType::SmartType_Null) {
- application->set_help_prompt(help_prompt);
- }
-
- const smart_objects::SmartObject& keyboard_properties =
- properties_so.getElement(strings::keyboard_properties);
- if (keyboard_properties.getType() != smart_objects::SmartType::SmartType_Invalid &&
- keyboard_properties.getType() != smart_objects::SmartType::SmartType_Null) {
- application->set_keyboard_props(keyboard_properties);
- }
-
- const smart_objects::SmartObject& menu_title =
- properties_so.getElement(strings::menu_title);
- if (menu_title.getType() != smart_objects::SmartType::SmartType_Invalid &&
- menu_title.getType() != smart_objects::SmartType::SmartType_Null) {
- application->set_menu_title(menu_title);
- }
-
- const smart_objects::SmartObject& menu_icon =
- properties_so.getElement(strings::menu_icon);
- if (menu_icon.getType() != smart_objects::SmartType::SmartType_Invalid &&
- menu_icon.getType() != smart_objects::SmartType::SmartType_Null) {
- application->set_menu_icon(menu_icon);
- }
-
- MessageHelper::SendGlobalPropertiesToHMI(application);
+ sync_primitives::AutoLock lock(resumtion_lock_);
+ const int idx = GetObjectIndex(application->mobile_app_id());
+ if (-1 == idx) {
+ LOG4CXX_WARN(logger_, "Application not saved");
+ return false;
}
- //subscribes
- if (!subscribtions.isNull()) {
- Json::Value& subscribtions_buttons = subscribtions[strings::application_buttons];
- Json::Value& subscribtions_ivi= subscribtions[strings::application_vehicle_info];
- for (Json::Value::iterator json_it = subscribtions_buttons.begin();
- json_it != subscribtions_buttons.end(); ++json_it) {
- mobile_apis::ButtonName::eType btn;
- btn = static_cast<mobile_apis::ButtonName::eType>((*json_it).asInt());
- application->SubscribeToButton(btn);
- }
-
- for (Json::Value::iterator json_it = subscribtions_ivi.begin();
- json_it != subscribtions_ivi.end(); ++json_it) {
- VehicleDataType ivi;
- ivi = static_cast<VehicleDataType>((*json_it).asInt());
- LOG4CXX_INFO(logger_, "VehicleDataType :" << ivi);
-#ifdef ENABLE_LOG
- bool result =
-#endif
- application->SubscribeToIVI(ivi);
- LOG4CXX_INFO(logger_, "result = :" << result);
- }
- requests = MessageHelper::GetIVISubscribtionRequests(application->app_id());
-
- for (MessageHelper::SmartObjectList::iterator it = requests.begin();
- it != requests.end(); ++it) {
- ProcessHMIRequest(*it,true);
- }
+ const Json::Value& saved_app = GetSavedApplications()[idx];
+ if(saved_app.isMember(strings::grammar_id)) {
+ const uint32_t app_grammar_id = saved_app[strings::grammar_id].asUInt();
+ application->set_grammar_id(app_grammar_id);
+
+ AddFiles(application, saved_app);
+ AddSubmenues(application, saved_app);
+ AddCommands(application, saved_app);
+ AddChoicesets(application, saved_app);
+ SetGlobalProperties(application, saved_app);
+ AddSubscriptions(application, saved_app);
}
return true;
}
bool ResumeCtrl::IsHMIApplicationIdExist(uint32_t hmi_app_id) {
- LOG4CXX_INFO(logger_, "ResumeCtrl::IsHMIApplicationIdExist " << hmi_app_id);
-
+ LOG4CXX_TRACE(logger_, "ENTER hmi_app_id :" << hmi_app_id);
+ sync_primitives::AutoLock lock(resumtion_lock_);
for (Json::Value::iterator it = GetSavedApplications().begin();
it != GetSavedApplications().end(); ++it) {
- if ((*it)[strings::hmi_app_id].asUInt() == hmi_app_id) {
- return true;
+ if ((*it).isMember(strings::hmi_app_id)) {
+ if ((*it)[strings::hmi_app_id].asUInt() == hmi_app_id) {
+ return true;
+ }
}
}
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ ApplicationManagerImpl::ApplictionSet apps(accessor.applications());
+ ApplicationManagerImpl::ApplictionSetIt it = apps.begin();
+ ApplicationManagerImpl::ApplictionSetIt it_end = apps.end();
- std::set<ApplicationSharedPtr>::iterator it =
- app_mngr_->application_list_.begin();
- std::set<ApplicationSharedPtr>::iterator it_end =
- app_mngr_->application_list_.end();
for (;it != it_end; ++it) {
if (hmi_app_id == (*it)->hmi_app_id()) {
+ LOG4CXX_TRACE(logger_, "EXIT result = true");
return true;
}
}
-
+ LOG4CXX_TRACE(logger_, "EXIT result = false");
return false;
}
bool ResumeCtrl::IsApplicationSaved(const std::string& mobile_app_id) {
- bool result = false;
- for (Json::Value::iterator it = GetSavedApplications().begin();
- it != GetSavedApplications().end(); ++it) {
- if ((*it)[strings::app_id].asString() == mobile_app_id) {
- result = true;
- }
+ LOG4CXX_TRACE(logger_, "ENTER mobile_app_id :" << mobile_app_id);
+
+ sync_primitives::AutoLock lock(resumtion_lock_);
+ int index = GetObjectIndex(mobile_app_id);
+ if (-1 == index) {
+ return false;
}
- LOG4CXX_INFO(logger_, "IsApplicationSaved " << mobile_app_id << " : " << (result?"true":"false"));
- return result;
+
+ if (!IsResumptionDataValid(index)) {
+ LOG4CXX_INFO(logger_, "Resumption data for app " << mobile_app_id <<
+ " is corrupted. Remove application from resumption list");
+ RemoveApplicationFromSaved(mobile_app_id);
+ return false;
+ }
+
+ return true;
}
uint32_t ResumeCtrl::GetHMIApplicationID(const std::string& mobile_app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
uint32_t hmi_app_id = 0;
- for (Json::Value::iterator it = GetSavedApplications().begin();
- it != GetSavedApplications().end(); ++it) {
- if ((*it)[strings::app_id].asString() == mobile_app_id) {
- hmi_app_id = (*it)[strings::hmi_app_id].asUInt();
- }
+
+ sync_primitives::AutoLock lock(resumtion_lock_);
+ const int idx = GetObjectIndex(mobile_app_id);
+ if (-1 == idx) {
+ LOG4CXX_WARN(logger_, "Application not saved");
+ return hmi_app_id;
}
+ const Json::Value& json_app = GetSavedApplications()[idx];
+ if (json_app.isMember(strings::app_id)) {
+ hmi_app_id = json_app[strings::hmi_app_id].asUInt();
+ }
+ LOG4CXX_DEBUG(logger_, "hmi_app_id :" << hmi_app_id);
return hmi_app_id;
}
-bool ResumeCtrl::RemoveApplicationFromSaved(ApplicationConstSharedPtr application) {
- LOG4CXX_INFO(logger_, "ResumeCtrl::RemoveApplicationFromSaved ");
- DCHECK(application.get());
-
+bool ResumeCtrl::RemoveApplicationFromSaved(const std::string& mobile_app_id) {
+ LOG4CXX_TRACE(logger_, "Remove mobile_app_id " << mobile_app_id);
+ sync_primitives::AutoLock lock(resumtion_lock_);
bool result = false;
std::vector<Json::Value> temp;
for (Json::Value::iterator it = GetSavedApplications().begin();
it != GetSavedApplications().end(); ++it) {
- const std::string& saved_m_app_id = (*it)[strings::app_id].asString();
+ if ((*it).isMember(strings::app_id)) {
+ const std::string& saved_m_app_id = (*it)[strings::app_id].asString();
- if (saved_m_app_id != application->mobile_app_id()->asString()) {
- temp.push_back((*it));
- } else {
- result = true;
+ if (saved_m_app_id != mobile_app_id) {
+ temp.push_back((*it));
+ } else {
+ result = true;
+ }
}
}
if (false == result) {
+ LOG4CXX_TRACE(logger_, "EXIT result: " << (result ? "true" : "false"));
return result;
}
@@ -520,267 +370,391 @@ bool ResumeCtrl::RemoveApplicationFromSaved(ApplicationConstSharedPtr applicatio
it != temp.end(); ++it) {
GetSavedApplications().append((*it));
}
+ LOG4CXX_TRACE(logger_, "EXIT result: " << (result ? "true" : "false"));
return result;
}
-void ResumeCtrl::IgnitionOff() {
- LOG4CXX_INFO(logger_, "ResumeCtrl::IgnitionOff()");
-
+void ResumeCtrl::Suspend() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ StopSavePersistentDataTimer();
+ SaveAllApplications();
Json::Value to_save;
+ sync_primitives::AutoLock lock(resumtion_lock_);
for (Json::Value::iterator it = GetSavedApplications().begin();
it != GetSavedApplications().end(); ++it) {
- uint32_t ign_off_count = (*it)[strings::ign_off_count].asUInt();
- if (ign_off_count < kApplicationLifes) {
- ign_off_count++;
- (*it)[strings::ign_off_count] = ign_off_count;
- to_save.append(*it);
+ if ((*it).isMember(strings::suspend_count)) {
+ const uint32_t suspend_count = (*it)[strings::suspend_count].asUInt();
+ (*it)[strings::suspend_count] = suspend_count + 1;
+ } else {
+ LOG4CXX_WARN(logger_, "Unknown key among saved applications");
+ (*it)[strings::suspend_count] = 1;
+ }
+ if ((*it).isMember(strings::ign_off_count)) {
+ const uint32_t ign_off_count = (*it)[strings::ign_off_count].asUInt();
+ if (ign_off_count < kApplicationLifes) {
+ (*it)[strings::ign_off_count] = ign_off_count + 1;
+ to_save.append(*it);
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Unknown key among saved applications");
+ (*it)[strings::ign_off_count] = 1;
}
}
SetSavedApplication(to_save);
+ SetLastIgnOffTime(time(NULL));
+ LOG4CXX_DEBUG(logger_,
+ GetResumptionData().toStyledString());
+ resumption::LastState::instance()->SaveToFileSystem();
+}
+
+void ResumeCtrl::OnAwake() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock lock(resumtion_lock_);
+ for (Json::Value::iterator it = GetSavedApplications().begin();
+ it != GetSavedApplications().end(); ++it) {
+ if ((*it).isMember(strings::ign_off_count)) {
+ const uint32_t ign_off_count = (*it)[strings::ign_off_count].asUInt();
+ (*it)[strings::ign_off_count] = ign_off_count - 1;
+ } else {
+ LOG4CXX_WARN(logger_, "Unknown key among saved applications");
+ (*it)[strings::ign_off_count] = 0;
+ }
+ }
+ ResetLaunchTime();
+ StartSavePersistentDataTimer();
+}
+
+
+
+void ResumeCtrl::StartSavePersistentDataTimer() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!save_persistent_data_timer_.isRunning()) {
+ save_persistent_data_timer_.start(
+ profile::Profile::instance()->app_resumption_save_persistent_data_timeout());
+ }
+}
+
+void ResumeCtrl::StopSavePersistentDataTimer() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (save_persistent_data_timer_.isRunning()) {
+ save_persistent_data_timer_.stop();
+ }
}
+
bool ResumeCtrl::StartResumption(ApplicationSharedPtr application,
- uint32_t hash) {
- LOG4CXX_INFO(logger_, "ResumeCtrl::StartResumption");
- if (!application.valid()) {
+ const std::string& hash) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!application) {
LOG4CXX_WARN(logger_, "Application not exist");
return false;
}
- LOG4CXX_INFO(logger_, " app_id = " << application->app_id()
+ LOG4CXX_DEBUG(logger_, " Resume app_id = " << application->app_id()
<< " hmi_app_id = " << application->hmi_app_id()
- << " mobile_id = "
- << application->mobile_app_id()->asString());
+ << " mobile_id = " << application->mobile_app_id()
+ << "received hash = " << hash);
- Json::Value::iterator it = GetSavedApplications().begin();
- ApplicationManagerImpl::ApplicationListAccessor accessor;
- for (; it != GetSavedApplications().end(); ++it) {
- const std::string& saved_m_app_id = (*it)[strings::app_id].asString();
+ sync_primitives::AutoLock lock(resumtion_lock_);
+ const int idx = GetObjectIndex(application->mobile_app_id());
+ if (-1 == idx) {
+ LOG4CXX_WARN(logger_, "Application not saved");
+ return false;
+ }
- if (saved_m_app_id == application->mobile_app_id()->asString()) {
+ const Json::Value& json_app = GetSavedApplications()[idx];
+ LOG4CXX_DEBUG(logger_, "Saved_application_data: " << json_app.toStyledString());
+ if (json_app.isMember(strings::hash_id) && json_app.isMember(strings::time_stamp)) {
+ const std::string& saved_hash = json_app[strings::hash_id].asString();
- uint32_t saved_hash = (*it)[strings::hash_id].asUInt();
- uint32_t time_stamp= (*it)[strings::time_stamp].asUInt();
+ if (saved_hash == hash) {
+ RestoreApplicationData(application);
+ }
+ application->UpdateHash();
+
+ queue_lock_.Acquire();
+ waiting_for_timer_.push_back(application->app_id());
+ queue_lock_.Release();
+ if (!is_resumption_active_) {
+ is_resumption_active_ = true;
+ restore_hmi_level_timer_.start(
+ profile::Profile::instance()->app_resuming_timeout());
+ }
+ } else {
+ LOG4CXX_INFO(logger_, "There are some unknown keys in the dictionary.");
+ return false;
+ }
- if (hash == saved_hash) {
- RestoreApplicationData(application);
- }
+ return true;
+}
- application->UpdateHash();
- if (!timer_.isRunning() && accessor.applications().size() > 1) {
- RestoreApplicationHMILevel(application);
- RemoveApplicationFromSaved(application);
- } else {
- sync_primitives::AutoLock auto_lock(queue_lock_);
- SetupDefaultHMILevel(application);
- waiting_for_timer_.insert(std::make_pair(application->app_id(),
- time_stamp));
- timer_.start(kTimeStep);
- }
- return true;
+void ResumeCtrl::StartAppHmiStateResumption(ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace profile;
+ using namespace date_time;
+ DCHECK_OR_RETURN_VOID(application);
+ const int idx = GetObjectIndex(application->mobile_app_id());
+ DCHECK_OR_RETURN_VOID(idx != -1);
+ const Json::Value& json_app = GetSavedApplications()[idx];
+
+ if (!json_app.isMember(strings::ign_off_count)) {
+ LOG4CXX_INFO(logger_, "Do not need to resume application "
+ << application->app_id());
+ SetupDefaultHMILevel(application);
+ return;
+ }
+
+ // check if if is resumption during one IGN cycle
+ const uint32_t ign_off_count = json_app[strings::ign_off_count].asUInt();
+
+ if (0 == ign_off_count) {
+ if (CheckAppRestrictions(application, json_app)) {
+ LOG4CXX_INFO(logger_, "Resume application after short IGN cycle");
+ RestoreAppHMIState(application);
+ RemoveApplicationFromSaved(application->mobile_app_id());
+ } else {
+ LOG4CXX_INFO(logger_, "Do not need to resume application "
+ << application->app_id());
+ }
+ } else {
+ if (CheckIgnCycleRestrictions(json_app) &&
+ CheckAppRestrictions(application, json_app)) {
+ LOG4CXX_INFO(logger_, "Resume application after IGN cycle");
+ RestoreAppHMIState(application);
+ RemoveApplicationFromSaved(application->mobile_app_id());
+ } else {
+ LOG4CXX_INFO(logger_, "Do not need to resume application "
+ << application->app_id());
}
}
+}
- LOG4CXX_INFO(logger_, "ResumeCtrl::Application wasn't saved");
- MessageHelper::SendHMIStatusNotification(*application);
- return false;
+std::set<ApplicationSharedPtr> ResumeCtrl::retrieve_application() {
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ return std::set<ApplicationSharedPtr>(accessor.begin(), accessor.end());
}
bool ResumeCtrl::StartResumptionOnlyHMILevel(ApplicationSharedPtr application) {
- LOG4CXX_INFO(logger_, "ResumeCtrl::StartResumptionOnlyHMILevel");
+ LOG4CXX_AUTO_TRACE(logger_);
if (!application.valid()) {
- LOG4CXX_WARN(logger_, "Application not exist");
+ LOG4CXX_WARN(logger_, "Application do not exists");
return false;
}
- LOG4CXX_INFO(logger_, "app_id = " << application->app_id()
+ LOG4CXX_DEBUG(logger_, "ENTER app_id = " << application->app_id()
<< "mobile_id = "
- << application->mobile_app_id()->asString());
+ << application->mobile_app_id());
- Json::Value::iterator it = GetSavedApplications().begin();
- ApplicationManagerImpl::ApplicationListAccessor accessor;
- for (; it != GetSavedApplications().end(); ++it) {
- const std::string& saved_m_app_id = (*it)[strings::app_id].asString();
- if (saved_m_app_id == application->mobile_app_id()->asString()) {
- uint32_t time_stamp= (*it)[strings::time_stamp].asUInt();
- if (!timer_.isRunning() && accessor.applications().size() > 1) {
- // resume in case there is already registered app
- RestoreApplicationHMILevel(application);
- RemoveApplicationFromSaved(application);
- } else {
- sync_primitives::AutoLock auto_lock(queue_lock_);
- SetupDefaultHMILevel(application);
- waiting_for_timer_.insert(std::make_pair(application->app_id(),
- time_stamp));
- // woun't start timer if it is active already
- timer_.start(kTimeStep);
- }
- return true;
- }
+ sync_primitives::AutoLock lock(resumtion_lock_);
+ const int idx = GetObjectIndex(application->mobile_app_id());
+ if (-1 == idx) {
+ LOG4CXX_WARN(logger_, "Application not saved");
+ return false;
}
- LOG4CXX_INFO(logger_, "ResumeCtrl::Application wasn't saved");
- MessageHelper::SendHMIStatusNotification(*application);
- return false;
+ queue_lock_.Acquire();
+ waiting_for_timer_.push_back(application->app_id());
+ queue_lock_.Release();
+ if (!is_resumption_active_) {
+ is_resumption_active_ = true;
+ restore_hmi_level_timer_.start(
+ profile::Profile::instance()->app_resuming_timeout());
+ }
+
+ return true;
}
bool ResumeCtrl::CheckPersistenceFilesForResumption(ApplicationSharedPtr application) {
- LOG4CXX_INFO(logger_, "CheckPersistenceFilesForResumption");
- DCHECK(application.get());
-
- Json::Value::iterator it = GetSavedApplications().begin();
- for (; it != GetSavedApplications().end(); ++it) {
- const std::string& saved_m_app_id = (*it)[strings::app_id].asString();
+ LOG4CXX_AUTO_TRACE(logger_);
- if (saved_m_app_id == application->mobile_app_id()->asString()) {
- break;
- }
+ if (!application.valid()) {
+ LOG4CXX_WARN(logger_, "Application do not exists");
+ return false;
}
+ LOG4CXX_DEBUG(logger_, "Process app_id = " << application->app_id());
- if (it == GetSavedApplications().end()) {
+ sync_primitives::AutoLock lock(resumtion_lock_);
+ const int idx = GetObjectIndex(application->mobile_app_id());
+ if (-1 == idx) {
LOG4CXX_WARN(logger_, "Application not saved");
return false;
}
- Json::Value& saved_app = *it;
- MessageHelper::SmartObjectList requests;
-
- LOG4CXX_INFO(logger_, saved_app.toStyledString());
- Json::Value& app_commands = saved_app[strings::application_commands];
- Json::Value& app_choise_sets = saved_app[strings::application_choise_sets];
-
- //add commands
- for (Json::Value::iterator json_it = app_commands.begin();
- json_it != app_commands.end(); ++json_it) {
- Json::Value& json_command = *json_it;
- smart_objects::SmartObject message =
- smart_objects::SmartObject(smart_objects::SmartType::SmartType_Map);
- Formatters::CFormatterJsonBase::jsonValueToObj(json_command, message);
- mobile_apis::Result::eType verification_result =
- MessageHelper::VerifyImageFiles(message, application);
- if (verification_result == mobile_apis::Result::INVALID_DATA) {
- LOG4CXX_WARN(logger_, "app_commands missed icons");
+ const Json::Value& saved_app = GetSavedApplications()[idx];
+
+ if (!saved_app.isMember(strings::application_commands) ||
+ !saved_app.isMember(strings::application_choise_sets)) {
+ LOG4CXX_WARN(logger_, "application_commands or "
+ "application_choise_sets are not exists");
return false;
}
- }
- //add choice sets
- for (Json::Value::iterator json_it = app_choise_sets.begin();
- json_it != app_choise_sets.end(); ++json_it) {
- Json::Value& json_choiset = *json_it;
- smart_objects::SmartObject msg_param =
- smart_objects::SmartObject(smart_objects::SmartType::SmartType_Map);
- Formatters::CFormatterJsonBase::jsonValueToObj(json_choiset , msg_param);
- mobile_apis::Result::eType verification_result =
- MessageHelper::VerifyImageFiles(msg_param, application);
- if (verification_result == mobile_apis::Result::INVALID_DATA) {
- LOG4CXX_WARN(logger_, "app_choise_sets missed icons");
+ if (!CheckIcons(application, saved_app[strings::application_commands])) {
return false;
}
- }
-
+ if (!CheckIcons(application, saved_app[strings::application_choise_sets])) {
+ return false;
+ }
+ LOG4CXX_DEBUG(logger_, " result = true");
return true;
}
bool ResumeCtrl::CheckApplicationHash(ApplicationSharedPtr application,
- uint32_t hash) {
- Json::Value::iterator it = GetSavedApplications().begin();
- for (; it != GetSavedApplications().end(); ++it) {
- std::string saved_m_app_id = (*it)[strings::app_id].asString();
-
- if (saved_m_app_id == application->mobile_app_id()->asString()) {
- uint32_t saved_hash = (*it)[strings::hash_id].asUInt();
- LOG4CXX_INFO(logger_, "received hash = " << hash);
- LOG4CXX_INFO(logger_, "saved hash = " << saved_hash);
- if (hash == saved_hash) {
- return true;
- }
- }
+ const std::string& hash) {
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application pointer is invalid");
+ return false;
}
- return false;
-}
+ LOG4CXX_DEBUG(logger_, "ENTER app_id : " << application->app_id()
+ << " hash : " << hash);
-void ResumeCtrl::onTimer() {
- LOG4CXX_INFO(logger_, "ResumeCtrl::onTimer() size is "
- << waiting_for_timer_.size());
- sync_primitives::AutoLock auto_lock(queue_lock_);
+ sync_primitives::AutoLock lock(resumtion_lock_);
+ const int idx = GetObjectIndex(application->mobile_app_id());
+ if (-1 == idx) {
+ LOG4CXX_WARN(logger_, "Application not saved");
+ return false;
+ }
- std::multiset<application_timestamp, TimeStampComparator>::iterator it=
- waiting_for_timer_.begin();
+ const Json::Value& json_app = GetSavedApplications()[idx];
- for (; it != waiting_for_timer_.end(); ++it) {
- ApplicationSharedPtr app =
- ApplicationManagerImpl::instance()->application((*it).first);
- if (!app.get()) {
- LOG4CXX_ERROR(logger_, "Invalid app_id = " << (*it).first);
- continue;
+ if (json_app.isMember(strings::hash_id)) {
+ const std::string& saved_hash = json_app[strings::hash_id].asString();
+
+ LOG4CXX_TRACE(logger_, "Found saved application : " << json_app.toStyledString());
+ LOG4CXX_INFO(logger_, "received hash = " << hash);
+ LOG4CXX_INFO(logger_, "saved hash = " << saved_hash);
+ if (hash == saved_hash) {
+ return true;
}
+ }
+
+ return false;
+}
- RestoreApplicationHMILevel(app);
- RemoveApplicationFromSaved(app);
+void ResumeCtrl::SaveDataOnTimer() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (is_resumption_active_) {
+ LOG4CXX_WARN(logger_, "Resumption timer is active skip saving");
+ return;
}
- waiting_for_timer_.clear();
+ if (false == is_data_saved) {
+ SaveAllApplications();
+ is_data_saved = true;
+ resumption::LastState::instance()->SaveToFileSystem();
+ }
}
bool ResumeCtrl::IsDeviceMacAddressEqual(ApplicationSharedPtr application,
const std::string& saved_device_mac) {
const std::string device_mac =
MessageHelper::GetDeviceMacAddressForHandle(application->device());
-
return device_mac == saved_device_mac;
}
+Json::Value&ResumeCtrl::GetResumptionData() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Json::Value& last_state = resumption::LastState::instance()->dictionary;
+ if (!last_state.isMember(strings::resumption)) {
+ last_state[strings::resumption] = Json::Value(Json::objectValue);
+ LOG4CXX_WARN(logger_, "resumption section is missed");
+ }
+ Json::Value& resumption = last_state[strings::resumption];
+ if (!resumption.isObject()) {
+ LOG4CXX_ERROR(logger_, "resumption type INVALID rewrite");
+ resumption = Json::Value(Json::objectValue);
+ }
+ return resumption;
+}
+
Json::Value& ResumeCtrl::GetSavedApplications() {
- return resumption::LastState::instance()->dictionary[strings::resumption];
+ LOG4CXX_AUTO_TRACE(logger_);
+ Json::Value& resumption = GetResumptionData();
+ if (!resumption.isMember(strings::resume_app_list)) {
+ resumption[strings::resume_app_list] = Json::Value(Json::arrayValue);
+ LOG4CXX_WARN(logger_, "app_list section is missed");
+ }
+ Json::Value& resume_app_list = resumption[strings::resume_app_list];
+ if (!resume_app_list.isArray()) {
+ LOG4CXX_ERROR(logger_, "resume_app_list type INVALID rewrite");
+ resume_app_list = Json::Value(Json::arrayValue);
+ }
+ return resume_app_list;
+}
+
+time_t ResumeCtrl::GetIgnOffTime() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Json::Value& resumption = GetResumptionData();
+ if (!resumption.isMember(strings::last_ign_off_time)) {
+ resumption[strings::last_ign_off_time] = 0;
+ LOG4CXX_WARN(logger_, "last_save_time section is missed");
+ }
+ time_t last_ign_off = static_cast<time_t>(
+ resumption[strings::last_ign_off_time].asUInt());
+ return last_ign_off;
}
+void ResumeCtrl::SetLastIgnOffTime(time_t ign_off_time) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_WARN(logger_, "ign_off_time = " << ign_off_time);
+ Json::Value& resumption = GetResumptionData();
+ resumption[strings::last_ign_off_time] = static_cast<uint32_t>(ign_off_time);
+}
+
+
void ResumeCtrl::SetSavedApplication(Json::Value& apps_json) {
- resumption::LastState::instance()->dictionary[strings::resumption] = apps_json ;
+ Json::Value& app_list = GetSavedApplications();
+ app_list = apps_json;
}
void ResumeCtrl::ClearResumptionInfo() {
- Json::Value empty_json;
+ LOG4CXX_AUTO_TRACE(logger_);
+ Json::Value empty_json;
- SetSavedApplication(empty_json);
- resumption::LastState::instance()->SaveToFileSystem();
+ SetSavedApplication(empty_json);
+ resumption::LastState::instance()->SaveToFileSystem();
}
Json::Value ResumeCtrl::GetApplicationCommands(
ApplicationConstSharedPtr application) {
- DCHECK(application.get());
- LOG4CXX_INFO(logger_, "ResumeCtrl::GetApplicationCommands "
- << application->app_id());
-
+ LOG4CXX_AUTO_TRACE(logger_);
Json::Value result;
- const CommandsMap& commands = application->commands_map();
+ DCHECK(application.get());
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL Pointer App");
+ return result;
+ }
+ const DataAccessor<CommandsMap> accessor = application->commands_map();
+ const CommandsMap& commands = accessor.GetData();
CommandsMap::const_iterator it = commands.begin();
for (;it != commands.end(); ++it) {
smart_objects::SmartObject* so = it->second;
Json::Value curr;
Formatters::CFormatterJsonBase::objToJsonValue(*so, curr);
result.append(curr);
- LOG4CXX_INFO(logger_, "Converted:" << curr.toStyledString());
}
return result;
}
Json::Value ResumeCtrl::GetApplicationSubMenus(
ApplicationConstSharedPtr application) {
- DCHECK(application.get());
- LOG4CXX_INFO(logger_, "ResumeCtrl::GetApplicationCommands "
- << application->app_id());
-
+ LOG4CXX_AUTO_TRACE(logger_);
Json::Value result;
- const SubMenuMap& sub_menus = application->sub_menu_map();
+ DCHECK(application.get());
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL Pointer App");
+ return result;
+ }
+ const DataAccessor<SubMenuMap> accessor = application->sub_menu_map();
+ const SubMenuMap& sub_menus = accessor.GetData();
SubMenuMap::const_iterator it = sub_menus.begin();
for (;it != sub_menus.end(); ++it) {
smart_objects::SmartObject* so = it->second;
Json::Value curr;
Formatters::CFormatterJsonBase::objToJsonValue(*so, curr);
result.append(curr);
- LOG4CXX_INFO(logger_, "Converted:" << curr.toStyledString());
}
return result;
}
@@ -788,29 +762,32 @@ Json::Value ResumeCtrl::GetApplicationSubMenus(
Json::Value ResumeCtrl::GetApplicationInteractionChoiseSets(
ApplicationConstSharedPtr application) {
DCHECK(application.get());
- LOG4CXX_INFO(logger_, "ResumeCtrl::GetApplicationInteractionChoiseSets "
+ LOG4CXX_TRACE(logger_, "ENTER app_id:"
<< application->app_id());
Json::Value result;
- const ChoiceSetMap& choices = application->choice_set_map();
+ const DataAccessor<ChoiceSetMap> accessor = application->choice_set_map();
+ const ChoiceSetMap& choices = accessor.GetData();
ChoiceSetMap::const_iterator it = choices.begin();
for ( ;it != choices.end(); ++it) {
smart_objects::SmartObject* so = it->second;
Json::Value curr;
Formatters::CFormatterJsonBase::objToJsonValue(*so, curr);
result.append(curr);
- LOG4CXX_INFO(logger_, "Converted:" << curr.toStyledString());
}
return result;
}
Json::Value ResumeCtrl::GetApplicationGlobalProperties(
ApplicationConstSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Json::Value sgp;
DCHECK(application.get());
- LOG4CXX_INFO(logger_, "ResumeCtrl::GetApplicationGlobalProperties "
- << application->app_id());
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL Pointer App");
+ return sgp;
+ }
- Json::Value result;
const smart_objects::SmartObject* help_promt = application->help_prompt();
const smart_objects::SmartObject* timeout_prompt = application->timeout_prompt();
const smart_objects::SmartObject* vr_help = application->vr_help();
@@ -820,7 +797,6 @@ Json::Value ResumeCtrl::GetApplicationGlobalProperties(
const smart_objects::SmartObject* menu_title = application->menu_title();
const smart_objects::SmartObject* menu_icon = application->menu_icon();
- Json::Value sgp;
sgp[strings::help_prompt] = JsonFromSO(help_promt);
sgp[strings::timeout_prompt] = JsonFromSO(timeout_prompt);
sgp[strings::vr_help] = JsonFromSO(vr_help);
@@ -829,35 +805,34 @@ Json::Value ResumeCtrl::GetApplicationGlobalProperties(
sgp[strings::keyboard_properties] = JsonFromSO(keyboard_props);
sgp[strings::menu_title] = JsonFromSO(menu_title);
sgp[strings::menu_icon] = JsonFromSO(menu_icon);
-
return sgp;
}
Json::Value ResumeCtrl::GetApplicationSubscriptions(
ApplicationConstSharedPtr application) {
- DCHECK(application.get());
- LOG4CXX_INFO(logger_, "ResumeCtrl::GetApplicationSubscriptions "
- << application->app_id());
-
+ LOG4CXX_AUTO_TRACE(logger_);
Json::Value result;
- std::set<mobile_apis::ButtonName::eType>::iterator it_button ;
- std::set<uint32_t>::iterator it_vehicle;
-
- for (it_button = application->SubscribedButtons().begin() ;
- it_button != application->SubscribedButtons().end(); ++it_button) {
- result[strings::application_buttons].append(*it_button);
- }
- for (it_vehicle = application->SubscribesIVI().begin();
- it_vehicle != application->SubscribesIVI().end(); ++it_vehicle) {
- result[strings::application_vehicle_info].append(*it_vehicle);
+ DCHECK(application.get());
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL Pointer App");
+ return result;
}
+ LOG4CXX_DEBUG(logger_, "app_id:" << application->app_id());
+ LOG4CXX_DEBUG(logger_, "SubscribedButtons:" << application->SubscribedButtons().size());
+ Append(application->SubscribedButtons().begin(),
+ application->SubscribedButtons().end(),
+ strings::application_buttons, result);
+ LOG4CXX_DEBUG(logger_, "SubscribesIVI:" << application->SubscribesIVI().size());
+ Append(application->SubscribesIVI().begin(),
+ application->SubscribesIVI().end(),
+ strings::application_vehicle_info, result);
return result;
}
Json::Value ResumeCtrl::GetApplicationFiles(
ApplicationConstSharedPtr application) {
DCHECK(application.get());
- LOG4CXX_INFO(logger_, "ResumeCtrl::GetApplicationFiles "
+ LOG4CXX_TRACE(logger_, "ENTER app_id:"
<< application->app_id());
Json::Value result;
@@ -880,8 +855,8 @@ Json::Value ResumeCtrl::GetApplicationFiles(
Json::Value ResumeCtrl::GetApplicationShow(
ApplicationConstSharedPtr application) {
DCHECK(application.get());
- LOG4CXX_INFO(logger_, "ResumeCtrl::GetApplicationShow "
- << application->app_id());
+ LOG4CXX_TRACE(logger_, "ENTER app_id:"
+ << application->app_id());
Json::Value result;
const smart_objects::SmartObject* show_so = application->show_command();
@@ -900,8 +875,9 @@ Json::Value ResumeCtrl::JsonFromSO(const smart_objects::SmartObject *so) {
return temp;
}
-bool ResumeCtrl::ProcessHMIRequest(smart_objects::SmartObject* request,
+bool ResumeCtrl::ProcessHMIRequest(smart_objects::SmartObjectSPtr request,
bool use_events) {
+ LOG4CXX_AUTO_TRACE(logger_);
if (use_events) {
const hmi_apis::FunctionID::eType function_id =
static_cast<hmi_apis::FunctionID::eType>(
@@ -918,14 +894,397 @@ bool ResumeCtrl::ProcessHMIRequest(smart_objects::SmartObject* request,
return false;
}
-void ResumeCtrl::SendHMIRequest(
+void ResumeCtrl::AddFiles(ApplicationSharedPtr application, const Json::Value& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (saved_app.isMember(strings::application_files)) {
+ const Json::Value& application_files = saved_app[strings::application_files];
+ for (Json::Value::iterator json_it = application_files.begin();
+ json_it != application_files.end(); ++json_it) {
+ const Json::Value& file_data = *json_it;
+
+ const bool is_persistent = file_data.isMember(strings::persistent_file) &&
+ file_data[strings::persistent_file].asBool();
+ if (is_persistent) {
+ AppFile file;
+ file.is_persistent = is_persistent;
+ file.is_download_complete = file_data[strings::is_download_complete].asBool();
+ file.file_name = file_data[strings::sync_file_name].asString();
+ file.file_type = static_cast<mobile_apis::FileType::eType> (
+ file_data[strings::file_type].asInt());
+ application->AddFile(file);
+ }
+ }
+ } else {
+ LOG4CXX_FATAL(logger_, "application_files section is not exists");
+ }
+}
+
+void ResumeCtrl::AddSubmenues(ApplicationSharedPtr application, const Json::Value& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (saved_app.isMember(strings::application_submenus)) {
+ const Json::Value& app_submenus = saved_app[strings::application_submenus];
+ for (Json::Value::iterator json_it = app_submenus.begin();
+ json_it != app_submenus.end(); ++json_it) {
+ const Json::Value& json_submenu = *json_it;
+ smart_objects::SmartObject message(smart_objects::SmartType::SmartType_Map);
+ Formatters::CFormatterJsonBase::jsonValueToObj(json_submenu, message);
+ application->AddSubMenu(message[strings::menu_id].asUInt(), message);
+ }
+
+ ProcessHMIRequests(MessageHelper::CreateAddSubMenuRequestToHMI(application));
+ } else {
+ LOG4CXX_FATAL(logger_, "application_submenus section is not exists");
+ }
+}
+
+void ResumeCtrl::AddCommands(ApplicationSharedPtr application, const Json::Value& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (saved_app.isMember(strings::application_commands)) {
+ const Json::Value& app_commands = saved_app[strings::application_commands];
+ for (Json::Value::iterator json_it = app_commands.begin();
+ json_it != app_commands.end(); ++json_it) {
+ const Json::Value& json_command = *json_it;
+ smart_objects::SmartObject message(smart_objects::SmartType::SmartType_Map);
+ Formatters::CFormatterJsonBase::jsonValueToObj(json_command, message);
+ application->AddCommand(message[strings::cmd_id].asUInt(), message);
+ }
+
+ ProcessHMIRequests(MessageHelper::CreateAddCommandRequestToHMI(application));
+ } else {
+ LOG4CXX_FATAL(logger_, "application_commands section is not exists");
+ }
+}
+
+void ResumeCtrl::AddChoicesets(ApplicationSharedPtr application, const Json::Value& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (saved_app.isMember(strings::application_choise_sets)) {
+ const Json::Value& app_choise_sets = saved_app[strings::application_choise_sets];
+ for (Json::Value::iterator json_it = app_choise_sets.begin();
+ json_it != app_choise_sets.end(); ++json_it) {
+ const Json::Value& json_choiset = *json_it;
+ smart_objects::SmartObject msg_param(smart_objects::SmartType::SmartType_Map);
+ Formatters::CFormatterJsonBase::jsonValueToObj(json_choiset , msg_param);
+ const int32_t choice_set_id = msg_param
+ [strings::interaction_choice_set_id].asInt();
+ uint32_t choice_grammar_id = msg_param[strings::grammar_id].asUInt();
+ application->AddChoiceSet(choice_set_id, msg_param);
+
+ const size_t size = msg_param[strings::choice_set].length();
+ for (size_t j = 0; j < size; ++j) {
+ smart_objects::SmartObject choise_params(smart_objects::SmartType_Map);
+ choise_params[strings::app_id] = application->app_id();
+ choise_params[strings::cmd_id] =
+ msg_param[strings::choice_set][j][strings::choice_id];
+ choise_params[strings::vr_commands] = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+ choise_params[strings::vr_commands] =
+ msg_param[strings::choice_set][j][strings::vr_commands];
+
+ choise_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
+ choise_params[strings::grammar_id] = choice_grammar_id;
+ SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &choise_params);
+ }
+ }
+ } else {
+ LOG4CXX_FATAL(logger_, "There is no any choicesets");
+ }
+}
+
+void ResumeCtrl::SetGlobalProperties(ApplicationSharedPtr application, const Json::Value& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const Json::Value& global_properties = saved_app[strings::application_global_properties];
+ if (!global_properties.isNull()) {
+ smart_objects::SmartObject properties_so(smart_objects::SmartType::SmartType_Map);
+ Formatters::CFormatterJsonBase::jsonValueToObj(global_properties , properties_so);
+ application->load_global_properties(properties_so);
+ MessageHelper::SendGlobalPropertiesToHMI(application);
+ }
+}
+
+void ResumeCtrl::AddSubscriptions(ApplicationSharedPtr application, const Json::Value& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (saved_app.isMember(strings::application_subscribtions)) {
+ const Json::Value& subscribtions = saved_app[strings::application_subscribtions];
+
+ if (subscribtions.isMember(strings::application_buttons)) {
+ const Json::Value& subscribtions_buttons = subscribtions[strings::application_buttons];
+ mobile_apis::ButtonName::eType btn;
+ for (Json::Value::iterator json_it = subscribtions_buttons.begin();
+ json_it != subscribtions_buttons.end(); ++json_it) {
+ btn = static_cast<mobile_apis::ButtonName::eType>((*json_it).asInt());
+ application->SubscribeToButton(btn);
+ }
+ }
+ if (subscribtions.isMember(strings::application_vehicle_info)) {
+ const Json::Value& subscribtions_ivi= subscribtions[strings::application_vehicle_info];
+ VehicleDataType ivi;
+ for (Json::Value::iterator json_it = subscribtions_ivi.begin();
+ json_it != subscribtions_ivi.end(); ++json_it) {
+ ivi = static_cast<VehicleDataType>((*json_it).asInt());
+ application->SubscribeToIVI(ivi);
+ }
+ }
+ ProcessHMIRequests(MessageHelper::GetIVISubscriptionRequests(application));
+ MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(application);
+ }
+}
+
+void ResumeCtrl::ProcessHMIRequests(const smart_objects::SmartObjectList& requests) {
+ for (smart_objects::SmartObjectList::const_iterator it = requests.begin(),
+ total = requests.end();
+ it != total; ++it) {
+ ProcessHMIRequest(*it, true);
+ }
+}
+
+bool ResumeCtrl::CheckIcons(ApplicationSharedPtr application,
+ const Json::Value& json_object) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool result = true;
+ if (!json_object.isNull()) {
+ Json::Value::const_iterator json_it = json_object.begin();
+ for (;json_it != json_object.end() && result; ++json_it) {
+ const Json::Value& json_command = *json_it;
+ if (!json_command.isNull()) {
+ smart_objects::SmartObject message(smart_objects::SmartType::SmartType_Map);
+ Formatters::CFormatterJsonBase::jsonValueToObj(json_command, message);
+ const mobile_apis::Result::eType verify_images =
+ MessageHelper::VerifyImageFiles(message, application);
+ result = (mobile_apis::Result::INVALID_DATA != verify_images);
+ } else {
+ LOG4CXX_WARN(logger_, "Invalid json object");
+ }
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Passed json object is null");
+ }
+ LOG4CXX_DEBUG(logger_, "CheckIcons result " << result);
+ return result;
+}
+
+Json::Value& ResumeCtrl::GetFromSavedOrAppend(const std::string& mobile_app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ for (Json::Value::iterator it = GetSavedApplications().begin();
+ it != GetSavedApplications().end(); ++it) {
+ if (mobile_app_id == (*it)[strings::app_id].asString()) {
+ return *it;
+ }
+ }
+
+ return GetSavedApplications().append(Json::Value());
+}
+
+bool ResumeCtrl::CheckIgnCycleRestrictions(const Json::Value& json_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool result = true;
+
+ if (!CheckDelayAfterIgnOn()) {
+ LOG4CXX_INFO(logger_, "Application was connected long after ign on");
+ result = false;
+ }
+
+ if (!DisconnectedJustBeforeIgnOff(json_app)) {
+ LOG4CXX_INFO(logger_, "Application was dissconnected long before ign off");
+ result = false;
+ }
+ return result;
+}
+
+bool ResumeCtrl::DisconnectedInLastIgnCycle(const Json::Value& json_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(json_app.isMember(strings::suspend_count), false);
+ const uint32_t suspend_count = json_app[strings::suspend_count].asUInt();
+ LOG4CXX_DEBUG(logger_, " suspend_count " << suspend_count);
+ return (1 == suspend_count);
+}
+
+bool ResumeCtrl::DisconnectedJustBeforeIgnOff(const Json::Value& json_app) {
+ using namespace date_time;
+ using namespace profile;
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(json_app.isMember(strings::time_stamp), false);
+
+ const time_t time_stamp =
+ static_cast<time_t>(json_app[strings::time_stamp].asUInt());
+ time_t ign_off_time = GetIgnOffTime();
+ const uint32_t sec_spent_before_ign = labs(ign_off_time - time_stamp);
+ LOG4CXX_DEBUG(logger_,"ign_off_time " << ign_off_time
+ << "; app_disconnect_time " << time_stamp
+ << "; sec_spent_before_ign " << sec_spent_before_ign
+ << "; resumption_delay_before_ign " <<
+ Profile::instance()->resumption_delay_before_ign());
+ return sec_spent_before_ign <=
+ Profile::instance()->resumption_delay_before_ign();
+}
+
+bool ResumeCtrl::CheckDelayAfterIgnOn() {
+ using namespace date_time;
+ using namespace profile;
+ LOG4CXX_AUTO_TRACE(logger_);
+ time_t curr_time = time(NULL);
+ time_t sdl_launch_time = launch_time();
+ const uint32_t seconds_from_sdl_start = labs(curr_time - sdl_launch_time);
+ const uint32_t wait_time =
+ Profile::instance()->resumption_delay_after_ign();
+ LOG4CXX_DEBUG(logger_, "curr_time " << curr_time
+ << "; sdl_launch_time " << sdl_launch_time
+ << "; seconds_from_sdl_start " << seconds_from_sdl_start
+ << "; wait_time " << wait_time);
+ return seconds_from_sdl_start <= wait_time;
+}
+
+bool ResumeCtrl::CheckAppRestrictions(ApplicationSharedPtr application,
+ const Json::Value& json_app) {
+ using namespace mobile_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(json_app.isMember(strings::hmi_level), false);
+
+ const bool is_media_app = application->is_media_application();
+ const HMILevel::eType hmi_level =
+ static_cast<HMILevel::eType>(json_app[strings::hmi_level].asInt());
+ LOG4CXX_DEBUG(logger_, "is_media_app " << is_media_app
+ << "; hmi_level " << hmi_level);
+
+ if (is_media_app) {
+ if (hmi_level == HMILevel::HMI_FULL ||
+ hmi_level == HMILevel::HMI_LIMITED) {
+ return true;
+ }
+ }
+ return false;
+}
+
+int ResumeCtrl::GetObjectIndex(const std::string& mobile_app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock lock(resumtion_lock_);
+ const Json::Value& apps = GetSavedApplications();
+ const Json::ArrayIndex size = apps.size();
+ Json::ArrayIndex idx = 0;
+ for (; idx != size; ++idx) {
+ const std::string& saved_app_id = apps[idx][strings::app_id].asString();
+ if (mobile_app_id == saved_app_id) {
+ LOG4CXX_DEBUG(logger_, "Found " << idx);
+ return idx;
+ }
+ }
+ return -1;
+}
+time_t ResumeCtrl::launch_time() const {
+ return launch_time_;
+}
+
+void ResumeCtrl::ResetLaunchTime() {
+ launch_time_ = time(NULL);
+}
+
+void ResumeCtrl::ApplicationResumptiOnTimer() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ is_resumption_active_ = false;
+ std::vector<uint32_t>::iterator it = waiting_for_timer_.begin();
+
+ for (; it != waiting_for_timer_.end(); ++it) {
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(*it);
+ if (!app.get()) {
+ LOG4CXX_ERROR(logger_, "Invalid app_id = " << *it);
+ continue;
+ }
+
+ StartAppHmiStateResumption(app);
+ }
+
+ waiting_for_timer_.clear();
+}
+
+void ResumeCtrl::LoadResumeData() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock lock(resumtion_lock_);
+
+ Json::Value& resume_app_list = GetSavedApplications();
+ Json::Value::iterator full_app = resume_app_list.end();
+ time_t time_stamp_full = 0;
+ Json::Value::iterator limited_app = resume_app_list.end();
+ time_t time_stamp_limited = 0;
+
+ Json::Value::iterator it = resume_app_list.begin();
+ for (; it != resume_app_list.end(); ++it) {
+ if ((*it).isMember(strings::ign_off_count) &&
+ (*it).isMember(strings::hmi_level)) {
+
+ // only apps with first IGN should be resumed
+ const int32_t first_ign = 1;
+ if (first_ign == (*it)[strings::ign_off_count].asInt()) {
+
+ const mobile_apis::HMILevel::eType saved_hmi_level =
+ static_cast<mobile_apis::HMILevel::eType>((*it)[strings::hmi_level].asInt());
+
+ const time_t saved_time_stamp =
+ static_cast<time_t>((*it)[strings::time_stamp].asUInt());
+
+ if (mobile_apis::HMILevel::HMI_FULL == saved_hmi_level) {
+ if (time_stamp_full < saved_time_stamp) {
+ time_stamp_full = saved_time_stamp;
+ full_app = it;
+ }
+ }
+
+ if (mobile_apis::HMILevel::HMI_LIMITED == saved_hmi_level) {
+ if (time_stamp_limited < saved_time_stamp) {
+ time_stamp_limited = saved_time_stamp;
+ limited_app = it;
+ }
+ }
+ }
+
+ // set invalid HMI level for all
+ (*it)[strings::hmi_level] =
+ static_cast<int32_t>(mobile_apis::HMILevel::INVALID_ENUM);
+ }
+ }
+
+ if (full_app != resume_app_list.end()) {
+ (*full_app)[strings::hmi_level] =
+ static_cast<int32_t>(mobile_apis::HMILevel::HMI_FULL);
+ }
+
+ if (limited_app != resume_app_list.end()) {
+ (*limited_app)[strings::hmi_level] =
+ static_cast<int32_t>(mobile_apis::HMILevel::HMI_LIMITED);
+ }
+ LOG4CXX_DEBUG(logger_, GetResumptionData().toStyledString());
+}
+
+bool ResumeCtrl::IsResumptionDataValid(uint32_t index) {
+ const Json::Value& json_app = GetSavedApplications()[index];
+ if (!json_app.isMember(strings::app_id) ||
+ !json_app.isMember(strings::ign_off_count) ||
+ !json_app.isMember(strings::hmi_level) ||
+ !json_app.isMember(strings::hmi_app_id) ||
+ !json_app.isMember(strings::time_stamp)) {
+ LOG4CXX_ERROR(logger_, "Wrong resumption data");
+ return false;
+ }
+
+ if (json_app.isMember(strings::hmi_app_id) &&
+ 0 >= json_app[strings::hmi_app_id].asUInt()) {
+ LOG4CXX_ERROR(logger_, "Wrong resumption hmi app ID");
+ return false;
+ }
+
+ return true;
+}
+
+uint32_t ResumeCtrl::SendHMIRequest(
const hmi_apis::FunctionID::eType& function_id,
const smart_objects::SmartObject* msg_params, bool use_events) {
-
- NsSmartDeviceLink::NsSmartObjects::SmartObject* result =
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr result =
MessageHelper::CreateModuleInfoSO(function_id);
- int32_t hmi_correlation_id =
- (*result)[strings::params][strings::correlation_id].asInt();
+ uint32_t hmi_correlation_id =
+ (*result)[strings::params][strings::correlation_id].asUInt();
if (use_events) {
subscribe_on_event(function_id, hmi_correlation_id);
}
@@ -937,6 +1296,7 @@ void ResumeCtrl::SendHMIRequest(
if (!ApplicationManagerImpl::instance()->ManageHMICommand(result)) {
LOG4CXX_ERROR(logger_, "Unable to send request");
}
+ return hmi_correlation_id;
}
} // namespace application_manager
diff --git a/src/components/application_manager/src/state_context.cc b/src/components/application_manager/src/state_context.cc
new file mode 100644
index 000000000..ae3b40e09
--- /dev/null
+++ b/src/components/application_manager/src/state_context.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/state_context.h"
+#include "application_manager/application_manager_impl.h"
+#include "config_profile/profile.h"
+
+namespace application_manager {
+
+
+bool StateContext::is_navi_app(const uint32_t app_id) const {
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+ DCHECK_OR_RETURN(app, false);
+ return app ? app->is_navi() : false;
+}
+
+bool StateContext::is_meida_app(const uint32_t app_id) const {
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+ return app ? app->is_media_application() : false;
+}
+
+bool StateContext::is_voice_comunication_app(const uint32_t app_id) const {
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+ return app ? app->is_voice_communication_supported() : false;
+}
+
+bool StateContext::is_attenuated_supported() const{
+ const HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ return hmi_capabilities.attenuated_supported() &&
+ profile::Profile::instance()->is_mixing_audio_supported();
+}
+
+}
diff --git a/src/components/application_manager/src/state_controller.cc b/src/components/application_manager/src/state_controller.cc
new file mode 100644
index 000000000..720312adb
--- /dev/null
+++ b/src/components/application_manager/src/state_controller.cc
@@ -0,0 +1,436 @@
+/*
+ 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/state_controller.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+#include "utils/helpers.h"
+
+namespace application_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "StateController");
+
+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;
+}
+
+StateController::StateController():EventObserver() {
+ subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_OnEmergencyEvent);
+ subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_OnPhoneCall);
+ subscribe_on_event(hmi_apis::FunctionID::TTS_Started);
+ subscribe_on_event(hmi_apis::FunctionID::TTS_Stopped);
+ subscribe_on_event(hmi_apis::FunctionID::VR_Started);
+ subscribe_on_event(hmi_apis::FunctionID::VR_Stopped);
+}
+
+void StateController::SetRegularState(ApplicationSharedPtr app,
+ const mobile_apis::AudioStreamingState::eType audio_state) {
+ if (!app) {
+ return;
+ }
+ HmiStatePtr prev_state = app->RegularHmiState();
+ DCHECK_OR_RETURN_VOID(prev_state);
+ HmiStatePtr hmi_state = CreateHmiState(app->app_id(),
+ HmiState::StateID::STATE_ID_REGULAR);
+ 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_system_context(prev_state->system_context());
+ SetRegularState<false>(app, hmi_state);
+}
+
+void StateController::HmiLevelConflictResolver::operator ()
+ (ApplicationSharedPtr to_resolve) {
+ using namespace mobile_apis;
+ using namespace helpers;
+ DCHECK_OR_RETURN_VOID(state_ctrl_);
+ if (to_resolve == applied_)
+ return;
+ if (Compare<HMILevel::eType, EQ, ONE>(state_->hmi_level(),
+ HMILevel::HMI_FULL,
+ HMILevel::HMI_LIMITED)) {
+ HmiStatePtr cur_state = to_resolve->RegularHmiState();
+ if (Compare<HMILevel::eType, EQ, ONE>(cur_state->hmi_level(),
+ HMILevel::HMI_FULL,
+ HMILevel::HMI_LIMITED)) {
+ if (applied_->IsAudioApplication() && state_ctrl_->IsSameAppType(applied_, to_resolve)) {
+ state_ctrl_->SetupRegularHmiState(to_resolve, HMILevel::HMI_BACKGROUND,
+ AudioStreamingState::NOT_AUDIBLE);
+ } else {
+ state_ctrl_->SetupRegularHmiState(to_resolve, HMILevel::HMI_LIMITED,
+ AudioStreamingState::AUDIBLE);
+ }
+ }
+ }
+}
+
+void StateController::SetupRegularHmiState(ApplicationSharedPtr app,
+ HmiStatePtr state) {
+ 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());
+ HmiStatePtr curr_state = app->CurrentHmiState();
+ HmiStatePtr old_state = CreateHmiState(app->app_id(),
+ 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_system_context(curr_state->system_context());
+ app->SetRegularState(state);
+ if (state->hmi_level() == mobile_apis::HMILevel::HMI_NONE) {
+ app->ResetDataInNone();
+ }
+ if (!app->IsAudioApplication()) {
+ if (state->hmi_level() == HMILevel::HMI_LIMITED) {
+ LOG4CXX_ERROR(logger_, "Trying to setup LIMITED to non audio app");
+ state->set_hmi_level(HMILevel::HMI_BACKGROUND);
+ }
+ if (state->audio_streaming_state() != AudioStreamingState::NOT_AUDIBLE) {
+ LOG4CXX_ERROR(logger_, "Trying to setup audio state " <<
+ state->audio_streaming_state() <<" to non audio app");
+ state->set_audio_streaming_state(AudioStreamingState::NOT_AUDIBLE);
+ }
+ }
+ HmiStatePtr new_state = app->CurrentHmiState();
+ OnStateChanged(app, old_state, new_state);
+}
+
+void StateController::SetupRegularHmiState(ApplicationSharedPtr app,
+ const mobile_apis::HMILevel::eType hmi_level,
+ const mobile_apis::AudioStreamingState::eType audio_state) {
+ using namespace mobile_apis;
+ using namespace helpers;
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(app);
+ HmiStatePtr prev_state = app->RegularHmiState();
+ DCHECK_OR_RETURN_VOID(prev_state);
+ HmiStatePtr new_state = CreateHmiState(app->app_id(),
+ HmiState::StateID::STATE_ID_REGULAR);
+ DCHECK_OR_RETURN_VOID(new_state);
+ new_state->set_hmi_level(hmi_level);
+ new_state->set_audio_streaming_state(audio_state);
+ new_state->set_system_context(prev_state->system_context());
+ SetupRegularHmiState(app, new_state);
+}
+
+void StateController::ApplyRegularState(ApplicationSharedPtr app,
+ HmiStatePtr state) {
+ DCHECK_OR_RETURN_VOID(app);
+ DCHECK_OR_RETURN_VOID(state);
+ DCHECK_OR_RETURN_VOID(state->state_id() == HmiState::STATE_ID_REGULAR);
+ SetupRegularHmiState(app, state);
+ ForEachApplication<HmiLevelConflictResolver, ApplicationManagerImpl>
+ (HmiLevelConflictResolver(app, state, this));
+}
+
+bool StateController::IsSameAppType(ApplicationConstSharedPtr app1,
+ ApplicationConstSharedPtr app2) {
+ return app1->is_media_application() == app2->is_media_application() ||
+ app1->is_navi() == app2->is_navi() ||
+ app1->is_voice_communication_supported() == app2->is_voice_communication_supported();
+}
+
+void StateController::on_event(const event_engine::Event& event) {
+ using namespace smart_objects;
+ using namespace event_engine;
+ using namespace hmi_apis;
+
+ LOG4CXX_AUTO_TRACE(logger_);
+ const SmartObject& message = event.smart_object();
+ const FunctionID::eType id = static_cast<FunctionID::eType> (event.id());
+ switch (id) {
+ case FunctionID::BasicCommunication_ActivateApp: {
+ OnActivateAppResponse(message);
+ break;
+ }
+ case FunctionID::BasicCommunication_OnEmergencyEvent: {
+ bool is_active =
+ message[strings::msg_params][hmi_response::enabled].asBool();
+ if (is_active) {
+ OnSafetyModeEnabled();
+ } else {
+ OnSafetyModeDisabled();
+ }
+ break;
+ }
+ case FunctionID::BasicCommunication_OnPhoneCall: {
+ bool is_active =
+ message[strings::msg_params][hmi_notification::is_active].asBool();
+ if (is_active) {
+ OnPhoneCallStarted();
+ } else {
+ OnPhoneCallEnded();
+ }
+ break;
+ }
+ case FunctionID::VR_Started: {
+ OnVRStarted();
+ break;
+ }
+ case FunctionID::VR_Stopped: {
+ OnVREnded();
+ break;
+ }
+ case FunctionID::TTS_Started: {
+ OnTTSStarted();
+ break;
+ }
+ case FunctionID::TTS_Stopped: {
+ OnTTSStopped();
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+void StateController::OnStateChanged(ApplicationSharedPtr app,
+ HmiStatePtr old_state,
+ HmiStatePtr new_state) {
+ DCHECK_OR_RETURN_VOID(app);
+ DCHECK_OR_RETURN_VOID(old_state);
+ DCHECK_OR_RETURN_VOID(new_state);
+ if (IsStatusChanged(old_state, new_state)) {
+ MessageHelper::SendHMIStatusNotification(*app);
+ if (new_state->hmi_level() == mobile_apis::HMILevel::HMI_NONE) {
+ app->ResetDataInNone();
+ }
+ ApplicationManagerImpl::instance()->OnHMILevelChanged(app->app_id(),
+ old_state->hmi_level(), new_state->hmi_level());
+ } else {
+ LOG4CXX_ERROR(logger_, "Status not changed");
+ }
+}
+
+void StateController::ApplyStatesForApp(ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(active_states_lock_);
+ DCHECK_OR_RETURN_VOID(app);
+ StateIDList::iterator it = active_states_.begin();
+ for(; it != active_states_.end(); ++it) {
+ HmiStatePtr new_state = CreateHmiState(app->app_id(), *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);
+ }
+
+}
+
+void StateController::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");
+ }
+}
+
+void StateController::TempStateStopped(HmiState::StateID ID) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(active_states_lock_);
+ active_states_.remove(ID);
+}
+void StateController::OnActivateAppResponse(
+ const smart_objects::SmartObject& message) {
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const int32_t correlation_id = message[strings::params]
+ [strings::correlation_id].asInt();
+ const uint32_t hmi_app_id = ApplicationManagerImpl::instance()->
+ application_id(correlation_id);
+ ApplicationSharedPtr application = ApplicationManagerImpl::instance()->
+ application_by_hmi_app(hmi_app_id);
+ if (application) {
+ HmiStatePtr pending_state = waiting_for_activate[application->app_id()];
+ DCHECK_OR_RETURN_VOID(pending_state);
+ if (code != hmi_apis::Common_Result::SUCCESS) {
+ const HmiStatePtr cur = application->RegularHmiState();
+ pending_state->set_hmi_level(cur->hmi_level());
+ }
+ ApplyRegularState(application, pending_state);
+ }
+}
+
+
+void StateController::OnPhoneCallStarted() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ForEachApplication(std::bind1st(
+ std::mem_fun(
+ &StateController::HMIStateStarted<HmiState::STATE_ID_PHONE_CALL>),
+ this)
+ );
+ TempStateStarted(HmiState::STATE_ID_PHONE_CALL);
+}
+
+void StateController::OnPhoneCallEnded() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ForEachApplication(std::bind1st(
+ std::mem_fun(
+ &StateController::HMIStateStopped<HmiState::STATE_ID_PHONE_CALL>),
+ this)
+ );
+ TempStateStopped(HmiState::STATE_ID_PHONE_CALL);
+}
+
+void StateController::OnSafetyModeEnabled() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ForEachApplication(std::bind1st(
+ std::mem_fun(
+ &StateController::HMIStateStarted<HmiState::STATE_ID_SAFETY_MODE>),
+ this)
+ );
+ TempStateStarted(HmiState::STATE_ID_SAFETY_MODE);
+}
+
+void StateController::OnSafetyModeDisabled() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ForEachApplication(std::bind1st(
+ std::mem_fun(
+ &StateController::HMIStateStopped<HmiState::STATE_ID_SAFETY_MODE>),
+ this)
+ );
+ TempStateStopped(HmiState::STATE_ID_SAFETY_MODE);
+}
+
+void StateController::OnVRStarted() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ForEachApplication(std::bind1st(
+ std::mem_fun(
+ &StateController::HMIStateStarted<HmiState::STATE_ID_VR_SESSION>),
+ this)
+ );
+ TempStateStarted(HmiState::STATE_ID_VR_SESSION);
+}
+
+void StateController::OnVREnded() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ForEachApplication(std::bind1st(
+ std::mem_fun(
+ &StateController::HMIStateStopped<HmiState::STATE_ID_VR_SESSION>),
+ this)
+ );
+ TempStateStopped(HmiState::STATE_ID_VR_SESSION);
+}
+
+void StateController::OnTTSStarted() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ForEachApplication(std::bind1st(
+ std::mem_fun(
+ &StateController::HMIStateStarted<HmiState::STATE_ID_TTS_SESSION>),
+ this)
+ );
+ TempStateStarted(HmiState::STATE_ID_TTS_SESSION);
+}
+
+void StateController::OnTTSStopped() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ForEachApplication(std::bind1st(
+ std::mem_fun(
+ &StateController::HMIStateStopped<HmiState::STATE_ID_TTS_SESSION>),
+ this)
+ );
+ TempStateStopped(HmiState::STATE_ID_TTS_SESSION);
+}
+
+void StateController::OnNaviStreamingStarted() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ForEachApplication(std::bind1st(
+ std::mem_fun(
+ &StateController::HMIStateStarted<HmiState::STATE_ID_NAVI_STREAMING>),
+ this)
+ );
+ TempStateStarted(HmiState::STATE_ID_NAVI_STREAMING);
+}
+
+void StateController::OnNaviStreamingStopped() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ForEachApplication(std::bind1st(
+ std::mem_fun(
+ &StateController::HMIStateStopped<HmiState::STATE_ID_NAVI_STREAMING>),
+ this)
+ );
+ TempStateStopped(HmiState::STATE_ID_NAVI_STREAMING);
+}
+
+HmiStatePtr StateController::CreateHmiState(uint32_t app_id, HmiState::StateID state_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ HmiStatePtr new_state;
+ switch (state_id) {
+ case HmiState::STATE_ID_PHONE_CALL: {
+ new_state.reset(new PhoneCallHmiState(app_id, state_context_));
+ break;
+ }
+ case HmiState::STATE_ID_SAFETY_MODE: {
+ new_state.reset(new SafetyModeHmiState(app_id, state_context_));
+ break;
+ }
+ case HmiState::STATE_ID_VR_SESSION: {
+ new_state.reset(new VRHmiState(app_id, state_context_));
+ break;
+ }
+ case HmiState::STATE_ID_TTS_SESSION: {
+ new_state.reset(new TTSHmiState(app_id, state_context_));
+ break;
+ }
+ case HmiState::STATE_ID_NAVI_STREAMING: {
+ new_state.reset(new NaviStreamingHmiState(app_id, state_context_));
+ break;
+ }
+ case HmiState::STATE_ID_REGULAR: {
+ new_state.reset(new HmiState(app_id, state_context_));
+ break;
+ }
+ default:
+ LOG4CXX_FATAL(logger_, "Invalid state_id " << state_id);
+ NOTREACHED();
+ break;
+ }
+ return new_state;
+}
+
+}
diff --git a/src/components/application_manager/src/usage_statistics.cc b/src/components/application_manager/src/usage_statistics.cc
index 44ab16453..ad986d222 100644
--- a/src/components/application_manager/src/usage_statistics.cc
+++ b/src/components/application_manager/src/usage_statistics.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt
index 4d0e7a738..473ae6765 100644
--- a/src/components/application_manager/test/CMakeLists.txt
+++ b/src/components/application_manager/test/CMakeLists.txt
@@ -1,4 +1,37 @@
-#Replace include for mocking singltone
+# 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.
+
+# TODO{ALeshin}: APPLINK-10792. Do not write tests which use
+# application manager(AM) singleton while refactoring of AM is finished.
+
+# Replace include for mocking singltone
get_property(the_include_dirs DIRECTORY "" PROPERTY INCLUDE_DIRECTORIES)
set(class_to_mock ${CMAKE_SOURCE_DIR}/src/components/application_manager/include)
list(FIND the_include_dirs ${class_to_mock} find_idx)
@@ -7,20 +40,24 @@ if(find_idx GREATER -1)
endif()
set_property(DIRECTORY "" PROPERTY INCLUDE_DIRECTORIES ${the_include_dirs})
-include_directories (
+include_directories(
${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/include
${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/gtest/include
+ ${COMPONENTS_DIR}/application_manager/include/application_manager/
+ ${COMPONENTS_DIR}/application_manager/include/application_manager/policies
)
set(testSources
- ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/src/gmock_main.cc
- ${AM_TEST_DIR}/command_impl_test.cc
+ #${AM_TEST_DIR}/command_impl_test.cc
+ ${COMPONENTS_DIR}/application_manager/test/mobile_message_handler_test.cc
+ #${AM_TEST_DIR}/request_info_test.cc
)
-set (mockedSources
+
+set(mockedSources
${AM_MOCK_DIR}/src/application_manager_impl.cc
)
-set (AM_SOURCES
+set(AM_SOURCES
${AM_SOURCE_DIR}/src/policies/policy_handler.cc
${AM_SOURCE_DIR}/src/policies/policy_event_observer.cc
@@ -28,12 +65,14 @@ set (AM_SOURCES
${AM_SOURCE_DIR}/src/commands/command_request_impl.cc
${AM_SOURCE_DIR}/src/commands/command_response_impl.cc
${AM_SOURCE_DIR}/src/commands/command_notification_impl.cc
+ ${AM_SOURCE_DIR}/src/commands/command_notification_from_mobile_impl.cc
${AM_SOURCE_DIR}/src/commands/pending.cc
${AM_SOURCE_DIR}/src/usage_statistics.cc
${AM_SOURCE_DIR}/src/request_info.cc
${AM_SOURCE_DIR}/src/message.cc
${AM_SOURCE_DIR}/src/application_impl.cc
+ ${AM_SOURCE_DIR}/src/state_controller.cc
${AM_SOURCE_DIR}/src/mobile_command_factory.cc
${AM_SOURCE_DIR}/src/message_helper.cc
${AM_SOURCE_DIR}/src/hmi_command_factory.cc
@@ -43,24 +82,16 @@ set (AM_SOURCES
${AM_SOURCE_DIR}/src/resume_ctrl.cpp
${AM_SOURCE_DIR}/src/mobile_message_handler.cc
)
-
include_directories(
${AM_SOURCE_DIR}/policy/src/policy/policy_table/table_struct
)
- list(APPEND AM_SOURCES
- ${COMPONENTS_DIR}/application_manager/src/policies/pt_exchange_handler_impl.cc
- ${COMPONENTS_DIR}/application_manager/src/policies/policy_retry_sequence.cc
- )
-
set(testLibraries
gmock
- gtest
- gmock
gmock_main
UsageStatistics
dl
ProtocolLibrary
- )
+)
set(test_exec_libraries
HMI_API
@@ -77,6 +108,7 @@ set(test_exec_libraries
MediaManager
Resumption
)
+
IF(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
list(REMOVE_ITEM test_exec_libraries dl)
endif()
@@ -88,11 +120,25 @@ if(ENABLE_LOG)
list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY})
endif()
-add_library("ApplicationManagerTest" ${mockedSources} ${testSources} ${AM_SOURCES})
+add_library("ApplicationManagerTest" ${mockedSources} ${testSources})
+
target_link_libraries("ApplicationManagerTest" ${testLibraries} AMHMICommandsLibrary
AMMobileCommandsLibrary
AMEventEngine
AMPolicyLibrary)
-add_executable(application_manager_test ${testSources})
-target_link_libraries(application_manager_test ApplicationManagerTest ${test_exec_libraries})
+create_test("application_manager_test" "${testSources}" "${ApplicationManagerTest}")
+target_link_libraries("application_manager_test"
+ ApplicationManagerTest ${test_exec_libraries}
+ ApplicationManager
+ ProtocolLibrary
+ connectionHandler
+ ConfigProfile
+ jsoncpp
+ MediaManager
+ ProtocolHandler
+ Resumption
+)
+
+#add_executable(application_manager_test ${testSources})
+#target_link_libraries(application_manager_test ApplicationManagerTest ${test_exec_libraries})
diff --git a/src/components/application_manager/test/command_impl_test.cc b/src/components/application_manager/test/command_impl_test.cc
index 40b16b5c2..677515784 100644
--- a/src/components/application_manager/test/command_impl_test.cc
+++ b/src/components/application_manager/test/command_impl_test.cc
@@ -1,3 +1,35 @@
+/*
+ * 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 "gmock/gmock.h"
#include "application_manager/application_manager_impl.h"
@@ -25,19 +57,18 @@ bool MessageResultCodeIsGENERIC_ERROR(const utils::SharedPtr<smart_objects::Smar
}
}
-TEST(ApplicationManagerTest, SingltoneTestCheckWork) {
+TEST(ApplicationManager, SingletonInstance_CallTwice_ReferencesAreSame) {
application_manager::ApplicationManagerImpl* am = application_manager::ApplicationManagerImpl::instance();
application_manager::ApplicationManagerImpl* am2 = application_manager::ApplicationManagerImpl::instance();
- ASSERT_TRUE(am == am2);
- EXPECT_CALL((*am), GetNextHMICorrelationID()).WillRepeatedly(Return(1));
- smart_objects::SmartObject* so = application_manager::MessageHelper::CreateModuleInfoSO(0);
- delete so;
+ ASSERT_EQ(am, am2);
+ //EXPECT_CALL((*am), GetNextHMICorrelationID()).WillRepeatedly(Return(1));
+ //smart_objects::SmartObjectSPtr so = application_manager::MessageHelper::CreateModuleInfoSO(0);
application_manager::ApplicationManagerImpl::destroy();
}
TEST(MobileCommandsTest, CommandImplTimeOut) {
application_manager::ApplicationManagerImpl* am = application_manager::ApplicationManagerImpl::instance();
- smart_objects::SmartObject* so = application_manager::MessageHelper::CreateModuleInfoSO(0);
+ smart_objects::SmartObjectSPtr so = application_manager::MessageHelper::CreateModuleInfoSO(0);
application_manager::commands::CommandRequestImpl request(so);
EXPECT_CALL((*am), ManageMobileCommand(Truly(MessageResultCodeIsGENERIC_ERROR)));
request.onTimeOut();
diff --git a/src/components/application_manager/test/mobile_message_handler_test.cc b/src/components/application_manager/test/mobile_message_handler_test.cc
new file mode 100644
index 000000000..ec144826a
--- /dev/null
+++ b/src/components/application_manager/test/mobile_message_handler_test.cc
@@ -0,0 +1,53 @@
+/*
+ * 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 "gmock/gmock.h"
+#include "application_manager/mobile_message_handler.h"
+
+
+using ::testing::_;
+
+namespace application_manager {
+
+TEST(mobile_message_test, basic_test) {
+ // Example message
+ MobileMessage message = new application_manager::Message(
+ protocol_handler::MessagePriority::kDefault);
+ EXPECT_FALSE(message->has_binary_data());
+ BinaryData* binary_data = new BinaryData;
+ binary_data->push_back('X');
+ message->set_binary_data(binary_data);
+ EXPECT_TRUE(message->has_binary_data());
+}
+
+}
diff --git a/src/components/application_manager/test/mock/include/application_manager/application.h b/src/components/application_manager/test/mock/include/application_manager/application.h
index 5f1f59885..7b86b18d4 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/application.h
+++ b/src/components/application_manager/test/mock/include/application_manager/application.h
@@ -1,558 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_H_
-
-#include <string>
-#include <map>
-#include "utils/shared_ptr.h"
-#include "interfaces/MOBILE_API.h"
-#include "connection_handler/device.h"
-#include "application_manager/message.h"
-#include <set>
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
-
-namespace application_manager {
-
-namespace mobile_api = mobile_apis;
-
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-typedef int32_t ErrorCode;
-
-class UsageStatistics;
-
-enum APIVersion {
- kUnknownAPI = -1,
- kAPIV0 = 0,
- kAPIV1 = 1,
- kAPIV2 = 2,
- kAPIV3 = 3
-};
-
-enum TLimitSource {
- POLICY_TABLE = 0,
- CONFIG_FILE
-};
-
-
-struct Version {
- APIVersion min_supported_api_version;
- APIVersion max_supported_api_version;
-
- Version()
- : min_supported_api_version(APIVersion::kUnknownAPI),
- max_supported_api_version(APIVersion::kUnknownAPI) {
- }
-};
-
-struct AppFile {
- // need to use in std::map;
- AppFile() {
- }
- AppFile(const std::string& name, bool persistent, bool download_complete,
- mobile_apis::FileType::eType type)
- : file_name(name),
- is_persistent(persistent),
- is_download_complete(download_complete),
- file_type(type){
- }
- std::string file_name;
- bool is_persistent;
- bool is_download_complete;
- mobile_apis::FileType::eType file_type;
-};
-typedef std::map<std::string, AppFile> AppFilesMap;
-class InitialApplicationData {
- public:
- virtual ~InitialApplicationData() {
- }
-
- virtual const smart_objects::SmartObject* app_types() const = 0;
- virtual const smart_objects::SmartObject* vr_synonyms() const = 0;
- virtual const smart_objects::SmartObject* mobile_app_id() const = 0;
- virtual const smart_objects::SmartObject* tts_name() const = 0;
- 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 void set_app_types(const smart_objects::SmartObject& app_types) = 0;
- virtual void set_vr_synonyms(
- const smart_objects::SmartObject& vr_synonyms) = 0;
- virtual void set_mobile_app_id(
- const smart_objects::SmartObject& mobile_app_id) = 0;
- virtual void set_tts_name(const smart_objects::SmartObject& tts_name) = 0;
- virtual void set_ngn_media_screen_name(
- const smart_objects::SmartObject& ngn_name) = 0;
- virtual void set_language(const mobile_api::Language::eType& language) = 0;
- virtual void set_ui_language(
- const mobile_api::Language::eType& ui_language) = 0;
-};
-
-/*
- * @brief Typedef for supported commands in application menu
- */
-typedef std::map<uint32_t, smart_objects::SmartObject*> CommandsMap;
-
-/*
- * @brief Typedef for supported sub menu in application menu
- */
-typedef std::map<uint32_t, smart_objects::SmartObject*> SubMenuMap;
-
-/*
- * @brief Typedef for interaction choice set
- */
-typedef std::map<uint32_t, smart_objects::SmartObject*> ChoiceSetMap;
-
-/*
- * @brief Typedef for perform interaction choice set
- */
-typedef std::map<uint32_t, smart_objects::SmartObject*> PerformChoiceSetMap;
-
-/**
- * @brief Defines id of SoftButton
- */
-typedef std::set<uint32_t> SoftButtonID;
-
-class DynamicApplicationData {
- public:
- virtual ~DynamicApplicationData() {
- }
- virtual const smart_objects::SmartObject* help_prompt() const = 0;
- virtual const smart_objects::SmartObject* timeout_prompt() const = 0;
- virtual const smart_objects::SmartObject* vr_help_title() const = 0;
- virtual const smart_objects::SmartObject* vr_help() const = 0;
- virtual const mobile_api::TBTState::eType& tbt_state() const = 0;
- virtual const smart_objects::SmartObject* show_command() const = 0;
- virtual const smart_objects::SmartObject* tbt_show_command() const = 0;
- virtual const std::set<mobile_apis::ButtonName::eType>& SubscribedButtons() const = 0;
- virtual const std::set<uint32_t>& SubscribesIVI() 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 void set_help_prompt(
- const smart_objects::SmartObject& help_prompt) = 0;
- virtual void set_timeout_prompt(
- const smart_objects::SmartObject& timeout_prompt) = 0;
- virtual void set_vr_help_title(
- const smart_objects::SmartObject& vr_help_title) = 0;
- virtual void reset_vr_help_title() = 0;
- virtual void set_vr_help(const smart_objects::SmartObject& vr_help) = 0;
- virtual void reset_vr_help() = 0;
- virtual void set_tbt_state(const mobile_api::TBTState::eType& tbt_state) = 0;
- virtual void set_show_command(
- const smart_objects::SmartObject& show_command) = 0;
- virtual void set_tbt_show_command(
- const smart_objects::SmartObject& tbt_show) = 0;
- virtual void set_keyboard_props(
- const smart_objects::SmartObject& keyboard_props) = 0;
- virtual void set_menu_title(
- const smart_objects::SmartObject& menu_title) = 0;
- virtual void set_menu_icon(
- const smart_objects::SmartObject& menu_icon) = 0;
- /*
- * @brief Adds a command to the in application menu
- */
- virtual void AddCommand(uint32_t cmd_id,
- const smart_objects::SmartObject& command) = 0;
-
- /*
- * @brief Deletes all commands from the application
- * menu with the specified command id
- */
- virtual void RemoveCommand(uint32_t cmd_id) = 0;
-
- /*
- * @brief Finds command with the specified command id
- */
- virtual smart_objects::SmartObject* FindCommand(uint32_t cmd_id) = 0;
-
- /*
- * @brief Adds a menu to the application
- */
- virtual void AddSubMenu(uint32_t menu_id,
- const smart_objects::SmartObject& menu) = 0;
-
- /*
- * @brief Deletes menu from the application menu
- */
- virtual void RemoveSubMenu(uint32_t menu_id) = 0;
-
- /*
- * @brief Finds menu with the specified id
- */
- virtual smart_objects::SmartObject* FindSubMenu(
- uint32_t menu_id) const = 0;
-
- /*
- * @brief Returns true if sub menu with such name already exist
- */
- virtual bool IsSubMenuNameAlreadyExist(const std::string& name) = 0;
-
- /*
- * @brief Adds a interaction choice set to the application
- *
- * @param choice_set_id Unique ID used for this interaction choice set
- * @param choice_set SmartObject that represent choice set
- */
- virtual void AddChoiceSet(uint32_t choice_set_id,
- const smart_objects::SmartObject& choice_set) = 0;
-
- /*
- * @brief Deletes choice set from the application
- *
- * @param choice_set_id Unique ID of the interaction choice set
- */
- virtual void RemoveChoiceSet(uint32_t choice_set_id) = 0;
-
- /*
- * @brief Finds choice set with the specified choice_set_id id
- *
- * @param choice_set_id Unique ID of the interaction choice set
- */
- virtual smart_objects::SmartObject* FindChoiceSet(
- uint32_t choice_set_id) = 0;
-
- /*
- * @brief Adds perform interaction choice set to the application
- *
- * @param choice_set_id Unique ID used for this interaction choice set
- * @param choice_set SmartObject that represents choice set
- */
- virtual void AddPerformInteractionChoiceSet(
- uint32_t choice_set_id,
- const smart_objects::SmartObject& choice_set) = 0;
-
- /*
- * @brief Deletes entirely perform interaction choice set map
- *
- */
- virtual void DeletePerformInteractionChoiceSetMap() = 0;
-
- /*
- * @brief Retrieves entirely ChoiceSet - VR commands map
- *
- * @return ChoiceSet map that is currently in use
- */
- virtual const PerformChoiceSetMap&
- performinteraction_choice_set_map() const = 0;
-
- /*
- * @brief Retrieves choice set that is currently in use by perform
- * interaction
- *
- * @param choice_set_id Unique ID of the interaction choice set
- *
- * @return SmartObject that represents choice set
- */
- virtual smart_objects::SmartObject* FindPerformInteractionChoiceSet(
- uint32_t choice_set_id) const = 0;
-
- /*
- * @brief Retrieve application commands
- */
- virtual const CommandsMap& commands_map() const = 0;
-
- /*
- * @brief Retrieve application sub menus
- */
- virtual const SubMenuMap& sub_menu_map() const = 0;
-
- /*
- * @brief Retrieve application choice set map
- */
- virtual const ChoiceSetMap& choice_set_map() const = 0;
-
- /*
- * @brief Sets perform interaction state
- *
- * @param active Current state of the perform interaction
- */
- virtual void set_perform_interaction_active(uint32_t active) = 0;
-
- /*
- * @brief Retrieves perform interaction state
- *
- * @return TRUE if perform interaction active, otherwise FALSE
- */
- virtual uint32_t is_perform_interaction_active() const = 0;
-
- /*
- * @brief Sets the choice that was selected in
- * response to PerformInteraction
- *
- * @param choice Choice that was selected
- */
- virtual void set_perform_interaction_ui_corrid(uint32_t choice) = 0;
-
- /*
- * @brief Retrieve the choice that was selected in
- * response to PerformInteraction
- *
- * @return Choice that was selected in response to PerformInteraction
- */
- virtual uint32_t perform_interaction_ui_corrid() const = 0;
-
- /*
- * @brief Sets the mode for perform interaction: UI/VR/BOTH
- *
- * @param mode Mode that was selected (MENU; VR; BOTH)
- */
- virtual void set_perform_interaction_mode(int32_t mode) = 0;
-
- /*
- * @brief Retrieve the mode that was PerformInteraction sent in
- *
- * @return mode of PerformInteraction
- */
- virtual int32_t perform_interaction_mode() const = 0;
-
- /*
- * @brief Sets reset global properties state
- *
- * @param active Current state of the reset global properties
- */
- virtual void set_reset_global_properties_active(bool active) = 0;
-
- /*
- * @brief Retrieves reset global properties state
- *
- * @return TRUE if perform interaction active, otherwise FALSE
- */
- virtual bool is_reset_global_properties_active() const = 0;
-};
-
-class Application : public virtual InitialApplicationData,
- public virtual DynamicApplicationData {
- public:
- virtual ~Application() {
- }
-
- /**
- * @brief Returns message belonging to the application
- * that is currently executed (i.e. on HMI).
- * @return smart_objects::SmartObject * Active message
- */
- virtual const smart_objects::SmartObject* active_message() const = 0;
-
- /**
- * @brief Change Hash value and return it
- * @return next Hash value
- */
- virtual uint32_t nextHash() = 0;
-
- /**
- * @brief returns cuurent hash value
- * @return current Hash value
- */
- virtual uint32_t curHash() const = 0;
-
- /**
- * @brief Change Hash for current application
- * and send notification to mobile
- * @return updated_hash
- */
- virtual uint32_t UpdateHash() = 0;
-
- virtual void CloseActiveMessage() = 0;
- virtual bool IsFullscreen() const = 0;
- virtual bool MakeFullscreen() = 0;
- virtual bool IsAudible() const = 0;
- virtual void MakeNotAudible() = 0;
- virtual bool allowed_support_navigation() const = 0;
- virtual void set_allowed_support_navigation(bool allow) = 0;
- virtual bool hmi_supports_navi_video_streaming() const = 0;
- virtual void set_hmi_supports_navi_video_streaming(bool supports) = 0;
- virtual bool hmi_supports_navi_audio_streaming() const = 0;
- virtual void set_hmi_supports_navi_audio_streaming(bool supports) = 0;
-
- virtual bool is_voice_communication_supported() const = 0;
- virtual void set_voice_communication_supported(
- bool is_voice_communication_supported) = 0;
- virtual bool app_allowed() const = 0;
- virtual bool has_been_activated() const = 0;
-
- virtual const Version& version() const = 0;
- virtual void set_hmi_application_id(uint32_t hmi_app_id) = 0;
- virtual uint32_t hmi_app_id() const = 0;
- virtual uint32_t app_id() const = 0;
- virtual const std::string& name() const = 0;
- virtual const std::string folder_name() const = 0;
- virtual bool is_media_application() const = 0;
- virtual const mobile_api::HMILevel::eType& hmi_level() const = 0;
- virtual const uint32_t put_file_in_none_count() const = 0;
- virtual const uint32_t delete_file_in_none_count() const = 0;
- virtual const uint32_t list_files_in_none_count() const = 0;
- virtual const mobile_api::SystemContext::eType& system_context() const = 0;
- virtual const mobile_api::AudioStreamingState::eType&
- audio_streaming_state() const = 0;
- virtual const std::string& app_icon_path() const = 0;
- virtual connection_handler::DeviceHandle device() const = 0;
- virtual void set_tts_speak_state(bool state_tts_speak) = 0;
- virtual bool tts_speak_state() = 0;
- /**
- * @brief sets true if application has sent TTS GlobalProperties
- * request with empty array help_prompt to HMI with level
- * NONE BACKGROUND
- * @param active contains state of sending TTS GlobalProperties
- */
- virtual void set_tts_properties_in_none(
- bool active) = 0;
- /**
- * @brief returns true if application has sent TTS GlobalProperties
- * otherwise return false
- * @return flag tts_properties_in_none
- */
- virtual bool tts_properties_in_none() = 0;
- /**
- * @brief sets true if application has sent TTS GlobalProperties
- * request with default array help_prompt to HMI with level
- * FULL LIMITED
- * @param active contains state of sending TTS GlobalProperties
- */
- virtual void set_tts_properties_in_full(
- bool active) = 0;
- /**
- * @brief returns true if application has sent TTS GlobalProperties
- * otherwise return false
- * @return flag tts_properties_in_full
- */
- virtual bool tts_properties_in_full() = 0;
- virtual void set_version(const Version& version) = 0;
- virtual void set_name(const std::string& name) = 0;
- virtual void set_is_media_application(bool is_media) = 0;
- virtual void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) = 0;
- virtual void increment_put_file_in_none_count() = 0;
- virtual void increment_delete_file_in_none_count() = 0;
- virtual void increment_list_files_in_none_count() = 0;
- virtual void set_system_context(
- const mobile_api::SystemContext::eType& system_context) = 0;
- virtual void set_audio_streaming_state(
- const mobile_api::AudioStreamingState::eType& state) = 0;
- virtual bool set_app_icon_path(const std::string& file_name) = 0;
- virtual void set_app_allowed(const bool& allowed) = 0;
- virtual void set_device(connection_handler::DeviceHandle device) = 0;
- virtual uint32_t get_grammar_id() const = 0 ;
- virtual void set_grammar_id(uint32_t value) = 0;
-
- virtual void set_protocol_version(
- const ProtocolVersion& protocol_version) = 0;
- virtual ProtocolVersion protocol_version() const = 0;
-
- virtual bool AddFile(AppFile& file) = 0;
- virtual const AppFilesMap& getAppFiles() const = 0;
-
- /**
- * @brief Updates fields of existing file
- * @param file_name File name, that need to update
- * @param is_persistent Bollean describes is file persistent?
- * @param is_download_complete Bollean describes is file downloaded fully on need to finish downloading?
- * @return TRUE if file exist and updated sucsesfuly, othervise return false
- */
- virtual bool UpdateFile(AppFile& file) = 0;
- virtual bool DeleteFile(const std::string& file_name) = 0;
- virtual const AppFile* GetFile(const std::string& file_name) = 0;
-
- virtual bool SubscribeToButton(mobile_apis::ButtonName::eType btn_name) = 0;
- virtual bool IsSubscribedToButton(mobile_apis::ButtonName::eType btn_name) = 0;
- 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_) = 0;
- virtual bool UnsubscribeFromIVI(uint32_t vehicle_info_type_) = 0;
-
- /**
- * @brief Check, if limits for command number per time is exceeded
- * @param cmd_id Unique command id from mobile API
- * @param source Limits source, e.g. policy table, config file etc.
- * @return true, if - excedeed, otherwise - false
- */
- virtual bool IsCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
- TLimitSource source) = 0;
-
- /**
- * Returns object for recording statistics
- * @return object for recording statistics
- */
- virtual UsageStatistics& usage_report() = 0;
-
- /**
- * @brief Keeps id of softbuttons which is created in commands:
- * Alert, Show, ScrollableMessage, ShowConstantTBT, AlertManeuver, UpdateTurnList
- * @param cmd_id Unique command id from mobile API
- * @param list of softbuttons were created by command.
- */
- virtual void SubscribeToSoftButtons(int32_t cmd_id,
- const SoftButtonID& softbuttons_id) = 0;
-
- /**
- * @brief Determine the existence of softbutton
- * @param Softbutton_id contains id of softbutton
- * @return Returns true if application contains softbutton id otherwise returns false.
- */
- virtual bool IsSubscribedToSoftButton(const uint32_t softbutton_id) = 0;
-
- /**
- * @brief Removes list of softbuttons which is created in commands
- * @param cmd_id Unique command id from mobile API
- */
- virtual void UnsubscribeFromSoftButtons(int32_t cmd_id) = 0;
-
- /**
- * @brief Check's if it is media, voice communication or navigation application
- *
- * @return true if application is media, voice communication or navigation
- */
- virtual bool IsAudioApplication() const = 0;
-
- protected:
-
- // interfaces for NAVI retry sequence
- virtual bool video_stream_retry_active() const = 0;
- virtual void set_video_stream_retry_active(bool active) = 0;
- virtual bool audio_stream_retry_active() const = 0;
- virtual void set_audio_stream_retry_active(bool active) = 0;
- virtual void OnVideoStreamRetry() = 0;
- virtual void OnAudioStreamRetry() = 0;
-};
-
-typedef utils::SharedPtr<Application> ApplicationSharedPtr;
-typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_H_
+../../../../include/application_manager/application.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/application_data_impl.h b/src/components/application_manager/test/mock/include/application_manager/application_data_impl.h
index 556eee434..a53ea11d5 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/application_data_impl.h
+++ b/src/components/application_manager/test/mock/include/application_manager/application_data_impl.h
@@ -1,328 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_DATA_IMPL_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_DATA_IMPL_H_
-
-#include <string>
-#include "smart_objects/smart_object.h"
-#include "application_manager/application.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace mobile_api = mobile_apis;
-
-class InitialApplicationDataImpl : public virtual Application {
- public:
- InitialApplicationDataImpl();
- ~InitialApplicationDataImpl();
-
- const smart_objects::SmartObject* app_types() const;
- const smart_objects::SmartObject* vr_synonyms() const;
- const smart_objects::SmartObject* mobile_app_id() const;
- const smart_objects::SmartObject* tts_name() const;
- const smart_objects::SmartObject* ngn_media_screen_name() const;
- const mobile_api::Language::eType& language() const;
- const mobile_api::Language::eType& ui_language() 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 smart_objects::SmartObject& mobile_app_id);
- void set_tts_name(const smart_objects::SmartObject& tts_name);
- 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);
-
- protected:
- smart_objects::SmartObject* app_types_;
- smart_objects::SmartObject* vr_synonyms_;
- smart_objects::SmartObject* mobile_app_id_;
- smart_objects::SmartObject* tts_name_;
- smart_objects::SmartObject* ngn_media_screen_name_;
- mobile_api::Language::eType language_;
- mobile_api::Language::eType ui_language_;
- private:
- DISALLOW_COPY_AND_ASSIGN(InitialApplicationDataImpl);
-};
-
-class DynamicApplicationDataImpl : public virtual Application {
- public:
- DynamicApplicationDataImpl();
- ~DynamicApplicationDataImpl();
- const smart_objects::SmartObject* help_prompt() const;
- const smart_objects::SmartObject* timeout_prompt() const;
- const smart_objects::SmartObject* vr_help_title() const;
- const smart_objects::SmartObject* vr_help() const;
- const mobile_api::TBTState::eType& tbt_state() const;
- const smart_objects::SmartObject* show_command() const;
- const smart_objects::SmartObject* tbt_show_command() const;
- const smart_objects::SmartObject* keyboard_props() const;
- const smart_objects::SmartObject* menu_title() const;
- const smart_objects::SmartObject* menu_icon() const;
-
- void set_help_prompt(const smart_objects::SmartObject& help_prompt);
- void set_timeout_prompt(const smart_objects::SmartObject& timeout_prompt);
- void set_vr_help_title(const smart_objects::SmartObject& vr_help_title);
- void reset_vr_help_title();
- void set_vr_help(const smart_objects::SmartObject& vr_help);
- void reset_vr_help();
- void set_tbt_state(const mobile_api::TBTState::eType& tbt_state);
- void set_show_command(const smart_objects::SmartObject& show_command);
- void set_tbt_show_command(const smart_objects::SmartObject& tbt_show);
- 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);
- /*
- * @brief Adds a command to the in application menu
- */
- void AddCommand(uint32_t cmd_id,
- const smart_objects::SmartObject& command);
-
- /*
- * @brief Deletes all commands from the application menu with the specified command id
- */
- void RemoveCommand(uint32_t cmd_id);
-
- /*
- * @brief Finds command with the specified command id
- */
- smart_objects::SmartObject* FindCommand(uint32_t cmd_id);
-
- /*
- * @brief Adds a menu to the application
- */
- void AddSubMenu(uint32_t menu_id, const smart_objects::SmartObject& menu);
-
- /*
- * @brief Deletes menu from the application menu
- */
- void RemoveSubMenu(uint32_t menu_id);
-
- /*
- * @brief Finds menu with the specified id
- */
- smart_objects::SmartObject* FindSubMenu(uint32_t menu_id) const;
-
- /*
- * @brief Returns true if sub menu with such name already exist
- */
- bool IsSubMenuNameAlreadyExist(const std::string& name);
-
- /*
- * @brief Adds a interaction choice set to the application
- *
- * @param choice_set_id Unique ID used for this interaction choice set
- * @param choice_set SmartObject that represent choice set
- */
- void AddChoiceSet(uint32_t choice_set_id,
- const smart_objects::SmartObject& choice_set);
-
- /*
- * @brief Deletes choice set from the application
- *
- * @param choice_set_id Unique ID of the interaction choice set
- */
- void RemoveChoiceSet(uint32_t choice_set_id);
-
- /*
- * @brief Finds choice set with the specified choice_set_id id
- *
- * @param choice_set_id Unique ID of the interaction choice set
- */
- smart_objects::SmartObject* FindChoiceSet(uint32_t choice_set_id);
-
- /*
- * @brief Adds perform interaction choice set to the application
- *
- * @param choice_set_id Unique ID used for this interaction choice set
- * @param choice_set SmartObject that represents choice set
- */
- void AddPerformInteractionChoiceSet(
- uint32_t choice_set_id, const smart_objects::SmartObject& choice_set);
-
- /*
- * @brief Deletes entirely perform interaction choice set map
- *
- */
- void DeletePerformInteractionChoiceSetMap();
-
- /*
- * @brief Retrieves entirely ChoiceSet - VR commands map
- *
- * @return ChoiceSet map that is currently in use
- */
- inline const PerformChoiceSetMap& performinteraction_choice_set_map() const;
-
- /*
- * @brief Retrieves choice set that is currently in use by perform
- * interaction
- *
- * @param choice_set_id Unique ID of the interaction choice set
- *
- * @return SmartObject that represents choice set
- */
- smart_objects::SmartObject* FindPerformInteractionChoiceSet(
- uint32_t choice_set_id) const;
-
- /*
- * @brief Retrieve application commands
- */
- inline const CommandsMap& commands_map() const;
-
- /*
- * @brief Retrieve application sub menus
- */
- inline const SubMenuMap& sub_menu_map() const;
-
- /*
- * @brief Retrieve application choice set map
- */
- inline const ChoiceSetMap& choice_set_map() const;
-
- /*
- * @brief Sets perform interaction state
- *
- * @param active Current state of the perform interaction
- */
- void set_perform_interaction_active(uint32_t active);
-
- /*
- * @brief Retrieves perform interaction state
- *
- * @return TRUE if perform interaction active, otherwise FALSE
- */
- inline uint32_t is_perform_interaction_active() const;
-
- /*
- * @brief Sets the choice that was selected in
- * response to PerformInteraction
- *
- * @param choice Choice that was selected
- */
- void set_perform_interaction_ui_corrid(uint32_t corr_id);
-
- /*
- * @brief Retrieve the choice that was selected in
- * response to PerformInteraction
- *
- * @return Choice that was selected in response to PerformInteraction
- */
- inline uint32_t perform_interaction_ui_corrid() const;
- /*
- * @brief Sets the mode for perform interaction: UI/VR/BOTH
- *
- * @param mode Mode that was selected (MENU; VR; BOTH)
- */
- void set_perform_interaction_mode(int32_t mode);
-
- /*
- * @brief Retrieve the mode that was PerformInteraction sent in
- *
- * @return mode of PerformInteraction
- */
- inline int32_t perform_interaction_mode() const;
-
- /*
- * @brief Sets reset global properties state
- *
- * @param active Current state of the reset global properties
- */
- void set_reset_global_properties_active(bool active);
-
- /*
- * @brief Retrieves reset global properties state
- *
- * @return TRUE if perform interaction active, otherwise FALSE
- */
- inline bool is_reset_global_properties_active() const;
-
- protected:
- smart_objects::SmartObject* help_prompt_;
- smart_objects::SmartObject* timeout_prompt_;
- smart_objects::SmartObject* vr_help_title_;
- smart_objects::SmartObject* vr_help_;
- mobile_api::TBTState::eType tbt_state_;
- smart_objects::SmartObject* show_command_;
- smart_objects::SmartObject* keyboard_props_;
- smart_objects::SmartObject* menu_title_;
- smart_objects::SmartObject* menu_icon_;
- smart_objects::SmartObject* tbt_show_command_;
-
-
- CommandsMap commands_;
- SubMenuMap sub_menu_;
- ChoiceSetMap choice_set_map_;
- PerformChoiceSetMap performinteraction_choice_set_map_;
- uint32_t is_perform_interaction_active_;
- uint32_t perform_interaction_ui_corrid_;
- bool is_reset_global_properties_active_;
- int32_t perform_interaction_mode_;
- private:
- DISALLOW_COPY_AND_ASSIGN(DynamicApplicationDataImpl);
-};
-
-const CommandsMap& DynamicApplicationDataImpl::commands_map() const {
- return commands_;
-}
-
-const SubMenuMap& DynamicApplicationDataImpl::sub_menu_map() const {
- return sub_menu_;
-}
-
-const ChoiceSetMap& DynamicApplicationDataImpl::choice_set_map() const {
- return choice_set_map_;
-}
-
-uint32_t DynamicApplicationDataImpl::is_perform_interaction_active() const {
- return is_perform_interaction_active_;
-}
-
-uint32_t DynamicApplicationDataImpl::perform_interaction_ui_corrid() const {
- return perform_interaction_ui_corrid_;
-}
-
-bool DynamicApplicationDataImpl::is_reset_global_properties_active() const {
- return is_reset_global_properties_active_;
-}
-
-const PerformChoiceSetMap&
-DynamicApplicationDataImpl::performinteraction_choice_set_map() const {
- return performinteraction_choice_set_map_;
-}
-
-inline int32_t DynamicApplicationDataImpl::perform_interaction_mode() const {
- return perform_interaction_mode_;
-}
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_DATA_IMPL_H_
+../../../../include/application_manager/application_data_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/application_impl.h b/src/components/application_manager/test/mock/include/application_manager/application_impl.h
index dadfce092..838885790 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/application_impl.h
+++ b/src/components/application_manager/test/mock/include/application_manager/application_impl.h
@@ -1,286 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_IMPL_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_IMPL_H_
-
-#include <map>
-#include <set>
-#include <vector>
-#include <utility>
-
-#include "utils/date_time.h"
-#include "application_manager/application_data_impl.h"
-#include "application_manager/usage_statistics.h"
-#include "connection_handler/device.h"
-#include "utils/timer_thread.h"
-#include "utils/lock.h"
-
-namespace usage_statistics {
-class StatisticsManager;
-} // namespace usage_statistics
-
-namespace application_manager {
-namespace mobile_api = mobile_apis;
-
-class ApplicationImpl : public virtual InitialApplicationDataImpl,
- public virtual DynamicApplicationDataImpl {
- public:
- ApplicationImpl(uint32_t application_id,
- const std::string& mobile_app_id,
- const std::string& app_name,
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager);
-
- ~ApplicationImpl();
-
- /**
- * @brief Returns message belonging to the application
- * that is currently executed (i.e. on HMI).
- * @return smart_objects::SmartObject * Active message
- */
- const smart_objects::SmartObject* active_message() const;
- void CloseActiveMessage();
- bool IsFullscreen() const;
- bool MakeFullscreen();
- bool IsAudible() const;
- void MakeNotAudible();
-
- // navi
- bool allowed_support_navigation() const;
- void set_allowed_support_navigation(bool allow);
- bool hmi_supports_navi_video_streaming() const;
- void set_hmi_supports_navi_video_streaming(bool supports);
- bool hmi_supports_navi_audio_streaming() const;
- void set_hmi_supports_navi_audio_streaming(bool supports);
-
- virtual bool is_voice_communication_supported() const;
- virtual void set_voice_communication_supported(
- bool is_voice_communication_supported);
- inline bool app_allowed() const;
- bool has_been_activated() const;
-
- const Version& version() const;
- void set_hmi_application_id(uint32_t hmi_app_id);
- inline uint32_t hmi_app_id() const;
- inline uint32_t app_id() const;
- const std::string& name() const;
- const std::string folder_name() const;
- bool is_media_application() const;
- const mobile_api::HMILevel::eType& hmi_level() const;
- const uint32_t put_file_in_none_count() const;
- const uint32_t delete_file_in_none_count() const;
- const uint32_t list_files_in_none_count() const;
- const mobile_api::SystemContext::eType& system_context() const;
- inline const mobile_api::AudioStreamingState::eType&
- audio_streaming_state() const;
- const std::string& app_icon_path() const;
- connection_handler::DeviceHandle device() const;
- void set_tts_speak_state(bool state_tts_speak);
- bool tts_speak_state();
- void set_tts_properties_in_none(bool active);
- bool tts_properties_in_none();
- void set_tts_properties_in_full(bool active);
- bool tts_properties_in_full();
- void set_version(const Version& ver);
- void set_name(const std::string& name);
- void set_is_media_application(bool is_media);
- void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level);
- void increment_put_file_in_none_count();
- void increment_delete_file_in_none_count();
- void increment_list_files_in_none_count();
- void set_system_context(
- const mobile_api::SystemContext::eType& system_context);
- void set_audio_streaming_state(
- const mobile_api::AudioStreamingState::eType& state);
- bool set_app_icon_path(const std::string& path);
- void set_app_allowed(const bool& allowed);
- void set_device(connection_handler::DeviceHandle device);
- virtual uint32_t get_grammar_id() const;
- virtual void set_grammar_id(uint32_t value);
-
- virtual void set_protocol_version(const ProtocolVersion& protocol_version);
- virtual ProtocolVersion protocol_version() const;
-
- bool AddFile(AppFile& file);
- bool UpdateFile(AppFile& file);
-
- bool DeleteFile(const std::string& file_name);
- virtual const AppFilesMap& getAppFiles() const;
-
- virtual const AppFile* GetFile(const std::string& file_name);
-
- bool SubscribeToButton(mobile_apis::ButtonName::eType btn_name);
- bool IsSubscribedToButton(mobile_apis::ButtonName::eType btn_name);
- bool UnsubscribeFromButton(mobile_apis::ButtonName::eType btn_name);
-
- bool SubscribeToIVI(uint32_t vehicle_info_type_);
- bool IsSubscribedToIVI(uint32_t vehicle_info_type_);
- bool UnsubscribeFromIVI(uint32_t vehicle_info_type_);
-
- virtual const std::set<mobile_apis::ButtonName::eType>& SubscribedButtons() const;
- virtual const std::set<uint32_t>& SubscribesIVI() const;
-
- virtual uint32_t nextHash();
- virtual uint32_t curHash() const;
-
- /**
- * @brief Change Hash for current application
- * and send notification to mobile
- * @return updated_hash
- */
- virtual uint32_t UpdateHash();
-
- UsageStatistics& usage_report();
-
- bool IsCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
- TLimitSource source);
- virtual void SubscribeToSoftButtons(int32_t cmd_id,
- const SoftButtonID& softbuttons_id);
- virtual bool IsSubscribedToSoftButton(const uint32_t softbutton_id);
-
- virtual void UnsubscribeFromSoftButtons(int32_t cmd_id);
-
- /**
- * @brief Check's if it is media, voice communication or navigation application
- *
- * @return true if application is media, voice communication or navigation
- */
- virtual bool IsAudioApplication() const;
-
- protected:
-
- /**
- * @brief Clean up application folder. Persistent files will stay
- */
- void CleanupFiles();
-
- /**
- * @brief Load persistent files from application folder.
- */
- void LoadPersistentFiles();
-
- private:
-
- // interfaces for NAVI retry sequence
- bool video_stream_retry_active() const;
- void set_video_stream_retry_active(bool active);
- bool audio_stream_retry_active() const;
- void set_audio_stream_retry_active(bool active);
- void OnVideoStreamRetry();
- void OnAudioStreamRetry();
-
- uint32_t hash_val_;
- uint32_t grammar_id_;
-
-
- Version version_;
- std::string app_name_;
- uint32_t hmi_app_id_;
- uint32_t app_id_;
- smart_objects::SmartObject* active_message_;
- bool is_media_;
- bool allowed_support_navigation_;
- bool hmi_supports_navi_video_streaming_;
- bool hmi_supports_navi_audio_streaming_;
- bool is_app_allowed_;
- bool has_been_activated_;
- bool tts_speak_state_;
- bool tts_properties_in_none_;
- bool tts_properties_in_full_;
- mobile_api::HMILevel::eType hmi_level_;
- uint32_t put_file_in_none_count_;
- uint32_t delete_file_in_none_count_;
- uint32_t list_files_in_none_count_;
- mobile_api::SystemContext::eType system_context_;
- mobile_api::AudioStreamingState::eType audio_streaming_state_;
- std::string app_icon_path_;
- connection_handler::DeviceHandle device_;
-
- AppFilesMap app_files_;
- std::set<mobile_apis::ButtonName::eType> subscribed_buttons_;
- std::set<uint32_t> subscribed_vehicle_info_;
- UsageStatistics usage_report_;
- ProtocolVersion protocol_version_;
- bool is_voice_communication_application_;
-
- // NAVI retry stream
- volatile bool is_video_stream_retry_active_;
- volatile bool is_audio_stream_retry_active_;
- uint32_t video_stream_retry_number_;
- uint32_t audio_stream_retry_number_;
- utils::SharedPtr<timer::TimerThread<ApplicationImpl>> video_stream_retry_timer_;
- utils::SharedPtr<timer::TimerThread<ApplicationImpl>> audio_stream_retry_timer_;
-
-
- /**
- * @brief Defines number per time in seconds limits
- */
- typedef std::pair<TimevalStruct, uint32_t> TimeToNumberLimit;
-
- /**
- * @brief Defines specific command number per time in seconds limits
- */
- typedef std::map<mobile_apis::FunctionID::eType, TimeToNumberLimit>
- CommandNumberTimeLimit;
-
- /**
- * @brief Defines id of SoftButton which is related from name of command
- */
- typedef std::map<int32_t, SoftButtonID>
- CommandSoftButtonID;
- CommandNumberTimeLimit cmd_number_to_time_limits_;
- CommandSoftButtonID cmd_softbuttonid_;
- // Lock for command soft button id
- sync_primitives::Lock cmd_softbuttonid_lock_;
- DISALLOW_COPY_AND_ASSIGN(ApplicationImpl);
-};
-
-uint32_t ApplicationImpl::hmi_app_id() const {
- return hmi_app_id_;
-}
-
-uint32_t ApplicationImpl::app_id() const {
- return app_id_;
-}
-
-const mobile_api::AudioStreamingState::eType&
-ApplicationImpl::audio_streaming_state() const {
- return audio_streaming_state_;
-}
-
-bool ApplicationImpl::app_allowed() const {
- return is_app_allowed_;
-}
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_IMPL_H_
+../../../../include/application_manager/application_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/application_manager.h b/src/components/application_manager/test/mock/include/application_manager/application_manager.h
index 6ca85a5d3..d9f08e4c2 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/application_manager.h
+++ b/src/components/application_manager/test/mock/include/application_manager/application_manager.h
@@ -1,79 +1 @@
-/*
- * 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_APPLICATION_MANAGER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
-
-// Other compomnents class declaration
-namespace hmi_message_handler {
- class HMIMessageHandler;
-}
-namespace protocol_handler {
- class ProtocolHandler;
-}
-namespace connection_handler {
- class ConnectionHandler;
-}
-
-namespace application_manager {
-
-class Application;
-class HMIMatrix;
-
-class ApplicationManager {
- public:
- virtual ~ApplicationManager() {
- }
-
- /**
- * Inits application manager
- */
- virtual bool Init() = 0;
-
- /**
- * @brief Stop work.
- *
- * @return TRUE on success otherwise FALSE.
- **/
- virtual bool Stop() = 0;
-
- virtual void set_hmi_message_handler(
- hmi_message_handler::HMIMessageHandler* handler) = 0;
- virtual void set_protocol_handler(
- protocol_handler::ProtocolHandler* handler) = 0;
- virtual void set_connection_handler(
- connection_handler::ConnectionHandler* handler) = 0;
-};
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
+../../../../include/application_manager/application_manager.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h b/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h
index 85048477a..bc6a4e6ba 100644
--- a/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h
+++ b/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -46,7 +46,9 @@
#include "application_manager/request_controller.h"
#include "application_manager/resume_ctrl.h"
#include "application_manager/vehicle_info_data.h"
+#include "application_manager/state_controller.h"
#include "protocol_handler/protocol_observer.h"
+#include "protocol_handler/protocol_handler.h"
#include "hmi_message_handler/hmi_message_observer.h"
#include "hmi_message_handler/hmi_message_sender.h"
@@ -79,7 +81,7 @@
namespace application_manager {
enum VRTTSSessionChanging {
kVRSessionChanging = 0,
- kTTSSessionChanging = 1
+ kTTSSessionChanging
};
namespace impl {
@@ -133,6 +135,13 @@ typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToMobile> > To
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;
}
typedef std::vector<std::string> RPCParams;
@@ -142,6 +151,7 @@ class ApplicationManagerImpl : public ApplicationManager,
public connection_handler::ConnectionHandlerObserver,
public impl::FromMobileQueue::Handler, public impl::ToMobileQueue::Handler,
public impl::FromHmiQueue::Handler, public impl::ToHmiQueue::Handler,
+ public impl::AudioPassThruQueue::Handler,
public utils::Singleton<ApplicationManagerImpl> {
friend class ResumeCtrl;
@@ -164,12 +174,14 @@ class ApplicationManagerImpl : public ApplicationManager,
MOCK_METHOD3(OnServiceStartedCallback, bool (const connection_handler::DeviceHandle&,
const int32_t&,
const protocol_handler::ServiceType&));
- MOCK_METHOD2(OnServiceEndedCallback, void (const int32_t&,
- const protocol_handler::ServiceType&));
+ MOCK_METHOD3(OnServiceEndedCallback, void (const int32_t&,
+ const protocol_handler::ServiceType&,
+ const connection_handler::CloseSessionReason&));
MOCK_METHOD1(Handle, void (const impl::MessageFromMobile));
MOCK_METHOD1(Handle, void (const impl::MessageToMobile));
MOCK_METHOD1(Handle, void (const impl::MessageFromHmi));
MOCK_METHOD1(Handle, void (const impl::MessageToHmi));
+ MOCK_METHOD1(Handle, void (const impl::AudioData));
//ApplicationManager methods
MOCK_METHOD1(set_hmi_message_handler, void (hmi_message_handler::HMIMessageHandler*));
@@ -177,11 +189,13 @@ class ApplicationManagerImpl : public ApplicationManager,
MOCK_METHOD1(set_connection_handler, void (connection_handler::ConnectionHandler*));
//ApplicationManagerImpl methods:
-
+#ifdef TIME_TESTER
MOCK_METHOD1(SetTimeMetricObserver, void(AMMetricObserver*));
+#endif
MOCK_METHOD1(RegisterApplication,
ApplicationSharedPtr(const utils::SharedPtr<smart_objects::SmartObject>&));
MOCK_METHOD0(hmi_capabilities, HMICapabilities& ());
+ MOCK_METHOD1(ProcessQueryApp, void (const smart_objects::SmartObject& sm_object));
MOCK_METHOD1(ManageHMICommand, bool (const utils::SharedPtr<smart_objects::SmartObject>&));
MOCK_METHOD1(ManageMobileCommand, bool (const utils::SharedPtr<smart_objects::SmartObject>& message));
MOCK_METHOD1(SendMessageToHMI, bool (const utils::SharedPtr<smart_objects::SmartObject>&));
@@ -189,17 +203,18 @@ class ApplicationManagerImpl : public ApplicationManager,
bool));
MOCK_METHOD1(SendMessageToMobile, bool (const utils::SharedPtr<smart_objects::SmartObject>&));
MOCK_METHOD1(GetDeviceName, std::string (connection_handler::DeviceHandle));
+ MOCK_METHOD1(GetDeviceTransportType, hmi_apis::Common_TransportType::eType (const std::string&));
MOCK_METHOD1(application, ApplicationSharedPtr (uint32_t));
MOCK_METHOD1(application_by_policy_id, ApplicationSharedPtr (const std::string&));
MOCK_METHOD1(RemoveAppDataFromHMI, bool(ApplicationSharedPtr));
MOCK_METHOD1(HeadUnitReset, void(mobile_api::AppInterfaceUnregisteredReason::eType));
- MOCK_METHOD0(HeadUnitSuspend, void());
MOCK_METHOD1(LoadAppDataToHMI, bool(ApplicationSharedPtr));
MOCK_METHOD1(ActivateApplication, bool (ApplicationSharedPtr));
- MOCK_METHOD1(PutApplicationInFull, mobile_api::HMILevel::eType (ApplicationSharedPtr));
+ MOCK_METHOD1(IsHmiLevelFullAllowed, mobile_api::HMILevel::eType (ApplicationSharedPtr));
+ MOCK_METHOD3(OnHMILevelChanged, void (uint32_t, mobile_apis::HMILevel::eType, mobile_apis::HMILevel::eType));
MOCK_METHOD2(UnregisterRevokedApplication, void(uint32_t, mobile_apis::Result::eType));
MOCK_METHOD1(SetUnregisterAllApplicationsReason, void(mobile_api::AppInterfaceUnregisteredReason::eType));
- MOCK_METHOD1(UnregisterAllApplications, void(bool));
+ MOCK_METHOD0(UnregisterAllApplications, void());
MOCK_METHOD0(connection_handler, connection_handler::ConnectionHandler*());
MOCK_METHOD0(protocol_handler, protocol_handler::ProtocolHandler*());
MOCK_METHOD0(hmi_message_handler, hmi_message_handler::HMIMessageHandler*());
@@ -229,8 +244,14 @@ class ApplicationManagerImpl : public ApplicationManager,
MOCK_METHOD1(ReplaceHMIByMobileAppId, void(smart_objects::SmartObject&));
MOCK_METHOD1(ReplaceMobileByHMIAppId, void(smart_objects::SmartObject&));
MOCK_METHOD0(resume_controller, ResumeCtrl&());
- MOCK_METHOD1(IsVideoStreamingAllowed, bool(uint32_t));
- MOCK_METHOD1(IsAudioStreamingAllowed, bool(uint32_t));
+ MOCK_METHOD1(GetDefaultHmiLevel, mobile_api::HMILevel::eType (ApplicationSharedPtr));
+
+ MOCK_METHOD2(HMILevelAllowsStreaming, bool(uint32_t, protocol_handler::ServiceType));
+ MOCK_METHOD2(CanAppStream, bool(uint32_t, protocol_handler::ServiceType));
+ MOCK_METHOD1(EndNaviServices, void(int32_t));
+ MOCK_METHOD1(ForbidStreaming, void(int32_t));
+ MOCK_METHOD3(OnAppStreaming, void(int32_t, protocol_handler::ServiceType, bool));
+
MOCK_METHOD1(Unmute, void(VRTTSSessionChanging));
MOCK_METHOD1(Mute, void(VRTTSSessionChanging));
MOCK_METHOD2(set_application_id, void(const int32_t, const uint32_t));
@@ -238,8 +259,26 @@ class ApplicationManagerImpl : public ApplicationManager,
MOCK_METHOD1(removeNotification, void(const commands::Command*));
MOCK_METHOD1(addNotification, void(const CommandSharedPtr ));
MOCK_METHOD0(StartDevicesDiscovery, void());
- MOCK_METHOD2(SendAudioPassThroughNotification, void(uint32_t, std::vector<uint8_t>));
+ MOCK_METHOD2(SendAudioPassThroughNotification, void(uint32_t, std::vector<uint8_t>&));
MOCK_METHOD1(set_all_apps_allowed, void(const bool));
+ MOCK_METHOD4(CreateRegularState, HmiStatePtr (uint32_t, mobile_api::HMILevel::eType,
+ mobile_apis::AudioStreamingState::eType,
+ mobile_apis::SystemContext::eType));
+
+ template<bool SendActivateApp>
+ MOCK_METHOD2(SetState, void(uint32_t, HmiState));
+ template<bool SendActivateApp>
+ MOCK_METHOD2(SetState, void(uint32_t, mobile_api::HMILevel::eType));
+ template<bool SendActivateApp>
+ MOCK_METHOD3(SetState, void(uint32_t, mobile_api::HMILevel::eType,
+ mobile_apis::AudioStreamingState::eType));
+ template<bool SendActivateApp>
+ MOCK_METHOD4(SetState, void(uint32_t, mobile_api::HMILevel::eType,
+ mobile_apis::AudioStreamingState::eType,
+ mobile_apis::SystemContext::eType));
+ MOCK_METHOD2(SetState, void(uint32_t,
+ mobile_apis::AudioStreamingState::eType));
+
MOCK_CONST_METHOD0(all_apps_allowed, bool());
MOCK_METHOD1(set_vr_session_started, void(const bool));
MOCK_CONST_METHOD0(vr_session_started, bool());
@@ -252,6 +291,7 @@ class ApplicationManagerImpl : public ApplicationManager,
MOCK_METHOD0(OnTimerSendTTSGlobalProperties, void());
MOCK_METHOD0(CreatePhoneCallAppList, void());
MOCK_METHOD0(ResetPhoneCallAppList, void());
+ MOCK_METHOD2(ChangeAppsHMILevel, void(uint32_t, mobile_apis::HMILevel::eType));
MOCK_METHOD1(AddAppToTTSGlobalPropertiesList, void(const uint32_t));
MOCK_METHOD1(RemoveAppFromTTSGlobalPropertiesList, void(const uint32_t));
MOCK_METHOD1(application_by_hmi_app, ApplicationSharedPtr(uint32_t));
@@ -260,16 +300,58 @@ class ApplicationManagerImpl : public ApplicationManager,
bool));
MOCK_METHOD4(UnregisterApplication, void(const uint32_t,mobile_apis::Result::eType,
bool, bool));
+ MOCK_METHOD1(OnAppUnauthorized, void(const uint32_t&));
MOCK_CONST_METHOD0(get_limited_media_application, ApplicationSharedPtr());
MOCK_CONST_METHOD0(get_limited_navi_application, ApplicationSharedPtr());
MOCK_CONST_METHOD0(get_limited_voice_application, ApplicationSharedPtr());
- MOCK_CONST_METHOD1(DoesAudioAppWithSameHMITypeExistInFullOrLimited, bool(ApplicationSharedPtr));
+ MOCK_CONST_METHOD1(IsAppTypeExistsInFullOrLimited, bool(ApplicationSharedPtr));
MOCK_CONST_METHOD0(active_application, ApplicationSharedPtr ());
MOCK_METHOD0(OnApplicationListUpdateTimer, void());
+ MOCK_METHOD0(OnLowVoltage, void());
+ MOCK_METHOD0(OnWakeUp, void());
+ MOCK_METHOD1(OnUpdateHMIAppType, void(std::map<std::string, std::vector<std::string> >));
+ MOCK_METHOD3(set_state, void(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType,
+ mobile_apis::AudioStreamingState::eType));
+MOCK_CONST_METHOD0(IsStopping, bool());
+
+ struct ApplicationsAppIdSorter {
+ bool operator() (const ApplicationSharedPtr lhs,
+ const ApplicationSharedPtr rhs) {
+ return lhs->app_id() < rhs->app_id();
+ }
+ };
+
+ // typedef for Applications list
+ typedef std::set<ApplicationSharedPtr,
+ ApplicationsAppIdSorter> ApplictionSet;
+
+ // typedef for Applications list iterator
+ typedef ApplictionSet::iterator ApplictionSetIt;
+
+ // typedef for Applications list const iterator
+ typedef ApplictionSet::const_iterator ApplictionSetConstIt;
+
+
+ /**
+ * Class for thread-safe access to applications list
+ */
+ class ApplicationListAccessor: public DataAccessor<ApplictionSet> {
+ public:
+ ApplicationListAccessor() :
+ DataAccessor<ApplictionSet>(ApplictionSet(),sync_primitives::Lock()) {
+ }
+ MOCK_CONST_METHOD0(applications, const ApplictionSet());
+ MOCK_METHOD0(begin, ApplictionSetConstIt());
+ MOCK_METHOD0(end, ApplictionSetConstIt());
+ MOCK_METHOD1(Erase, void(ApplicationSharedPtr));
+ MOCK_METHOD1(Insert, void(ApplicationSharedPtr));
+ MOCK_METHOD0(Empty, bool());
+ };
+
+ friend class ApplicationListAccessor;
+
- typedef const std::set<ApplicationSharedPtr> TAppList;
- typedef std::set<ApplicationSharedPtr>::iterator TAppListIt;
- typedef std::set<ApplicationSharedPtr>::const_iterator TAppListConstIt;
class ApplicationListUpdateTimer : public timer::TimerThread<ApplicationManagerImpl> {
public:
ApplicationListUpdateTimer(ApplicationManagerImpl* callee) :
@@ -280,16 +362,10 @@ class ApplicationManagerImpl : public ApplicationManager,
};
typedef utils::SharedPtr<ApplicationListUpdateTimer> ApplicationListUpdateTimerSptr;
- class ApplicationListAccessor {
- public:
- MOCK_METHOD0(applications, TAppList());
- private:
- };
- friend class ApplicationListAccessor;
private:
//FIXME(AKutsan) In resume_controller is is nessesery to change realisation for remove using application_list_
- std::set<ApplicationSharedPtr> application_list_;
+ ApplictionSet application_list_;
FRIEND_BASE_SINGLETON_CLASS(ApplicationManagerImpl);
};
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command.h b/src/components/application_manager/test/mock/include/application_manager/commands/command.h
index 587c3d834..07b2c0796 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/command.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/command.h
@@ -1,117 +1 @@
-/**
- 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_COMMAND_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_H_
-
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/event_engine/event_observer.h"
-#include "application_manager/smart_object_keys.h"
-
-namespace application_manager {
-/**
- * @brief SmartObject type
- **/
-
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-typedef utils::SharedPtr<smart_objects::SmartObject> MessageSharedPtr;
-
-namespace commands {
-
-/**
- * @brief Base command class
- **/
-class Command {
- public:
- /**
- * @brief Checks command permissions according to policy table
- */
- virtual bool CheckPermissions() = 0;
-
- /**
- * @brief Command initialization function
- **/
- virtual bool Init() = 0;
-
- /**
- * @brief Execute command
- **/
- virtual void Run() = 0;
-
- /**
- * @brief Free resources
- **/
- virtual bool CleanUp() = 0;
-
- /**
- * \brief Command class destructor
- **/
- virtual ~Command() {}
-
- /**
- * @brief Retrieves request default timeout.
- * If request has a custom timeout, request_timeout_ should be reassign to it
- *
- * @return Request default timeout
- */
- virtual uint32_t default_timeout() const = 0;
-
- /*
- * @brief Retrieves correlation ID
- */
- virtual uint32_t correlation_id() const = 0;
-
- /*
- * @brief Retrieves connection_key
- */
- virtual uint32_t connection_key() const = 0;
-
- /*
- * @brief Retrieves request ID
- */
- virtual int32_t function_id() const = 0;
-
- /*
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- *
- */
- virtual void onTimeOut() = 0;
-
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_H_
+../../../../../include/application_manager/commands/command.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command_impl.h b/src/components/application_manager/test/mock/include/application_manager/commands/command_impl.h
index a34716bd6..eb9e9576d 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/command_impl.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/command_impl.h
@@ -1,140 +1 @@
-/**
- 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_COMMAND_IMPL_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_IMPL_H_
-
-#include "application_manager/commands/command.h"
-#include "utils/logger.h"
-
-namespace application_manager {
-
-/**
- * @brief Contains command parameters permissions (if any) defined in policy
- * table
- */
-struct CommandParametersPermissions {
- std::vector<std::string> allowed_params;
- std::vector<std::string> disallowed_params;
- std::vector<std::string> undefined_params;
-};
-
-namespace commands {
-
-/**
- * @brief Class is intended to encapsulate RPC as an object
- **/
-class CommandImpl : public Command {
- public:
- /**
- * @brief CommandImpl class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit CommandImpl(const MessageSharedPtr& message);
-
- /**
- * @brief CommandImpl class destructor
- *
- **/
- virtual ~CommandImpl();
-
- /**
- * @brief Checks command permissions according to policy table
- */
- virtual bool CheckPermissions();
-
- /**
- * @brief Init required by command resources
- **/
- virtual bool Init();
-
- /**
- * @brief Cleanup all resources used by command
- **/
- virtual bool CleanUp();
-
- /**
- * @brief Execute corresponding command by calling the action on reciever
- **/
- virtual void Run();
-
- /**
- * @brief Retrieves request default timeout.
- * If request has a custom timeout, request_timeout_ should be reassign to it
- *
- * @return Request default timeout
- */
- virtual uint32_t default_timeout() const;
-
- /*
- * @brief Retrieves correlation ID
- */
- virtual uint32_t correlation_id() const;
-
- /*
- * @brief Retrieves connection key
- */
- virtual uint32_t connection_key() const;
-
- /*
- * @brief Retrieves request ID
- */
- virtual int32_t function_id() const;
-
- /*
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- *
- */
- virtual void onTimeOut();
-
- // members
- static const int32_t hmi_protocol_type_;
- static const int32_t mobile_protocol_type_;
- static const int32_t protocol_version_;
-
- protected:
- MessageSharedPtr message_;
- uint32_t default_timeout_;
-
-#ifdef ENABLE_LOG
- static log4cxx::LoggerPtr logger_;
-#endif // ENABLE_LOG
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CommandImpl);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_IMPL_H_
+../../../../../include/application_manager/commands/command_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_from_mobile_impl.h b/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_from_mobile_impl.h
new file mode 120000
index 000000000..1e3d6f0af
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_from_mobile_impl.h
@@ -0,0 +1 @@
+../../../../../include/application_manager/commands/command_notification_from_mobile_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_impl.h b/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_impl.h
index 7d0d11af8..2b946196d 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_impl.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_impl.h
@@ -1,64 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_NOTIFICATION_IMPL_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_NOTIFICATION_IMPL_H_
-
-#include "application_manager/commands/command_impl.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
-
-namespace application_manager {
-
-namespace commands {
-
-class CommandNotificationImpl : public CommandImpl {
- public:
- explicit CommandNotificationImpl(const MessageSharedPtr& message);
- virtual ~CommandNotificationImpl();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
- void SendNotification();
- private:
- DISALLOW_COPY_AND_ASSIGN(CommandNotificationImpl);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_NOTIFICATION_IMPL_H_
+../../../../../include/application_manager/commands/command_notification_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command_request_impl.h b/src/components/application_manager/test/mock/include/application_manager/commands/command_request_impl.h
index 1bbba5aa0..953008ead 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/command_request_impl.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/command_request_impl.h
@@ -1,191 +1 @@
-/**
- 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_COMMAND_REQUEST_IMPL_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_IMPL_H_
-
-#include "application_manager/commands/command_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/lock.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
-
-namespace application_manager {
-namespace commands {
-
-namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
-
-class CommandRequestImpl : public CommandImpl,
- public event_engine::EventObserver {
- public:
-
- enum RequestState {
- kAwaitingHMIResponse = 0,
- kTimedOut,
- kCompleted
- };
-
- explicit CommandRequestImpl(const MessageSharedPtr& message);
- virtual ~CommandRequestImpl();
- virtual bool CheckPermissions();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
-
- /*
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- *
- */
- virtual void onTimeOut();
-
- /**
- * @brief Default EvenObserver's pure virtual method implementation
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- /*
- * @brief Creates Mobile response
- *
- * @param success true if successful; false, if failed
- * @param result_code Result code (SUCCESS, INVALID_DATA, e.t.c)
- * @param info Provides additional human readable info regarding the result
- * @param response_params Additional params in response
- */
- void SendResponse(const bool success,
- const mobile_apis::Result::eType& result_code,
- const char* info = NULL,
- const NsSmart::SmartObject* response_params = NULL);
-
- /**
- * @brief Check syntax of string from mobile
- * @param str - string that need to be checked
- * @param allow_empty_string if true methods allow empty sting
- * @return true if success otherwise return false
- */
- bool CheckSyntax(std::string str, bool allow_empty_line = false);
-
- /*
- * @brief Sends HMI request
- *
- * @param function_id HMI request ID
- * @param msg_params HMI request msg params
- * @param use_events true if we need subscribe on event(HMI request)
- *
- */
- void SendHMIRequest(const hmi_apis::FunctionID::eType& function_id,
- const NsSmart::SmartObject* msg_params = NULL,
- bool use_events = false);
-
- /*
- * @brief Creates HMI request
- *
- * @param function_id HMI request ID
- * @param msg_params HMI request msg params
- */
- void CreateHMINotification(const hmi_apis::FunctionID::eType& function_id,
- const NsSmart::SmartObject& msg_params) const;
-
- /**
- * @brief Converts HMI result code to Mobile result code
- *
- * @param hmi_code HMI result code
- * @return Mobile result code
- */
- mobile_apis::Result::eType GetMobileResultCode(
- const hmi_apis::Common_Result::eType& hmi_code) const;
-
-protected:
-
- /**
- * @brief Checks message permissions and parameters according to policy table
- * permissions
- */
- bool CheckAllowedParameters();
-
- /**
- * @brief Remove from current message parameters disallowed by policy table
- * @param params_permissions Parameters permissions from policy table
- */
- void RemoveDisallowedParameters(
- const CommandParametersPermissions& params_permissions);
-
- /**
- * @brief Adds disallowed parameters back to response with appropriate
- * reasons
- * @param response Response message, which should be extended with blocked
- * parameters reasons
- */
- void AddDisallowedParameters(smart_objects::SmartObject& response);
-
- /**
- * @brief Checks if any request param was marked as disallowed by policy
- * @return true if any param was marked as disallowed
- */
- bool HasDisallowedParams() const;
-
- protected:
- RequestState current_state_;
- sync_primitives::Lock state_lock_;
- CommandParametersPermissions parameters_permissions_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CommandRequestImpl);
-
-
- /**
- * @brief Adds param to disallowed parameters enumeration
- * @param info string with disallowed params enumeration
- * @param param disallowed param
- */
- void AddDissalowedParameterToInfoString(std::string& info,
- const std::string& param) const;
-
- /**
- * @brief Adds disallowed parameters to response info
- * @param response Response message, which info should be extended
- */
- void AddDisallowedParametersToInfo(smart_objects::SmartObject& response) const;
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_IMPL_H_
+../../../../../include/application_manager/commands/command_request_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command_response_impl.h b/src/components/application_manager/test/mock/include/application_manager/commands/command_response_impl.h
index 0c93bf54d..71136ecbf 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/command_response_impl.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/command_response_impl.h
@@ -1,68 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_RESPONSE_IMPL_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_RESPONSE_IMPL_H_
-
-#include "application_manager/commands/command_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
-
-namespace application_manager {
-
-namespace commands {
-
-class CommandResponseImpl : public CommandImpl {
- public:
- explicit CommandResponseImpl(const MessageSharedPtr& message);
- virtual ~CommandResponseImpl();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
- void SendResponse(bool successe,
- const mobile_apis::Result::eType& result_code =
- mobile_apis::Result::INVALID_ENUM,
- bool final_message = false);
- private:
- DISALLOW_COPY_AND_ASSIGN(CommandResponseImpl);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_RESPONSE_IMPL_H_
+../../../../../include/application_manager/commands/command_response_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_request.h
index 3495ce137..5ebc42567 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_request.h
@@ -1,79 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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, event_engine::EventObserver {
- public:
- /**
- * @brief ActivateAppRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit ActivateAppRequest(const MessageSharedPtr& message);
-
- /**
- * @brief Calback for response
- *
- * @param event - event response
- **/
- virtual void on_event(const event_engine::Event& event);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/activate_app_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_response.h
index 1df9bc095..74e0b401a 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit ActivateAppResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/activate_app_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/add_statistics_info_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/add_statistics_info_notification.h
index 1569af434..0a68ef8aa 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/add_statistics_info_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/add_statistics_info_notification.h
@@ -1,72 +1 @@
-/**
- * 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
- **/
- explicit AddStatisticsInfoNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/add_statistics_info_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_request.h
index 6c2db489c..f110d5596 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit AllowAllAppsRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/allow_all_apps_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_response.h
index 0eb8184fa..5d81eebc0 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit AllowAllAppsResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/allow_all_apps_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_request.h
index 91228440a..4674c5625 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit AllowAppRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/allow_app_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_response.h
index 5a24ac1a7..a972bbe3f 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit AllowAppResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/allow_app_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h
new file mode 120000
index 000000000..a7f0223e3
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h
@@ -0,0 +1 @@
+../../../../../../include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_request.h
index d066df813..4190191f1 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit BasicCommunicationSystemRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/basic_communication_system_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_response.h
index 1948211c4..62e9bdbac 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit BasicCommunicationSystemResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/basic_communication_system_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_request.h
index 3c9fbac68..826259176 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit ButtonGetCapabilitiesRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/button_get_capabilities_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_response.h
index 067954537..8ca8d9282 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit ButtonGetCapabilitiesResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/button_get_capabilities_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_request.h
index 72ff8a2c5..bac5ced3b 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit ClosePopupRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/close_popup_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_response.h
index 05318e3cb..607da1f8b 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit ClosePopupResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/close_popup_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_request.h
index 8cb34718a..45a17a4c4 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit GetSystemInfoRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/get_system_info_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_response.h
index f10c07c52..dd46df23e 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief GetSystemInfoResponse command class
- **/
-class GetSystemInfoResponse : public ResponseFromHMI {
- public:
- /**
- * @brief GetSystemInfoResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit GetSystemInfoResponse(const MessageSharedPtr& message);
-
- /**
- * @brief GetSystemInfoResponse class destructor
- **/
- virtual ~GetSystemInfoResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- 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_
+../../../../../../include/application_manager/commands/hmi/get_system_info_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls.h
index 924144667..68789b0a5 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls.h
@@ -1,70 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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"
-
-namespace application_manager {
-namespace commands {
-
-/**
- * @brief GetUrls command class
- **/
-class GetUrls : public RequestFromHMI {
- public:
- /**
- * @brief GetUrls class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit GetUrls(const MessageSharedPtr& message);
-
- /**
- * @brief GetUrls class destructor
- **/
- virtual ~GetUrls();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetUrls);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
+../../../../../../include/application_manager/commands/hmi/get_urls.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls_response.h
index 6b025142e..b76a19d07 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls_response.h
@@ -1,67 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit GetUrlsResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/get_urls_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_request.h
index 905b5b383..73c501170 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit MixingAudioSupportedRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/mixing_audio_supported_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_response.h
index c8bfe4e15..041b46c65 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit MixingAudioSupportedResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/mixing_audio_supported_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_request.h
index 1e2a39df9..9b879237e 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit NaviAlertManeuverRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_alert_maneuver_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_response.h
index 41e0f623f..4ed6ec165 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit NaviAlertManeuverResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_alert_maneuver_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_request.h
index a321d32dd..0c83f540a 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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:
- /**
- * @brief AudioStartStreamRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit AudioStartStreamRequest(const MessageSharedPtr& message);
-
- /**
- * @brief OnNaviStartStreamRequest class destructor
- **/
- virtual ~AudioStartStreamRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- 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_
+../../../../../../include/application_manager/commands/hmi/navi_audio_start_stream_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_response.h
index 01992eb3b..fd9ca2d59 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_response.h
@@ -1,71 +1 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit AudioStartStreamResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_audio_start_stream_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h
index 04bba8b75..3b9a69ee3 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h
@@ -1,71 +1 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit AudioStopStreamRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_audio_stop_stream_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h
index 7275ac34d..46c13499c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h
@@ -1,71 +1 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit AudioStopStreamResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_audio_stop_stream_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_request.h
index a31efc7fe..beff169e8 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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:
- /**
- * @brief NaviIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit NaviIsReadyRequest(const MessageSharedPtr& message);
-
- /**
- * @brief NaviIsReadyRequest class destructor
- **/
- virtual ~NaviIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviIsReadyRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVIGATION_IS_READY_REQUEST_H_
+../../../../../../include/application_manager/commands/hmi/navi_is_ready_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_response.h
index 0fbad3515..e1c9b1266 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit NaviIsReadyResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_is_ready_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_request.h
index 9c91df648..c3f11a798 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- */
- explicit NaviSendLocationRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_send_location_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_response.h
index 029d90319..8728efe1e 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- */
- explicit NaviSendLocationResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_send_location_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h
index 5da47e580..82bb72563 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit NaviShowConstantTBTRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_show_constant_tbt_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h
index 4a26b26b0..116c2428d 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit NaviShowConstantTBTResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_show_constant_tbt_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_request.h
index f43b99221..9f6e2036f 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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:
- /**
- * @brief NaviStartStreamRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit NaviStartStreamRequest(const MessageSharedPtr& message);
-
- /**
- * @brief OnNaviStartStreamRequest class destructor
- **/
- virtual ~NaviStartStreamRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- 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_
+../../../../../../include/application_manager/commands/hmi/navi_start_stream_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_response.h
index c94b6f219..788f569dd 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_response.h
@@ -1,71 +1 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit NaviStartStreamResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_start_stream_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_request.h
index 86b0981c2..433340adb 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_request.h
@@ -1,71 +1 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit NaviStopStreamRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_stop_stream_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_response.h
index 6f4986e4c..501556537 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_response.h
@@ -1,71 +1 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit NaviStopStreamResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_stop_stream_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_request.h
index 61beef1b3..2d8888a1b 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit NaviUpdateTurnListRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_update_turn_list_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_response.h
index 9e711b8be..37f5dcf4b 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit NaviUpdateTurnListResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/navi_update_turn_list_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_from_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_from_hmi.h
index 219306d37..d2fb7da95 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_from_hmi.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_from_hmi.h
@@ -1,69 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class CSmartObject;
-}
-}
-
-namespace application_manager {
-
-namespace commands {
-
-namespace NsSmartObj = NsSmartDeviceLink::NsSmartObjects;
-
-class NotificationFromHMI : public CommandImpl {
- public:
- explicit NotificationFromHMI(const MessageSharedPtr& message);
- 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 NsSmartObj::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_
+../../../../../../include/application_manager/commands/hmi/notification_from_hmi.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_to_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_to_hmi.h
index 2372754b6..cd2036c6c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_to_hmi.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_to_hmi.h
@@ -1,58 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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:
- explicit NotificationToHMI(const MessageSharedPtr& message);
- 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_
+../../../../../../include/application_manager/commands/hmi/notification_to_hmi.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h
index aa549638e..7088e0977 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnAllowSDLFunctionalityNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_activated_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_activated_notification.h
index a8bdeb6c9..e3dee8333 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_activated_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_activated_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnAppActivatedNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_app_activated_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_deactivated_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_deactivated_notification.h
index 4c56dc415..3db5068c2 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_deactivated_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_deactivated_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnAppDeactivatedNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_app_deactivated_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_changed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_changed_notification.h
index 034efb7a8..698c66aee 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_changed_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_changed_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnAppPermissionChangedNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_app_permission_changed_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_consent_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_consent_notification.h
index a5037820c..4feacfd69 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_consent_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_consent_notification.h
@@ -1,72 +1 @@
-/**
- * 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
- **/
- explicit OnAppPermissionConsentNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_app_permission_consent_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_registered_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_registered_notification.h
index 4364aa9a3..8c6b32f1b 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_registered_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_registered_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnAppRegisteredNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_app_registered_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_unregistered_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_unregistered_notification.h
index d8470af39..e5a5bc23c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_unregistered_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_unregistered_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnAppUnregisteredNotification(const MessageSharedPtr& message);
-
- /**
- * @brief OnAppUnregisteredNotification class destructor
- **/
- virtual ~OnAppUnregisteredNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- 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_
+../../../../../../include/application_manager/commands/hmi/on_app_unregistered_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_event_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_event_notification.h
index a4657ea24..5276b6e20 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_event_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_event_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnButtonEventNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_button_event_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_press_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_press_notification.h
index 065cdc4a7..89460e876 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_press_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_press_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnButtonPressNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_button_press_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_subscription_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_subscription_notification.h
new file mode 120000
index 000000000..f35c69137
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_subscription_notification.h
@@ -0,0 +1 @@
+../../../../../../include/application_manager/commands/hmi/on_button_subscription_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_chosen_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_chosen_notification.h
index e980bfe41..3cceadabd 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_chosen_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_chosen_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnDeviceChosenNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_device_chosen_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_state_changed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_state_changed_notification.h
index 5c12bdfd9..87c152730 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_state_changed_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_state_changed_notification.h
@@ -1,72 +1 @@
-/**
- * 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
- **/
- explicit OnDeviceStateChangedNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_device_state_changed_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_driver_distraction_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_driver_distraction_notification.h
index 77da5cf3b..8d7b4e999 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_driver_distraction_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_driver_distraction_notification.h
@@ -1,78 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnDriverDistractionNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_driver_distraction_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_emergency_event_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_emergency_event_notification.h
new file mode 120000
index 000000000..4458ec502
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_emergency_event_notification.h
@@ -0,0 +1 @@
+../../../../../../include/application_manager/commands/hmi/on_emergency_event_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_all_applications_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_all_applications_notification.h
index c913509e5..482ae7154 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_all_applications_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_all_applications_notification.h
@@ -1,78 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_EXIT_ALL_APPLICATIONS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_ALL_APPLICATIONS_REQUEST_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
- **/
- explicit OnExitAllApplicationsNotification(const MessageSharedPtr& message);
-
- /**
- * @brief OnExitAllApplicationsNotification class destructor
- **/
- virtual ~OnExitAllApplicationsNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- 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_EXIT_ALL_APPLICATIONS_REQUEST_H_
+../../../../../../include/application_manager/commands/hmi/on_exit_all_applications_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_application_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_application_notification.h
index b78c0e2af..ebe9dc9b9 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_application_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_application_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_EXIT_APPLICATION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_APPLICATION_REQUEST_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
- **/
- explicit OnExitApplicationNotification(const MessageSharedPtr& message);
-
- /**
- * @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_EXIT_APPLICATION_REQUEST_H_
+../../../../../../include/application_manager/commands/hmi/on_exit_application_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_file_removed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_file_removed_notification.h
index b6b46041f..bec80bf2c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_file_removed_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_file_removed_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnFileRemovedNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_file_removed_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_find_applications.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_find_applications.h
index 2499129b2..5c427c883 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_find_applications.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_find_applications.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_LIST_UPDATED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_LIST_UPDATED_NOTIFICATION_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
- **/
- explicit OnFindApplications(const MessageSharedPtr& message);
-
- /**
- * @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_DEVICE_LIST_UPDATED_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/hmi/on_find_applications.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h
index ed0638f3c..8caf1afa5 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h
@@ -1,74 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnIgnitionCycleOverNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h
index 6e42e1a0c..2ef1136e2 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnNaviTBTClientStateNotification command class
- **/
-class OnNaviTBTClientStateNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnNaviTBTClientStateNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnNaviTBTClientStateNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_phone_call_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_phone_call_notification.h
index 45d831eb0..4ab1c9986 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_phone_call_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_phone_call_notification.h
@@ -1,77 +1 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_PHONE_CALL_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PHONE_CALL_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-
-/**
- * @brief OnPhoneCallNotification command class
- **/
-class OnPhoneCallNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnPhoneCallNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnPhoneCallNotification(const MessageSharedPtr& message);
-
- /**
- * @brief OnPhoneCallNotification class destructor
- **/
- virtual ~OnPhoneCallNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnPhoneCallNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PHONE_CALL_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/hmi/on_phone_call_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_play_tone_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_play_tone_notification.h
index 8e463c327..21fd85dac 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_play_tone_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_play_tone_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_PLAY_TONE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PLAY_TONE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnPlayToneNotification command class
- **/
-class OnPlayToneNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnPlayToneNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnPlayToneNotification(const MessageSharedPtr& message);
-
- /**
- * @brief OnPlayToneNotification class destructor
- **/
- virtual ~OnPlayToneNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnPlayToneNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PLAY_TONE_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/hmi/on_play_tone_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_policy_update.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_policy_update.h
index f71de540e..fb8c782b8 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_policy_update.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_policy_update.h
@@ -1,66 +1 @@
-/**
- * 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
- **/
- explicit OnPolicyUpdate(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_policy_update.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_put_file_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_put_file_notification.h
index 839af785b..61c4005e4 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_put_file_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_put_file_notification.h
@@ -1,74 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnPutFileNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_put_file_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ready_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ready_notification.h
index a3e2dd731..735af4237 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ready_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ready_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnReadyNotification command class
- **/
-class OnReadyNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnReadyNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnReadyNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_ready_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_received_policy_update.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_received_policy_update.h
index 38a4470d2..c53f1ce65 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_received_policy_update.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_received_policy_update.h
@@ -1,69 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnReceivedPolicyUpdate(const MessageSharedPtr& message);
-
- /**
- * @brief OnReceivedPolicyUpdate class destructor
- **/
- virtual ~OnReceivedPolicyUpdate();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- 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_
+../../../../../../include/application_manager/commands/hmi/on_received_policy_update.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_record_start_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_record_start_notification.h
index 81f0b5bdd..733827254 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_record_start_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_record_start_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnRecordStartdNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_record_start_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_resume_audio_source_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_resume_audio_source_notification.h
index c27e2e5ee..f7b6f6bba 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_resume_audio_source_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_resume_audio_source_notification.h
@@ -1,74 +1 @@
-/**
- * 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
- **/
- explicit OnResumeAudioSourceNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_resume_audio_source_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_close_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_close_notification.h
index e6b4418d6..a8cd1db47 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_close_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_close_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnSDLCloseNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_sdl_close_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h
index c9b93a4dc..531002efa 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnSDLConsentNeededNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h
index 5da06ef34..2a8c51814 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnSDLPersistenceCompleteNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_start_device_discovery.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_start_device_discovery.h
index 3e4dc1daf..459d55684 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_start_device_discovery.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_start_device_discovery.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_START_DEVICE_DISCOVERY_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_START_DEVICE_DISCOVERY_REQUEST_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
- **/
- explicit OnStartDeviceDiscovery(const MessageSharedPtr& message);
-
- /**
- * @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_START_DEVICE_DISCOVERY_REQUEST_H_
+../../../../../../include/application_manager/commands/hmi/on_start_device_discovery.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_status_update_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_status_update_notification.h
index ae85d1371..5304b2fcb 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_status_update_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_status_update_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_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
- **/
- explicit OnStatusUpdateNotification(const MessageSharedPtr& message);
-
- /**
- * @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_SDL_GET_STATUS_UPDATE_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/hmi/on_status_update_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_context_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_context_notification.h
index b16df6069..4403b0fc9 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_context_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_context_notification.h
@@ -1,77 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnSystemContextNotification(const MessageSharedPtr& message);
-
- /**
- * @brief OnSystemContextNotification class destructor
- **/
- virtual ~OnSystemContextNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- void SendSystemContextNotification(ApplicationSharedPtr app,
- mobile_api::SystemContext::eType system_context);
-
- 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_
+../../../../../../include/application_manager/commands/hmi/on_system_context_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_error_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_error_notification.h
index cb3fc1201..861208997 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_error_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_error_notification.h
@@ -1,72 +1 @@
-/**
- * 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
- **/
- explicit OnSystemErrorNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_system_error_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_info_changed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_info_changed_notification.h
index d0bcadfaa..9bfb39bb8 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_info_changed_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_info_changed_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnSystemInfoChangedNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_system_info_changed_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_request_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_request_notification.h
index 6e3a0eea7..923cbe795 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_request_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_request_notification.h
@@ -1,74 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnSystemRequestNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_system_request_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_language_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_language_change_notification.h
index d9b55ac0c..2ad7fd628 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_language_change_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_language_change_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnTTSLanguageChangeNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_tts_language_change_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h
index 3bafc920b..e91f381a0 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h
@@ -1,76 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnTTSResetTimeoutNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_started_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_started_notification.h
index 8cb625607..c5c748cec 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_started_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_started_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnTTSStartedNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_tts_started_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_stopped_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_stopped_notification.h
index 31fb6fb31..d40bc7ffb 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_stopped_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_stopped_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnTTSStoppedNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_tts_stopped_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_command_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_command_notification.h
index 1d0aaf307..86b7591eb 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_command_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_command_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnUICommandNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_ui_command_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h
index bb0a6a72d..04873772d 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h
@@ -1,77 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.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
- **/
- explicit OnUIKeyBoardInputNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_language_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_language_change_notification.h
index 85b8f60c4..419745c08 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_language_change_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_language_change_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnUILanguageChangeNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_ui_language_change_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h
index 511606d07..3a68034b3 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h
@@ -1,76 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnUIResetTimeoutNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_touch_event_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_touch_event_notification.h
index 3231d1ca2..86531d491 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_touch_event_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_touch_event_notification.h
@@ -1,77 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.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
- **/
- explicit OnUITouchEventNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_ui_touch_event_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_update_device_list.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_update_device_list.h
index c0d355c92..2a6c0c4ac 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_update_device_list.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_update_device_list.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnUpdateDeviceList(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_update_device_list.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h
index 04bb3e54b..35f259dd5 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIAccPedalPositionNotification command class
- **/
-class OnVIAccPedalPositionNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIAccPedalPositionNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIAccPedalPositionNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_belt_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_belt_status_notification.h
index 3cfb048cd..2ca86120d 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_belt_status_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_belt_status_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIBeltStatusNotification command class
- **/
-class OnVIBeltStatusNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIBeltStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIBeltStatusNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_belt_status_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_body_information_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_body_information_notification.h
index b9ecf5a34..c0ff7d8c2 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_body_information_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_body_information_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIBodyInformationNotification command class
- **/
-class OnVIBodyInformationNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIBodyInformationNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIBodyInformationNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_body_information_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_device_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_device_status_notification.h
index 925989e8c..4f32e2153 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_device_status_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_device_status_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIDeviceStatusNotification command class
- **/
-class OnVIDeviceStatusNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIDeviceStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIDeviceStatusNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_device_status_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h
index 7baea9065..01fc3fdf4 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIDriverBrakingNotification command class
- **/
-class OnVIDriverBrakingNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIDriverBrakingNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIDriverBrakingNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_driver_braking_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h
index 33dd824c6..a2f074b76 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIEngineTorqueNotification command class
- **/
-class OnVIEngineTorqueNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIEngineTorqueNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIEngineTorqueNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_engine_torque_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h
index 207302a37..aef5bd913 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIExternalTemperatureNotification command class
- **/
-class OnVIExternalTemperatureNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIExternalTemperatureNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIExternalTemperatureNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_external_temperature_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h
index 535758db2..1f63c652b 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIFuelLevelNotification command class
- **/
-class OnVIFuelLevelNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIFuelLevelNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIFuelLevelNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_fuel_level_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h
index 92dffd89b..2f8a4a8aa 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIFuelLevelStateNotification command class
- **/
-class OnVIFuelLevelStateNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIFuelLevelStateNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIFuelLevelStateNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_gps_data_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_gps_data_notification.h
index d8f2a768f..9fcf1f980 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_gps_data_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_gps_data_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIGpsDataNotification command class
- **/
-class OnVIGpsDataNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIGpsDataNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIGpsDataNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_gps_data_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h
index 47802e97e..c837834b4 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIHeadLampStatusNotification command class
- **/
-class OnVIHeadLampStatusNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIHeadLampStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIHeadLampStatusNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h
index fe3841298..bdbbf718b 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIInstantFuelConsumptionNotification command class
- **/
-class OnVIInstantFuelConsumptionNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIInstantFuelConsumptionNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIInstantFuelConsumptionNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_my_key_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_my_key_notification.h
index d636b6e77..d1d9ed76b 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_my_key_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_my_key_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIMyKeyNotification command class
- **/
-class OnVIMyKeyNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIMyKeyNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIMyKeyNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_my_key_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_odometer_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_odometer_notification.h
index 1cf4c2587..d1b371506 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_odometer_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_odometer_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIOdometerNotification command class
- **/
-class OnVIOdometerNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIOdometerNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIOdometerNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_odometer_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_prndl_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_prndl_notification.h
index 5a3a13637..1e5fe3c22 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_prndl_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_prndl_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIPrndlNotification command class
- **/
-class OnVIPrndlNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIPrndlNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIPrndlNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_prndl_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_rpm_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_rpm_notification.h
index 80dea2a6e..1be92ae38 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_rpm_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_rpm_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIRpmNotification command class
- **/
-class OnVIRpmNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIRpmNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIRpmNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_rpm_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_speed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_speed_notification.h
index 19bffabf4..6ed9e5a22 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_speed_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_speed_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVISpeedNotification command class
- **/
-class OnVISpeedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVISpeedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVISpeedNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_speed_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h
index 0826cb6c6..7dbf52e86 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVISteeringWheelAngleNotification command class
- **/
-class OnVISteeringWheelAngleNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVISteeringWheelAngleNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVISteeringWheelAngleNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h
index ba8eceefc..d86bd602c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVITirePressureNotification command class
- **/
-class OnVITirePressureNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVITirePressureNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVITirePressureNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h
index 30ad9d6ac..a86015d35 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h
@@ -1,74 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.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
- **/
- explicit OnVIVehicleDataNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vin_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vin_notification.h
index 0cb5fb17d..4d055a2db 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vin_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vin_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIVinNotification command class
- **/
-class OnVIVinNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIVinNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIVinNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_vin_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h
index c7a1a6bd6..0de802fea 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIWiperStatusNotification command class
- **/
-class OnVIWiperStatusNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIWiperStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnVIWiperStatusNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vi_wiper_status_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_command_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_command_notification.h
index 677bc2672..ca58b0c54 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_command_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_command_notification.h
@@ -1,74 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnVRCommandNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vr_command_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_language_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_language_change_notification.h
index 24c60c32d..0ee1334d1 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_language_change_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_language_change_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnVRLanguageChangeNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vr_language_change_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_started_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_started_notification.h
index cc78f010b..3ad1e6a4c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_started_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_started_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnVRStartedNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vr_started_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_stopped_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_stopped_notification.h
index 2ee8ad429..b230685cf 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_stopped_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_stopped_notification.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit OnVRStoppedNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/on_vr_stopped_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_from_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_from_hmi.h
index 39ebd9581..cc64e0435 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_from_hmi.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_from_hmi.h
@@ -1,66 +1 @@
- /**
- 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"
-
- namespace NsSmartDeviceLink {
- namespace NsSmartObjects {
- class SmartObject;
- }
- }
-
- namespace application_manager {
-
- namespace commands {
-
- namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
-
- class RequestFromHMI : public CommandImpl {
- public:
- explicit RequestFromHMI(const MessageSharedPtr& message);
- virtual ~RequestFromHMI();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
-
- 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_
+../../../../../../include/application_manager/commands/hmi/request_from_hmi.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_to_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_to_hmi.h
index 3a9de4b7b..8f4f9bfc6 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_to_hmi.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_to_hmi.h
@@ -1,67 +1 @@
-/**
- 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"
-
-namespace application_manager {
-
-namespace commands {
-
-
-class RequestToHMI : public CommandImpl {
- public:
- explicit RequestToHMI(const MessageSharedPtr& message);
- 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_
+../../../../../../include/application_manager/commands/hmi/request_to_hmi.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_from_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_from_hmi.h
index 21497a133..7352ba503 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_from_hmi.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_from_hmi.h
@@ -1,77 +1 @@
-/**
- 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 "interfaces/HMI_API.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
-
-namespace application_manager {
-
-namespace commands {
-
-namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
-
-class ResponseFromHMI : public CommandImpl {
- public:
- explicit ResponseFromHMI(const MessageSharedPtr& message);
- virtual ~ResponseFromHMI();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
- void SendResponseToMobile(const MessageSharedPtr& message);
-
- /*
- * @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 NsSmart::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_
+../../../../../../include/application_manager/commands/hmi/response_from_hmi.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_to_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_to_hmi.h
index ce9e9469d..eea5e5252 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_to_hmi.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_to_hmi.h
@@ -1,67 +1 @@
-
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
-
-namespace application_manager {
-
-namespace commands {
-
-namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
-
-class ResponseToHMI : public CommandImpl {
- public:
- explicit ResponseToHMI(const MessageSharedPtr& message);
- 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_
+../../../../../../include/application_manager/commands/hmi/response_to_hmi.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_request.h
index db4a93b0b..dbd292757 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_request.h
@@ -1,71 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLActivateAppRequest command class
- **/
-class SDLActivateAppRequest : public RequestFromHMI {
- public:
- /**
- * @brief SDLActivateAppRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit SDLActivateAppRequest(const MessageSharedPtr& message);
-
- /**
- * @brief SDLActivateAppRequest class destructor
- **/
- virtual ~SDLActivateAppRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- 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_
+../../../../../../include/application_manager/commands/hmi/sdl_activate_app_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_response.h
index 63adc6c0d..359281f71 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_response.h
@@ -1,71 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit SDLActivateAppResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/sdl_activate_app_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h
index 5da473b1a..852f46c8e 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h
@@ -1,71 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_LIST_OF_PERMISSIONS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_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
- **/
- explicit SDLGetListOfPermissionsRequest(const MessageSharedPtr& message);
-
- /**
- * @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_GET_LIST_OF_PERMISSIONS_REQUEST_H_
+../../../../../../include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h
index 5de9fc0ea..aabab692d 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_LIST_OF_PERMISSIONS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_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
- **/
- explicit SDLGetListOfPermissionsResponse(const MessageSharedPtr& message);
-
- /**
- * @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_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
+../../../../../../include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_request.h
index a098e0a11..19aea33e8 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_request.h
@@ -1,71 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit SDLGetStatusUpdateRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/sdl_get_status_update_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_response.h
index 6299cde63..2b8a3579e 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_response.h
@@ -1,71 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit SDLGetStatusUpdateResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/sdl_get_status_update_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h
index b729a1617..a7de55033 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h
@@ -1,71 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_USER_FRIENDLY_MESSAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLGetUserFriendlyMessageRequest command class
- **/
-class SDLGetUserFriendlyMessageRequest : public RequestFromHMI {
- public:
- /**
- * @brief SDLGetUserFriendlyMessageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit SDLGetUserFriendlyMessageRequest(const MessageSharedPtr& message);
-
- /**
- * @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_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
+../../../../../../include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h
index bb7a7f8e2..888023b1c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_USER_FRIENDLY_MESSAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_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
- **/
- explicit SDLGetUserFriendlyMessageResponse(const MessageSharedPtr& message);
-
- /**
- * @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_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
+../../../../../../include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update.h
index ee2b9865c..fce6df879 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update.h
@@ -1,63 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit SDLPolicyUpdate(const MessageSharedPtr& message);
- virtual ~SDLPolicyUpdate();
- /**
- * @brief Execute command
- **/
- virtual void Run();
- 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_
+../../../../../../include/application_manager/commands/hmi/sdl_policy_update.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update_response.h
index b6ab925fd..32c5d5c9d 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update_response.h
@@ -1,69 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit SDLPolicyUpdateResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/sdl_policy_update_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_request.h
index a587af950..07988fae1 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSChangeRegistrationRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_change_registration_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_response.h
index 3a9e9fda5..a3f6db17e 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSChangeRegistratioResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_change_registration_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_request.h
index 73edd9de7..bf50cc1ea 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSGetCapabilitiesRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_get_capabilities_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_response.h
index 71f85d68e..2b3a1013e 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSGetCapabilitiesResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_get_capabilities_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_request.h
index 94e38ec47..11363e063 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSGetLanguageRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_get_language_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_response.h
index bd67d64f3..a60f44c46 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSGetLanguageResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_get_language_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_request.h
index ff80dd238..f3f6d9766 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSGetSupportedLanguagesRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_get_supported_languages_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_response.h
index 244f22346..855129ba9 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSGetSupportedLanguagesResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_get_supported_languages_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_request.h
index dc58d852e..76a09f344 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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:
- /**
- * @brief TTSIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit TTSIsReadyRequest(const MessageSharedPtr& message);
-
- /**
- * @brief TTSIsReadyRequest class destructor
- **/
- virtual ~TTSIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- 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_
+../../../../../../include/application_manager/commands/hmi/tts_is_ready_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_response.h
index 375e5a5d1..42e69db57 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSIsReadyResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_is_ready_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_request.h
index b398e0b2d..6ec0b44a6 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSSetGlobalPropertiesRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_set_global_properties_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_response.h
index adf0b7027..006774292 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSSetGlobalPropertiesResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_set_global_properties_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_request.h
index 326c638f4..09dd90b89 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_request.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSSpeakRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_speak_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_response.h
index e22c54987..af8a6598f 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_response.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSSpeakResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_speak_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_request.h
index 0d82121fd..8d32593fd 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSStopSpeakingRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_stop_speaking_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_response.h
index b9055bfbe..d8cec177c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit TTSStopSpeakingResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/tts_stop_speaking_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_request.h
index ffd6eeeef..7c8ecca06 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIAddCommandRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_add_command_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_response.h
index f84b71d0f..c48d437da 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIAddCommandResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_add_command_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_request.h
index 1227de046..07ed92389 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIAddSubmenuRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_add_submenu_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_response.h
index 1b3a10729..1fb095cc4 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIAddSubmenuResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_add_submenu_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_request.h
index 7395eb19e..576c8967a 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIAlertRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_alert_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_response.h
index 1d17d9809..78b58a1b2 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIAlertResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_alert_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_request.h
index 51276b7b0..ae2a74d2a 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIChangeRegistrationRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_change_registration_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_response.h
index edb7574e8..4a207b3ea 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIChangeRegistratioResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_change_registration_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_request.h
index 398f78c28..cd7898653 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIDeleteCommandRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_delete_command_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_response.h
index bb1981190..0421c44fa 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIDeleteCommandResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_delete_command_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_request.h
index 1b3747234..4afa03981 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIDeleteSubmenuRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_delete_submenu_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_response.h
index 8bbab9946..4374dea7c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIDeleteSubmenuResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_delete_submenu_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h
index 9e8e11c1a..c19af2221 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIEndAudioPassThruRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h
index 740fc5501..20a9a7ff1 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIEndAudioPassThruResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_request.h
index 2d0469d6a..c999d31f2 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIGetCapabilitiesRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_get_capabilities_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_response.h
index dc6052e04..4d8267f2d 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIGetCapabilitiesResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_get_capabilities_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_request.h
index 4fca4826b..b5a3e9840 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIGetLanguageRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_get_language_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_response.h
index ea43e3856..e06614fba 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIGetLanguageResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_get_language_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_request.h
index cc0e70fea..90bedce44 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIGetSupportedLanguagesRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_get_supported_languages_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_response.h
index 15e400687..ae94b347b 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIGetSupportedLanguagesResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_get_supported_languages_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_request.h
index 5e2cb7ef9..53e9aadbb 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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:
- /**
- * @brief UIIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit UIIsReadyRequest(const MessageSharedPtr& message);
-
- /**
- * @brief UIIsReadyRequest class destructor
- **/
- virtual ~UIIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- 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_
+../../../../../../include/application_manager/commands/hmi/ui_is_ready_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_response.h
index bc7210f2a..b2e926541 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIIsReadyResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_is_ready_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h
index 94bc4827a..8255ac277 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIPerformAudioPassThruRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h
index 04afedfba..3b2607185 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIPerformAudioPassThruResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_request.h
index 0d6313943..668e39563 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIPerformInteractionRequest(const MessageSharedPtr& message);
-
- /**
- * @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_CREATE_INTERACTION_SET_REQUEST_H_
+../../../../../../include/application_manager/commands/hmi/ui_perform_interaction_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_response.h
index 32a87c73c..30e74367b 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIPerformInteractionResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_perform_interaction_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_request.h
index 6f23d3b21..c554acc31 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIScrollableMessageRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_scrollable_message_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_response.h
index 7bf15a051..e5bb7ab1b 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIScrollableMessageResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_scrollable_message_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_request.h
new file mode 120000
index 000000000..d79aae3c4
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_request.h
@@ -0,0 +1 @@
+../../../../../../include/application_manager/commands/hmi/ui_set_app_icon_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_response.h
new file mode 120000
index 000000000..d961f29dc
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_app_icon_response.h
@@ -0,0 +1 @@
+../../../../../../include/application_manager/commands/hmi/ui_set_app_icon_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_request.h
index 7e67912f5..f4d379ef2 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_request.h
@@ -1,71 +1 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UiSetDisplayLayoutRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_set_display_layout_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_response.h
index 74df2030e..e09307f1e 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UiSetDisplayLayoutResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_set_display_layout_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_request.h
index f3f7d0e73..09760bc97 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UISetGlobalPropertiesRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_set_global_properties_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_response.h
index bc00397e3..7975cd942 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UISetGlobalPropertiesResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_set_global_properties_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_request.h
index 1541aada6..8d3d93549 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UISetIconRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_set_icon_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_response.h
index f125f6428..6415eaf20 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit 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_
+../../../../../../include/application_manager/commands/hmi/ui_set_icon_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h
index 44cbbbfcf..65d9c7fbd 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UISetMediaClockTimerRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h
index dd46f128d..3035e4f46 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UISetMediaClockTimerResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_request.h
index 6f22263e6..5669790e2 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIShowRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_show_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_response.h
index a6391fa6c..22d0aab4a 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UIShowResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_show_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_request.h
index 5cb31b4a9..bc7ee7f1b 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UISliderRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_slider_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_response.h
index aae5408e2..b630730e4 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UISliderResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/ui_slider_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_request.h
index d2307232e..28a8e0103 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_request.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UpdateAppListRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
-
+../../../../../../include/application_manager/commands/hmi/update_app_list_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_response.h
index 3e6a1d78a..11af15734 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UpdateAppListResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/update_app_list_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_request.h
index e9a32e9fc..bf55fd6c4 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_request.h
@@ -1,92 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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_DEVICE_LIST_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_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
- **/
- explicit UpdateDeviceListRequest(const MessageSharedPtr& message);
-
- /**
- * @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_GET_DEVICE_LIST_REQUEST_H_
+../../../../../../include/application_manager/commands/hmi/update_device_list_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_response.h
index d4191c8be..87653d8d0 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UpdateDeviceListResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/update_device_list_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_request.h
index 506c13786..116a6c36c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateSDLRequest command class
- **/
-class UpdateSDLRequest : public RequestToHMI {
- public:
- /**
- * @brief UpdateSDLRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit UpdateSDLRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/update_sdl_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_response.h
index 729483cfa..d12d01f24 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit UpdateSDLResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/update_sdl_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_request.h
index 90e1e145c..d11b2d66c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VIDiagnosticMessageRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_diagnostic_message_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_response.h
index f332a3281..a9874fb19 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VIDiagnosticMessageResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_diagnostic_message_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_request.h
index 93f046d7d..5e5516e66 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VIGetDTCsRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_get_dtcs_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_response.h
index 9ee7fac44..378b95743 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VIGetDTCsResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_get_dtcs_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h
index 9cb964981..2dde6fcea 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VIGetVehicleDataRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_get_vehicle_data_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h
index 951bf0c33..abc1bbb91 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define HMI_VI_GETBSCRIBE_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
- **/
- explicit VIGetVehicleDataRequestTemplate(const MessageSharedPtr& message)
- : RequestToHMI(message) {
- }
-
- /**
- * @brief Execute command with sending DBus thin request to HMI
- **/
- virtual void Run() {
- LOG4CXX_INFO(logger_, "VIGetVehicleDataRequestTemplate::Run");
- SendRequest();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataRequestTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+../../../../../../include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h
index 952b0fb4d..0f5636732 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIGetVehicleDataResponse command class
- **/
-class VIGetVehicleDataResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIGetVehicleDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit VIGetVehicleDataResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_get_vehicle_data_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h
index ecd465365..cbde6eb30 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h
@@ -1,73 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_RESPONSE_H_
-#define HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_RESPONSE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/response_from_hmi.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
- **/
- explicit VIGetVehicleDataResponseTemplate(const MessageSharedPtr& message)
- : ResponseFromHMI(message) {
- }
-
- /**
- * @brief Execute command
- **/
- virtual void Run() {
- LOG4CXX_INFO(logger_, "VIGetVehicleDataResponseTemplate::Run");
- event_engine::Event event(eventID);
- event.set_smart_object(*message_);
- event.raise();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataResponseTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_RESPONSE_H_
+../../../../../../include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h
index 876f7d2e5..534638fb6 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VIGetVehicleTypeRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_get_vehicle_type_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h
index 8b632182f..d346b466c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VIGetVehicleTypeResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_get_vehicle_type_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_request.h
index e905cf4c0..2b345707b 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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:
- /**
- * @brief VIIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit VIIsReadyRequest(const MessageSharedPtr& message);
-
- /**
- * @brief VIIsReadyRequest class destructor
- **/
- virtual ~VIIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- 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_
+../../../../../../include/application_manager/commands/hmi/vi_is_ready_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_response.h
index e13e368b3..95ba17d5e 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIIsReadyResponse command class
- **/
-class VIIsReadyResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIIsReadyResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit VIIsReadyResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_is_ready_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_request.h
index 336ad4443..de1f2ac0d 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VIReadDIDRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_read_did_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_response.h
index af6650517..2ba6a58d2 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VIReadDIDResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_read_did_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h
index ef14a05f2..61ddc3a54 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VISubscribeVehicleDataRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h
index bcfa2f6f1..0822b5732 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h
@@ -1,74 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define 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
- **/
- explicit VISubscribeVehicleDataRequestTemplate(
- const MessageSharedPtr& message)
- : RequestToHMI(message) {
- }
-
- /**
- * @brief Execute command with sending DBus thin request to HMI
- **/
- virtual void Run() {
- LOG4CXX_INFO(logger_, "VISubscriveVehicleDataRequestTemplate::Run");
- SendRequest();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataRequestTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+../../../../../../include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h
index 057fd52e1..485cc17af 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VISubscribeVehicleDataResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h
index 740d8c386..6790cc663 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-#define HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/response_from_hmi.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
- **/
- explicit VISubscribeVehicleDataResponseTemplate(
- const MessageSharedPtr& message)
- : ResponseFromHMI(message) {
- }
-
- /**
- * @brief Execute command
- **/
- virtual void Run() {
- LOG4CXX_INFO(logger_, "VISubscribeVehicleDataResponse::Run");
- event_engine::Event event(eventID);
- event.set_smart_object(*message_);
- event.raise();
- }
- private:
- DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataResponseTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+../../../../../../include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h
index 18d118fad..786a8cabe 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VIUnsubscribeVehicleDataRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
index d604d4d53..c95c2267a 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
@@ -1,74 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define 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
- **/
- explicit VIUnsubscribeVehicleDataRequestTemplate(
- const MessageSharedPtr& message)
- : RequestToHMI(message) {
- }
-
- /**
- * @brief Execute command with sending DBus thin request to HMI
- **/
- virtual void Run() {
- LOG4CXX_INFO(logger_, "VIUnsubscriveVehicleDataRequestTemplate::Run");
- SendRequest();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataRequestTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+../../../../../../include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h
index b71b8241f..7fe6df28e 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VIUnsubscribeVehicleDataResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
index 8730cc036..aed21a829 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
@@ -1,74 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-#define HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/response_from_hmi.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
- **/
- explicit VIUnsubscribeVehicleDataResponseTemplate(
- const MessageSharedPtr& message)
- : ResponseFromHMI(message) {
- }
-
- /**
- * @brief Execute command
- **/
- virtual void Run() {
- LOG4CXX_INFO(logger_, "VIUnsubscriveVehicleDataResponseTemplate::Run");
- event_engine::Event event(eventID);
- event.set_smart_object(*message_);
- event.raise();
- }
- private:
- DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataResponseTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+../../../../../../include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_request.h
index 3675cfb15..7fe9944f3 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRAddCommandRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_add_command_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_response.h
index 328e8a205..734f31c8d 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRAddCommandResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_add_command_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_request.h
index 5e69b4c18..d8e68ce6d 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRChangeRegistrationRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_change_registration_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_response.h
index f79da4459..b220b61c9 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRChangeRegistrationResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_change_registration_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_request.h
index b843f498f..864ab3d81 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRDeleteCommandRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_delete_command_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_response.h
index 11a681bd5..02be59d16 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRDeleteCommandResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_delete_command_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_request.h
index 7771bdd14..48f24ad62 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRGetCapabilitiesRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_get_capabilities_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_response.h
index ced60c9d6..e5f7e2d64 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRGetCapabilitiesResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_get_capabilities_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_request.h
index 955355d06..a625a0883 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRGetLanguageRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_get_language_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_response.h
index 2bd59b8be..8facd3e43 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRGetLanguageResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_get_language_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_request.h
index 79105978b..df9ab1ed8 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRGetSupportedLanguagesRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_get_supported_languages_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_response.h
index 38f505622..dbd01ab4f 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRGetSupportedLanguagesResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_get_supported_languages_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_request.h
index ac734638b..79cbd18e8 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRIsReadyRequest command class
- **/
-class VRIsReadyRequest : public RequestToHMI {
- public:
- /**
- * @brief VRIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit VRIsReadyRequest(const MessageSharedPtr& message);
-
- /**
- * @brief VRIsReadyRequest class destructor
- **/
- virtual ~VRIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- 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_
+../../../../../../include/application_manager/commands/hmi/vr_is_ready_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_response.h
index 4f4f86d84..b9db7f3fd 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRIsReadyResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_is_ready_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_request.h
index b71b31baf..c26f6f823 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_request.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRPerformInteractionRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_perform_interaction_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_response.h
index fbf5b87cb..6dcda065e 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_response.h
@@ -1,72 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit VRPerformInteractionResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/hmi/vr_perform_interaction_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_request.h
index fc683988b..cbae637fe 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_request.h
@@ -1,147 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_REQUEST_H_
-
-#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
- **/
- explicit AddCommandRequest(const MessageSharedPtr& message);
-
- /**
- * @brief AddCommandRequest class destructor
- **/
- virtual ~AddCommandRequest();
-
- /**
- * @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 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 Function is called by RequestController when request execution time
- * has exceed it's limit
- */
- virtual void onTimeOut();
-
- /**
- * @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();
-
- bool send_ui_;
- bool send_vr_;
-
- bool is_ui_received_;
- bool is_vr_received_;
-
- 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_ADD_COMMAND_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/add_command_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_response.h
index 67a49a8e1..d2bd28060 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit AddCommandResponse(const MessageSharedPtr& message);
-
- /**
- * @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_ADD_COMMAND_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/add_command_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_request.h
index befeb76d9..e2e5940aa 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_request.h
@@ -1,88 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit AddSubMenuRequest(const MessageSharedPtr& message);
-
- /**
- * @brief AddSubMenuRequest class destructor
- **/
- virtual ~AddSubMenuRequest();
-
- /**
- * @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 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_ADD_SUB_MENU_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/add_sub_menu_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_response.h
index 62c404951..fdac5156c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit AddSubMenuResponse(const MessageSharedPtr& message);
-
- /**
- * @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_ADD_SUB_MENU_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/add_sub_menu_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_request.h
index 02423f063..ff657e332 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_request.h
@@ -1,94 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit AlertManeuverRequest(const MessageSharedPtr& message);
-
- /**
- * @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 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();
-
- mobile_apis::Result::eType tts_speak_result_code_;
- mobile_apis::Result::eType navi_alert_maneuver_result_code_;
- Pending pending_requests_;
-
- DISALLOW_COPY_AND_ASSIGN(AlertManeuverRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/alert_maneuver_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_response.h
index 5f0827699..b78ff30d8 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit AlertManeuverResponse(const MessageSharedPtr& message);
-
- /**
- * @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_ALERT_MANEUVER_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/alert_maneuver_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_request.h
index 705a1d145..c25127760 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_request.h
@@ -1,142 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_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 AlertRequest command class
- **/
-class AlertRequest : public CommandRequestImpl {
- public:
- /**
- * @brief AlertRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit AlertRequest(const MessageSharedPtr& message);
-
- /**
- * @brief AlertRequest class destructor
- **/
- virtual ~AlertRequest();
-
- /**
- * @brief Initialize request params
- **/
- virtual bool Init();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /*
- * @brief Will caled by request controller, when default will be expired.
- * If Alert request has soft buttons, timeout response should not be sent to mobile
- */
- virtual void onTimeOut();
-
- /**
- * @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
- */
- void SendSpeakRequest(int32_t app_id);
-
- /*
- * @brief Sends Basic communication playtone notification
- *
- * @param app_id Id of application requested this RPC
- */
- void SendPlayToneNotification(int32_t app_id);
-
- /*
- * @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();
-
- bool awaiting_ui_alert_response_;
- bool awaiting_tts_speak_response_;
- bool awaiting_tts_stop_speaking_response_;
- bool response_success_;
- bool flag_other_component_sent_;
- mobile_apis::Result::eType response_result_;
- smart_objects::SmartObject response_params_;
- mobile_apis::Result::eType tts_speak_response_;
-
- DISALLOW_COPY_AND_ASSIGN(AlertRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/alert_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_response.h
index 59b38933a..42269e9ed 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit AlertResponse(const MessageSharedPtr& message);
-
- /**
- * @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_ALERT_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/alert_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_request.h
index 3de3e8fc2..aa92e2065 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_request.h
@@ -1,162 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ChangeRegistrationRequest command class
- **/
-class ChangeRegistrationRequest : public CommandRequestImpl {
- public:
- /**
- * @brief ChangeRegistrationRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit ChangeRegistrationRequest(const MessageSharedPtr& message);
-
- /**
- * @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 result codes
- *
- * @return true if one of result codes is success
- */
- static bool WasAnySuccess(const hmi_apis::Common_Result::eType ui,
- const hmi_apis::Common_Result::eType vr,
- const hmi_apis::Common_Result::eType tts);
-
- /**
- * @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 Predicate for using with CheckCoincidence method to compare with VR synonym SO
- *
- * @return TRUE if there is coincidence of VR, otherwise FALSE
- */
- struct CoincidencePredicateVR {
- explicit CoincidencePredicateVR(const std::string &newItem)
- :newItem_(newItem)
- {};
-
- bool operator()(smart_objects::SmartObject obj) {
- const std::string vr_synonym = obj.asString();
- return !(strcasecmp(vr_synonym.c_str(), newItem_.c_str()));
- };
-
- const std::string &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_;
-
- DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/change_registration_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_response.h
index 2cac5f2d5..b0cb00622 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CHANGE_REGISTRATION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit ChangeRegistrationResponse(const MessageSharedPtr& message);
-
- /**
- * @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_CHANGE_REGISTRATION_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/change_registration_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_request.h
index 1936c9678..64357af6c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_request.h
@@ -1,179 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
-
-#include "application_manager/application.h"
-#include "application_manager/commands/command_request_impl.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
- **/
- explicit CreateInteractionChoiceSetRequest(const MessageSharedPtr& message);
-
- /**
- * @brief CreateInteractionChoiceSetRequest class destructor
- **/
- virtual ~CreateInteractionChoiceSetRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
-
- /*
- * @brief Sends VR AddCommand request to HMI
- *
- * @param app_id Application ID
- *
- */
- void SendVRAddCommandRequest(application_manager::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 {
- explicit 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 {
- explicit 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 {
- explicit 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);
-
- DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/create_interaction_choice_set_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
index 965573f4a..eb4145c22 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit CreateInteractionChoiceSetResponse(const MessageSharedPtr& message);
-
- /**
- * @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_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/create_interaction_choice_set_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_request.h
index bae0fedd5..d7187ab75 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_request.h
@@ -1,97 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_REQUEST_H_
-
-#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
- **/
- explicit DeleteCommandRequest(const MessageSharedPtr& message);
-
- /**
- * @brief DeleteCommandRequest class destructor
- **/
- virtual ~DeleteCommandRequest();
-
- /**
- * @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(DeleteCommandRequest);
-
- /*
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
- 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_;
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/delete_command_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_response.h
index 0fe0f0959..4d877b7cd 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit DeleteCommandResponse(const MessageSharedPtr& message);
-
- /**
- * @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_DELETE_COMMAND_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/delete_command_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_request.h
index 492722746..7f82ed14e 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_request.h
@@ -1,77 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit DeleteFileRequest(const MessageSharedPtr& message);
-
- /**
- * @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_DELETE_FILE_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/delete_file_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_response.h
index cfe6aaa4f..f41903168 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit DeleteFileResponse(const MessageSharedPtr& message);
-
- /**
- * @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_DELETE_FILE_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/delete_file_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
index 283b882fa..d1ac51364 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
@@ -1,84 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit DeleteInteractionChoiceSetRequest(const MessageSharedPtr& message);
-
- /**
- * @brief DeleteInteractionChoiceSetRequest class destructor
- **/
- virtual ~DeleteInteractionChoiceSetRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- 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_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/delete_interaction_choice_set_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
index 1f641e15b..abf9ed5eb 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit DeleteInteractionChoiceSetResponse(const MessageSharedPtr& message);
-
- /**
- * @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_DELETE_INTERACTION_CHOICE_SET_RESPONSE_COMMAND_H_
+../../../../../../include/application_manager/commands/mobile/delete_interaction_choice_set_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_request.h
index 668721805..10baa78dd 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_request.h
@@ -1,99 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit DeleteSubMenuRequest(const MessageSharedPtr& message);
-
- /**
- * @brief DeleteSubMenuRequest class destructor
- **/
- virtual ~DeleteSubMenuRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- 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);
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/delete_sub_menu_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_response.h
index 0bb080e93..22f656191 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit DeleteSubMenuResponse(const MessageSharedPtr& message);
-
- /**
- * @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_DELETE_SUB_MENU_RESPONSE_COMMAND_H_
+../../../../../../include/application_manager/commands/mobile/delete_sub_menu_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_request.h
index 4cda040b4..cfc9d7bc3 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_request.h
@@ -1,80 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit DiagnosticMessageRequest(const MessageSharedPtr& message);
-
- /**
- * @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_DIAGNOSTIC_MESSAGE_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/diagnostic_message_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_response.h
index 1b6a6024f..73fe20f08 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit DiagnosticMessageResponse(const MessageSharedPtr& message);
-
- /**
- * @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_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/diagnostic_message_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/dial_number_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/dial_number_request.h
index 10ffa5b32..c448f3a5a 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/dial_number_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/dial_number_request.h
@@ -1,72 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAL_NUMBER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit DialNumberRequest(const MessageSharedPtr& message);
-
- /**
- * \brief DialNumberRequest class destructor
- **/
- virtual ~DialNumberRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DialNumberRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAL_NUMBER_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/dial_number_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
index f291f7a74..331f7b8cc 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
@@ -1,80 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit EndAudioPassThruRequest(const MessageSharedPtr& message);
-
- /**
- * @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_END_AUDIO_PASS_THRU_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/end_audio_pass_thru_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
index 5ad5f85e6..7b7eff611 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit EndAudioPassThruResponse(const MessageSharedPtr& message);
-
- /**
- * @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_END_AUDIO_PASS_THRU_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/end_audio_pass_thru_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/generic_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/generic_response.h
index c3b39bf91..10f5e3b00 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/generic_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/generic_response.h
@@ -1,70 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GENERIC_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit GenericResponse(const MessageSharedPtr& message)
- : CommandResponseImpl(message) {
- }
-
- /**
- * \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_GENERIC_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/generic_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_request.h
index d76ac253b..995fb8441 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_request.h
@@ -1,80 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit GetDTCsRequest(const MessageSharedPtr& message);
-
- /**
- * @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_GET_DTCS_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/get_dtcs_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_response.h
index 69ff1fca5..53786a916 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit GetDTCsResponse(const MessageSharedPtr& message);
-
- /**
- * @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_GET_DTCS_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/get_dtcs_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_request.h
index db9db7b0a..18e2658a6 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_request.h
@@ -1,94 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit GetVehicleDataRequest(const MessageSharedPtr& message);
-
- /**
- * @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_GET_VEHICLE_DATA_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/get_vehicle_data_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_response.h
index f0306df6a..9641c9cb7 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit GetVehicleDataResponse(const MessageSharedPtr& message);
-
- /**
- * @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_GET_VEHICLE_DATA_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/get_vehicle_data_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_request.h
index 86171f1ff..633ee9dda 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_request.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit ListFilesRequest(const MessageSharedPtr& message);
-
- /**
- * @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_LIST_FILES_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/list_files_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_response.h
index 6f8e80bae..75443a836 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit ListFilesResponse(const MessageSharedPtr& message);
-
- /**
- * @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_LIST_FILES_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/list_files_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
index 875366047..82c74342a 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
@@ -1,74 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit OnAppInterfaceUnregisteredNotification(
- const MessageSharedPtr& message);
-
- /**
- * @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_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
index 67bc31977..7cf9f3d1c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
@@ -1,74 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit OnAudioPassThruNotification(const MessageSharedPtr& message);
-
- /**
- * @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_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/mobile/on_audio_pass_thru_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_event_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_event_notification.h
index d1297ba98..d41cba2c0 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_event_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_event_notification.h
@@ -1,86 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_EVENT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit OnButtonEventNotification(const MessageSharedPtr& message);
-
- /**
- * @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_ON_BUTTON_EVENT_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/mobile/on_button_event_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_press_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_press_notification.h
index 0ebdb6d7c..7ef855750 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_press_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_press_notification.h
@@ -1,85 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_PRESS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit OnButtonPressNotification(const MessageSharedPtr& message);
-
- /**
- * @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_ON_BUTTON_PRESS_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/mobile/on_button_press_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_command_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_command_notification.h
index 751b1e7dd..759c4d33f 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_command_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_command_notification.h
@@ -1,75 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_COMMAND_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit OnCommandNotification(const MessageSharedPtr& message);
-
- /**
- * @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_ON_COMMAND_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/mobile/on_command_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_driver_distraction_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_driver_distraction_notification.h
index 2f2a3c81f..ebe3fed8f 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_driver_distraction_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_driver_distraction_notification.h
@@ -1,77 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit OnDriverDistractionNotification(const MessageSharedPtr& message);
-
- /**
- * @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_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/mobile/on_driver_distraction_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hash_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hash_change_notification.h
index be8304786..16aa5c9bb 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hash_change_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hash_change_notification.h
@@ -1,75 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HASH_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit OnHashChangeNotification(const MessageSharedPtr& message);
-
- /**
- * @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_ON_HASH_CHANGE_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/mobile/on_hash_change_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification.h
index aefa7f9c2..bc9cedbfb 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HMI_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit OnHMIStatusNotification(const MessageSharedPtr& message);
-
- /**
- * @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_ON_HMI_STATUS_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/mobile/on_hmi_status_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h
new file mode 120000
index 000000000..617cc4604
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h
@@ -0,0 +1 @@
+../../../../../../include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_keyboard_input_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_keyboard_input_notification.h
index e0d6a258e..41474d2cb 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_keyboard_input_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_keyboard_input_notification.h
@@ -1,76 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit OnKeyBoardInputNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/on_keyboard_input_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_language_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_language_change_notification.h
index d16311489..d65fdc56a 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_language_change_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_language_change_notification.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit OnLanguageChangeNotification(const MessageSharedPtr& message);
-
- /**
- * @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_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/mobile/on_language_change_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_permissions_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_permissions_change_notification.h
index 3cffe8ff4..9dff29eeb 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_permissions_change_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_permissions_change_notification.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit OnPermissionsChangeNotification(const MessageSharedPtr& message);
-
- /**
- * @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_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/mobile/on_permissions_change_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_system_request_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_system_request_notification.h
index 183b673af..77c3741be 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_system_request_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_system_request_notification.h
@@ -1,76 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_SYSTEM_REQUEST_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_SYSTEM_REQUEST_NOTIFICATION_H_
-
-
-#include "application_manager/commands/command_notification_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-/**
- * @brief OnSystemRequestNotification class
- **/
-class OnSystemRequestNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnSystemRequestNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit OnSystemRequestNotification(const MessageSharedPtr& message);
-
- /**
- * @brief OnSystemRequestNotification class destructor
- **/
- virtual ~OnSystemRequestNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
-};
-
-} // namespace mobile
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/mobile/on_system_request_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_tbt_client_state_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
index 5c34caba3..63d770348 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit OnTBTClientStateNotification(const MessageSharedPtr& message);
-
- /**
- * @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_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/mobile/on_tbt_client_state_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_touch_event_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_touch_event_notification.h
index 1aba3087d..6ec885678 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_touch_event_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_touch_event_notification.h
@@ -1,76 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit OnTouchEventNotification(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/on_touch_event_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_vehicle_data_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_vehicle_data_notification.h
index 7e64f1963..4b628b7c6 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_vehicle_data_notification.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_vehicle_data_notification.h
@@ -1,82 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_VEHICLE_DATA_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit OnVehicleDataNotification(const MessageSharedPtr& message);
-
- /**
- * @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_ON_VEHICLE_DATA_NOTIFICATION_H_
+../../../../../../include/application_manager/commands/mobile/on_vehicle_data_notification.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
index 62ca1257b..0316606c0 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
@@ -1,132 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit PerformAudioPassThruRequest(const MessageSharedPtr& message);
-
- /**
- * @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 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();
-
- //flag display state of speak during perform audio pass thru
- bool is_active_tts_speak_;
- mobile_apis::Result::eType result_tts_speak_;
-
- DISALLOW_COPY_AND_ASSIGN(PerformAudioPassThruRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/perform_audio_pass_thru_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
index d659e59be..ba81d3e53 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit PerformAudioPassThruResponse(const MessageSharedPtr& message);
-
- /**
- * @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_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/perform_audio_pass_thru_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_request.h
index ce85a7017..9cb56984d 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_request.h
@@ -1,220 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application.h"
-#include "utils/timer_thread.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
- **/
- explicit PerformInteractionRequest(const MessageSharedPtr& message);
-
- /**
- * @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 Timer callback function
- *
- */
- void onTimer();
-
- private:
- /*
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- *
- */
- virtual void onTimeOut();
-
- /*
- * @brief Function will be called when VR_OnCommand event
- * comes
- *
- * @param message which should send to mobile side
- *
- */
- void ProcessVRResponse(const smart_objects::SmartObject& message);
-
- /*
- * @brief Sends PerformInteraction response to mobile side
- *
- * @param message which should send to mobile side
- *
- */
- void ProcessPerformInteractionResponse
- (const smart_objects::SmartObject& message);
-
-
- /*
- * @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 Creates and Sends Perform interaction to UI.
- */
- void CreateUIPerformInteraction(const smart_objects::SmartObject& msg_params,
- application_manager::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);
-
- // members
- timer::TimerThread<PerformInteractionRequest> timer_;
-
- DISALLOW_COPY_AND_ASSIGN(PerformInteractionRequest);
- mobile_apis::Result::eType vr_perform_interaction_code_;
- mobile_apis::InteractionMode::eType interaction_mode_;
- bool ui_response_recived;
- bool vr_response_recived;
-
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/perform_interaction_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_response.h
index 4ecc149fb..8b90adea9 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit PerformInteractionResponse(const MessageSharedPtr& message);
-
- /**
- * @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_PERFORM_INTERACTION_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/perform_interaction_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_request.h
index 8a94a708a..be4b97728 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_request.h
@@ -1,81 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-#include "application_manager/application_manager_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief PutFileRequest command class
- **/
-class PutFileRequest : public CommandRequestImpl {
- public:
- /**
- * @brief PutFileRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit PutFileRequest(const MessageSharedPtr& message);
-
- /**
- * @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_PUT_FILE_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/put_file_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_response.h
index 89ff6ad08..664c76e53 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit PutFileResponse(const MessageSharedPtr& message);
-
- /**
- * @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_PUT_FILE_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/put_file_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_request.h
index e2e5dbf3d..c9727e504 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_request.h
@@ -1,80 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit ReadDIDRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/read_did_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_response.h
index 80b9b5ea4..95e0c625a 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit ReadDIDResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/read_did_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_request.h
index 9c1d46368..cc1fb2fee 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_request.h
@@ -1,174 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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 <string.h>
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace policy {
-struct DeviceInfo;
-}
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-/**
- * @brief Register app interface request command class
- **/
-class RegisterAppInterfaceRequest : public CommandRequestImpl {
- public:
- /**
- * \brief RegisterAppInterfaceRequest class constructor
- **/
- explicit RegisterAppInterfaceRequest(const MessageSharedPtr& message);
-
- /**
- * @brief RegisterAppInterfaceRequest class destructor
- **/
- virtual ~RegisterAppInterfaceRequest();
-
- /**
- * @brief Init required by command resources
- **/
- virtual bool Init();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
- // virtual void cleanUp() = 0;
-
- /**
- * @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 Sends RegisterAppInterface response to mobile
- *
- *@param application_impl application
- *
- **/
- void SendRegisterAppInterfaceResponseToMobile(
- mobile_apis::Result::eType result = mobile_apis::Result::SUCCESS);
-
- private:
- /*
- * @brief Check new ID along with known mobile application ID
- *
- * return TRUE if ID is known already, otherwise - FALSE
- */
- bool IsApplicationWithSameAppIdRegistered();
-
- /*
- * @brief Check for some request param. names restrictions, e.g. for
- * newline characters
- *
- * return SUCCESS if param name pass the check, otherwise - error code
- * will be returned
- */
- mobile_apis::Result::eType CheckRestrictions() const;
-
- /*
- * @brief Removes hidden symbols and spaces
- *
- * return cleared copy of param name
- */
- std::string ClearParamName(std::string param_name) const;
-
-
- /*
- * @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 {
- explicit CoincidencePredicateVR(const std::string &newItem)
- :newItem_(newItem)
- {};
-
- bool operator()(smart_objects::SmartObject obj) {
- const std::string vr_synonym = obj.asString();
- return !(strcasecmp(vr_synonym.c_str(), newItem_.c_str()));
- };
-
- const std::string &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();
-
- std::string response_info_;
-
- 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_
+../../../../../../include/application_manager/commands/mobile/register_app_interface_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_response.h
index 1244cb65f..0f1ffccc6 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_response.h
@@ -1,75 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit RegisterAppInterfaceResponse(const MessageSharedPtr& response)
- : CommandResponseImpl(response) {
- }
-
- /**
- * \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_
+../../../../../../include/application_manager/commands/mobile/register_app_interface_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_request.h
index d7abe38c1..ea2ae40b8 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_request.h
@@ -1,130 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit ResetGlobalPropertiesRequest(const MessageSharedPtr& message);
-
- /**
- * @brief ResetGlobalPropertiesRequest class destructor
- **/
- virtual ~ResetGlobalPropertiesRequest();
-
- /**
- * @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 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 Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
- DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesRequest);
-
- 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_;
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/reset_global_properties_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_response.h
index 7c0b8eb00..daba7103a 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit ResetGlobalPropertiesResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/reset_global_properties_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_request.h
index a810f4eb2..50bd0a294 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_request.h
@@ -1,85 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit ScrollableMessageRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/scrollable_message_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_response.h
index 36fd311ad..d73af42f6 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_response.h
@@ -1,68 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit ScrollableMessageResponse(const MessageSharedPtr& message);
-
- /**
- * \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_
+../../../../../../include/application_manager/commands/mobile/scrollable_message_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_request.h
index e178e284d..d36205775 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_request.h
@@ -1,87 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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 "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
- */
- explicit SendLocationRequest(const MessageSharedPtr& message);
-
- /**
- * @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 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();
-
-
- DISALLOW_COPY_AND_ASSIGN(SendLocationRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/send_location_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_response.h
index 6e18aa5f2..547cf897e 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_response.h
@@ -1,67 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- */
- explicit SendLocationResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/send_location_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_request.h
new file mode 120000
index 000000000..a2b137233
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_request.h
@@ -0,0 +1 @@
+../../../../../../include/application_manager/commands/mobile/set_app_icon_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_response.h
new file mode 120000
index 000000000..6deebcabc
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_app_icon_response.h
@@ -0,0 +1 @@
+../../../../../../include/application_manager/commands/mobile/set_app_icon_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_request.h
index 925a1cd67..f02f9317c 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_request.h
@@ -1,80 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit SetDisplayLayoutRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/set_display_layout_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_response.h
index dbf3de8d8..b5b2e7354 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit SetDisplayLayoutResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/set_display_layout_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_request.h
index d9e18dd76..fee7f8c00 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_request.h
@@ -1,121 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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 "application_manager/commands/command_request_impl.h"
-#include "utils/macro.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
- **/
- explicit SetGlobalPropertiesRequest(const MessageSharedPtr& message);
-
- /**
- * @brief SetGlobalPropertiesRequest class destructor
- **/
- virtual ~SetGlobalPropertiesRequest();
-
- /**
- * @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 Chec if HelpItems order is correct
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool CheckVrHelpItemsOrder();
-
- /*
- * @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();
-
- DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesRequest);
-
- 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_;
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/set_global_properties_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_response.h
index dd80e738e..76c7bf249 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit SetGlobalPropertiesResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/set_global_properties_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_request.h
index d46094032..2db9520a2 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_request.h
@@ -1,88 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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 "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
- **/
- explicit SetIconRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/set_icon_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_response.h
index 88dceaf5a..ac04c4d9f 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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 "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
- **/
- explicit SetIconResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/set_icon_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_request.h
index e4fae5c0b..196167113 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_request.h
@@ -1,81 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit SetMediaClockRequest(const MessageSharedPtr& message);
-
- /**
- * \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_
+../../../../../../include/application_manager/commands/mobile/set_media_clock_timer_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_response.h
index e835c17c8..ecffab999 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_response.h
@@ -1,67 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit SetMediaClockTimerResponse(const MessageSharedPtr& message);
-
- /**
- * \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_
+../../../../../../include/application_manager/commands/mobile/set_media_clock_timer_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_request.h
index a22ee9852..35acb02f1 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_request.h
@@ -1,89 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit ShowConstantTBTRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/show_constant_tbt_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_response.h
index 6a102b198..5b3738ca8 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit ShowConstantTBTResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/show_constant_tbt_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_request.h
index 091cab3bf..e299277b4 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_request.h
@@ -1,88 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit ShowRequest(const MessageSharedPtr& message);
-
- /**
- * \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();
-
- DISALLOW_COPY_AND_ASSIGN(ShowRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/show_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_response.h
index 970b54747..afa7d2547 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_response.h
@@ -1,67 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit ShowResponse(const MessageSharedPtr& message);
-
- /**
- * \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_
+../../../../../../include/application_manager/commands/mobile/show_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_request.h
index de24438dd..8a1c85497 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_request.h
@@ -1,91 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit SliderRequest(const MessageSharedPtr& message);
-
- /**
- * \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_
+../../../../../../include/application_manager/commands/mobile/slider_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_response.h
index b7821adca..a869256ee 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_response.h
@@ -1,67 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit SliderResponse(const MessageSharedPtr& message);
-
- /**
- * \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_
+../../../../../../include/application_manager/commands/mobile/slider_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_request.h
index 7d3b2096a..5921def79 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_request.h
@@ -1,93 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit SpeakRequest(const MessageSharedPtr& message);
-
- /**
- * \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_
+../../../../../../include/application_manager/commands/mobile/speak_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_response.h
index ef9b8f89d..f4b69f793 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_response.h
@@ -1,67 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT 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
- **/
- explicit SpeakResponse(const MessageSharedPtr& message);
-
- /**
- * \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_
+../../../../../../include/application_manager/commands/mobile/speak_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_request.h
index 3e0cc2cea..e5da6a448 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_request.h
@@ -1,88 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit SubscribeButtonRequest(const MessageSharedPtr& message);
-
- /**
- * @brief SubscribeButtonRequest class destructor
- **/
- virtual ~SubscribeButtonRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- 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 IsSubscribtionAllowed(ApplicationSharedPtr app,
- const mobile_apis::ButtonName::eType btn_id);
-
- DISALLOW_COPY_AND_ASSIGN(SubscribeButtonRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/subscribe_button_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_response.h
index 836688454..dda081d9b 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit SubscribeButtonResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/subscribe_button_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
index 288500e7e..8e4908abd 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
@@ -1,97 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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 "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
- **/
- explicit SubscribeVehicleDataRequest(const MessageSharedPtr& message);
-
- /**
- * @brief SubscribeButtonCommandRequest class destructor
- **/
- virtual ~SubscribeVehicleDataRequest();
-
- /**
- * @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);
-
-#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:
- bool IsAnythingAlreadySubscribed(
- const smart_objects::SmartObject& msg_params) const;
-
- 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_
+../../../../../../include/application_manager/commands/mobile/subscribe_vehicle_data_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h
index d2771c071..262a56f0d 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit SubscribeVehicleDataResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/subscribe_vehicle_data_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_request.h
index 64a6510fc..b4b9ca764 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_request.h
@@ -1,80 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SystemRequest command class
- **/
-class SystemRequest : public CommandRequestImpl {
- public:
- /**
- * @brief SystemRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- explicit SystemRequest(const MessageSharedPtr& message);
-
- /**
- * @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:
-
- static uint32_t index;
- DISALLOW_COPY_AND_ASSIGN(SystemRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/system_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_response.h
index ca2fb9997..f71dd2f31 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_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
- **/
- explicit SystemResponse(const MessageSharedPtr& message);
-
- /**
- * @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_SYSTEM_RESPONSE_H_
+../../../../../../include/application_manager/commands/mobile/system_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_request.h
index a5a53736e..0851fea06 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_request.h
@@ -1,76 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit UnregisterAppInterfaceRequest(const MessageSharedPtr& message)
- : CommandRequestImpl(message) {
- }
-
- /**
- * \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_
+../../../../../../include/application_manager/commands/mobile/unregister_app_interface_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_response.h
index 5c8928a6c..16ed184de 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_response.h
@@ -1,72 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit UnregisterAppInterfaceResponse(const MessageSharedPtr& response)
- : CommandResponseImpl(response) {
- }
-
- /**
- * \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_
+../../../../../../include/application_manager/commands/mobile/unregister_app_interface_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_request.h
index 3ec216de2..98b479605 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_request.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit UnsubscribeButtonRequest(const MessageSharedPtr& message);
-
- /**
- * @brief UnsubscribeButtonRequest class destructor
- **/
- virtual ~UnsubscribeButtonRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
+../../../../../../include/application_manager/commands/mobile/unsubscribe_button_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_response.h
index 972da4806..12d3efc86 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit UnsubscribeButtonResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/unsubscribe_button_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
index dd52a7722..8bd2f2844 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
@@ -1,96 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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 "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
- **/
- explicit UnsubscribeVehicleDataRequest(const MessageSharedPtr& message);
-
- /**
- * @brief UnsubscribeVehicleDataRequest class destructor
- **/
- virtual ~UnsubscribeVehicleDataRequest();
-
- /**
- * @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);
-
-#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:
- bool IsAnythingAlreadyUnsubscribed(
- const smart_objects::SmartObject& msg_params) const;
- 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_
+../../../../../../include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h
index 3fb932ecf..980a88534 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit UnsubscribeVehicleDataResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_request.h
index c65c2bc53..443280476 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_request.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_request.h
@@ -1,97 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit UpdateTurnListRequest(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/update_turn_list_request.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_response.h
index fdbf64826..c778fb169 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_response.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_response.h
@@ -1,73 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT 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
- **/
- explicit UpdateTurnListResponse(const MessageSharedPtr& message);
-
- /**
- * @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_
+../../../../../../include/application_manager/commands/mobile/update_turn_list_response.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/pending.h b/src/components/application_manager/test/mock/include/application_manager/commands/pending.h
index bbfc24665..4dd9a4a88 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/commands/pending.h
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/pending.h
@@ -1,75 +1 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PENDING_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PENDING_H_
-
-#include <set>
-#include "utils/macro.h"
-#include "utils/lock.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/*
- * @brief Class for monitoring of pending requests/responses to HMI
- */
-class Pending {
- public:
- /*
- * Constructor
- */
- Pending();
-
- /*
- * Destructor
- */
- ~Pending();
-
- void Add(hmi_apis::FunctionID::eType id);
- void Remove(hmi_apis::FunctionID::eType id);
- bool IsFinal(hmi_apis::FunctionID::eType id);
-
- private:
- std::set<hmi_apis::FunctionID::eType> pending_;
- sync_primitives::Lock lock_;
- hmi_apis::FunctionID::eType last_;
- DISALLOW_COPY_AND_ASSIGN(Pending);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PENDING_H_
+../../../../../include/application_manager/commands/pending.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/event_engine/event.h b/src/components/application_manager/test/mock/include/application_manager/event_engine/event.h
index e76b767f1..7b6f06988 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/event_engine/event.h
+++ b/src/components/application_manager/test/mock/include/application_manager/event_engine/event.h
@@ -1,147 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_H_
-
-#include <interfaces/HMI_API.h>
-
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-
-namespace application_manager {
-namespace event_engine {
-
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
-class Event {
- public:
-
- // Typedef for possible Event ID's from mobile_apis functionID enum
- typedef hmi_apis::FunctionID::eType EventID;
-
- /*
- * @brief Constructor with parameters
- *
- * @param id Event ID. Please see mobile_apis::FunctionID for possible ID's
- */
- explicit Event(const EventID& id);
-
- /*
- * @brief Destructor
- */
- virtual ~Event();
-
- /*
- * @brief Sends synchronously event to all subscribers.
- *
- */
- void raise();
-
- /*
- * @brief Provides event ID
- */
- inline const EventID& id() const;
-
- /*
- * @brief Sets event smart object
- *
- * @param so The smart_object received in HMI response
- */
- void set_smart_object(smart_objects::SmartObject& so);
-
- /*
- * @brief Retrieves event smart object
- *
- * @return The smart_object received in HMI response
- */
- inline const smart_objects::SmartObject& smart_object() const;
-
- /*
- * @brief Retrieves smart object request ID
- */
- inline int32_t smart_object_function_id() const;
-
- /*
- * @brief Retrieves smart object correlation ID
- */
- inline int32_t smart_object_correlation_id() const;
-
- /*
- * @brief Retrieves smart_object response type
- */
- inline int32_t smart_object_type() const;
-
- protected:
-
- private:
-
- EventID id_;
- smart_objects::SmartObject response_so_;
-
- /*
- * @brief Default constructor
- *
- * Unimplemented to avoid misusing
- */
- Event();
-
- DISALLOW_COPY_AND_ASSIGN(Event);
-};
-
-const Event::EventID& Event::id() const {
- return id_;
-}
-
-const smart_objects::SmartObject& Event::smart_object() const {
- return response_so_;
-}
-
-int32_t Event::smart_object_function_id() const {
- return response_so_.getElement(
- strings::params).getElement(strings::function_id).asInt();
-}
-
-int32_t Event::smart_object_correlation_id() const {
- return response_so_.getElement(
- strings::params).getElement(strings::correlation_id).asInt();
-}
-
-int32_t Event::smart_object_type() const {
- return response_so_.getElement(
- strings::params).getElement(strings::message_type).asInt();
-}
-
-}
-}
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_H_
+../../../../../include/application_manager/event_engine/event.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/event_engine/event_dispatcher.h b/src/components/application_manager/test/mock/include/application_manager/event_engine/event_dispatcher.h
index 875add282..b0f651781 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/event_engine/event_dispatcher.h
+++ b/src/components/application_manager/test/mock/include/application_manager/event_engine/event_dispatcher.h
@@ -1,117 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_DISPATCHER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_DISPATCHER_H_
-
-#include <list>
-#include <map>
-
-#include "utils/lock.h"
-#include "utils/singleton.h"
-
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-namespace event_engine {
-
-class EventObserver;
-
-class EventDispatcher : public utils::Singleton<EventDispatcher> {
- public:
-
- /*
- * @brief Delivers the event to all subscribers
- *
- * @param event Received event
- */
- void raise_event(const Event& 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 Event::EventID& event_id,
- int32_t hmi_correlation_id,
- EventObserver* 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 Event::EventID& event_id,
- EventObserver* const observer);
-
- /*
- * @brief Unsubscribes the observer from all events
- *
- * @param observer The observer to be unsubscribed
- */
- void remove_observer(EventObserver* const observer);
-
- protected:
-
- private:
-
- /*
- * @brief Default constructor
- */
- EventDispatcher();
-
- /*
- * @brief Destructor
- */
- virtual ~EventDispatcher();
-
- DISALLOW_COPY_AND_ASSIGN(EventDispatcher);
-
- FRIEND_BASE_SINGLETON_CLASS(EventDispatcher);
-
- // Data types section
- typedef std::list<EventObserver*> ObserverList;
- typedef std::map<int32_t, ObserverList> ObserversMap;
- typedef std::map<Event::EventID, ObserversMap> EventObserverMap;
-
- // Members section
- sync_primitives::Lock state_lock_;
- EventObserverMap observers_;
-};
-
-}
-}
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_DISPATCHER_H_
+../../../../../include/application_manager/event_engine/event_dispatcher.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/event_engine/event_observer.h b/src/components/application_manager/test/mock/include/application_manager/event_engine/event_observer.h
index 863120329..dc6af8624 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/event_engine/event_observer.h
+++ b/src/components/application_manager/test/mock/include/application_manager/event_engine/event_observer.h
@@ -1,116 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_OBSERVER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_OBSERVER_H_
-
-#include <string>
-#include "application_manager/event_engine/event.h"
-#include "application_manager/event_engine/event_dispatcher.h"
-
-namespace application_manager {
-namespace event_engine {
-
-class EventObserver
-{
- public:
-
- friend class EventDispatcher;
-
- // 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
- */
- inline const ObserverID& id() const;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const Event& event) = 0;
-
- protected:
-
- /*
- * @brief Subscribe to an event
- *
- * @param event_id The event ID to subscribe for
- * @param hmi_correlation_id The event HMI correlation ID.
- * If param is omitted, it means subscription for HMI notification
- */
- void subscribe_on_event(
- const Event::EventID& event_id, int32_t hmi_correlation_id = 0);
-
- /*
- * @brief Unsubscribes the observer from specific event
- *
- * @param event_id The event ID to unsubscribe from
- */
- void unsubscribe_from_event(const Event::EventID& event_id);
-
- /*
- * @brief Unsubscribes the observer from all events
- *
- */
- void unsubscribe_from_all_events();
-
- private:
-
- ObserverID id_;
-
- DISALLOW_COPY_AND_ASSIGN(EventObserver);
-};
-
-const EventObserver::ObserverID& EventObserver::id() const {
- return id_;
-}
-
-}
-}
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_OBSERVER_H_
+../../../../../include/application_manager/event_engine/event_observer.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/hmi_capabilities.h b/src/components/application_manager/test/mock/include/application_manager/hmi_capabilities.h
index 20a849bae..9ceb7b9b9 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/hmi_capabilities.h
+++ b/src/components/application_manager/test/mock/include/application_manager/hmi_capabilities.h
@@ -1,538 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
-
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
-#include "json/json.h"
-#include "utils/macro.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
-
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
-namespace application_manager {
-class ApplicationManagerImpl;
-
-class HMICapabilities {
-
- public:
-
- /*
- * @ Class constructor
- *
- * @param app_mngr Application manager pointer
- */
- explicit HMICapabilities(ApplicationManagerImpl* const app_mngr);
-
- /*
- * @brief Class destructor
- *
- */
- virtual ~HMICapabilities();
-
- /**
- * @brief Checks if all HMI capabilities received
- *
- * @return TRUE if all information received, otherwise FALSE
- */
- bool is_hmi_capabilities_initialized() const;
-
- /*
- * @brief Checks is image type(Static/Dynamic) requested by
- * Mobile Device is supported on current HMI.
- * @param image_type recieved type of image from Enum.
- * @return Bool true if supported
- */
- bool VerifyImageType(int32_t image_type) const;
-
- /**
- * @brief Checks if all HMI capabilities received
- *
- * @return TRUE if all information received, otherwise FALSE
- */
- inline bool is_vr_cooperating() const;
- void set_is_vr_cooperating(bool value);
-
- inline bool is_tts_cooperating() const;
- void set_is_tts_cooperating(bool value);
-
- inline bool is_ui_cooperating() const;
- void set_is_ui_cooperating(bool value);
-
- inline bool is_navi_cooperating() const;
- void set_is_navi_cooperating(bool value);
-
- inline bool is_ivi_cooperating() const;
- void set_is_ivi_cooperating(bool value);
-
- /*
- * @brief Retrieves if mixing audio is supported by HMI
- * (ie recording TTS command and playing audio)
- *
- * @return Current state of the mixing audio flag
- */
- inline bool attenuated_supported() const;
-
- /*
- * @brief Sets state for mixing audio
- *
- * @param state New state to be set
- */
- void set_attenuated_supported(bool state);
-
- /*
- * @brief Retrieves currently active UI language
- *
- * @return Currently active UI language
- */
- inline const hmi_apis::Common_Language::eType&
- active_ui_language() const;
-
- /*
- * @brief Sets currently active UI language
- *
- * @param language Currently active UI language
- */
- void set_active_ui_language(const hmi_apis::Common_Language::eType& language);
-
- /*
- * @brief Retrieves UI supported languages
- *
- * @return Currently supported UI languages
- */
- inline const smart_objects::SmartObject*
- ui_supported_languages() const;
-
- /*
- * @brief Sets supported UI languages
- *
- * @param supported_languages Supported UI languages
- */
- void set_ui_supported_languages(
- const smart_objects::SmartObject& supported_languages);
-
- /*
- * @brief Retrieves currently active VR language
- *
- * @return Currently active VR language
- */
- inline const hmi_apis::Common_Language::eType&
- active_vr_language() const;
-
- /*
- * @brief Sets currently active VR language
- *
- * @param language Currently active VR language
- */
- void set_active_vr_language(const hmi_apis::Common_Language::eType& language);
-
- /*
- * @brief Retrieves VR supported languages
- *
- * @return Currently supported VR languages
- */
- inline const smart_objects::SmartObject*
- vr_supported_languages() const;
-
- /*
- * @brief Sets supported VR languages
- *
- * @param supported_languages Supported VR languages
- */
- void set_vr_supported_languages(
- const smart_objects::SmartObject& supported_languages);
-
- /*
- * @brief Retrieves currently active TTS language
- *
- * @return Currently active TTS language
- */
- inline const hmi_apis::Common_Language::eType&
- active_tts_language() const;
-
- /*
- * @brief Sets currently active TTS language
- *
- * @param language Currently active TTS language
- */
- void set_active_tts_language(
- const hmi_apis::Common_Language::eType& language);
-
- /*
- * @brief Retrieves TTS supported languages
- *
- * @return Currently supported TTS languages
- */
- inline const smart_objects::SmartObject*
- tts_supported_languages() const;
-
- /*
- * @brief Sets supported TTS languages
- *
- * @param supported_languages Supported TTS languages
- */
- void set_tts_supported_languages(
- const smart_objects::SmartObject& supported_languages);
-
- /*
- * @brief Retrieves information about the display capabilities
- *
- * @return Currently supported display capabilities
- */
- inline const smart_objects::SmartObject*
- display_capabilities() const;
-
- /*
- * @brief Sets supported display capabilities
- *
- * @param display_capabilities supported display capabilities
- */
- void set_display_capabilities(
- const smart_objects::SmartObject& display_capabilities);
-
- /*
- * @brief Retrieves information about the HMI zone capabilities
- *
- * @return Currently supported HMI zone capabilities
- */
- inline const smart_objects::SmartObject*
- hmi_zone_capabilities() const;
-
- /*
- * @brief Sets supported HMI zone capabilities
- *
- * @param hmi_zone_capabilities supported HMI zone capabilities
- */
- void set_hmi_zone_capabilities(
- const smart_objects::SmartObject& hmi_zone_capabilities);
-
- /*
- * @brief Retrieves information about the SoftButton's capabilities
- *
- * @return Currently supported SoftButton's capabilities
- */
- inline const smart_objects::SmartObject*
- soft_button_capabilities() const;
-
- /*
- * @brief Sets supported SoftButton's capabilities
- *
- * @param soft_button_capabilities supported SoftButton's capabilities
- */
- void set_soft_button_capabilities(
- const smart_objects::SmartObject& soft_button_capabilities);
-
- /*
- * @brief Retrieves information about the Button's capabilities
- *
- * @return Currently supported Button's capabilities
- */
- inline const smart_objects::SmartObject* button_capabilities() const;
-
- /*
- * @brief Sets supported Button's capabilities
- *
- * @param soft_button_capabilities supported Button's capabilities
- */
- void set_button_capabilities(
- const smart_objects::SmartObject& button_capabilities);
-
- /*
- * @brief Sets supported speech capabilities
- *
- * @param speech_capabilities supported speech capabilities
- */
- void set_speech_capabilities(
- const smart_objects::SmartObject& speech_capabilities);
-
- /*
- * @brief Retrieves information about the speech capabilities
- *
- * @return Currently supported speech capabilities
- */
- inline const smart_objects::SmartObject* speech_capabilities() const;
-
- /*
- * @brief Sets supported VR capabilities
- *
- * @param vr_capabilities supported VR capabilities
- */
- void set_vr_capabilities(const smart_objects::SmartObject& vr_capabilities);
-
- /*
- * @brief Retrieves information about the VR capabilities
- *
- * @return Currently supported VR capabilities
- */
- inline const smart_objects::SmartObject* vr_capabilities() const;
-
- /*
- * @brief Sets supported audio_pass_thru capabilities
- *
- * @param vr_capabilities supported audio_pass_thru capabilities
- */
- void set_audio_pass_thru_capabilities(
- const smart_objects::SmartObject& audio_pass_thru_capabilities);
-
- /*
- * @brief Retrieves information about the audio_pass_thru capabilities
- *
- * @return Currently supported audio_pass_thru capabilities
- */
- inline const smart_objects::SmartObject*
- audio_pass_thru_capabilities() const;
-
- /*
- * @brief Retrieves information about the preset bank capabilities
- *
- * @return Currently supported preset bank capabilities
- */
- inline const smart_objects::SmartObject* preset_bank_capabilities() const;
-
- /*
- * @brief Sets supported preset bank capabilities
- *
- * @param soft_button_capabilities supported preset bank capabilities
- */
- void set_preset_bank_capabilities(
- const smart_objects::SmartObject& preset_bank_capabilities);
-
- /*
- * @brief Sets vehicle information(make, model, modelYear)
- *
- * @param vehicle_type Cuurent vehicle information
- */
- void set_vehicle_type(const smart_objects::SmartObject& vehicle_type);
-
- /*
- * @brief Retrieves vehicle information(make, model, modelYear)
- *
- * @param vehicle_type Cuurent vehicle information
- */
- inline const smart_objects::SmartObject* vehicle_type() const;
-
- /*
- * @brief Retrieves information about the prerecorded speech
- *
- * @return Currently supported prerecorded speech
- */
- inline const smart_objects::SmartObject* prerecorded_speech() const;
-
- /*
- * @brief Sets supported prerecorded speech
- *
- * @param prerecorded_speech supported prerecorded speech
- */
- void set_prerecorded_speech(
- const smart_objects::SmartObject& prerecorded_speech);
-
- protected:
-
- /*
- * @brief Loads capabilities from local file in case SDL was launched
- * without HMI
- *
- * @return TRUE if capabilities loaded successfully, otherwise FALSE.
- */
- bool load_capabilities_from_file();
-
- /*
- * @brief function checks if json member exists
- *
- * @param json_member from file hmi_capabilities.json
- * @param name_of_member name which we should check
- * hmi_capabilities.json
- *
- * @returns TRUE if member exists and returns FALSE if
- * member does not exist.
- */
- bool check_existing_json_member(
- const Json::Value& json_member, const char* name_of_member);
-
- /*
- * @brief function converts json object "languages" to smart object
- *
- * @param json_languages from file hmi_capabilities.json
- * @param languages - the converted object
- *
- */
- void convert_json_languages_to_obj(Json::Value& json_languages,
- smart_objects::SmartObject& languages);
-
- private:
- bool is_vr_cooperating_;
- bool is_tts_cooperating_;
- bool is_ui_cooperating_;
- bool is_navi_cooperating_;
- bool is_ivi_cooperating_;
-
- // to check if IsReady response for corresponding interface received
- bool is_vr_ready_response_recieved_;
- bool is_tts_ready_response_recieved_;
- bool is_ui_ready_response_recieved_;
- bool is_navi_ready_response_recieved_;
- bool is_ivi_ready_response_recieved_;
-
- bool attenuated_supported_;
- hmi_apis::Common_Language::eType ui_language_;
- hmi_apis::Common_Language::eType vr_language_;
- hmi_apis::Common_Language::eType tts_language_;
- smart_objects::SmartObject* vehicle_type_;
- smart_objects::SmartObject* ui_supported_languages_;
- smart_objects::SmartObject* tts_supported_languages_;
- smart_objects::SmartObject* vr_supported_languages_;
- smart_objects::SmartObject* display_capabilities_;
- smart_objects::SmartObject* hmi_zone_capabilities_;
- smart_objects::SmartObject* soft_buttons_capabilities_;
- smart_objects::SmartObject* button_capabilities_;
- smart_objects::SmartObject* preset_bank_capabilities_;
- smart_objects::SmartObject* vr_capabilities_;
- smart_objects::SmartObject* speech_capabilities_;
- smart_objects::SmartObject* audio_pass_thru_capabilities_;
- smart_objects::SmartObject* prerecorded_speech_;
-
- ApplicationManagerImpl* app_mngr_;
-
- DISALLOW_COPY_AND_ASSIGN(HMICapabilities);
-};
-
-bool HMICapabilities::is_ui_cooperating() const {
- return is_ui_cooperating_;
-}
-
-bool HMICapabilities::is_vr_cooperating() const {
- return is_vr_cooperating_;
-}
-
-bool HMICapabilities::is_tts_cooperating() const {
- return is_tts_cooperating_;
-}
-
-bool HMICapabilities::is_navi_cooperating() const {
- return is_navi_cooperating_;
-}
-
-bool HMICapabilities::is_ivi_cooperating() const {
- return is_ivi_cooperating_;
-}
-
-const hmi_apis::Common_Language::eType&
-HMICapabilities::active_ui_language() const {
- return ui_language_;
-}
-
-const smart_objects::SmartObject*
-HMICapabilities::ui_supported_languages() const {
- return ui_supported_languages_;
-}
-
-const hmi_apis::Common_Language::eType&
-HMICapabilities::active_vr_language() const {
- return vr_language_;
-}
-
-const smart_objects::SmartObject*
-HMICapabilities::vr_supported_languages() const {
- return vr_supported_languages_;
-}
-
-const hmi_apis::Common_Language::eType&
-HMICapabilities::active_tts_language() const {
- return tts_language_;
-}
-
-const smart_objects::SmartObject*
-HMICapabilities::tts_supported_languages() const {
- return tts_supported_languages_;
-}
-
-const smart_objects::SmartObject*
-HMICapabilities::display_capabilities() const {
- return display_capabilities_;
-}
-
-const smart_objects::SmartObject*
-HMICapabilities::hmi_zone_capabilities() const {
- return hmi_zone_capabilities_;
-}
-
-const smart_objects::SmartObject*
-HMICapabilities::soft_button_capabilities() const {
- return soft_buttons_capabilities_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::button_capabilities() const {
- return button_capabilities_;
-}
-
-const smart_objects::SmartObject*
-HMICapabilities::speech_capabilities() const {
- return speech_capabilities_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::vr_capabilities() const {
- return vr_capabilities_;
-}
-
-const smart_objects::SmartObject*
-HMICapabilities::audio_pass_thru_capabilities() const {
- return audio_pass_thru_capabilities_;
-}
-
-const smart_objects::SmartObject*
-HMICapabilities::preset_bank_capabilities() const {
- return preset_bank_capabilities_;
-}
-
-bool HMICapabilities::attenuated_supported() const {
- return attenuated_supported_;
-}
-
-const smart_objects::SmartObject* HMICapabilities::vehicle_type() const {
- return vehicle_type_;
-}
-
-const smart_objects::SmartObject*
-HMICapabilities::prerecorded_speech() const {
- return prerecorded_speech_;
-}
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
+../../../../include/application_manager/hmi_capabilities.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/hmi_command_factory.h b/src/components/application_manager/test/mock/include/application_manager/hmi_command_factory.h
index d6f85a480..327faa973 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/hmi_command_factory.h
+++ b/src/components/application_manager/test/mock/include/application_manager/hmi_command_factory.h
@@ -1,63 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY 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;
-
-/**
- * @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 MessageSharedPtr& message);
-
- private:
- HMICommandFactory();
- DISALLOW_COPY_AND_ASSIGN(HMICommandFactory);
-};
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_
+../../../../include/application_manager/hmi_command_factory.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/hmi_state.h b/src/components/application_manager/test/mock/include/application_manager/hmi_state.h
new file mode 120000
index 000000000..62e3c1a93
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/hmi_state.h
@@ -0,0 +1 @@
+../../../../include/application_manager/hmi_state.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/message.h b/src/components/application_manager/test/mock/include/application_manager/message.h
index d92c89adf..3ae48a912 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/message.h
+++ b/src/components/application_manager/test/mock/include/application_manager/message.h
@@ -1,128 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_
-
-#include <string>
-#include <vector>
-
-#include "utils/shared_ptr.h"
-#include "protocol/message_priority.h"
-#include "protocol/rpc_type.h"
-#include "smart_objects/smart_object.h"
-
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
-namespace application_manager {
-
-typedef std::vector<uint8_t> BinaryData;
-
-// Message type is a general type used by both mobile and HMI messages
-enum MessageType {
- kUnknownType = -1,
- kRequest = 0,
- kResponse = 1,
- kNotification = 2,
- kErrorResponse = 3 // Error Response HMI ONLY
-};
-
-// Map PrcType to corresponding MessageType
-MessageType MessageTypeFromRpcType(protocol_handler::RpcType rpc_type);
-
-enum ProtocolVersion {
- kUnknownProtocol = -1,
- kHMI = 0,
- kV1 = 1,
- kV2 = 2,
- kV3 = 3
-};
-
-class Message {
- public:
- Message(protocol_handler::MessagePriority priority);
- Message(const Message& message);
- Message& operator=(const Message& message);
- bool operator==(const Message& message);
- ~Message();
-
- //! --------------------------------------------------------------------------
- int32_t function_id() const;
- int32_t correlation_id() const;
- int32_t connection_key() const;
-
- MessageType type() const;
- ProtocolVersion protocol_version() const;
-
- const std::string& json_message() const;
- const BinaryData* binary_data() const;
- bool has_binary_data() const;
- size_t data_size() const;
- size_t payload_size() const;
- const smart_objects::SmartObject& smart_object() const;
-
- //! --------------------------------------------------------------------------
- void set_function_id(int32_t id);
- void set_correlation_id(int32_t id);
- void set_connection_key(int32_t key);
- void set_message_type(MessageType type);
- void set_binary_data(BinaryData* data);
- void set_json_message(const std::string& json_message);
- void set_protocol_version(ProtocolVersion version);
- void set_smart_object(const smart_objects::SmartObject& object);
- void set_data_size(size_t data_size);
- void set_payload_size(size_t payload_size);
-
- protocol_handler::MessagePriority Priority() const { return priority_; }
-
- private:
- int32_t function_id_; // @remark protocol V2.
- int32_t correlation_id_; // @remark protocol V2.
- MessageType type_; // @remark protocol V2.
-
- // Pre-calculated message priority, higher priority messages are
- // Processed first
- protocol_handler::MessagePriority priority_;
-
- int32_t connection_key_;
- std::string json_message_;
- smart_objects::SmartObject smart_object_;
-
- // TODO(akandul): replace with shared_ptr
- BinaryData* binary_data_;
- size_t data_size_;
- size_t payload_size_;
- ProtocolVersion version_;
-};
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_
+../../../../include/application_manager/message.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/message_helper.h b/src/components/application_manager/test/mock/include/application_manager/message_helper.h
index 69c7b7bba..6227694b3 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/message_helper.h
+++ b/src/components/application_manager/test/mock/include/application_manager/message_helper.h
@@ -1,494 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_HELPER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_HELPER_H_
-
-#include <map>
-#include <string>
-#include <string.h>
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/macro.h"
-#include "connection_handler/device.h"
-#include "application_manager/application.h"
-#include "application_manager/vehicle_info_data.h"
-#include "policy/policy_types.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
-
-namespace application_manager {
-namespace mobile_api = mobile_apis;
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
-/*
- * @brief Typedef for VehicleData
- *
- * @param const char* Name of the parameter in mobile request
- * @param VehicleDataType Enum for vehicle data
- */
-typedef std::map<std::string, VehicleDataType> VehicleData;
-
-/**
- * @brief MessageHelper class
- **/
-class MessageHelper {
- public:
-
- typedef std::vector<smart_objects::SmartObject*> SmartObjectList;
-
- /**
- * @brief Creates request for different interfaces(JSON, DBUS)
- * @param correlation_id unique ID
- * @param params Vector of arguments that we need in GetVehicleData request (e.g. gps, odometer, fuel_level)
- */
- static void CreateGetVehicleDataRequest(uint32_t correlation_id, const std::vector<std::string>& params);
-
- /**
- * @brief Sends HMI status notification to mobile
- *
- *@param application_impl application with changed HMI status
- *
- **/
- static void SendHMIStatusNotification(const Application& application_impl);
-
- /**
- * @brief Sends OnAppRegistered notification to HMI
- *
- *@param application_impl application with changed HMI status
- *
- **/
- static void SendOnAppRegisteredNotificationToHMI(
- const Application& application_impl,
- bool resumption = false,
- bool need_restore_vr = false);
-
- /**
- * @brief Create mobile HashUpdateNotification
- */
- static smart_objects::SmartObject* GetHashUpdateNotification(const uint32_t app_id);
-
- /**
- * @brief Sends to mobile HashUpdateNotification
- */
- static void SendHashUpdateNotification(const uint32_t app_id);
-
- /**
- * @brief Sends OnAppInterfaceUnregistered notification to mobile
- *
- *@param connection_key Connection key
- *@param reason Reason
- *
- **/
- static void SendOnAppInterfaceUnregisteredNotificationToMobile(
- int32_t connection_key,
- mobile_apis::AppInterfaceUnregisteredReason::eType reason);
-
- /*
- * @brief Retrieve vehicle data map for param name in mobile request
- * to VehicleDataType
- *
- * @return VehicleData reference
- */
- static const VehicleData& vehicle_data();
-
- /**
- * @brief Convert string to HMI level, if possible
- * @param hmi_level Stringified HMI level
- * @return Appropriate enum from HMI level, or INVALID_ENUM, if conversiion
- * is not possible
- */
- static mobile_api::HMILevel::eType StringToHMILevel(
- const std::string& hmi_level);
-
- /*
- * @brief Used to obtain string representation of app's
- * HMI Level.
- * @param hmi_level Desired HMI Level
- */
- static std::string StringifiedHMILevel(
- mobile_apis::HMILevel::eType hmi_level);
-
- /*
- * @brief Used to obtain function name by its id
- * @param function_id Function ID
- */
- static std::string StringifiedFunctionID(
- mobile_apis::FunctionID::eType function_id);
-
- static smart_objects::SmartObject* CreateBlockedByPoliciesResponse(
- mobile_apis::FunctionID::eType function_id,
- mobile_apis::Result::eType result, uint32_t correlation_id,
- uint32_t connection_key);
-
- /*
- * @brief Prepare GetDeviceListResponse
- *
- *
- * @param devices Devices list
- *
- */
- static smart_objects::SmartObject* CreateDeviceListSO(
- const connection_handler::DeviceMap& devices);
-
- static smart_objects::SmartObject* CreateModuleInfoSO(
- uint32_t function_id);
-
- static smart_objects::SmartObject* CreateSetAppIcon(
- const std::string& path_to_icon, uint32_t app_id);
-
- /**
- * @brief Sends IVI subscriptions
- */
- static bool SendIVISubscribtions(const uint32_t app_id);
-
- /**
- * @brief Sends IVI subscriptions
- */
- static SmartObjectList GetIVISubscribtionRequests(const uint32_t app_id);
-
- static void SendAppDataToHMI(ApplicationConstSharedPtr app);
- static void SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app);
- static SmartObjectList CreateGlobalPropertiesRequestsToHMI(ApplicationConstSharedPtr app);
-
- static smart_objects::SmartObject* CreateAppVrHelp(ApplicationConstSharedPtr app);
-
- static SmartObjectList CreateShowRequestToHMI(ApplicationConstSharedPtr app);
- static void SendShowRequestToHMI(ApplicationConstSharedPtr app);
- static void SendShowConstantTBTRequestToHMI(ApplicationConstSharedPtr app);
- static void SendAddCommandRequestToHMI(ApplicationConstSharedPtr app);
- static SmartObjectList CreateAddCommandRequestToHMI(ApplicationConstSharedPtr app);
-
- static void SendChangeRegistrationRequestToHMI(ApplicationConstSharedPtr app);
- static void SendAddVRCommandToHMI(
- uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
- uint32_t app_id);
-
- static smart_objects::SmartObject* CreateAddVRCommandToHMI(
- uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
- uint32_t app_id);
-
- /*
- * @brief Create Common.HMIApplication struct application instance
- * @param app : applicaton instace
- * @param output smart object to store Common.HMIApplication struct
- * @return true on succes, otherwise return false;
- */
- static bool CreateHMIApplicationStruct(ApplicationConstSharedPtr app,
- smart_objects::SmartObject& output);
-
- static void SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app);
- static SmartObjectList CreateAddSubMenuRequestToHMI(ApplicationConstSharedPtr app);
-
- /*
- * @brief Creates BasicCommunication.OnAppUnregistered notification
- * @param app Application instance
- * @param is_unexpected_disconnect
- * Indicates if connection was unexpectedly lost by TM or HB
- */
- static void SendOnAppUnregNotificationToHMI(ApplicationConstSharedPtr app,
- bool is_unexpected_disconnect = false);
- static void SendActivateAppToHMI(
- uint32_t const app_id,
- hmi_apis::Common_HMILevel::eType level = hmi_apis::Common_HMILevel::FULL);
-
- static void SendOnResumeAudioSourceToHMI(const uint32_t app_id);
-
- static std::string GetDeviceMacAddressForHandle(
- const uint32_t device_handle);
-
- static void GetDeviceInfoForHandle(const uint32_t device_handle,
- policy::DeviceParams* device_info);
- static void GetDeviceInfoForApp(uint32_t connection_key,
- policy::DeviceParams* device_info);
-
- /**
- * @brief Send SDL_ActivateApp response to HMI
- * @param permissions response parameters
- */
- static void SendSDLActivateAppResponse(policy::AppPermissions& permissions,
- uint32_t correlation_id);
-
- /**
- * @brief Send OnSDLConsentNeeded to HMI for device data consent by user
- * @param device_info Device info, e.g. mac, handle, name
- */
- static void SendOnSDLConsentNeeded(const policy::DeviceParams& device_info);
-
- /**
- * @brief Send request to SyncP process to read file and send
- * Policy Table Snapshot using Retry Strategy
- * @param file_path Path to file with PTS
- * @param timeout Timeout to wait for PTU
- * @param retries Seconds between retries
- */
- static void SendPolicyUpdate(const std::string& file_path,
- int timeout,
- const std::vector<int>& retries);
-
- /**
- * @brief Send GetUserFriendlyMessage response to HMI
- * @param msg Appopriate messages params
- * @param correlation_id Correlation id of request
- */
- static void SendGetUserFriendlyMessageResponse(
- const std::vector<policy::UserFriendlyMessage>& msg,
- uint32_t correlation_id);
-
- /**
- * @brief Send GetListOfPermissions response to HMI
- * @param permissions Array of groups permissions
- * @param correlation_id Correlation id of request
- */
- static void SendGetListOfPermissionsResponse(
- const std::vector<policy::FunctionalGroupPermission>& permissions,
- uint32_t correlation_id);
-
- /*
- * @brief Sends notification to HMI to start video streaming
- *
- * @param connection_key Application connection key
- *
- */
- static void SendNaviStartStream(int32_t connection_key);
-
- /*
- * @brief Sends notification to HMI to stop video streaming
- *
- * @param connection_key Application connection key
- *
- */
- static void SendNaviStopStream(int32_t connection_key);
-
- /*
- * @brief Send notification for Update of Policy Table
- * with PT Snapshot.
- * @param connection_key Id of application to send message to
- * @param policy_data PT Snapshot
- * @param url If empty string, no URL is provided
- * @param timeout If -1 no timeout is provdied
- */
- static void SendPolicySnapshotNotification(
- unsigned int connection_key, const std::vector<uint8_t>& policy_data,
- const std::string& url = "", int timeout = -1);
-
- /*
- * @brief Send notification to mobile on application permissions update
- * @param connection_key Id of application to send message to
- * @param permissions updated permissions for application
- */
- static void SendOnPermissionsChangeNotification(
- uint32_t connection_key, const policy::Permissions& permissions);
-
- /*
- * @brief Send notification to HMI on application permissions update
- * @param connection_key Id of application to send message to
- * @param permissions updated permissions for application
- */
- static void SendOnAppPermissionsChangedNotification(
- uint32_t connection_key, const policy::AppPermissions& permissions);
-
- /**
- * @brief Send GetStatusUpdate response to HMI with current policy update
- * status
- * @param status Update status
- * @param correlation_id Correlation id from request
- */
- static void SendGetStatusUpdateResponse(const std::string& status,
- uint32_t correlation_id);
-
- /**
- * @brief Send UpdateSDL response to HMI with policy update result
- * @param result Update result
- * @param correlation_id Correlation id from request
- */
- static void SendUpdateSDLResponse(const std::string& result,
- uint32_t correlation_id);
-
- /**
- * @brief Send OnStatusUpdate to HMI on policy update status change
- * @param status Policy table update status
- */
- static void SendOnStatusUpdate(const std::string& status);
-
- /**
- * @brief Send GetSystemInfo request to HMI
- */
- static void SendGetSystemInfoRequest();
-
- /*
- * @brief Sends notification to HMI to start audio streaming
- *
- * @param connection_key Application connection key
- *
- */
- static void SendAudioStartStream(int32_t connection_key);
-
- /*
- * @brief Sends notification to HMI to stop audio streaming
- *
- * @param connection_key Application connection key
- *
- */
- static void SendAudioStopStream(int32_t connection_key);
-
- /*
- * @brief Sends notification to HMI to stop audioPathThru
- *
- * @param connection_key Application connection key
- *
- * @return TRUE on SUCCES otherwise return FALSE
- */
- static bool SendStopAudioPathThru();
-
- static smart_objects::SmartObject* CreateNegativeResponse(
- uint32_t connection_key, int32_t function_id, uint32_t correlation_id,
- int32_t result_code);
-
- /*
- * @brief Verify image and add image file full path
- *
- * @param SmartObject with image
- *
- * @param app current application
- *
- * @return verification result
- *
- */
- static mobile_apis::Result::eType VerifyImage(smart_objects::SmartObject& image,
- ApplicationConstSharedPtr app);
-
- /*
- * @brief Finds "Image" structure in request and verify image file presence
- * in Core.
- *
- * @param message SmartObject with request
- *
- * @param app current application
- *
- * @return verification result
- *
- */
- static mobile_apis::Result::eType VerifyImageFiles(
- smart_objects::SmartObject& message, ApplicationConstSharedPtr app);
-
- static mobile_apis::Result::eType VerifyImageVrHelpItems(
- smart_objects::SmartObject& message, ApplicationConstSharedPtr app);
-
- /**
- * @brief Checks string if it contains incorrect character \t\n \\t \\n
- * or string contains only whitespace
- * @param parameter str contains string which must be checked
- * @return returns FALSE if string contains incorrect character or
- * string is empty otherwise returns TRUE
- */
- static bool VerifySoftButtonString(const std::string& str);
-
- static mobile_apis::Result::eType ProcessSoftButtons(
- smart_objects::SmartObject& message_params,
- ApplicationConstSharedPtr app);
-
- /*
- * @brief subscribe application to softbutton
- *
- * @param message_params contains data of request
- *
- * @param app current application
- *
- * @param function_id Unique command id from mobile API
- */
- static void SubscribeApplicationToSoftButton(
- smart_objects::SmartObject& message_params,
- ApplicationSharedPtr app,
- int32_t function_id);
-
- static bool PrintSmartObject(const smart_objects::SmartObject& object);
-
- template<typename From, typename To>
- static To ConvertEnumAPINoCheck(const From& input) {
- return static_cast<To>(input);
- }
-
- /**
- * @brief Convert common language to string representation
- * @param language Common language
- * @return Common language string representation
- */
- static std::string CommonLanguageToString(
- hmi_apis::Common_Language::eType language);
-
- /**
- * @brief Gets command limit number per minute for specific application
- * @param policy_app_id Unique application id
- * @return Limit for number of command per minute
- */
- static uint32_t GetAppCommandLimit(const std::string& policy_app_id);
-
- /**
- * @brief Creates TTS.SetGlobalProperties request and sends
- * to HMI for VCA module.
- * @param app contains application which sends TTS GlobalProperties to HMI
- * after timeout or first time when application register with level NONE or
- * BACKGROUND
- * @param default_help_prompt
- * if default_help_prompt=TRUE->TTSGlobalProperties request will be created with
- * default helpPrompt array, otherwise TTSGlobalProperties request will be created
- * with empty helpPrompt array.
- */
- static void SendTTSGlobalProperties(
- ApplicationSharedPtr app, bool default_help_prompt);
-
- private:
- /**
- * @brief Allows to fill SO according to the current permissions.
- * @param permissions application permissions.
- * @param message which should be filled.
- */
- static void FillAppRevokedPermissions(const policy::AppPermissions& permissions,
- smart_objects::SmartObject& message);
-
- static smart_objects::SmartObject* CreateChangeRegistration(
- int32_t function_id, int32_t language, uint32_t app_id);
-
- MessageHelper();
-
- static const VehicleData vehicle_data_;
- DISALLOW_COPY_AND_ASSIGN(MessageHelper);
-};
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_HELPER_H_
+../../../../include/application_manager/message_helper.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/mobile_command_factory.h b/src/components/application_manager/test/mock/include/application_manager/mobile_command_factory.h
index 1bf60fb74..20bd35432 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/mobile_command_factory.h
+++ b/src/components/application_manager/test/mock/include/application_manager/mobile_command_factory.h
@@ -1,63 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY 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;
-
-/**
- * @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 commands::Command* CreateCommand(const MessageSharedPtr& message);
-
- private:
- MobileCommandFactory();
- DISALLOW_COPY_AND_ASSIGN(MobileCommandFactory);
-};
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_
+../../../../include/application_manager/mobile_command_factory.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/mobile_message_handler.h b/src/components/application_manager/test/mock/include/application_manager/mobile_message_handler.h
index 67d51c0da..8cfa824c4 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/mobile_message_handler.h
+++ b/src/components/application_manager/test/mock/include/application_manager/mobile_message_handler.h
@@ -1,64 +1 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY 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_MESSAGE_HANDLER_IMPL_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_IMPL_H_
-
-#include "utils/macro.h"
-#include "protocol/common.h"
-#include "application_manager/message.h"
-
-namespace application_manager {
-typedef utils::SharedPtr<application_manager::Message> MobileMessage;
-class MobileMessageHandler {
- public:
- static application_manager::Message* HandleIncomingMessageProtocolV1(
- const protocol_handler::RawMessagePtr message);
-
- static application_manager::Message* HandleIncomingMessageProtocolV2(
- const protocol_handler::RawMessagePtr message);
-
- //! -------------------------------------------------------------
-
- static protocol_handler::RawMessage* HandleOutgoingMessageProtocolV1(
- const MobileMessage& message);
-
- static protocol_handler::RawMessage* HandleOutgoingMessageProtocolV2(
- const MobileMessage& message);
-
- //! -------------------------------------------------------------
- private:
- DISALLOW_COPY_AND_ASSIGN(MobileMessageHandler);
-};
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_IMPL_H_
+../../../../include/application_manager/mobile_message_handler.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/delegates/app_permission_delegate.h b/src/components/application_manager/test/mock/include/application_manager/policies/delegates/app_permission_delegate.h
index 55a4f146c..0dc895b54 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/delegates/app_permission_delegate.h
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/delegates/app_permission_delegate.h
@@ -1,81 +1 @@
-/*
- 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_DELEGATES_APP_PERMISSION_DELEGATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DELEGATES_APP_PERMISSION_DELEGATE_H_
-
-
-#include "utils/threads/thread.h"
-#include "utils/threads/thread_delegate.h"
-#include "utils/conditional_variable.h"
-
-#include "policy/policy_types.h"
-
-namespace policy {
-
- /**
- * @brief The AppPermissionDelegate class allows to call OnAppPermissionConsent
- * in async way.
- */
-class AppPermissionDelegate: public threads::ThreadDelegate {
- public:
- /**
- * @brief AppPermissionDelegate constructor, contains parameters
- * which will be pass to the called function.
- *
- * @param connection_key connection key.
- *
- * @param permissions new permissions
- */
- AppPermissionDelegate(const uint32_t connection_key,
- const PermissionConsent &permissions);
-
- /**
- * @brief threadMain run the needed function.
- */
- virtual void threadMain();
-
- /**
- * @brief exitThreadMain do some stuff before exit from thread
- *
- * @return true in case when thread has been finished properly
- */
- virtual void exitThreadMain();
-
- private:
- uint32_t connection_key_;
- PermissionConsent permissions_;
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DELEGATES_APP_PERMISSION_DELEGATE_H_
+../../../../../../include/application_manager/policies/delegates/app_permission_delegate.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/delegates/statistics_delegate.h b/src/components/application_manager/test/mock/include/application_manager/policies/delegates/statistics_delegate.h
index 9044a3fd3..4e71cefaa 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/delegates/statistics_delegate.h
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/delegates/statistics_delegate.h
@@ -1,82 +1 @@
-/*
- 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_DELEGATES_STATISTICS_DELEGATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DELEGATES_STATISTICS_DELEGATE_H_
-
-#include <string>
-
-#include "utils/threads/thread.h"
-#include "utils/threads/thread_delegate.h"
-#include "utils/conditional_variable.h"
-#include "application_manager/usage_statistics.h"
-
-namespace policy {
-
- class StatisticsDelegate: public threads::ThreadDelegate {
- enum StatisticType{
- INCREMENT_GLOBAL,
- INCREMENT_APP,
- SET,
- ADD
- };
- public:
- explicit StatisticsDelegate(usage_statistics::GlobalCounterId type);
-
- StatisticsDelegate(const std::string& app_id,
- usage_statistics::AppCounterId type);
-
- StatisticsDelegate(const std::string& app_id,
- usage_statistics::AppInfoId type,
- const std::string& value);
-
- StatisticsDelegate(const std::string& app_id,
- usage_statistics::AppStopwatchId type,
- int32_t timespan_seconds);
-
- virtual void threadMain();
-
- virtual void exitThreadMain();
- private:
- StatisticType type_;
- usage_statistics::GlobalCounterId global_counter_;
- usage_statistics::AppCounterId app_counter_;
- usage_statistics::AppInfoId app_info_;
- usage_statistics::AppStopwatchId stop_watch_;
-
- std::string app_id_;
- std::string value_;
- int32_t timespan_seconds_;
- };
-} // namespace policy
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DELEGATES_STATISTICS_DELEGATE_H_
+../../../../../../include/application_manager/policies/delegates/statistics_delegate.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/policy_event_observer.h b/src/components/application_manager/test/mock/include/application_manager/policies/policy_event_observer.h
index 7fdfb4e0a..5cba69ed2 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/policy_event_observer.h
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/policy_event_observer.h
@@ -1,59 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_EVENT_OBSERVER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_EVENT_OBSERVER_H_
-
-#include "application_manager/event_engine/event_observer.h"
-#include "utils/shared_ptr.h"
-
-namespace policy {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
-class PolicyManager;
-
-class PolicyEventObserver :
- public application_manager::event_engine::EventObserver {
- public:
- PolicyEventObserver(utils::SharedPtr<PolicyManager> policy_manager);
- void on_event(const application_manager::event_engine::Event& event);
- void subscribe_on_event(
- const application_manager::event_engine::Event::EventID& event_id,
- int32_t hmi_correlation_id = 0);
- private:
- utils::SharedPtr<PolicyManager> policy_manager_;
- void ProcessOdometerEvent(const smart_objects::SmartObject& message);
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_EVENT_OBSERVER_H_
+../../../../../include/application_manager/policies/policy_event_observer.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler.h b/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler.h
index dfc29fe00..522113630 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler.h
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler.h
@@ -1,419 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_H_
-
-#include <string>
-#include <map>
-#include <set>
-#include <vector>
-#include "policy/policy_manager.h"
-#include "application_manager/policies/policy_event_observer.h"
-#include "application_manager/policies/pt_exchange_handler.h"
-#include "utils/logger.h"
-#include "utils/singleton.h"
-#include "usage_statistics/statistics_manager.h"
-
-namespace Json {
-class Value;
-}
-
-namespace policy {
-typedef std::vector<uint32_t> AppIds;
-typedef std::vector<uint32_t> DeviceHandles;
-
-class PolicyHandler :
- public utils::Singleton<PolicyHandler, utils::deleters::Deleter<PolicyHandler> >,
- public PolicyListener {
- public:
- virtual ~PolicyHandler();
- bool LoadPolicyLibrary();
- bool PolicyEnabled();
- bool InitPolicyTable();
- bool ResetPolicyTable();
- bool ClearUserConsent();
- bool SendMessageToSDK(const BinaryMessage& pt_string);
- bool ReceiveMessageFromSDK(const std::string& file,
- const BinaryMessage& pt_string);
- bool UnloadPolicyLibrary();
- void OnPTExchangeNeeded();
- void OnPermissionsUpdated(const std::string& policy_app_id,
- const Permissions& permissions,
- const HMILevel& default_hmi);
-
- bool GetPriority(const std::string& policy_app_id, std::string* priority);
- void CheckPermissions(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- const RPCParams& rpc_params,
- CheckPermissionResult& result);
-
- uint32_t GetNotificationsNumber(const std::string& priority);
- DeviceConsent GetUserConsentForDevice(const std::string& device_id);
- bool GetDefaultHmi(const std::string& policy_app_id,
- std::string* default_hmi);
- bool GetInitialAppData(const std::string& application_id,
- StringArray* nicknames = NULL,
- StringArray* app_hmi_types = NULL);
- EndpointUrls GetUpdateUrls(int service_type);
- void ResetRetrySequence();
- int NextRetryTimeout();
- int TimeoutExchange();
- void OnExceededTimeout();
- BinaryMessageSptr RequestPTUpdate();
- const std::vector<int> RetrySequenceDelaysSeconds();
-
- utils::SharedPtr<usage_statistics::StatisticsManager> GetStatisticManager();
-
- /**
- * Checks system action of application for permission of keep context
- * @param system_action system action (see mobile api)
- * @param policy_app_id unique application id
- * @return false if system_action is KEEP_CONTEXT and it isn't allowed by policy
- * otherwise true
- */
- bool CheckKeepContext(int system_action, const std::string& policy_app_id);
-
- /**
- * Checks system action of application for permission of steal focus
- * @param system_action system action (see mobile api)
- * @param policy_app_id unique application id
- * @return false if system_action is STEAL_FOCUS and it isn't allowed by policy
- * otherwise true
- */
- bool CheckStealFocus(int system_action, const std::string& policy_app_id);
-
- /**
- * Lets client to notify PolicyHandler that more kilometers expired
- * @param kms New value of odometer
- */
- void KmsChanged(int kms);
-
- /**
- * @brief Gather information for application and sends it to HMI
- * @param connection_key Connection key for application
- */
- void OnActivateApp(uint32_t connection_key, uint32_t correlation_id);
-
- /**
- * @brief Process user consent on mobile data connection access
- * @param Device id or 0, if concern to all SDL functionality
- * @param User consent from response
- */
- void OnAllowSDLFunctionalityNotification(bool is_allowed,
- uint32_t device_id = 0);
-
- /**
- * @brief Increment counter for ignition cycles
- */
- void OnIgnitionCycleOver();
-
- /**
- * @brief Send notification to HMI concerning revocation of application
- * @param policy_app_id Unique identifier of application
- */
- void OnAppRevoked(const std::string& policy_app_id);
-
- void OnPendingPermissionChange(const std::string& policy_app_id);
-
- /**
- * Initializes PT exchange at ignition if need
- */
- void PTExchangeAtRegistration(const std::string& app_id);
-
- /**
- * Initializes PT exchange at user request
- * @param correlation_id correlation id of request
- */
- void PTExchangeAtUserRequest(uint32_t correlation_id);
-
- /**
- * @brief Save device info for specific device to policy table
- * @param device_id Device mac address
- * @param device_info Device params
- */
- void SetDeviceInfo(std::string& device_id, const DeviceInfo& device_info);
-
- /**
- * @brief Store user-changed permissions consent to DB
- * @param connection_key Connection key of application or 0, if permissions
- * should be applied to all applications
- * @param permissions User-changed group permissions consent
- */
- void OnAppPermissionConsent(const uint32_t connection_key,
- PermissionConsent& permissions);
-
- /**
- * @brief Get appropriate message parameters and send them with response
- * to HMI
- * @param message_codes RPC message codes
- * @param language Language
- * @param correlation_id correlation id of request
- */
- void OnGetUserFriendlyMessage(const std::vector<std::string>& message_codes,
- const std::string& language,
- uint32_t correlation_id);
-
- /**
- * @brief Get list of permissions for application/device binded to
- * connection key from request and send response
- * @param connection_key Connection key for specific application or 0 for all
- * currently registered applications
- * @param correlation_id Correlation id from request
- */
- void OnGetListOfPermissions(const uint32_t connection_key,
- const uint32_t correlation_id);
-
- /**
- * @brief Get current policy table update state and send response
- * @param correlation_id Correlation id from request
- */
- void OnGetStatusUpdate(const uint32_t correlation_id);
-
- /**
- * @brief Send notification to HMI with changed policy update status
- * @param status Current policy update state
- */
- void OnUpdateStatusChanged(policy::PolicyTableStatus status);
-
- /**
- * @brief Update currently used device id in policies manager for given
- * application
- * @param policy_app_id Application id
- */
- std::string OnCurrentDeviceIdUpdateRequired(const std::string& policy_app_id);
-
- /**
- * @brief Set parameters from OnSystemInfoChanged to policy table
- * @param language System language
- */
- void OnSystemInfoChanged(const std::string& language);
-
- /**
- * @brief Save data from GetSystemInfo request to policy table
- * @param ccpu_version CCPU version
- * @param wers_country_code WERS country code
- * @param language System language
- */
- void OnGetSystemInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language);
-
- /**
- * @brief Send request to HMI to get update on system parameters
- */
- virtual void OnSystemInfoUpdateRequired();
-
- /**
- * @brief Sends GetVehicleData request in case when Vechicle info is ready.
- */
- virtual void OnVIIsReady();
-
- /**
- * @brief Allows to update vechicle data info.
- * @param SmartObject which contains all needed information.
- */
- virtual void OnVehicleDataUpdated(const smart_objects::SmartObject& message);
-
- /**
- * Removes device
- * @param device_id id of device
- */
- void RemoveDevice(const std::string& device_id);
-
- /**
- * Adds statistics info
- * @param type type of info
- */
- void AddStatisticsInfo(int type);
-
- /**
- * Handles system error
- * @param code code of error
- */
- void OnSystemError(int code);
-
- /**
- * @brief Choose application id to be used for snapshot sending
- * @return Application id or 0, if there are no applications registered
- */
- uint32_t GetAppIdForSending();
-
- std::string GetAppName(const std::string& policy_app_id);
-
- virtual void OnUserRequestedUpdateCheckRequired();
-
- virtual void OnDeviceConsentChanged(const std::string& device_id,
- bool is_allowed);
-
- /**
- * @brief Allows to add new or update existed application during
- * registration process
- * @param application_id The policy aplication id.
- */
- void AddApplication(const std::string& application_id);
-
- /**
- * Checks whether application is revoked
- * @param app_id id application
- * @return true if application is revoked
- */
- bool IsApplicationRevoked(const std::string& app_id);
-
- /**
- * @brief Notifies policy manager, that PTS was sent out
- */
- void OnUpdateRequestSentToMobile();
-
- /**
- * Returns heart beat timeout
- * @param app_id application id
- * @return if timeout was set then value in seconds greater zero
- * otherwise heart beat for specific application isn't set
- */
- uint16_t HeartBeatTimeout(const std::string& app_id) const;
-
-//TODO(AKutsan) REMOVE THIS UGLY HOTFIX
- virtual void Increment(usage_statistics::GlobalCounterId type);
- virtual void Increment(const std::string& app_id,
- usage_statistics::AppCounterId type);
- virtual void Set(const std::string& app_id,
- usage_statistics::AppInfoId type,
- const std::string& value);
- virtual void Add(const std::string& app_id,
- usage_statistics::AppStopwatchId type,
- int32_t timespan_seconds);
-
-
-protected:
-
- /**
- * Starts next retry exchange policy table
- */
- void StartNextRetry();
-
- /**
- * Initializes PT exchange at odometer if need
- * @param kilometers value from odometer in kilometers
- */
- void PTExchangeAtOdometer(int kilometers);
-
- /**
- * Starts proccess updating policy table
- */
- void StartPTExchange(bool skip_device_selection = false);
-
- private:
- /**
- * @brief Choose device according to app HMI status and user consent for
- * device
- * @param device_info Struct with selected device parameters
- * @return consent status for selected device
- */
- DeviceConsent GetDeviceForSending(DeviceParams& device_params);
-
- /**
- * @brief Convert internal policy update status to appropriate status for HMI
- * @param status Internal policy update status
- * @return Converted status for sending to HMI
- */
- const std::string ConvertUpdateStatus(policy::PolicyTableStatus status);
-
-private:
-
- class StatisticManagerImpl: public usage_statistics::StatisticsManager {
- //TODO(AKutsan) REMOVE THIS UGLY HOTFIX
- virtual void Increment(usage_statistics::GlobalCounterId type) {
- return PolicyHandler::instance()->Increment(type);
- }
-
- virtual void Increment(const std::string& app_id,
- usage_statistics::AppCounterId type) {
- return PolicyHandler::instance()->Increment(app_id, type);
- }
-
- virtual void Set(const std::string& app_id,
- usage_statistics::AppInfoId type,
- const std::string& value) {
- return PolicyHandler::instance()->Set(app_id, type, value);
- }
-
- virtual void Add(const std::string& app_id,
- usage_statistics::AppStopwatchId type,
- int32_t timespan_seconds) {
- return PolicyHandler::instance()->Add(app_id, type, timespan_seconds);
- }
- };
- //TODO(AKutsan) REMOVE THIS UGLY HOTFIX
-
-
- PolicyHandler();
- static PolicyHandler* instance_;
- static const std::string kLibrary;
- utils::SharedPtr<PolicyManager> policy_manager_;
- void* dl_handle_;
- AppIds last_used_app_ids_;
- utils::SharedPtr<PTExchangeHandler> exchange_handler_;
- utils::SharedPtr<PolicyEventObserver> event_observer_;
- bool on_ignition_check_done_;
- uint32_t last_activated_app_id_;
- bool registration_in_progress;
-
- /**
- * @brief Contains device handles, which were sent for user consent to HMI
- */
- DeviceHandles pending_device_handles_;
-
- inline bool CreateManager();
-
- bool is_user_requested_policy_table_update_;
-
- /**
- * @brief Application-to-device map is used for getting/setting user consents
- * for all apps
- */
- std::map<std::string, std::string> app_to_device_link_;
-
-
- utils::SharedPtr<StatisticManagerImpl> statistic_manager_impl_;
-
-
- DISALLOW_COPY_AND_ASSIGN(PolicyHandler);
- FRIEND_BASE_SINGLETON_CLASS_WITH_DELETER(PolicyHandler,
- utils::deleters::Deleter<PolicyHandler>);
- FRIEND_DELETER_DESTRUCTOR(PolicyHandler);
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_H_
+../../../../../include/application_manager/policies/policy_handler.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler_observer.h b/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler_observer.h
new file mode 120000
index 000000000..22acc100d
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler_observer.h
@@ -0,0 +1 @@
+../../../../../include/application_manager/policies/policy_handler_observer.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/policy_retry_sequence.h b/src/components/application_manager/test/mock/include/application_manager/policies/policy_retry_sequence.h
index f1a9ff55b..569a62252 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/policy_retry_sequence.h
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/policy_retry_sequence.h
@@ -1,54 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_RETRY_SEQUENCE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_RETRY_SEQUENCE_H_
-
-#include "utils/threads/thread_delegate.h"
-
-namespace policy {
-
-class PolicyHandler;
-
-class RetrySequence : public threads::ThreadDelegate {
- public:
- explicit RetrySequence(PolicyHandler* const policy_handler);
- void threadMain();
-
- private:
- PolicyHandler* const policy_handler_;
- void StartNextRetry();
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_RETRY_SEQUENCE_H_
+../../../../../include/application_manager/policies/policy_retry_sequence.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler.h b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler.h
index 31f7ded50..22e071c88 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler.h
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler.h
@@ -1,47 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_H_
-
-#include "policy/policy_manager.h"
-
-namespace policy {
-class PTExchangeHandler {
- public:
- virtual ~PTExchangeHandler() {};
- virtual void Start() = 0;
- virtual void Stop() = 0;
-};
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_H_
+../../../../../include/application_manager/policies/pt_exchange_handler.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_ext.h b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_ext.h
index 05aec0c3e..080045466 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_ext.h
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_ext.h
@@ -1,52 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_EXT_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_EXT_H_
-
-#include "application_manager/policies/pt_exchange_handler.h"
-#include "application_manager/policies/policy_handler.h"
-
-namespace policy {
-class PTExchangeHandlerExt : public PTExchangeHandler {
- public:
- PTExchangeHandlerExt(PolicyHandler* policy_handler);
- ~PTExchangeHandlerExt();
- virtual void Start();
- virtual void Stop();
-
- private:
- PolicyHandler* policy_handler_;
-};
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_EXT_H_
+../../../../../include/application_manager/policies/pt_exchange_handler_ext.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_impl.h b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_impl.h
index 29c74aa96..f3a2017c5 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_impl.h
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_impl.h
@@ -1,61 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_INCLUDE_POLICY_PT_EXCHANGE_IMPL_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_IMPL_H_
-
-#include "application_manager/policies/pt_exchange_handler.h"
-#include "utils/lock.h"
-#include "utils/threads/thread.h"
-
-namespace policy {
-
-class PolicyHandler;
-
-class PTExchangeHandlerImpl : public PTExchangeHandler {
- public:
- PTExchangeHandlerImpl(PolicyHandler* handler);
- virtual ~PTExchangeHandlerImpl();
- virtual void Start();
- virtual void Stop();
-
- protected:
- PolicyHandler* policy_handler_;
- threads::Thread* retry_sequence_;
- sync_primitives::Lock retry_sequence_lock_;
-
- friend class RetrySequence;
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_IMPL_H_
+../../../../../include/application_manager/policies/pt_exchange_handler_impl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/request_controller.h b/src/components/application_manager/test/mock/include/application_manager/request_controller.h
index 2bc5f5466..1b619cf77 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/request_controller.h
+++ b/src/components/application_manager/test/mock/include/application_manager/request_controller.h
@@ -1,266 +1 @@
-/**
- * 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_REQUEST_CONTROLLER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
-
-#include <climits>
-#include <vector>
-#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"
-
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-#include "application_manager/request_info.h"
-#include "utils/timer_thread.h"
-
-
-namespace application_manager {
-
-namespace request_controller {
-
-using namespace threads;
-
-/**
-* @brief RequestController class is used to control currently active mobile
-* requests.
-*/
-class RequestController {
- public:
-
- /**
- * @brief Result code for addRequest
- */
- enum TResult
- {
- SUCCESS = 0,
- TOO_MANY_REQUESTS,
- TOO_MANY_PENDING_REQUESTS,
- NONE_HMI_LEVEL_MANY_REQUESTS,
- INVALID_DATA
- };
-
- /**
- * @brief Thread pool state
- */
- enum TPoolState
- {
- UNDEFINED = 0,
- STARTED,
- STOPPED,
- };
-
- // Methods
-
- /**
- * @brief Class constructor
- *
- */
- RequestController();
-
- /**
- * @brief Class destructor
- *
- */
- virtual ~RequestController();
-
- /**
- * @brief Initialize thread pool
- *
- */
- void InitializeThreadpool();
-
- /**
- * @brief Destroy thread pool
- *
- */
- void DestroyThreadpool();
-
- /**
- * @brief Check if max request amount wasn't exceed and adds request to queue.
- *
- * @param request Active mobile request
- * @param hmi_level Current application hmi_level
- *
- * @return Result code
- *
- */
- TResult addMobileRequest(const MobileRequestPtr& request,
- const mobile_apis::HMILevel::eType& hmi_level);
-
-
- /**
- * @brief Store HMI request until response or timeout won't remove it
- *
- * @param request Active hmi request
- * @return Result code
- *
- */
- TResult addHMIRequest(const RequestPtr request);
-
- /**
- * @ Add notification to collection
- *
- * @param ptr Reference to shared pointer that point on hmi notification
- */
- void addNotification(const RequestPtr ptr);
-
- /**
- * @brief Removes request from queue
- *
- * @param mobile_corellation_id Active mobile request correlation ID
- *
- */
- void terminateMobileRequest(const uint32_t& mobile_correlation_id);
-
-
- /**
- * @brief Removes request from queue
- *
- * @param mobile_corellation_id Active mobile request correlation ID
- *
- */
- void terminateHMIRequest(const uint32_t& correlation_id);
-
- /**
- * @ Add notification to collection
- *
- * @param ptr Reference to shared pointer that point on hmi notification
- */
- void removeNotification(const commands::Command* notification);
-
- /**
- * @brief Removes all requests from queue for specified application
- *
- * @param app_id Mobile application ID (app_id)
- *
- */
- void terminateAppRequests(const uint32_t& app_id);
-
- /**
- * @brief Terminates all requests from HMI
- */
- void terminateAllHMIRequests();
-
- /**
- * @brief Updates request timeout
- *
- * @param app_id Connection key of application
- * @param mobile_correlation_id Correlation ID of the mobile request
- * @param new_timeout_value New timeout to be set in milliseconds
- */
- void updateRequestTimeout(const uint32_t& app_id,
- const uint32_t& mobile_correlation_id,
- const uint32_t& new_timeout);
-
- protected:
-
- /**
- * @brief Checs if this app as able to add new requests, or limits was exceeded
- * @param app_id - application id
- * @param app_time_scale - time scale (seconds)
- * @param max_request_per_time_scale - maximum count of request that should be allowed for app_time_scale secconds
- */
- bool checkTimeScaleMaxRequest(const uint32_t& app_id,
- const uint32_t& app_time_scale,
- const uint32_t& max_request_per_time_scale);
-
- /**
- * @brief Checs if this app as able to add new requests in current hmi_level, or limits was exceeded
- * @param hmi_level - hmi level
- * @param app_id - application id
- * @param app_time_scale - time scale (seconds)
- * @param max_request_per_time_scale - maximum count of request that should be allowed for app_time_scale secconds
- */
- bool checkHMILevelTimeScaleMaxRequest(const mobile_apis::HMILevel::eType& hmi_level,
- const uint32_t& app_id,
- const uint32_t& app_time_scale,
- const uint32_t& max_request_per_time_scale);
-
- void onTimer();
-
- /**
- * @brief Update timout for next OnTimer
- * Not thread safe
- */
- void UpdateTimer();
-
- private:
-
- // Data types
-
- class Worker : public ThreadDelegate {
- public:
- Worker(RequestController* requestController);
- virtual ~Worker();
- virtual void threadMain();
- virtual bool exitThreadMain();
- protected:
- private:
- RequestController* request_controller_;
- sync_primitives::Lock thread_lock_;
- volatile bool stop_flag_;
- };
-
- std::vector<Thread*> pool_;
- volatile TPoolState pool_state_;
- uint32_t pool_size_;
- sync_primitives::ConditionalVariable cond_var_;
-
- std::list<MobileRequestPtr> mobile_request_list_;
- sync_primitives::Lock mobile_request_list_lock_;
-
- RequestInfoSet pending_request_set_;
- sync_primitives::Lock pending_request_set_lock_;
-
- /**
- * @brief Set of HMI notifications with timeout.
- */
- std::list<RequestPtr> notification_list_;
-
- timer::TimerThread<RequestController> timer_;
- static const uint32_t dafault_sleep_time_ = UINT_MAX;
-
- DISALLOW_COPY_AND_ASSIGN(RequestController);
-};
-
-} // namespace request_controller
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
+../../../../include/application_manager/request_controller.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/request_info.h b/src/components/application_manager/test/mock/include/application_manager/request_info.h
index b1409488f..c726e09a3 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/request_info.h
+++ b/src/components/application_manager/test/mock/include/application_manager/request_info.h
@@ -1,262 +1 @@
-/**
-* \file request_info.h
-* \brief request information structure header file.
-*
-* 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_REQUEST_INFO_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_INFO_H_
-
-#include <stdint.h>
-
-#include "application_manager/commands/command_request_impl.h"
-#include "commands/hmi/request_to_hmi.h"
-
-#include "utils/date_time.h"
-
-namespace application_manager {
-
-namespace request_controller {
-
- /*
- * @brief Typedef for active mobile request
- *
- */
- typedef utils::SharedPtr<commands::Command> RequestPtr;
- typedef utils::SharedPtr<commands::CommandRequestImpl> MobileRequestPtr;
-
- struct RequestInfo {
- RequestInfo(const uint64_t timeout_sec)
- : timeout_sec_(timeout_sec) {
- start_time_ = date_time::DateTime::getCurrentTime();
- updateEndTime();
- }
-
- RequestInfo(const TimevalStruct& start_time,const uint64_t timeout_sec)
- : start_time_(start_time),
- timeout_sec_(timeout_sec) {
- updateEndTime();
- }
-
- virtual ~RequestInfo(){}
-
- virtual uint32_t requestId() = 0;
- virtual commands::Command* request() = 0;
-
- void updateEndTime() {
- end_time_ = date_time::DateTime::getCurrentTime();
- end_time_.tv_sec += timeout_sec_;
-
- // possible delay during IPC
- const uint32_t hmi_delay_sec = 1;
- end_time_.tv_sec += hmi_delay_sec;
- }
-
- void updateTimeOut(const uint64_t& timeout_sec) {
- timeout_sec_ = timeout_sec;
- updateEndTime();
- }
-
- bool isExpired() {
- if ( date_time::GREATER ==
- date_time::DateTime::compareTime(end_time_, date_time::DateTime::getCurrentTime()) ) {
- return false;
- }
- return true;
- }
-
- TimevalStruct start_time() {
- return start_time_;
- }
-
- uint64_t timeout_sec() {
- return timeout_sec_;
- }
-
- TimevalStruct end_time() {
- return end_time_;
- }
-
- uint32_t app_id() {
- return app_id_;
- }
-
- mobile_apis::HMILevel::eType hmi_level() {
- return hmi_level_;
- }
-
- protected:
- TimevalStruct start_time_;
- uint64_t timeout_sec_;
- TimevalStruct end_time_;
- uint32_t app_id_;
- mobile_apis::HMILevel::eType hmi_level_;
- };
-
- typedef utils::SharedPtr<RequestInfo> RequestInfoPtr;
-
- struct RequestInfoComparator {
- bool operator() (const RequestInfoPtr lhs,
- const RequestInfoPtr rhs) const {
- date_time::TimeCompare compare_result =
- date_time::DateTime::compareTime(lhs->end_time(), rhs->end_time());
-
- return compare_result == date_time::LESS;
- }
- };
-
- typedef std::set<RequestInfoPtr,RequestInfoComparator> RequestInfoSet;
-
- struct HMIRequestInfo: public RequestInfo {
- HMIRequestInfo(RequestPtr request, const uint64_t timeout_sec);
- HMIRequestInfo(RequestPtr request, const TimevalStruct& start_time,
- const uint64_t timeout_sec);
-
- RequestPtr request_;
- uint32_t correlation_id_;
-
- virtual uint32_t requestId() {
- return correlation_id_;
- }
-
- virtual commands::Command* request() {
- return request_.get();
- }
- };
-
- struct MobileRequestInfo: public RequestInfo {
- MobileRequestInfo(RequestPtr request,
- const uint64_t timeout_sec);
-
- MobileRequestInfo(RequestPtr request,
- const TimevalStruct& start_time,
- const uint64_t timeout_sec);
-
- RequestPtr request_;
- uint32_t mobile_correlation_id_;
-
- virtual uint32_t requestId() {
- return mobile_correlation_id_;
- }
-
- virtual commands::Command* request() {
- return request_.get();
- }
- };
-
- /**
- * @brief Structure used in std algorithms to determine amount of request
- * during time scale
- */
- struct TimeScale {
- TimeScale(const TimevalStruct& start,
- const TimevalStruct& end,
- const uint32_t& app_id)
- : start_(start),
- end_(end),
- app_id_(app_id) {}
-
- bool operator()(RequestInfoPtr setEntry) {
-
- if (!setEntry.valid()) {
- return false;
- }
-
- if (setEntry->app_id() != app_id_) {
- return false;
- }
-
- if (date_time::DateTime::getmSecs(setEntry->start_time())
- < date_time::DateTime::getmSecs(start_) ||
- date_time::DateTime::getmSecs(setEntry->start_time())
- > date_time::DateTime::getmSecs(end_)) {
- return false;
- }
-
- return true;
- }
-
- private:
- TimevalStruct start_;
- TimevalStruct end_;
- uint32_t app_id_;
- };
-
- /**
- * @brief Structure used in std algorithms to determine amount of request
- * during time scale for application in defined hmi level
- */
- struct HMILevelTimeScale {
- HMILevelTimeScale(const TimevalStruct& start,
- const TimevalStruct& end,
- const uint32_t& app_id,
- const mobile_apis::HMILevel::eType& hmi_level)
- : start_(start),
- end_(end),
- app_id_(app_id),
- hmi_level_(hmi_level) {}
-
- bool operator()(RequestInfoPtr setEntry) {
- if (!setEntry.valid()) {
- return false;
- }
-
- if (setEntry->app_id() != app_id_) {
- return false;
- }
-
- if (setEntry->hmi_level() != hmi_level_) {
- return false;
- }
-
- if (date_time::DateTime::getSecs(setEntry->start_time())
- < date_time::DateTime::getSecs(start_) ||
- date_time::DateTime::getSecs(setEntry->start_time())
- > date_time::DateTime::getSecs(end_)) {
- return false;
- }
-
- return true;
- }
- private:
- TimevalStruct start_;
- TimevalStruct end_;
- uint32_t app_id_;
- mobile_apis::HMILevel::eType hmi_level_;
- };
-
-
-
-} // namespace request_controller
-
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_INFO_H_
+../../../../include/application_manager/request_info.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/resume_ctrl.h b/src/components/application_manager/test/mock/include/application_manager/resume_ctrl.h
index 463df0b86..889e967d4 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/resume_ctrl.h
+++ b/src/components/application_manager/test/mock/include/application_manager/resume_ctrl.h
@@ -1,285 +1 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_RESUME_CTRL_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_RESUME_CTRL_H
-
-#include <stdint.h>
-#include <vector>
-#include <map>
-#include <set>
-#include <list>
-
-#include "json/json.h"
-#include "interfaces/HMI_API.h"
-#include "interfaces/HMI_API_schema.h"
-#include "interfaces/MOBILE_API_schema.h"
-#include "connection_handler/connection_handler_observer.h"
-#include "connection_handler/device.h"
-#include "application_manager/event_engine/event_observer.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/application.h"
-#include "utils/timer_thread.h"
-
-namespace application_manager {
-
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
-class ApplicationManagerImpl;
-class Application;
-class ResumeCtrl: public event_engine::EventObserver {
-
- public:
-
- /**
- * @brief Constructor
- * @param app_mngr ApplicationManager pointer
- */
- explicit ResumeCtrl(ApplicationManagerImpl* app_mngr);
-
- /**
- * @brief Event, that raised if application get resumption response from HMI
- * @param event : event object, that contains smart_object with HMI message
- */
- virtual void on_event(const event_engine::Event& event);
-
- /**
- * @brief Save all applications info to the file system
- */
- void SaveAllApplications();
-
- /**
- * @brief Save application persistent info for future resuming
- * @param application is application witch need to be saved
- */
- void SaveApplication(ApplicationConstSharedPtr application);
-
- /**
- * @brief Set application HMI Level as saved
- * @param application is application witch HMI Level is need to restore
- * @return true if success, otherwise return false
- */
- bool RestoreApplicationHMILevel(ApplicationSharedPtr application);
-
- /**
- * @brief Set application HMI Level as stored in policy
- * @param application is application witch HMI Level is need to setup
- * @return true if success, otherwise return false
- */
- bool SetupDefaultHMILevel(ApplicationSharedPtr application);
-
- /**
- * @brief Setup HmiLevel for application
- * Do routine of setting up hmi_level
- * @param application is application witch HMI Level is need to setup
- * @param hmi_level HMI Level is needed to setup
- * @param hmi_level AudioStreamingState is needed to setup
- * @param check_policy indicate if policy data consent must be verified
- * @return true if success, otherwise return false
- */
- bool SetupHMILevel(ApplicationSharedPtr application,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_streaming_state,
- bool check_policy = true);
-
- /**
- * @brief Set application HMI Level as saved
- * @param application is application witch HMI Level is need to restore
- * @return true if success, otherwise return false
- */
- bool RestoreApplicationData(ApplicationSharedPtr application);
-
- /**
- * @brief Check if Resume controller have saved instance of application
- * @param application is application witch need to be checked
- * @return true if exist, false otherwise
- */
- bool ApplicationIsSaved(ApplicationConstSharedPtr application);
-
- /**
- * @brief Remove application from list of saved applications
- * @param application is application witch need to be removed
- * @return return true, if success, otherwise return false
- */
- bool RemoveApplicationFromSaved(ApplicationConstSharedPtr application);
-
- /**
- * @brief Increments ignition counter for all registered applications
- */
- void IgnitionOff();
-
- /**
- * @brief Start timer for resumption applications
- * Restore D1-D5 data
- * @param application that is need to be restored
- * @return true if it was saved, otherwise return false
- */
- bool StartResumption(ApplicationSharedPtr application, uint32_t hash);
-
- /**
- * @brief Start timer for resumption applications
- * Does not restore D1-D5 data
- * @param application that is need to be restored
- * @return true if it was saved, otherwise return false
- */
- bool StartResumptionOnlyHMILevel(ApplicationSharedPtr application);
-
- /**
- * @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
- */
- bool CheckPersistenceFilesForResumption(ApplicationSharedPtr application);
-
- /**
- * @brief Check application hash
- * @param application that is need to be restored
- * @return true if it was saved, otherwise return false
- */
- bool CheckApplicationHash(ApplicationSharedPtr application, uint32_t hash);
-
- /**
- * @brief Check if Resume controller have saved application with hmi app id
- * @param hmi_app_id - hmi application id
- * @return true if exist, false otherwise
- */
- bool IsHMIApplicationIdExist(uint32_t hmi_app_id);
-
- /**
- * @brief Check if Resume controller have saved instance of application
- * @param mobile_app_id - mobile application id
- * @return true if exist, false otherwise
- */
- bool IsApplicationSaved(const std::string& mobile_app_id);
-
- /**
- * @brief Function is used for application resume. HMI app ID must be
- * the same(PASA VCA module use it for stored app info).
- * Retrieves HMI app ID for the given mobile app ID from stored information.
- *
- * @param mobile_app_id - mobile application id
- * @return HMI app ID
- */
- uint32_t GetHMIApplicationID(const std::string& mobile_app_id);
-
- /**
- * @brief Timer callback function
- *
- */
- void onTimer();
-
- void ClearResumptionInfo();
-
- private:
-
- typedef std::pair<uint32_t, uint32_t> application_timestamp;
-
- /**
- * @brief This struct need to map
- * timestamp and application from correlationID
- */
- struct ResumingApp {
- uint32_t old_session_key; // session key is the same as app_id
- ApplicationSharedPtr app;
- };
-
- struct TimeStampComparator {
- bool operator() (const application_timestamp& lhs,
- const application_timestamp& rhs) const{
- return lhs.second < rhs.second;
- }
- };
-
- /**
- * @brief Check device MAC address
- *
- * @param application that is need to be restored
- * @param saved_device_mac Saved device MAC address
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool IsDeviceMacAddressEqual(ApplicationSharedPtr application,
- const std::string& saved_device_mac);
-
- Json::Value& GetSavedApplications();
-
- void SetSavedApplication(Json::Value& apps_json);
-
- Json::Value GetApplicationCommands(
- ApplicationConstSharedPtr application);
- Json::Value GetApplicationSubMenus(
- ApplicationConstSharedPtr application);
- Json::Value GetApplicationInteractionChoiseSets(
- ApplicationConstSharedPtr application);
- Json::Value GetApplicationGlobalProperties(
- ApplicationConstSharedPtr application);
- Json::Value GetApplicationSubscriptions(
- ApplicationConstSharedPtr application);
- Json::Value GetApplicationFiles(
- ApplicationConstSharedPtr application);
- Json::Value GetApplicationShow(
- ApplicationConstSharedPtr application);
-
- Json::Value JsonFromSO(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject *so);
-
- void SendHMIRequest(const hmi_apis::FunctionID::eType& function_id,
- const smart_objects::SmartObject* msg_params = NULL,
- bool use_events = false);
-
- bool ProcessHMIRequest(
- NsSmartDeviceLink::NsSmartObjects::SmartObject* request = NULL,
- bool use_events = false);
-
- /**
- * @brief Time step to check resumption TIME_OUT
- */
- static const uint32_t kTimeStep = 3;
-
- /**
- * @brief times of IGN_OFF that zombie application have to be saved.
- */
- static const uint32_t kApplicationLifes = 3;
-
- /**
- *@brief Mapping applications to time_stamps
- * wait for timer to resume HMI Level
- *
- */
- std::multiset<application_timestamp, TimeStampComparator> waiting_for_timer_;
- mutable sync_primitives::Lock queue_lock_;
- ApplicationManagerImpl* app_mngr_;
- timer::TimerThread<ResumeCtrl> timer_;
-};
-
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_RESUME_CTRL_H
+../../../../include/application_manager/resume_ctrl.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/smart_object_keys.h b/src/components/application_manager/test/mock/include/application_manager/smart_object_keys.h
index 3d0398987..94919c6ce 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/smart_object_keys.h
+++ b/src/components/application_manager/test/mock/include/application_manager/smart_object_keys.h
@@ -1,370 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SMART_OBJECT_KEYS_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SMART_OBJECT_KEYS_H_
-
-namespace application_manager {
-
-namespace strings {
-
-const char params[] = "params";
-const char message_type[] = "message_type";
-const char correlation_id[] = "correlation_id";
-const char function_id[] = "function_id";
-const char protocol_version[] = "protocol_version";
-const char protocol_type[] = "protocol_type";
-const char connection_key[] = "connection_key";
-const char error[] = "error";
-const char error_msg[] = "message";
-const char default_app_id[] = "default";
-
-
-const char msg_params[] = "msg_params";
-const char info[] = "info";
-const char app_id[] = "appID";
-const char hmi_app_id[] = "hmiAppID";
-const char device_mac[] = "deviceMAC";
-const char url[] = "url";
-const char cmd_icon[] = "cmdIcon";
-const char result_code[] = "resultCode";
-const char success[] = "success";
-const char sync_msg_version[] = "syncMsgVersion";
-const char major_version[] = "majorVersion";
-const char minor_version[] = "minorVersion";
-const char app_name[] = "appName";
-const char ngn_media_screen_app_name[] = "ngnMediaScreenAppName";
-const char vr_synonyms[] = "vrSynonyms";
-const char uses_vehicle_data[] = "usesVehicleData";
-const char is_media_application[] = "isMediaApplication";
-const char language_desired[] = "languageDesired";
-const char auto_activated_id[] = "autoActivateID";
-const char app_type[] = "appType";
-const char app_hmi_type[] = "appHMIType";
-const char tts_name[] = "ttsName";
-const char binary_data[] = "binary_data";
-const char timeout_prompt[] = "timeoutPrompt";
-const char timeout[] = "timeout";
-const char vr_help_title[] = "vrHelpTitle";
-const char vr_help[] = "vrHelp";
-const char main_field_1[] = "mainField1";
-const char main_field_2[] = "mainField2";
-const char main_field_3[] = "mainField3";
-const char main_field_4[] = "mainField4";
-const char eta[] = "eta";
-const char time_to_destination[] = "timeToDestination";
-const char total_distance[] = "totalDistance";
-const char alignment[] = "alignment";
-const char graphic[] = "graphic";
-const char secondary_graphic[] = "secondaryGraphic";
-const char status_bar[] = "statusBar";
-const char media_clock[] = "mediaClock";
-const char media_track[] = "mediaTrack";
-const char properties[] = "properties";
-const char cmd_id[] = "cmdID";
-const char menu_params[] = "menuParams";
-const char menu_title[] = "menuTitle";
-const char menu_icon[] = "menuIcon";
-const char keyboard_properties[] = "keyboardProperties";
-const char vr_commands[] = "vrCommands";
-const char position[] = "position";
-const char num_ticks[] = "numTicks";
-const char slider_footer[] = "sliderFooter";
-const char menu_id[] = "menuID";
-const char menu_name[] = "menuName";
-const char interaction_choice_set_id[] = "interactionChoiceSetID";
-const char interaction_choice_set_id_list[] = "interactionChoiceSetIDList";
-const char choice_set[] = "choiceSet";
-const char choice_id[] = "choiceID";
-const char grammar_id[] = "grammarID";
-const char navigation_text_1[] = "navigationText1";
-const char navigation_text_2[] = "navigationText2";
-const char alert_text1[] = "alertText1";
-const char alert_text2[] = "alertText2";
-const char alert_text3[] = "alertText3";
-const char tts_chunks[] = "ttsChunks";
-const char initial_prompt[] = "initialPrompt";
-const char initial_text[] = "initialText";
-const char duration[] = "duration";
-const char progress_indicator[] = "progressIndicator";
-const char alert_type[] = "alertType";
-const char play_tone[] = "playTone";
-const char soft_buttons[] = "softButtons";
-const char soft_button_id[] = "softButtonID";
-const char custom_presets[] = "customPresets";
-const char audio_pass_display_text1[] = "audioPassThruDisplayText1";
-const char audio_pass_display_text2[] = "audioPassThruDisplayText2";
-const char max_duration[] = "maxDuration";
-const char sampling_rate[] = "samplingRate";
-const char bits_per_sample[] = "bitsPerSample";
-const char audio_type[] = "audioType";
-const char mute_audio[] = "muteAudio";
-const char button_name[] = "buttonName";
-const char button_event_mode[] = "buttonEventMode";
-const char button_press_mode[] = "buttonPressMode";
-const char custom_button_id[] = "customButtonID";
-const char data_type[] = "dataType";
-const char turn_list[] = "turnList";
-const char turn_icon[] = "turnIcon";
-const char next_turn_icon[] = "nextTurnIcon";
-const char value[] = "value";
-const char hmi_display_language[] = "hmiDisplayLanguage";
-const char language[] = "language";
-const char data[] = "data";
-const char start_time[] = "startTime";
-const char end_time[] = "endTime";
-const char hours[] = "hours";
-const char minutes[] = "minutes";
-const char seconds [] = "seconds";
-const char update_mode[] = "updateMode";
-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 system_context[] = "systemContext";
-const char speech_capabilities[] = "speechCapabilities";
-const char vr_capabilities[] = "vrCapabilities";
-const char audio_pass_thru_capabilities[] = "audioPassThruCapabilities";
-// PutFile
-const char sync_file_name[] = "syncFileName";
-const char file_name[] = "fileName";
-const char file_type[] = "fileType";
-const char file_size[] = "fileSize";
-const char request_type[] = "requestType";
-const char persistent_file[] = "persistentFile";
-const char file_data[] = "fileData";
-const char space_available[] = "spaceAvailable";
-const char image_type[] = "imageType";
-const char image[] = "image";
-const char type[] = "type";
-const char system_file[] = "systemFile";
-const char offset[] = "offset";
-const char length[] = "length";
-const char secondary_image[] = "secondaryImage";
-const char filenames[] = "filenames";
-
-const char hmi_display_language_desired[] = "hmiDisplayLanguageDesired";
-const char ecu_name[] = "ecuName";
-const char dtc_mask[] = "dtcMask";
-const char did_location[] = "didLocation";
-const char app_list[] = "appList";
-const char device_list[] = "deviceList";
-const char device_info[] = "deviceInfo";
-const char name[] = "name";
-const char id[] = "id";
-const char isSDLAllowed[] = "isSDLAllowed";
-const char application[] = "application";
-const char applications[] = "applications";
-const char icon[] = "icon";
-const char device_name[] = "deviceName";
-const char reason[] = "reason";
-const char available[] = "available";
-const char text[] = "text";
-const char character_set[] = "characterSet";
-const char secondary_text[] = "secondaryText";
-const char tertiary_text[] = "tertiaryText";
-const char hardware[] = "hardware";
-const char firmware_rev[] = "firmwareRev";
-const char os[] = "os";
-const char os_version[] = "osVersion";
-const char carrier[] = "carrier";
-const char slider_header[] = "sliderHeader";
-
-// duplicate names from hmi_request
-const char limited_character_list[] = "limitedCharacterList";
-const char auto_complete_text[] = "autoCompleteText";
-const char navigation_text[] = "navigationText";
-
-// vehicle info
-const char gps[] = "gps";
-const char speed[] = "speed";
-const char rpm[] = "rpm";
-const char fuel_level[] = "fuelLevel";
-const char fuel_level_state[] = "fuelLevel_State";
-const char instant_fuel_consumption[] = "instantFuelConsumption";
-const char external_temp[] = "externalTemperature";
-const char vin[] = "vin";
-const char prndl[] = "prndl";
-const char tire_pressure[] = "tirePressure";
-const char odometer[] = "odometer";
-const char belt_status[] = "beltStatus";
-const char body_information[] = "bodyInformation";
-const char device_status[] = "deviceStatus";
-const char driver_braking[] = "driverBraking";
-const char wiper_status[] = "wiperStatus";
-const char head_lamp_status[] = "headLampStatus";
-const char engine_torque[] = "engineTorque";
-const char acc_pedal_pos[] = "accPedalPosition";
-const char steering_wheel_angle[] = "steeringWheelAngle";
-const char e_call_info[] = "eCallInfo";
-const char airbag_status[] = "airbagStatus";
-const char emergency_event[] = "emergencyEvent";
-const char cluster_mode_status[] = "clusterModeStatus";
-const char my_key[] = "myKey";
-const char help_prompt[] = "helpPrompt";
-const char scroll_message_body[] = "scrollableMessageBody";
-const char data_result[] = "dataResult";
-const char dtc_list[] = "dtcList";
-const char interaction_mode[] = "interactionMode";
-const char slider_position[] = "sliderPosition";
-const char system_action[] = "systemAction";
-const char prerecorded_speech[] = "prerecordedSpeech";
-const char supported_diag_modes[] = "supportedDiagModes";
-const char priority[] = "priority";
-
-//resuming
-const char application_commands[] = "applicationCommands";
-const char application_submenus[] = "applicationSubMenus";
-const char application_choise_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_files[] = "applicationFiles";
-const char application_show[] = "applicationShow";
-const char resumption[] = "resumption";
-const char resume_vr_grammars[] = "resumeVrGrammars";
-
-const char ign_off_count[] = "ign_off_count";
-const char connection_info[] = "connection_info";
-const char is_download_complete[] = "is_download_complete";
-
-const char hash_id[] = "hashID";
-const char time_stamp[] = "timeStamp";
-const char manual_text_entry[] = "manualTextEntry";
-const char image_type_supported[] = "imageTypeSupported";
-const char unexpected_disconnect[] = "unexpectedDisconnect";
-const char location_name[] = "locationName";
-const char location_description[] = "locationDescription";
-const char address_lines[] = "addressLines";
-const char phone_number[] = "phoneNumber";
-const char location_image[] = "locationImage";
-} // namespace strings
-
-namespace mobile_notification {
-const char state[] = "state";
-const char syncp_timeout[] = "Timeout";
-const char syncp_url[] = "URL";
-} // namespace mobile_notification
-
-namespace hmi_levels {
-const char kFull[] = "FULL";
-const char kLimited[] = "LIMITED";
-const char kBackground[] = "BACKGROUND";
-const char kNone[] = "NONE";
-}
-
-namespace hmi_request {
-const char parent_id[] = "parentID";
-const char field_name[] = "fieldName";
-const char field_text[] = "fieldText";
-const char alert_strings[] = "alertStrings";
-const char duration[] = "duration";
-const char soft_buttons[] = "softButtons";
-const char tts_chunks[] = "ttsChunks";
-const char speak_type[] = "speakType";
-const char audio_pass_display_texts[] = "audioPassThruDisplayTexts";
-const char max_duration[] = "maxDuration";
-const char reason[] = "reason";
-const char message_text[] = "messageText";
-const char initial_text[] = "initialText";
-const char navi_texts[] = "navigationTexts";
-const char navi_text[] = "navigationText";
-const char show_strings[] = "showStrings";
-const char interaction_layout[] = "interactionLayout";
-const char menu_title[] = "menuTitle";
-const char menu_icon[] = "menuIcon";
-const char keyboard_properties[] = "keyboardProperties";
-const char method_name[] = "methodName";
-const char keyboard_layout[] = "keyboardLayout";
-const char limited_character_list[] = "limitedCharacterList";
-const char auto_complete_text[] = "autoCompleteText";
-const char file[] = "file";
-const char retry[] = "retry";
-const char service[] = "service";
-} // namespace hmi_request
-
-namespace hmi_response {
-const char code[] = "code";
-const char message[] = "message";
-const char method[] = "method";
-const char try_again_time[] = "tryAgainTime";
-const char custom_button_id[] = "customButtonID";
-const char button_name[] = "name";
-const char button_mode[] = "mode";
-const char attenuated_supported[] = "attenuatedSupported";
-const char languages[] = "languages";
-const char language[] = "language";
-const char display_capabilities[] = "displayCapabilities";
-const char hmi_zone_capabilities[] = "hmiZoneCapabilities";
-const char soft_button_capabilities[] = "softButtonCapabilities";
-const char image_supported[] = "imageSupported";
-const char button_capabilities[] = "buttonCapabilities";
-const char capabilities[] = "capabilities";
-const char speech_capabilities[] = "speechCapabilities";
-const char prerecorded_speech_capabilities[] = "prerecordedSpeechCapabilities";
-const char preset_bank_capabilities[] = "presetBankCapabilities";
-const char allowed[] = "allowed";
-const char vehicle_type[] = "vehicleType";
-const char did_result[] = "didResult";
-const char result_code[] = "resultCode";
-const char dtc[] = "dtc";
-const char ecu_header[] = "ecuHeader";
-const char image_capabilities[] = "imageCapabilities";
-const char display_type[] = "displayType";
-const char text_fields[] = "textFields";
-const char media_clock_formats[] = "mediaClockFormats";
-const char graphic_supported[] = "graphicSupported";
-const char image_fields[] = "imageFields";
-const char templates_available[] = "templatesAvailable";
-const char screen_params[] = "screenParams";
-const char num_custom_presets_available[] = "numCustomPresetsAvailable";
-const char urls[] = "urls";
-const char policy_app_id[] = "policyAppId";
-} // namespace hmi_response
-
-namespace hmi_notification {
-const char prndl[] = "prndl";
-const char file_name[] = "file_name";
-const char system_context[] = "systemContext";
-const char state[] = "state";
-const char result[] = "result";
-const char statistic_type[] = "statisticType";
-const char error[] = "error";
-const char policyfile[] = "policyfile";
-const char is_active[] = "isActive";
-
-} // namespace hmi_notification
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SMART_OBJECT_KEYS_H_
+../../../../include/application_manager/smart_object_keys.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/state_context.h b/src/components/application_manager/test/mock/include/application_manager/state_context.h
new file mode 120000
index 000000000..f94c0054c
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/state_context.h
@@ -0,0 +1 @@
+../../../../include/application_manager/state_context.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/state_controller.h b/src/components/application_manager/test/mock/include/application_manager/state_controller.h
new file mode 120000
index 000000000..6c61865d1
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/state_controller.h
@@ -0,0 +1 @@
+../../../../include/application_manager/state_controller.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/time_metric_observer.h b/src/components/application_manager/test/mock/include/application_manager/time_metric_observer.h
index 780401f6f..4786675fd 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/time_metric_observer.h
+++ b/src/components/application_manager/test/mock/include/application_manager/time_metric_observer.h
@@ -1,59 +1 @@
-/**
- * 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_TIME_METRIC_OBSERVER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_TIME_METRIC_OBSERVER_H_
-
-
-#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 smart_objects = NsSmartDeviceLink::NsSmartObjects;
-namespace application_manager {
-
-class AMMetricObserver {
- public:
- struct MessageMetric {
- TimevalStruct begin;
- TimevalStruct end;
- utils::SharedPtr<smart_objects::SmartObject> message;
- };
- typedef utils::SharedPtr<MessageMetric> MessageMetricSharedPtr;
-
- virtual void OnMessage(MessageMetricSharedPtr) = 0;
- virtual ~AMMetricObserver(){}
-};
-} // application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_
+../../../../include/application_manager/time_metric_observer.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/usage_statistics.h b/src/components/application_manager/test/mock/include/application_manager/usage_statistics.h
index dcd57aee3..bff65d563 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/usage_statistics.h
+++ b/src/components/application_manager/test/mock/include/application_manager/usage_statistics.h
@@ -1,71 +1 @@
-/**
- * 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_USAGE_STATISTICS_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_
-
-#include <string>
-#include "usage_statistics/counter.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-class UsageStatistics {
- public:
- UsageStatistics(const std::string& app_id,
- utils::SharedPtr<usage_statistics::StatisticsManager>
- statistics_manager);
- void RecordHmiStateChanged(mobile_apis::HMILevel::eType new_hmi_level);
- void RecordAppRegistrationGuiLanguage(
- mobile_apis::Language::eType gui_language);
- void RecordAppRegistrationVuiLanguage(
- mobile_apis::Language::eType vui_language);
- void RecordRpcSentInHMINone();
- void RecordPolicyRejectedRpcCall();
- void RecordAppUserSelection();
- void RecordRunAttemptsWhileRevoked();
- void RecordRemovalsForBadBehavior();
-
- private:
- usage_statistics::AppStopwatch time_in_hmi_state_;
- usage_statistics::AppInfo app_registration_language_gui_;
- usage_statistics::AppInfo app_registration_language_vui_;
- usage_statistics::AppCounter count_of_rejected_rpc_calls_;
- usage_statistics::AppCounter count_of_rpcs_sent_in_hmi_none_;
- usage_statistics::AppCounter count_of_user_selections_;
- usage_statistics::AppCounter count_of_run_attempts_while_revoked_;
- usage_statistics::AppCounter count_of_removals_for_bad_behavior_;
-};
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_
+../../../../include/application_manager/usage_statistics.h \ No newline at end of file
diff --git a/src/components/application_manager/test/mock/include/application_manager/vehicle_info_data.h b/src/components/application_manager/test/mock/include/application_manager/vehicle_info_data.h
index 0cac4fd8f..0ea43f121 100644..120000
--- a/src/components/application_manager/test/mock/include/application_manager/vehicle_info_data.h
+++ b/src/components/application_manager/test/mock/include/application_manager/vehicle_info_data.h
@@ -1,71 +1 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_VEHICLE_INFO_DATA_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_VEHICLE_INFO_DATA_H_
-
-namespace application_manager {
- /*
- * @brief Typedef for the vehicle data types that can
- * be published and subscribed to
- */
-enum VehicleDataType {
- GPS = 0,
- SPEED,
- RPM,
- FUELLEVEL,
- FUELLEVEL_STATE,
- FUELCONSUMPTION,
- EXTERNTEMP,
- VIN,
- PRNDL,
- TIREPRESSURE,
- ODOMETER,
- BELTSTATUS,
- BODYINFO,
- DEVICESTATUS,
- ECALLINFO,
- AIRBAGSTATUS,
- EMERGENCYEVENT,
- CLUSTERMODESTATUS,
- MYKEY,
- BRAKING,
- WIPERSTATUS,
- HEADLAMPSTATUS,
- BATTVOLTAGE,
- ENGINETORQUE,
- ACCPEDAL,
- STEERINGWHEEL
-};
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_VEHICLE_INFO_DATA_H_
+../../../../include/application_manager/vehicle_info_data.h \ No newline at end of file
diff --git a/src/components/application_manager/test/request_info_test.cc b/src/components/application_manager/test/request_info_test.cc
new file mode 100644
index 000000000..86103e799
--- /dev/null
+++ b/src/components/application_manager/test/request_info_test.cc
@@ -0,0 +1,242 @@
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+#include "application_manager/request_info.h"
+#include "application_manager/message_helper.h"
+#include <iostream>
+
+namespace request_info = application_manager::request_controller;
+
+class MockRequest: public application_manager::commands::Command {
+ public:
+ MockRequest(uint32_t connection_key,
+ uint32_t correlation_id):
+ connection_key_(connection_key),
+ correlation_id_(correlation_id) {
+
+ }
+ MOCK_METHOD0(CheckPermissions, bool ());
+ MOCK_METHOD0(Init, bool ());
+ MOCK_METHOD0(Run, void ());
+ MOCK_METHOD0(CleanUp, bool ());
+ MOCK_CONST_METHOD0(default_timeout, uint32_t ());
+ MOCK_CONST_METHOD0(function_id, int32_t ());
+ MOCK_METHOD0(onTimeOut, void ());
+ MOCK_METHOD0(AllowedToTerminate, bool ());
+ MOCK_METHOD1(SetAllowedToTerminate, void (bool));
+
+ uint32_t connection_key_;
+ uint32_t correlation_id_;
+ virtual uint32_t connection_key() const;
+ virtual uint32_t correlation_id() const;
+};
+
+class TestRequestInfo: public request_info::RequestInfo {
+ public:
+ TestRequestInfo(request_info::RequestPtr request,
+ const RequestType requst_type,
+ const TimevalStruct& start_time,
+ const uint64_t timeout_sec):
+ RequestInfo(request, requst_type, start_time,timeout_sec) {
+
+ }
+ void SetEndTime(const TimevalStruct& end_time);
+};
+class RequestInfoTest : public ::testing::Test {
+ protected:
+ virtual void SetUp() {
+ //INIT_LOGGER("log4cxx.properties");
+ count_of_requests_for_test_ = 1000;
+ hmi_connection_key_ = 0;
+ mobile_connection_key1_ = 65431;
+ mobile_connection_key2_ = 65123;
+ default_timeout_ = 10;
+ srand(42);
+ }
+ virtual void TearDown() {
+ //DEINIT_LOGGER();
+ }
+
+ request_info::RequestInfoSet request_info_set_;
+ uint32_t count_of_requests_for_test_ ;
+ uint32_t hmi_connection_key_;
+ uint32_t mobile_connection_key1_;
+ uint32_t mobile_connection_key2_;
+ uint32_t default_timeout_;
+
+ utils::SharedPtr<TestRequestInfo> create_test_info(uint32_t connection_key,
+ uint32_t correlation_id,
+ request_info::RequestInfo::RequestType requst_type,
+ const TimevalStruct& start_time,
+ uint64_t timeout_sec) {
+ utils::SharedPtr<MockRequest> mock_request(new MockRequest(connection_key,correlation_id));
+ TestRequestInfo* test_request_raw = new TestRequestInfo(mock_request,requst_type,
+ start_time, timeout_sec);
+ utils::SharedPtr<TestRequestInfo> request(test_request_raw);
+ return request;
+ }
+};
+
+TEST_F(RequestInfoTest, RequestInfoEqualEndTimeTest) {
+ std::list<utils::SharedPtr<TestRequestInfo> > requests;
+ const TimevalStruct& time = date_time::DateTime::getCurrentTime();
+ for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
+ utils::SharedPtr<TestRequestInfo> request =
+ create_test_info(rand(), rand(), request_info::RequestInfo::MobileRequest,
+ time, default_timeout_);
+ request->SetEndTime(time);
+ EXPECT_TRUE(request_info_set_.Add(request));
+ }
+ EXPECT_EQ(count_of_requests_for_test_, request_info_set_.Size());
+}
+
+TEST_F(RequestInfoTest, RequestInfoSetInsertErazeTest) {
+ for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
+ utils::SharedPtr<TestRequestInfo> request =
+ create_test_info(hmi_connection_key_, i, request_info::RequestInfo::HMIRequest,
+ date_time::DateTime::getCurrentTime(), default_timeout_);
+ EXPECT_TRUE(request_info_set_.Add(request));
+ EXPECT_EQ(1, request_info_set_.RemoveRequest(request));
+ }
+
+ EXPECT_EQ(0u, request_info_set_.Size());
+ std::list<utils::SharedPtr<TestRequestInfo> > requests;
+
+ for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
+ utils::SharedPtr<TestRequestInfo> request =
+ create_test_info(hmi_connection_key_, i, request_info::RequestInfo::HMIRequest,
+ date_time::DateTime::getCurrentTime(), default_timeout_);
+ requests.push_back(request);
+ EXPECT_TRUE(request_info_set_.Add(request));
+ }
+
+ std::list<utils::SharedPtr<TestRequestInfo> >::iterator it = requests.begin();
+ std::list<utils::SharedPtr<TestRequestInfo> >::iterator end = requests.end();
+
+ for (; it != end; ++it) {
+ EXPECT_EQ(1,request_info_set_.RemoveRequest(*it));
+ }
+ EXPECT_EQ(0u, request_info_set_.Size());
+ it = requests.begin();
+ for (; it != end; ++it) {
+ EXPECT_TRUE(request_info_set_.Add(*it));
+ }
+ EXPECT_EQ(count_of_requests_for_test_, request_info_set_.Size());
+ EXPECT_EQ(count_of_requests_for_test_, request_info_set_.RemoveByConnectionKey(hmi_connection_key_));
+ EXPECT_EQ(0u, request_info_set_.Size());
+ it = requests.begin();
+ for (; it != end; ++it) {
+ EXPECT_TRUE(request_info_set_.Add(*it));
+ }
+ EXPECT_EQ(count_of_requests_for_test_, request_info_set_.Size());
+ utils::SharedPtr<TestRequestInfo> mobile_request1 =
+ create_test_info(mobile_connection_key1_, 12345, request_info::RequestInfo::MobileRequest,
+ date_time::DateTime::getCurrentTime(), default_timeout_);
+ EXPECT_TRUE(request_info_set_.Add(mobile_request1));
+ utils::SharedPtr<TestRequestInfo> mobile_request2 =
+ create_test_info(mobile_connection_key2_, 54321, request_info::RequestInfo::MobileRequest,
+ date_time::DateTime::getCurrentTime(), default_timeout_);
+ EXPECT_TRUE(request_info_set_.Add(mobile_request2));
+ EXPECT_EQ(count_of_requests_for_test_ + 2, request_info_set_.Size());
+ EXPECT_EQ(2u, request_info_set_.RemoveMobileRequests());
+ EXPECT_EQ(count_of_requests_for_test_, request_info_set_.Size());
+ EXPECT_TRUE(request_info_set_.Add(mobile_request1));
+ EXPECT_TRUE(request_info_set_.Add(mobile_request2));
+ EXPECT_EQ(1u, request_info_set_.RemoveByConnectionKey(mobile_connection_key1_));
+ EXPECT_EQ(count_of_requests_for_test_ + 1, request_info_set_.Size());
+ EXPECT_EQ(count_of_requests_for_test_, request_info_set_.RemoveByConnectionKey(hmi_connection_key_));
+ EXPECT_EQ(1u, request_info_set_.Size());
+ EXPECT_EQ(1u, request_info_set_.RemoveMobileRequests());
+ EXPECT_EQ(0u, request_info_set_.Size());
+}
+
+TEST_F(RequestInfoTest, RequestInfoSetFrontTest) {
+
+ for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
+ utils::SharedPtr<TestRequestInfo> request =
+ create_test_info(mobile_connection_key1_, i, request_info::RequestInfo::HMIRequest,
+ date_time::DateTime::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_EQ(0u, request_info->timeout_sec());
+ request_info = request_info_set_.FrontWithNotNullTimeout();
+ EXPECT_TRUE(request_info.valid());
+ EXPECT_EQ(i, request_info->timeout_sec());
+ EXPECT_TRUE(request_info_set_.RemoveRequest(request_info));
+ }
+ EXPECT_EQ(1u, request_info_set_.Size());
+ EXPECT_EQ(1u, request_info_set_.RemoveByConnectionKey(mobile_connection_key1_));
+ EXPECT_EQ(0u, request_info_set_.Size());
+}
+
+TEST_F(RequestInfoTest, RequestInfoSetFindTest) {
+
+ std::list <std::pair<uint32_t, uint32_t> > appId_coorrId;
+ for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
+ appId_coorrId.push_back(std::pair<uint32_t, uint32_t>(rand(),rand()));
+ }
+ std::list <std::pair<uint32_t, uint32_t> >::iterator it;
+ std::list <std::pair<uint32_t, uint32_t> >::iterator end =
+ appId_coorrId.end();;
+
+ for (it = appId_coorrId.begin(); it != end; ++it) {
+ utils::SharedPtr<TestRequestInfo> request =
+ create_test_info(it->first, it->second, request_info::RequestInfo::HMIRequest,
+ date_time::DateTime::getCurrentTime(), 10);
+ EXPECT_TRUE(request_info_set_.Add(request));
+ }
+
+ request_info::RequestInfoPtr request = request_info_set_.Find(rand(),rand());
+ EXPECT_FALSE(request.valid());
+ for (it = appId_coorrId.begin(); it != end; ++it) {
+ request_info::RequestInfoPtr request = request_info_set_.Find(it->first, it->second);
+ EXPECT_TRUE(request.valid());
+ EXPECT_EQ(1u, request_info_set_.RemoveRequest(request));
+ request = request_info_set_.Find(it->first, it->second);
+ EXPECT_FALSE(request.valid());
+ }
+ EXPECT_EQ(0u, request_info_set_.Size());
+}
+
+TEST_F(RequestInfoTest, RequestInfoSetEqualHashTest) {
+ request_info::RequestInfoSet request_info_set;
+ const uint32_t connection_key = 65483;
+ const uint32_t corr_id = 65483;
+ utils::SharedPtr<TestRequestInfo> request =
+ create_test_info(connection_key, corr_id, request_info::RequestInfo::HMIRequest,
+ date_time::DateTime::getCurrentTime(), 10);
+ EXPECT_TRUE(request_info_set.Add(request));
+ EXPECT_FALSE(request_info_set.Add(request));
+ EXPECT_FALSE(request_info_set.Add(request));
+ EXPECT_EQ(1u, request_info_set.Size());
+ request_info::RequestInfoPtr found = request_info_set.Find(connection_key, corr_id);
+ EXPECT_TRUE(found.valid());
+ EXPECT_EQ(1u, 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_EQ(1u, request_info_set.RemoveRequest(found));
+ found = request_info_set.FrontWithNotNullTimeout();
+ EXPECT_FALSE(found.valid());
+ EXPECT_EQ(0u, request_info_set.Size());
+}
+
+
+uint32_t MockRequest::correlation_id() const {
+ return correlation_id_;
+}
+
+uint32_t MockRequest::connection_key() const {
+ return connection_key_;
+}
+
+
+
+void TestRequestInfo::SetEndTime(const TimevalStruct& end_time) {
+ end_time_ = end_time;
+}
diff --git a/src/components/application_manager/test/resumption/include/application_mock.h b/src/components/application_manager/test/resumption/include/application_mock.h
new file mode 100644
index 000000000..39c4b3353
--- /dev/null
+++ b/src/components/application_manager/test/resumption/include/application_mock.h
@@ -0,0 +1,266 @@
+/*
+* 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_TEST_RESUMPTION_INCLUDE_APPLICATION_MOCK_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_RESUMPTION_INCLUDE_APPLICATION_MOCK_H_
+#include <string>
+#include "gmock/gmock.h"
+#include "application_manager/application.h"
+
+namespace test {
+namespace components {
+namespace resumption_test {
+
+class ApplicationMock : public ::application_manager::Application {
+ public:
+ MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(curHash, const std::string&());
+ MOCK_METHOD0(UpdateHash, void());
+ MOCK_CONST_METHOD0(flag_sending_hash_change_after_awake, bool());
+ MOCK_METHOD1(set_flag_sending_hash_change_after_awake, void(bool flag));
+ 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_METHOD1(StartStreaming,
+ void(protocol_handler::ServiceType service_type));
+ MOCK_METHOD1(StopStreaming, 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 std::string&());
+ 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_METHOD0(tts_speak_state, bool());
+ MOCK_CONST_METHOD0(CurrentHmiState,
+ ::application_manager::HmiStatePtr());
+ MOCK_CONST_METHOD0(RegularHmiState,
+ ::application_manager::HmiStatePtr());
+ MOCK_CONST_METHOD0(PostponedHmiState,
+ ::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 std::string& 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 ::application_manager::ProtocolVersion& protocol_version));
+ MOCK_CONST_METHOD0(protocol_version,
+ ::application_manager::ProtocolVersion());
+ 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(IsCommandLimitsExceeded,
+ bool(mobile_apis::FunctionID::eType cmd_id,
+ ::application_manager::TLimitSource source));
+ MOCK_METHOD0(usage_report, ::application_manager::UsageStatistics&());
+ MOCK_METHOD1(SetRegularState, void(::application_manager::HmiStatePtr state));
+ MOCK_METHOD1(SetPostponedState, void(::application_manager::HmiStatePtr state));
+ 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_reset_global_properties_active, void(bool active));
+ MOCK_CONST_METHOD0(is_reset_global_properties_active, bool());
+ MOCK_CONST_METHOD0(app_id, uint32_t());
+};
+
+} // namespace resumption_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_RESUMPTION_INCLUDE_APPLICATION_MOCK_H_
diff --git a/src/components/application_manager/test/resumption/include/resumption_data_mock.h b/src/components/application_manager/test/resumption/include/resumption_data_mock.h
new file mode 100644
index 000000000..2c9285b02
--- /dev/null
+++ b/src/components/application_manager/test/resumption/include/resumption_data_mock.h
@@ -0,0 +1,86 @@
+/*
+* 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_TEST_RESUMPTION_INCLUDE_RESUMPTION_DATA_MOCK_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_RESUMPTION_INCLUDE_RESUMPTION_DATA_MOCK_H_
+#include <string>
+#include "gmock/gmock.h"
+#include "application_manager/resumption/resumption_data.h"
+#include "application_manager/application.h"
+
+namespace test {
+namespace components {
+namespace resumption_test {
+namespace app_mngr = application_manager;
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+class ResumptionDataMock : public ::resumption::ResumptionData {
+ public:
+ MOCK_METHOD1(SaveApplication,
+ void(app_mngr::ApplicationSharedPtr application));
+ MOCK_CONST_METHOD2(GetStoredHMILevel,
+ int32_t(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_CONST_METHOD1(IsHMIApplicationIdExist, bool(uint32_t hmi_app_id));
+ MOCK_METHOD2(CheckSavedApplication, bool(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_CONST_METHOD2(GetHMIApplicationID,
+ uint32_t(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_METHOD0(OnSuspend, void());
+ MOCK_CONST_METHOD3(GetHashId,
+ bool(const std::string& policy_app_id,
+ const std::string& device_id, std::string& hash_id));
+ MOCK_METHOD0(OnAwake, void());
+ MOCK_CONST_METHOD3(GetSavedApplication,
+ bool(const std::string& policy_app_id,
+ const std::string& device_id,
+ smart_objects::SmartObject& saved_app));
+ MOCK_METHOD2(RemoveApplicationFromSaved,
+ bool(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_CONST_METHOD0(GetIgnOffTime, uint32_t());
+ MOCK_CONST_METHOD2(IsApplicationSaved,
+ ssize_t(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_CONST_METHOD1(GetDataForLoadResumeData,
+ void(smart_objects::SmartObject& saved_data));
+ MOCK_METHOD3(UpdateHmiLevel, void(const std::string& policy_app_id,
+ const std::string& device_id,
+ mobile_apis::HMILevel::eType hmi_level));
+ MOCK_METHOD0(Init, bool());
+};
+
+} // namespace resumption_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_RESUMPTION_INCLUDE_RESUMPTION_DATA_MOCK_H_
diff --git a/src/components/application_manager/test/resumption/include/resumption_data_test.h b/src/components/application_manager/test/resumption/include/resumption_data_test.h
new file mode 100644
index 000000000..55767225b
--- /dev/null
+++ b/src/components/application_manager/test/resumption/include/resumption_data_test.h
@@ -0,0 +1,133 @@
+/*
+ * 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>
+#include <algorithm>
+#include "gtest/gtest.h"
+#include "application_manager/usage_statistics.h"
+#include "application_mock.h"
+#include "application_manager/application_manager_impl.h"
+#include "utils/data_accessor.h"
+
+namespace test {
+namespace components {
+namespace resumption_test {
+
+using ::testing::NiceMock;
+namespace am = application_manager;
+namespace sm = smart_objects;
+using namespace Json;
+
+using namespace resumption;
+using namespace mobile_apis;
+
+class ResumptionDataTest : public ::testing::Test {
+ protected:
+ // Check structure in saved application
+ void CheckSavedApp(sm::SmartObject& saved_data);
+
+ // Set data for resumption
+ virtual void PrepareData();
+ utils::SharedPtr<NiceMock<ApplicationMock>> app_mock;
+
+ HMILevel::eType hmi_level_;
+ size_t app_id_;
+ size_t hmi_app_id_;
+ std::string policy_app_id_;
+ size_t ign_off_count_;
+ const size_t tts_chunks_count = 4;
+
+ size_t grammar_id_;
+ std::string hash_;
+ bool is_audio_;
+ const connection_handler::DeviceHandle device_handle_ = 10;
+
+ sm::SmartObject* help_prompt_;
+ sm::SmartObject* timeout_prompt_;
+ sm::SmartObject* vr_help_;
+ sm::SmartObject* vr_help_title_;
+ sm::SmartObject* vr_synonyms_;
+ sm::SmartObject* keyboard_props_;
+ sm::SmartObject* menu_title_;
+ sm::SmartObject* menu_icon_;
+
+ void SetCommands();
+ void SetSubmenues();
+ void SetChoiceSet();
+ void SetAppFiles();
+ void SetGlobalProporties();
+ void SetKeyboardProperties();
+ void SetMenuTitleAndIcon();
+ void SetHelpAndTimeoutPrompt();
+ void SetVRHelpTitle();
+ void SetSubscriptions();
+
+ void CheckCommands(sm::SmartObject& res_list);
+ void CheckGlobalProporties(sm::SmartObject& res_list);
+ void CheckSubmenues(sm::SmartObject& res_list);
+ void CheckChoiceSet(sm::SmartObject& res_list);
+ void CheckAppFiles(sm::SmartObject& res_list);
+ void CheckKeyboardProperties(sm::SmartObject& res_list);
+ void CheckMenuTitle(sm::SmartObject& res_list);
+ 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 CheckVRTitle(sm::SmartObject& res_list);
+ void CheckSubscriptions(sm::SmartObject& res_list);
+
+ const size_t count_of_commands = 5;
+ const size_t count_of_choice = 2;
+ const size_t count_of_choice_sets = 4;
+ const size_t count_of_submenues = 3;
+ const size_t count_of_files = 8;
+ const size_t count_of_vrhelptitle = 2;
+ const std::string device_id_ = "12345";
+
+ am::CommandsMap test_commands_map;
+ am::SubMenuMap test_submenu_map;
+ am::ChoiceSetMap test_choiceset_map;
+ 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_;
+};
+
+} // namespace resumption_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/resumption/resume_ctrl_test.cc b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
new file mode 100644
index 000000000..bfd41b0f0
--- /dev/null
+++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
@@ -0,0 +1,937 @@
+/*
+ * 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/resumption/resume_ctrl.h"
+#include <string>
+#include <algorithm>
+#include "gtest/gtest.h"
+#include "application_manager/usage_statistics.h"
+#include "include/application_mock.h"
+#include "include/resumption_data_mock.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application.h"
+#include "config_profile/profile.h"
+#include "utils/data_accessor.h"
+#include "application_manager/test/mock_message_helper.h"
+
+namespace test {
+namespace components {
+namespace resumption_test {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::DoAll;
+using ::testing::SetArgReferee;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::AtLeast;
+
+using namespace resumption;
+using namespace mobile_apis::HMILevel;
+
+class ResumeCtrlTest : public ::testing::Test {
+ public:
+ virtual void SetUp() OVERRIDE {
+ app_mngr = application_manager::ApplicationManagerImpl::instance();
+ // Singleton should not be destroyed
+ Mock::AllowLeak(app_mngr);
+ mock_storage = new NiceMock<ResumptionDataMock>();
+ app_mock = new NiceMock<ApplicationMock>();
+ res_ctrl.set_resumption_storage(mock_storage);
+ test_audio_state = mobile_apis::AudioStreamingState::NOT_AUDIBLE;
+ test_app_id = 10;
+ default_testType = eType::HMI_NONE;
+ test_dev_id = 5;
+ test_policy_app_id = "test_policy_app_id";
+ test_grammar_id = 10;
+ hash = "saved_hash";
+ }
+
+ protected:
+ application_manager::ApplicationManagerImpl* app_mngr;
+ ResumeCtrl res_ctrl;
+ NiceMock<ResumptionDataMock>* mock_storage;
+ NiceMock<ApplicationMock>* app_mock;
+ mobile_apis::AudioStreamingState::eType test_audio_state;
+ // app_mock.app_id() will return this value
+ uint32_t test_app_id;
+ std::string test_policy_app_id;
+ mobile_apis::HMILevel::eType default_testType;
+
+ // app_mock.Device() will return this value
+ uint32_t test_dev_id;
+ uint32_t test_grammar_id;
+ std::string hash;
+};
+
+/**
+ * @brief Group of tests which check starting resumption with different data
+ */
+
+TEST_F(ResumeCtrlTest, StartResumption_AppWithGrammarId) {
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hash_id] = hash;
+ saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+
+ // Check RestoreApplicationData
+ EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
+ .Times(3)
+ .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ EXPECT_CALL(*app_mock, UpdateHash());
+ EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+
+ bool res = res_ctrl.StartResumption(app_mock, hash);
+ EXPECT_TRUE(res);
+}
+
+MATCHER_P4(CheckAppFile, is_persistent, is_download, file_name, file_type, "") {
+ application_manager::AppFile app_file = arg;
+ return app_file.is_persistent == is_persistent &&
+ app_file.is_download_complete == is_download &&
+ app_file.file_name == file_name && app_file.file_type == file_type;
+}
+
+TEST_F(ResumeCtrlTest, StartResumption_WithoutGrammarId) {
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hash_id] = hash;
+
+ // Check RestoreApplicationData
+ EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
+ .Times(3)
+ .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ EXPECT_CALL(*app_mock, UpdateHash());
+ EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id)).Times(0);
+
+ bool res = res_ctrl.StartResumption(app_mock, hash);
+ EXPECT_FALSE(res);
+}
+
+TEST_F(ResumeCtrlTest, StartResumption_AppWithFiles) {
+ smart_objects::SmartObject test_application_files;
+ smart_objects::SmartObject test_file;
+ const uint32_t count_of_files = 8;
+
+ int file_types[count_of_files];
+ std::string file_names[count_of_files];
+ const size_t max_size = 12;
+ char numb[max_size];
+ for (uint32_t i = 0; i < count_of_files; i++) {
+ file_types[i] = i;
+ std::snprintf(numb, max_size, "%d", i);
+ file_names[i] = "test_file" + std::string(numb);
+ }
+
+ // Should not been added
+ test_file[application_manager::strings::persistent_file] = false;
+ test_application_files[0] = test_file;
+
+ for (uint32_t i = 0; i < count_of_files; ++i) {
+ test_file[application_manager::strings::persistent_file] = true;
+ test_file[application_manager::strings::is_download_complete] = true;
+ test_file[application_manager::strings::file_type] = file_types[i];
+ test_file[application_manager::strings::sync_file_name] = file_names[i];
+ test_application_files[i + 1] = test_file;
+ }
+
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hash_id] = hash;
+ saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::application_files] =
+ test_application_files;
+
+ // Check RestoreApplicationData
+ EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
+ .Times(3)
+ .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ EXPECT_CALL(*app_mock, UpdateHash());
+ EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+ for (uint32_t i = 0; i < count_of_files; ++i) {
+ EXPECT_CALL(*app_mock,
+ AddFile(CheckAppFile(
+ true, true, file_names[i],
+ static_cast<mobile_apis::FileType::eType>(file_types[i]))));
+ }
+
+ bool res = res_ctrl.StartResumption(app_mock, hash);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest, StartResumption_AppWithSubmenues) {
+ smart_objects::SmartObject test_application_submenues;
+ smart_objects::SmartObject test_submenu;
+
+ const uint32_t count_of_submenues = 20;
+ for (uint32_t i = 0; i < count_of_submenues; ++i) {
+ test_submenu[application_manager::strings::menu_id] = i;
+ test_application_submenues[i] = test_submenu;
+ }
+
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hash_id] = hash;
+ saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::application_submenus] =
+ test_application_submenues;
+
+ // Check RestoreApplicationData
+ EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
+ .Times(3)
+ .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+
+ for (uint32_t i = 0; i < count_of_submenues; ++i) {
+ EXPECT_CALL(*app_mock, AddSubMenu(i, test_application_submenues[i]));
+ }
+ smart_objects::SmartObjectList requests;
+ EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
+ CreateAddSubMenuRequestToHMI(_)).WillRepeatedly(Return(requests));
+
+ EXPECT_CALL(*app_mock, UpdateHash());
+ bool res = res_ctrl.StartResumption(app_mock, hash);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest, StartResumption_AppWithCommands) {
+ smart_objects::SmartObject test_application_commands;
+ smart_objects::SmartObject test_commands;
+ const uint32_t count_of_commands = 20;
+
+ for (uint32_t i = 0; i < count_of_commands; ++i) {
+ test_commands[application_manager::strings::cmd_id] = i;
+ test_application_commands[i] = test_commands;
+ }
+
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hash_id] = hash;
+ saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::application_commands] =
+ test_application_commands;
+
+ // Check RestoreApplicationData
+ EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
+ .Times(3)
+ .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ EXPECT_CALL(*app_mock, UpdateHash());
+ EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+
+ for (uint32_t i = 0; i < count_of_commands; ++i) {
+ EXPECT_CALL(*app_mock, AddCommand(i, test_application_commands[i]));
+ }
+
+ smart_objects::SmartObjectList requests;
+ EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
+ CreateAddCommandRequestToHMI(_)).WillRepeatedly(Return(requests));
+
+ bool res = res_ctrl.StartResumption(app_mock, hash);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest, StartResumption_AppWithChoiceSet) {
+ smart_objects::SmartObject application_choice_sets;
+ smart_objects::SmartObject app_choice_set;
+
+ const uint32_t count_of_choice = 10;
+ smart_objects::SmartObject choice_vector;
+ smart_objects::SmartObject choice;
+ const size_t max_size = 12;
+ char numb[max_size];
+ for (uint32_t i = 0; i < count_of_choice; ++i) {
+ std::snprintf(numb, max_size, "%d", i);
+ choice[application_manager::strings::vr_commands] =
+ "VrCommand" + std::string(numb);
+ choice[application_manager::strings::choice_id] = i;
+ choice_vector[i] = choice;
+ }
+ const uint32_t count_of_choice_sets = 5;
+ for (uint32_t i = 0; i < count_of_choice_sets; ++i) {
+ app_choice_set[application_manager::strings::interaction_choice_set_id] = i;
+ app_choice_set[application_manager::strings::choice_set] = choice_vector;
+ application_choice_sets[i] = app_choice_set;
+ }
+
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hash_id] = hash;
+ saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::application_choice_sets] =
+ application_choice_sets;
+
+ // Check RestoreApplicationData
+ EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
+ .Times(3)
+ .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ EXPECT_CALL(*app_mock, UpdateHash());
+ EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+
+ for (uint32_t i = 0; i < count_of_choice_sets; ++i) {
+ EXPECT_CALL(*app_mock, AddChoiceSet(i, application_choice_sets[i]));
+ }
+
+ smart_objects::SmartObjectList requests;
+ EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
+ CreateAddVRCommandRequestFromChoiceToHMI(_))
+ .WillRepeatedly(Return(requests));
+
+ bool res = res_ctrl.StartResumption(app_mock, hash);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest, StartResumption_AppWithGlobalProperties) {
+ // Prepare Data
+ smart_objects::SmartObject test_global_properties;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hash_id] = hash;
+ saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::application_global_properties] =
+ test_global_properties;
+
+ // Check RestoreApplicationData
+ EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
+ .Times(3)
+ .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+
+ EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
+ SendGlobalPropertiesToHMI(_));
+
+ EXPECT_CALL(*app_mock, load_global_properties(test_global_properties));
+
+ EXPECT_CALL(*app_mock, UpdateHash());
+ bool res = res_ctrl.StartResumption(app_mock, hash);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) {
+ // Prepare Data
+ smart_objects::SmartObject test_subscriptions;
+ smart_objects::SmartObject app_buttons;
+
+ uint32_t count_of_buttons = 17;
+ for (uint32_t i = 0; i < count_of_buttons; ++i) {
+ app_buttons[i] = i;
+ }
+
+ test_subscriptions[application_manager::strings::application_buttons] =
+ app_buttons;
+
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hash_id] = hash;
+ saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::application_subscribtions] =
+ test_subscriptions;
+
+ // Check RestoreApplicationData
+ EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
+ .Times(3)
+ .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+
+ for (uint32_t i = 0; i < count_of_buttons; ++i) {
+ EXPECT_CALL(*app_mock, SubscribeToButton(
+ static_cast<mobile_apis::ButtonName::eType>(i)));
+ }
+ EXPECT_CALL(*app_mock, UpdateHash());
+
+ EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
+ SendAllOnButtonSubscriptionNotificationsForApp(_)).Times(2);
+
+ bool res = res_ctrl.StartResumption(app_mock, hash);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToIVI) {
+ // Prepare Data
+ smart_objects::SmartObject test_subscriptions;
+ smart_objects::SmartObject app_vi;
+
+ int vtype = application_manager::VehicleDataType::GPS;
+ uint i = 0;
+ for (; vtype < application_manager::VehicleDataType::STEERINGWHEEL;
+ ++i, ++vtype) {
+ app_vi[i] = vtype;
+ }
+
+ test_subscriptions[application_manager::strings::application_vehicle_info] =
+ app_vi;
+
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hash_id] = hash;
+ saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::application_subscribtions] =
+ test_subscriptions;
+
+ // Check RestoreApplicationData
+ EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
+ .Times(3)
+ .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*app_mock, set_grammar_id(test_grammar_id));
+
+ for (size_t i = 0; i < app_vi.length(); ++i) {
+ EXPECT_CALL(
+ *app_mock,
+ SubscribeToIVI(static_cast<application_manager::VehicleDataType>(i)));
+ }
+
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+
+ smart_objects::SmartObjectList requests;
+ EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
+ GetIVISubscriptionRequests(_)).WillRepeatedly(Return(requests));
+
+ EXPECT_CALL(*app_mock, UpdateHash());
+ bool res = res_ctrl.StartResumption(app_mock, hash);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest, StartResumptionOnlyHMILevel) {
+ smart_objects::SmartObject saved_app;
+ ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
+
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
+ ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
+ EXPECT_CALL(*mock_storage, GetSavedApplication(test_policy_app_id, _, _))
+ .WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
+ .Times(3)
+ .WillRepeatedly(Return(default_testType));
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+ EXPECT_CALL(*app_mngr, SetState(test_app_id, default_testType,
+ test_audio_state)).Times(2);
+ bool res = res_ctrl.StartResumptionOnlyHMILevel(app_mock);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInFull) {
+ mobile_apis::HMILevel::eType restored_testType = eType::HMI_FULL;
+ uint32_t ign_off_count = 0;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::ign_off_count] = ign_off_count;
+ saved_app[application_manager::strings::hmi_level] = restored_testType;
+
+ ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(true));
+
+ ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ EXPECT_CALL(*app_mngr,
+ SetHmiState(test_app_id, restored_testType)).Times(AtLeast(1));
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+ EXPECT_CALL(*mock_storage, GetSavedApplication(test_policy_app_id, _, _))
+ .Times(2)
+ .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
+ .WillOnce(Return(default_testType));
+
+ EXPECT_CALL(*mock_storage, RemoveApplicationFromSaved(_, _))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(*app_mngr, GetUserConsentForDevice("12345"))
+ .WillRepeatedly(Return(policy::kDeviceAllowed));
+ EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
+ EXPECT_CALL(*app_mngr,
+ SetState(test_app_id, default_testType, test_audio_state));
+ EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
+ .WillOnce(Return(true));
+
+ res_ctrl.StartAppHmiStateResumption(app_mock);
+}
+
+TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInBackground) {
+ uint32_t ign_off_count = 0;
+ smart_objects::SmartObject saved_app;
+
+ mobile_apis::HMILevel::eType restored_testType = eType::HMI_BACKGROUND;
+ saved_app[application_manager::strings::ign_off_count] = ign_off_count;
+ saved_app[application_manager::strings::hmi_level] = restored_testType;
+
+ ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ EXPECT_CALL(*mock_storage, GetSavedApplication(test_policy_app_id, _, _))
+ .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
+ .WillOnce(Return(default_testType));
+
+ EXPECT_CALL(*app_mngr, GetUserConsentForDevice("12345"))
+ .WillOnce(Return(policy::kDeviceAllowed));
+ EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
+ EXPECT_CALL(*app_mngr,
+ SetState(test_app_id, default_testType, test_audio_state));
+ EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
+ .WillOnce(Return(true));
+
+ res_ctrl.StartAppHmiStateResumption(app_mock);
+}
+
+/**
+ * @brief Group of tests which check restoring resumption with different data
+ */
+
+TEST_F(ResumeCtrlTest, RestoreAppHMIState_RestoreHMILevelFull) {
+ mobile_apis::HMILevel::eType restored_testType = eType::HMI_FULL;
+
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hash_id] = hash;
+ saved_app[application_manager::strings::grammar_id] = test_grammar_id;
+ saved_app[application_manager::strings::hmi_level] = restored_testType;
+
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
+ EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
+ .WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+
+ EXPECT_CALL(*app_mngr, GetUserConsentForDevice(""))
+ .WillOnce(Return(policy::kDeviceAllowed));
+ EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
+ .WillRepeatedly(Return(false));
+
+ utils::SharedPtr<application_manager::Application> null_app;
+ EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(null_app));
+
+ ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+
+ EXPECT_CALL(*app_mngr,
+ SetState(test_app_id, restored_testType, test_audio_state));
+
+ bool res = res_ctrl.RestoreAppHMIState(app_mock);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest, SetupDefaultHMILevel) {
+ smart_objects::SmartObject saved_app;
+
+ saved_app[application_manager::strings::hmi_level] = default_testType;
+
+ EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
+ .WillRepeatedly(Return(default_testType));
+
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ EXPECT_CALL(*app_mngr, GetUserConsentForDevice("")).Times(0);
+ EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
+ EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
+ .WillOnce(Return(default_testType));
+ EXPECT_CALL(*app_mngr,
+ SetHmiState(test_app_id, default_testType)).Times(AtLeast(1));
+
+ ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
+
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+ EXPECT_CALL(*app_mngr, SetState(test_app_id, default_testType,
+ test_audio_state)).Times(2);
+
+ res_ctrl.SetupDefaultHMILevel(app_mock);
+}
+
+/**
+ * @brief group of tests which check correct SetAppHMIState
+*/
+
+TEST_F(ResumeCtrlTest, SetAppHMIState_HMINone_NotMedia_WithoutCheckPolicy) {
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ EXPECT_CALL(*app_mngr, GetUserConsentForDevice("")).Times(0);
+ EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
+ EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
+ .WillOnce(Return(default_testType));
+
+ ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
+
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+ EXPECT_CALL(*app_mngr, SetState(test_app_id, default_testType,
+ test_audio_state)).Times(2);
+
+ bool res = res_ctrl.SetAppHMIState(app_mock, default_testType, false);
+ EXPECT_TRUE(res);
+}
+
+// TODO(VVeremjova) APPLINK-16718
+TEST_F(ResumeCtrlTest,
+ DISABLED_SetAppHMIState_HMILimited_NotMedia_WithoutCheckPolicy) {
+ mobile_apis::HMILevel::eType testType = eType::HMI_LIMITED;
+
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+ ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+
+ EXPECT_CALL(*app_mngr, GetUserConsentForDevice(""))
+ .WillRepeatedly(Return(policy::DeviceConsent::kDeviceAllowed));
+ EXPECT_CALL(*app_mngr, SetState(test_app_id, testType, test_audio_state));
+
+ bool res = res_ctrl.SetAppHMIState(app_mock, testType, false);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_NotMedia_WithoutCheckPolicy) {
+ mobile_apis::HMILevel::eType testType = eType::HMI_FULL;
+ ::testing::InSequence seq;
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
+ .WillOnce(Return(false));
+
+ // Only mocked application is exist
+ utils::SharedPtr<application_manager::Application> null_app;
+ EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(null_app));
+
+ ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
+
+ // GetDefaultHmiLevel should not be called
+ EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_)).Times(0);
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+
+ EXPECT_CALL(*app_mngr, SetState(test_app_id, testType, test_audio_state));
+
+ EXPECT_CALL(*app_mngr, GetUserConsentForDevice("")).Times(0);
+ bool res = res_ctrl.SetAppHMIState(app_mock, testType, false);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest,
+ SetAppHMIState_HMIFull_NotMedia_WithoutPolicy_AnotherFullActiveExists) {
+ mobile_apis::HMILevel::eType testType = eType::HMI_FULL;
+ ::testing::InSequence seq;
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
+ EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
+ .WillOnce(Return(default_testType));
+
+ ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
+
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+
+ // Expect set default HMI state
+ EXPECT_CALL(*app_mngr,
+ SetState(test_app_id, default_testType, test_audio_state));
+
+ EXPECT_CALL(*app_mngr, GetUserConsentForDevice("")).Times(0);
+ bool res = res_ctrl.SetAppHMIState(app_mock, testType, false);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest,
+ SetAppHMIState_HMIFull_MediaAudio_WithoutPolicy_AnotherActiveAppExists) {
+ mobile_apis::HMILevel::eType testType = eType::HMI_FULL;
+
+ // In case application is media, audio state will be AUDIBLE
+ test_audio_state = mobile_apis::AudioStreamingState::AUDIBLE;
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+
+ // Only our app in FULL
+ EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
+ .WillOnce(Return(false));
+
+ // Active app exists
+ EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
+
+ EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_)).Times(0);
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+
+ ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(true));
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+
+ mobile_apis::HMILevel::eType expected_testType = eType::HMI_LIMITED;
+ EXPECT_CALL(*app_mngr,
+ SetState(test_app_id, expected_testType, test_audio_state));
+
+ EXPECT_CALL(*app_mngr, GetUserConsentForDevice("")).Times(0);
+ bool res = res_ctrl.SetAppHMIState(app_mock, testType, false);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_Media_WithoutPolicy_FullExists) {
+ default_testType = eType::HMI_FULL;
+
+ // In case application is media, audio state will be AUDIBLE
+ test_audio_state = mobile_apis::AudioStreamingState::AUDIBLE;
+ ::testing::InSequence seq;
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
+ EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
+ .WillOnce(Return(default_testType));
+
+ ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(true));
+
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+ EXPECT_CALL(*app_mngr,
+ SetState(test_app_id, default_testType, test_audio_state));
+
+ EXPECT_CALL(*app_mngr, GetUserConsentForDevice("")).Times(0);
+ bool res = res_ctrl.SetAppHMIState(app_mock, default_testType, false);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_NotMedia_WithPolicy_DevAllowed) {
+ mobile_apis::HMILevel::eType testType = eType::HMI_FULL;
+
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+
+ EXPECT_CALL(*app_mngr, GetUserConsentForDevice("12345"))
+ .WillOnce(Return(policy::kDeviceAllowed));
+
+ EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
+ EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
+ .WillOnce(Return(default_testType));
+
+ ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
+
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+ EXPECT_CALL(*app_mngr,
+ SetState(test_app_id, default_testType, test_audio_state));
+
+ bool res = res_ctrl.SetAppHMIState(app_mock, testType, true);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_Media_WithCheckPolicy) {
+ mobile_apis::HMILevel::eType testType = eType::HMI_FULL;
+
+ // In case application is media, audio state will be AUDIBLE
+ test_audio_state = mobile_apis::AudioStreamingState::AUDIBLE;
+ ::testing::InSequence seq;
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+
+ // App is allowed
+ EXPECT_CALL(*app_mngr, GetUserConsentForDevice("12345"))
+ .WillOnce(Return(policy::kDeviceAllowed));
+ EXPECT_CALL(*app_mngr, IsAppTypeExistsInFullOrLimited(_))
+ .WillOnce(Return(false));
+ EXPECT_CALL(*app_mngr, active_application()).WillOnce(Return(app_mock));
+ EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_)).Times(0);
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+
+ ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(true));
+
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+
+ mobile_apis::HMILevel::eType expected_testType = eType::HMI_LIMITED;
+ EXPECT_CALL(*app_mngr,
+ SetState(test_app_id, expected_testType, test_audio_state));
+
+ bool res = res_ctrl.SetAppHMIState(app_mock, testType, true);
+ EXPECT_TRUE(res);
+}
+
+TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_Media_WithPolicy_DevDisallowed) {
+ mobile_apis::HMILevel::eType testType = eType::HMI_FULL;
+
+ ::testing::InSequence seq;
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ EXPECT_CALL(*app_mngr, GetUserConsentForDevice("12345"))
+ .WillOnce(Return(policy::kDeviceDisallowed));
+
+ EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
+ .WillOnce(Return(default_testType));
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(true));
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+ EXPECT_CALL(*app_mngr,
+ SetState(test_app_id, default_testType, test_audio_state));
+
+ bool res = res_ctrl.SetAppHMIState(app_mock, testType, true);
+ EXPECT_FALSE(res);
+}
+
+TEST_F(ResumeCtrlTest, SaveApplication) {
+ utils::SharedPtr<application_manager::Application> app_sh_mock =
+ new ApplicationMock();
+
+ EXPECT_CALL(*mock_storage, SaveApplication(app_sh_mock));
+ res_ctrl.SaveApplication(app_sh_mock);
+}
+
+TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionHasStarted) {
+ ::profile::Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+
+ smart_objects::SmartObject saved_app;
+ EXPECT_CALL(*app_mngr, GetDefaultHmiLevel(_))
+ .WillOnce(Return(default_testType));
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ ON_CALL(*app_mock, is_media_application()).WillByDefault(Return(false));
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+ EXPECT_CALL(*app_mngr,
+ SetState(test_app_id, default_testType, test_audio_state));
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
+ EXPECT_CALL(*mock_storage, GetSavedApplication(test_policy_app_id, _, _))
+ .WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id));
+
+ bool res = res_ctrl.StartResumptionOnlyHMILevel(app_mock);
+ EXPECT_TRUE(res);
+
+ utils::SharedPtr<ApplicationMock> app_sh_mock = new ApplicationMock();
+
+ EXPECT_CALL(*app_sh_mock, app_id()).WillOnce(Return(test_app_id));
+ res_ctrl.OnAppActivated(app_sh_mock);
+}
+
+TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionNotActive) {
+ utils::SharedPtr<ApplicationMock> app_sh_mock = new ApplicationMock();
+ EXPECT_CALL(*app_sh_mock, app_id()).Times(0);
+ res_ctrl.OnAppActivated(app_sh_mock);
+}
+
+TEST_F(ResumeCtrlTest, IsHMIApplicationIdExist) {
+ uint32_t hmi_app_id = 10;
+
+ EXPECT_CALL(*mock_storage, IsHMIApplicationIdExist(hmi_app_id))
+ .WillOnce(Return(true));
+ EXPECT_TRUE(res_ctrl.IsHMIApplicationIdExist(hmi_app_id));
+}
+
+TEST_F(ResumeCtrlTest, GetHMIApplicationID) {
+ uint32_t hmi_app_id = 10;
+ std::string device_id = "test_device_id";
+
+ EXPECT_CALL(*mock_storage, GetHMIApplicationID(test_policy_app_id, device_id))
+ .WillOnce(Return(hmi_app_id));
+ EXPECT_EQ(hmi_app_id,
+ res_ctrl.GetHMIApplicationID(test_policy_app_id, device_id));
+}
+
+TEST_F(ResumeCtrlTest, IsApplicationSaved) {
+ std::string policy_app_id = "policy_app_id";
+ std::string device_id = "device_id";
+
+ EXPECT_CALL(*mock_storage, IsApplicationSaved(policy_app_id, device_id))
+ .WillOnce(Return(true));
+ EXPECT_TRUE(res_ctrl.IsApplicationSaved(policy_app_id, device_id));
+}
+
+TEST_F(ResumeCtrlTest, CheckPersistenceFiles_WithoutCommandAndChoiceSets) {
+ uint32_t ign_off_count = 0;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::ign_off_count] = ign_off_count;
+ saved_app[application_manager::strings::hmi_level] = HMI_FULL;
+
+ ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+
+ EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
+ .WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_TRUE(res_ctrl.CheckPersistenceFilesForResumption(app_mock));
+}
+
+TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithCommands) {
+ smart_objects::SmartObject test_application_commands;
+ uint32_t ign_off_count = 0;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::ign_off_count] = ign_off_count;
+ saved_app[application_manager::strings::hmi_level] = HMI_FULL;
+ saved_app[application_manager::strings::application_commands] =
+ test_application_commands;
+
+ ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+
+ EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
+ .WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
+ VerifyImageFiles(_, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_TRUE(res_ctrl.CheckPersistenceFilesForResumption(app_mock));
+}
+
+TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithChoiceSet) {
+ smart_objects::SmartObject test_choice_sets;
+ uint32_t ign_off_count = 0;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::ign_off_count] = ign_off_count;
+ saved_app[application_manager::strings::hmi_level] = HMI_FULL;
+ saved_app[application_manager::strings::application_choice_sets] =
+ test_choice_sets;
+
+ ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+
+ EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
+ .WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_TRUE(res_ctrl.CheckPersistenceFilesForResumption(app_mock));
+}
+
+// TODO (VVeremjova) APPLINK-16718
+TEST_F(ResumeCtrlTest, DISABLED_OnSuspend) {
+ EXPECT_CALL(*mock_storage, OnSuspend());
+ res_ctrl.OnSuspend();
+}
+
+TEST_F(ResumeCtrlTest, OnAwake) {
+ EXPECT_CALL(*mock_storage, OnAwake());
+ res_ctrl.OnAwake();
+}
+
+TEST_F(ResumeCtrlTest, RemoveApplicationFromSaved) {
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
+ EXPECT_CALL(*mock_storage, RemoveApplicationFromSaved(_, _))
+ .WillOnce(Return(true));
+ EXPECT_TRUE(res_ctrl.RemoveApplicationFromSaved(app_mock));
+}
+
+TEST_F(ResumeCtrlTest, CheckApplicationHash) {
+ smart_objects::SmartObject saved_app;
+
+ std::string test_hash = "saved_hash";
+ saved_app[application_manager::strings::hash_id] = test_hash;
+
+ ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id));
+ ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(test_policy_app_id));
+ EXPECT_CALL(*mock_storage, GetSavedApplication(test_policy_app_id, _, _))
+ .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ EXPECT_TRUE(res_ctrl.CheckApplicationHash(app_mock, test_hash));
+}
+
+} // 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
new file mode 100644
index 000000000..a6ced1434
--- /dev/null
+++ b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
@@ -0,0 +1,837 @@
+/*
+ * 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>
+#include <algorithm>
+#include "gtest/gtest.h"
+#include "include/application_mock.h"
+#include "interfaces/MOBILE_API.h"
+#include "sql_database.h"
+#include "sql_query.h"
+
+#include "application_manager/application_manager_impl.h"
+#include "config_profile/profile.h"
+#include "utils/file_system.h"
+#include "include/resumption_data_test.h"
+
+#include "application_manager/resumption/resumption_sql_queries.h"
+#include "application_manager/resumption/resumption_data_db.h"
+
+namespace test {
+namespace components {
+namespace resumption_test {
+
+using ::testing::NiceMock;
+
+namespace am = application_manager;
+using namespace file_system;
+
+using namespace resumption;
+using namespace mobile_apis;
+
+class TestResumptionDataDB : public ResumptionDataDB {
+ public:
+ utils::dbms::SQLDatabase* get_db_handle() { return db(); }
+
+ TestResumptionDataDB(DbStorage db_storage) : ResumptionDataDB(db_storage) {}
+};
+
+class ResumptionDataDBTest : public ResumptionDataTest {
+ protected:
+ virtual void SetUp() {
+ app_mock = new NiceMock<ApplicationMock>();
+ policy_app_id_ = "test_policy_app_id";
+ app_id_ = 10;
+ is_audio_ = true;
+ hash_ = "saved_hash";
+ hmi_level_ = HMILevel::eType::HMI_FULL;
+ hmi_app_id_ = 8;
+ ign_off_count_ = 0;
+ grammar_id_ = 16;
+ }
+ virtual void TearDown() {
+ utils::dbms::SQLQuery query(test_db());
+ EXPECT_TRUE(query.Prepare(remove_all_tables));
+ EXPECT_TRUE(query.Exec());
+ }
+
+ static void SetUpTestCase() {
+ kDatabaseName = "resumption";
+ if (is_in_file) {
+ ::profile::Profile::instance()->config_file_name(
+ "smartDeviceLink_test.ini");
+ path_ = profile::Profile::instance()->app_storage_folder();
+ CreateDirectory("./" + path_);
+ test_db_ = new utils::dbms::SQLDatabase(kDatabaseName);
+ test_db_->set_path(path_ + "/");
+ res_db_ = new TestResumptionDataDB(In_File_Storage);
+ } else {
+ res_db_ = new TestResumptionDataDB(In_Memory_Storage);
+ test_db_ = res_db_->get_db_handle();
+ }
+
+ EXPECT_TRUE(test_db_->Open());
+ EXPECT_TRUE(test_db_->IsReadWrite());
+ }
+
+ static utils::dbms::SQLDatabase* test_db_;
+ static std::string kDatabaseName;
+ static std::string path_;
+
+ static void TearDownTestCase() {
+ test_db_->Close();
+ if (is_in_file) {
+ ::profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
+ RemoveDirectory("./" + path_, true);
+ }
+ delete res_db_;
+ }
+
+ utils::dbms::SQLDatabase* test_db() { return test_db_; }
+ std::string path() { return path_; }
+
+ void SetZeroIgnOffTime() {
+ utils::dbms::SQLQuery query(test_db());
+ EXPECT_TRUE(query.Prepare(KUpdateLastIgnOffTime));
+ query.Bind(0, 0);
+ EXPECT_TRUE(query.Exec());
+ }
+
+ static TestResumptionDataDB* res_db_;
+
+ TestResumptionDataDB* res_db() { return res_db_; }
+
+ // Check that db includes tables with given elements
+ void CheckSavedDB();
+
+ static const bool is_in_file = false;
+ const std::string tables_exist =
+ "SELECT COUNT(*) FROM sqlite_master WHERE `type` = 'table';";
+ const std::string init_last_ign_count =
+ "SELECT `last_ign_off_time` FROM resumption;";
+ const std::string internal_data = "SELECT COUNT(*) FROM _internal_data;";
+
+ const std::string remove_all_tables =
+ "DELETE FROM `resumption`; "
+ "DELETE FROM `image`; "
+ "DELETE FROM `applicationChoiceSet`; "
+ "DELETE FROM `file`; "
+ "DELETE FROM `subMenu`; "
+ "DELETE FROM `TTSChunk`; "
+ "DELETE FROM `vrHelpItem`; "
+ "DELETE FROM `tableLimitedCharacterList`; "
+ "DELETE FROM `characterArray`; "
+ "DELETE FROM `choice`; "
+ "DELETE FROM `command`; "
+ "DELETE FROM `globalProperties`; "
+ "DELETE FROM `choiceArray`; "
+ "DELETE FROM `vrCommandsArray`; "
+ "DELETE FROM `helpTimeoutPromptArray`; "
+ "DELETE FROM `vrHelpItemArray`; "
+ "DELETE FROM `application`; "
+ "DELETE FROM `applicationChoiceSetArray`; "
+ "DELETE FROM `applicationCommandsArray`; "
+ "DELETE FROM `applicationFilesArray`; "
+ "DELETE FROM `applicationSubMenuArray`; "
+ "DELETE FROM `applicationSubscribtionsArray`; "
+ "DELETE FROM `_internal_data`; ";
+
+ private:
+ void CheckExistenceApplication();
+ void CheckAppData();
+ void CheckAppFilesData();
+ void CheckSubmenuData();
+ void CheckCommandsData();
+ void CheckChoiceSetData();
+
+ void CheckGlobalProportiesData();
+ void CheckCharacters(int64_t global_properties_key);
+ void CheckVRHelpItem(int64_t global_properties_key);
+
+ void BindId(utils::dbms::SQLQuery& query);
+};
+
+utils::dbms::SQLDatabase* ResumptionDataDBTest::test_db_ = NULL;
+TestResumptionDataDB* ResumptionDataDBTest::res_db_ = NULL;
+std::string ResumptionDataDBTest::kDatabaseName = "";
+std::string ResumptionDataDBTest::path_ = "";
+
+void ResumptionDataDBTest::CheckSavedDB() {
+ utils::dbms::SQLQuery query_checks(test_db());
+ EXPECT_TRUE(query_checks.Prepare(kChecksResumptionData));
+ EXPECT_TRUE(query_checks.Exec());
+ EXPECT_EQ(1, query_checks.GetInteger(0));
+
+ CheckExistenceApplication();
+ CheckAppData();
+
+ CheckAppFilesData();
+ CheckSubmenuData();
+ CheckCommandsData();
+
+ CheckChoiceSetData();
+ CheckGlobalProportiesData();
+}
+
+void ResumptionDataDBTest::CheckExistenceApplication() {
+ utils::dbms::SQLQuery query(test_db());
+ EXPECT_TRUE(query.Prepare(kCheckApplication));
+ query.Bind(0, device_id_);
+ query.Bind(1, policy_app_id_);
+ EXPECT_TRUE(query.Exec());
+ EXPECT_EQ(1, query.GetInteger(0));
+}
+
+void ResumptionDataDBTest::CheckAppData() {
+ utils::dbms::SQLQuery query(test_db());
+ EXPECT_TRUE(query.Prepare(kSelectAppTable));
+ BindId(query);
+ EXPECT_TRUE(query.Exec());
+ EXPECT_EQ(policy_app_id_, query.GetString(0));
+ EXPECT_EQ(app_id_, query.GetUInteger(1));
+ EXPECT_EQ(grammar_id_, query.GetUInteger(2));
+ EXPECT_EQ(hash_, query.GetString(3));
+ EXPECT_EQ(hmi_app_id_, query.GetUInteger(4));
+ EXPECT_EQ(hmi_level_, query.GetInteger(5));
+
+ EXPECT_EQ(ign_off_count_, query.GetUInteger(6));
+
+ EXPECT_EQ(device_id_, query.GetString(8));
+ EXPECT_EQ(is_audio_, query.GetBoolean(9));
+}
+
+void ResumptionDataDBTest::CheckGlobalProportiesData() {
+ utils::dbms::SQLQuery select_globalproperties(test_db());
+
+ EXPECT_TRUE(select_globalproperties.Prepare(kSelectCountGlobalProperties));
+ BindId(select_globalproperties);
+ EXPECT_TRUE(select_globalproperties.Exec());
+ EXPECT_EQ(1, select_globalproperties.GetInteger(0));
+
+ EXPECT_TRUE(select_globalproperties.Prepare(kSelectGlobalProperties));
+ BindId(select_globalproperties);
+
+ size_t help_prompt_idx = 0;
+ size_t timeout_prompt_idx = 0;
+ int64_t global_properties_key = 0;
+ while (select_globalproperties.Next()) {
+ if (global_properties_key != select_globalproperties.GetLongInt(0)) {
+ global_properties_key = select_globalproperties.GetLongInt(0);
+ EXPECT_EQ((*vr_help_title_).asString(),
+ select_globalproperties.GetString(1));
+ EXPECT_EQ((*menu_title_).asString(),
+ select_globalproperties.GetString(2));
+ EXPECT_EQ((*keyboard_props_)[am::strings::language].asInt(),
+ select_globalproperties.GetInteger(4));
+ EXPECT_EQ((*keyboard_props_)[am::hmi_request::keyboard_layout].asInt(),
+ select_globalproperties.GetInteger(5));
+ EXPECT_EQ((*keyboard_props_)[am::strings::key_press_mode].asInt(),
+ select_globalproperties.GetInteger(6));
+ EXPECT_EQ((*keyboard_props_)[am::strings::auto_complete_text].asString(),
+ select_globalproperties.GetString(7));
+
+ EXPECT_FALSE(select_globalproperties.IsNull(3));
+ utils::dbms::SQLQuery select_image(test_db());
+ EXPECT_TRUE(select_image.Prepare(kSelectImage));
+ select_image.Bind(0, select_globalproperties.GetLongInt(3));
+ EXPECT_TRUE(select_image.Exec());
+ EXPECT_EQ((*menu_icon_)[am::strings::image_type].asInt(),
+ select_image.GetInteger(0));
+ EXPECT_EQ((*menu_icon_)[am::strings::value].asString(),
+ select_image.GetString(1));
+ }
+ if (!select_globalproperties.IsNull(8)) {
+ utils::dbms::SQLQuery select_tts_chunk(test_db());
+ EXPECT_TRUE(select_tts_chunk.Prepare(kSelectTTSChunk));
+ select_tts_chunk.Bind(0, select_globalproperties.GetLongInt(8));
+ EXPECT_TRUE(select_tts_chunk.Exec());
+
+ std::string text =
+ (*help_prompt_)[help_prompt_idx][am::strings::text].asString();
+ int type = (*help_prompt_)[help_prompt_idx][am::strings::type].asInt();
+ EXPECT_EQ(text, select_tts_chunk.GetString(0));
+ EXPECT_EQ(type, select_tts_chunk.GetInteger(1));
+ help_prompt_idx++;
+ }
+ if (!select_globalproperties.IsNull(9)) {
+ utils::dbms::SQLQuery select_tts_chunk(test_db());
+ EXPECT_TRUE(select_tts_chunk.Prepare(kSelectTTSChunk));
+ select_tts_chunk.Bind(0, select_globalproperties.GetLongInt(9));
+ EXPECT_TRUE(select_tts_chunk.Exec());
+
+ std::string text =
+ (*timeout_prompt_)[timeout_prompt_idx][am::strings::text].asString();
+ int type =
+ (*timeout_prompt_)[timeout_prompt_idx][am::strings::type].asInt();
+ EXPECT_EQ(text, select_tts_chunk.GetString(0));
+ EXPECT_EQ(type, select_tts_chunk.GetInteger(1));
+ timeout_prompt_idx++;
+ }
+ CheckCharacters(global_properties_key);
+ CheckVRHelpItem(global_properties_key);
+ }
+}
+void ResumptionDataDBTest::CheckVRHelpItem(int64_t global_properties_key) {
+ utils::dbms::SQLQuery checks_vrhelp_item(test_db());
+ EXPECT_TRUE(checks_vrhelp_item.Prepare(kChecksVrHelpItem));
+ checks_vrhelp_item.Bind(0, global_properties_key);
+ EXPECT_TRUE(checks_vrhelp_item.Exec());
+ EXPECT_NE(0, checks_vrhelp_item.GetInteger(0));
+ if (!checks_vrhelp_item.GetInteger(0)) {
+ utils::dbms::SQLQuery select_vrhelp_item(test_db());
+ EXPECT_TRUE(select_vrhelp_item.Prepare(kSelectVrHelpItem));
+ select_vrhelp_item.Bind(0, global_properties_key);
+ size_t vr_help_item_idx = 0;
+ while (select_vrhelp_item.Next()) {
+ std::string vr_text =
+ (*vr_help_)[vr_help_item_idx][am::strings::text].asString();
+ std::string vr_position =
+ (*vr_help_)[vr_help_item_idx++][am::strings::position].asString();
+ EXPECT_EQ(vr_text, select_vrhelp_item.GetString(0));
+ EXPECT_EQ(vr_position, select_vrhelp_item.GetString(1));
+ }
+ }
+}
+
+void ResumptionDataDBTest::CheckCharacters(int64_t global_properties_key) {
+ utils::dbms::SQLQuery checks_characters(test_db());
+ EXPECT_TRUE(checks_characters.Prepare(kChecksCharacter));
+ checks_characters.Bind(0, global_properties_key);
+ EXPECT_TRUE(checks_characters.Exec());
+ EXPECT_NE(0, checks_characters.GetInteger(0));
+ if (!checks_characters.GetInteger(0)) {
+ utils::dbms::SQLQuery select_characters(test_db());
+ EXPECT_TRUE(select_characters.Prepare(kSelectCharacter));
+ select_characters.Bind(0, global_properties_key);
+ size_t characters_idx = 0;
+ while (select_characters.Next()) {
+ std::string character =
+ (*keyboard_props_)[am::strings::limited_character_list]
+ [characters_idx++].asString();
+ EXPECT_EQ(character, select_characters.GetString(0));
+ }
+ }
+}
+
+void ResumptionDataDBTest::CheckSubmenuData() {
+ utils::dbms::SQLQuery select_submenu(test_db());
+
+ EXPECT_TRUE(select_submenu.Prepare(kSelectCountSubMenu));
+ BindId(select_submenu);
+ EXPECT_TRUE(select_submenu.Exec());
+ EXPECT_EQ(count_of_submenues, select_submenu.GetUInteger(0));
+
+ EXPECT_TRUE(select_submenu.Prepare(kSelectSubMenu));
+ BindId(select_submenu);
+ int i = 10;
+ while (select_submenu.Next()) {
+ uint32_t test_id = (*test_submenu_map[i])[am::strings::menu_id].asUInt();
+ std::string name =
+ (*test_submenu_map[i])[am::strings::menu_name].asString();
+ int position = (*test_submenu_map[i])[am::strings::position].asInt();
+ EXPECT_EQ(test_id, select_submenu.GetUInteger(0));
+ EXPECT_EQ(name, select_submenu.GetString(1));
+ EXPECT_EQ(position, select_submenu.GetInteger(2));
+ i++;
+ }
+}
+
+void ResumptionDataDBTest::CheckCommandsData() {
+ utils::dbms::SQLQuery select_commands(test_db());
+
+ EXPECT_TRUE(select_commands.Prepare(kSelectCountCommands));
+ BindId(select_commands);
+ EXPECT_TRUE(select_commands.Exec());
+ EXPECT_EQ(count_of_commands, select_commands.GetUInteger(0));
+
+ EXPECT_TRUE(select_commands.Prepare(kSelectCommands));
+ BindId(select_commands);
+
+ int32_t i = -1;
+ int64_t command_key = 0;
+ int j = 0;
+ while (select_commands.Next()) {
+ if (command_key != select_commands.GetLongInt(0)) {
+ ++i;
+ uint cmd = (*test_commands_map[i])[am::strings::cmd_id].asUInt();
+ EXPECT_EQ(cmd, select_commands.GetUInteger(1));
+ std::string name =
+ (*test_commands_map[i])[am::strings::menu_params]
+ [am::strings::menu_name].asString();
+ EXPECT_EQ(name, select_commands.GetString(2));
+ int position = (*test_commands_map[i])[am::strings::menu_params]
+ [am::strings::position].asInt();
+ EXPECT_EQ(position, select_commands.GetInteger(4));
+ int parent_id =
+ (*test_commands_map[i])[am::strings::menu_params]
+ [am::hmi_request::parent_id].asInt();
+ EXPECT_EQ(parent_id, select_commands.GetInteger(3));
+ std::string icon_name =
+ (*test_commands_map[i])[am::strings::cmd_icon][am::strings::value]
+ .asString();
+ EXPECT_EQ(icon_name, select_commands.GetString(5));
+
+ int icon_type = (*test_commands_map[i])[am::strings::cmd_icon]
+ [am::strings::image_type].asInt();
+ EXPECT_EQ(icon_type, select_commands.GetInteger(6));
+
+ j = 0;
+ command_key = select_commands.GetLongInt(0);
+ }
+ std::string vr =
+ (*test_commands_map[i])[am::strings::vr_commands][j].asString();
+ EXPECT_EQ(vr, select_commands.GetString(7));
+ j++;
+ }
+}
+
+void ResumptionDataDBTest::CheckChoiceSetData() {
+ utils::dbms::SQLQuery select_choice_set(test_db());
+ EXPECT_TRUE(select_choice_set.Prepare(kSelectCountChoiceSet));
+ BindId(select_choice_set);
+ EXPECT_TRUE(select_choice_set.Exec());
+ EXPECT_EQ(count_of_choice_sets, select_choice_set.GetUInteger(0));
+
+ EXPECT_TRUE(select_choice_set.Prepare(kSelectChoiceSets));
+ int64_t app_set_key = 0;
+ int64_t choice_key = 0;
+ int32_t choice_set_idx = -1;
+ int32_t choice_idx = -1;
+ size_t vr_cmd_idx = 0;
+ sm::SmartObject command;
+ while (select_choice_set.Next()) {
+ if (app_set_key != select_choice_set.GetLongInt(0)) {
+ command = (*test_choiceset_map[app_set_key]);
+ ++choice_set_idx;
+
+ int choice_set_id =
+ command[am::strings::interaction_choice_set_id].asUInt();
+ int grammar_id = command[am::strings::grammar_id].asUInt();
+
+ EXPECT_EQ(grammar_id, select_choice_set.GetInteger(1));
+ EXPECT_EQ(choice_set_id, select_choice_set.GetInteger(2));
+
+ app_set_key = select_choice_set.GetLongInt(0);
+ choice_idx = -1;
+ }
+
+ if (choice_key != select_choice_set.GetLongInt(3)) {
+ ++choice_idx;
+ choice_key = select_choice_set.GetLongInt(3);
+ int choice_id =
+ command[am::strings::choice_set][choice_idx][am::strings::choice_id]
+ .asUInt();
+ std::string menu_name =
+ command[am::strings::choice_set][choice_idx][am::strings::menu_name]
+ .asString();
+ std::string secondary_text =
+ command[am::strings::choice_set][choice_idx]
+ [am::strings::secondary_text].asString();
+ std::string tertiary_text =
+ command[am::strings::choice_set][choice_idx]
+ [am::strings::tertiary_text].asString();
+
+ EXPECT_EQ(choice_id, select_choice_set.GetInteger(4));
+ EXPECT_EQ(menu_name, select_choice_set.GetString(5));
+ EXPECT_EQ(secondary_text, select_choice_set.GetString(6));
+ EXPECT_EQ(tertiary_text, select_choice_set.GetString(7));
+
+ EXPECT_FALSE(select_choice_set.IsNull(8));
+ utils::dbms::SQLQuery select_image(test_db());
+ EXPECT_TRUE(select_image.Prepare(kSelectImage));
+ select_image.Bind(0, select_choice_set.GetLongInt(8));
+ EXPECT_TRUE(select_image.Exec());
+ std::string image_value =
+ command[am::strings::choice_set][choice_idx][am::strings::image]
+ [am::strings::value].asString();
+ int image_type =
+ command[am::strings::choice_set][choice_idx][am::strings::image]
+ [am::strings::image_type].asInt();
+ EXPECT_EQ(image_value, select_image.GetString(1));
+ EXPECT_EQ(image_type, select_image.GetInteger(0));
+
+ EXPECT_FALSE(select_choice_set.IsNull(9));
+ EXPECT_TRUE(select_image.Prepare(kSelectImage));
+ select_image.Bind(0, select_choice_set.GetLongInt(9));
+ EXPECT_TRUE(select_image.Exec());
+ image_value =
+ command[am::strings::choice_set][choice_idx]
+ [am::strings::secondary_image][am::strings::value].asString();
+ image_type =
+ command[am::strings::choice_set][choice_idx]
+ [am::strings::secondary_image][am::strings::image_type]
+ .asInt();
+ EXPECT_EQ(image_value, select_image.GetString(1));
+ EXPECT_EQ(image_type, select_image.GetInteger(0));
+
+ vr_cmd_idx = 0;
+ }
+ std::string vr_comm =
+ command[am::strings::choice_set][choice_idx][am::strings::vr_commands]
+ [vr_cmd_idx++].asString();
+ EXPECT_EQ(vr_comm, select_choice_set.GetString(10));
+ }
+}
+
+void ResumptionDataDBTest::CheckAppFilesData() {
+ utils::dbms::SQLQuery query(test_db());
+ EXPECT_TRUE(query.Prepare(kSelectCountFiles));
+ BindId(query);
+ EXPECT_TRUE(query.Exec());
+ EXPECT_EQ(count_of_files, query.GetUInteger(0));
+
+ EXPECT_TRUE(query.Prepare(kSelectFiles));
+ BindId(query);
+ am::AppFile check_file;
+ int i = 0;
+ while (query.Next()) {
+ char numb[12];
+ std::snprintf(numb, 12, "%d", i);
+ check_file = app_files_map_["test_file " + std::string(numb)];
+
+ EXPECT_EQ(check_file.file_type, query.GetInteger(0));
+ EXPECT_EQ(check_file.is_download_complete, query.GetBoolean(1));
+ EXPECT_EQ(check_file.is_persistent, query.GetBoolean(2));
+ EXPECT_EQ(check_file.file_name, query.GetString(3));
+ i++;
+ }
+}
+
+void ResumptionDataDBTest::BindId(utils::dbms::SQLQuery& query) {
+ query.Bind(0, policy_app_id_);
+ query.Bind(1, device_id_);
+}
+
+TEST_F(ResumptionDataDBTest, Init) {
+ utils::dbms::SQLQuery query_checks(test_db());
+
+ EXPECT_TRUE(res_db()->Init());
+
+ EXPECT_TRUE(query_checks.Prepare(tables_exist));
+ EXPECT_TRUE(query_checks.Exec());
+ EXPECT_NE(0, query_checks.GetInteger(0));
+
+ EXPECT_TRUE(query_checks.Prepare(kChecksResumptionData));
+ EXPECT_TRUE(query_checks.Exec());
+ EXPECT_NE(0, query_checks.GetInteger(0));
+
+ EXPECT_TRUE(query_checks.Prepare(init_last_ign_count));
+ EXPECT_TRUE(query_checks.Exec());
+ EXPECT_EQ(0, query_checks.GetInteger(0));
+
+ EXPECT_TRUE(query_checks.Prepare(internal_data));
+ EXPECT_TRUE(query_checks.Exec());
+ EXPECT_LE(0, query_checks.GetInteger(0));
+}
+
+TEST_F(ResumptionDataDBTest, SaveApplication) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+}
+
+TEST_F(ResumptionDataDBTest, RemoveApplicationFromSaved) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+ EXPECT_TRUE(res_db()->RemoveApplicationFromSaved(policy_app_id_, device_id_));
+
+ sm::SmartObject remove_app;
+ EXPECT_FALSE(
+ res_db()->GetSavedApplication(policy_app_id_, device_id_, remove_app));
+ EXPECT_TRUE(remove_app.empty());
+}
+
+TEST_F(ResumptionDataDBTest, RemoveApplicationFromSaved_AppNotSaved) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+
+ sm::SmartObject saved_app;
+ EXPECT_FALSE(
+ res_db()->GetSavedApplication(policy_app_id_, "54321", saved_app));
+ EXPECT_TRUE(saved_app.empty());
+}
+
+TEST_F(ResumptionDataDBTest, SavedApplicationTwice) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+}
+
+TEST_F(ResumptionDataDBTest, SavedApplicationTwice_UpdateApp) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+ (*vr_help_)[0][am::strings::position] = 2;
+
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+}
+
+TEST_F(ResumptionDataDBTest, IsApplicationSaved_ApplicationSaved) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+ ssize_t result = res_db()->IsApplicationSaved(policy_app_id_, device_id_);
+ EXPECT_EQ(0, result);
+}
+
+TEST_F(ResumptionDataDBTest, IsApplicationSaved_ApplicationRemoved) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+ EXPECT_TRUE(res_db()->RemoveApplicationFromSaved(policy_app_id_, device_id_));
+ ssize_t result = res_db()->IsApplicationSaved(policy_app_id_, device_id_);
+ EXPECT_EQ(-1, result);
+}
+
+TEST_F(ResumptionDataDBTest, GetSavedApplication) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+
+ sm::SmartObject saved_app;
+ EXPECT_TRUE(
+ res_db()->GetSavedApplication(policy_app_id_, device_id_, saved_app));
+ CheckSavedApp(saved_app);
+}
+
+TEST_F(ResumptionDataDBTest, GetSavedApplication_AppNotSaved) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ sm::SmartObject saved_app;
+ EXPECT_FALSE(
+ res_db()->GetSavedApplication(policy_app_id_, "54321", saved_app));
+ EXPECT_TRUE(saved_app.empty());
+}
+
+TEST_F(ResumptionDataDBTest, GetDataForLoadResumeData) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+ sm::SmartObject saved_app;
+ res_db()->GetDataForLoadResumeData(saved_app);
+
+ EXPECT_EQ(policy_app_id_, saved_app[0][am::strings::app_id].asString());
+ EXPECT_EQ(device_id_, saved_app[0][am::strings::device_id].asString());
+ EXPECT_EQ(hmi_level_, static_cast<HMILevel::eType>(
+ saved_app[0][am::strings::hmi_level].asInt()));
+ EXPECT_EQ(ign_off_count_, saved_app[0][am::strings::ign_off_count].asUInt());
+}
+
+TEST_F(ResumptionDataDBTest, GetDataForLoadResumeData_AppRemove) {
+ sm::SmartObject saved_app;
+
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+ EXPECT_TRUE(res_db()->RemoveApplicationFromSaved(policy_app_id_, device_id_));
+ res_db()->GetDataForLoadResumeData(saved_app);
+ EXPECT_TRUE(saved_app.empty());
+}
+
+TEST_F(ResumptionDataDBTest, UpdateHmiLevel) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+ HMILevel::eType new_hmi_level = HMILevel::HMI_LIMITED;
+ res_db()->UpdateHmiLevel(policy_app_id_, device_id_, new_hmi_level);
+ hmi_level_ = new_hmi_level;
+ CheckSavedDB();
+}
+
+TEST_F(ResumptionDataDBTest, IsHMIApplicationIdExist_AppIsSaved) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+ EXPECT_TRUE(res_db()->IsHMIApplicationIdExist(hmi_app_id_));
+}
+
+TEST_F(ResumptionDataDBTest, IsHMIApplicationIdExist_AppNotSaved) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+ uint32_t new_hmi_app_id_ = hmi_app_id_ + 10;
+ EXPECT_FALSE(res_db()->IsHMIApplicationIdExist(new_hmi_app_id_));
+}
+
+TEST_F(ResumptionDataDBTest, GetHMIApplicationID) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+ EXPECT_EQ(hmi_app_id_,
+ res_db()->GetHMIApplicationID(policy_app_id_, device_id_));
+}
+
+TEST_F(ResumptionDataDBTest, GetHMIApplicationID_AppNotSaved) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+ EXPECT_EQ(0u, res_db()->GetHMIApplicationID(policy_app_id_, "other_dev_id"));
+}
+
+TEST_F(ResumptionDataDBTest, OnSuspend) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ SetZeroIgnOffTime();
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+
+ res_db()->OnSuspend();
+ ign_off_count_++;
+ CheckSavedDB();
+}
+
+TEST_F(ResumptionDataDBTest, OnSuspendFourTimes) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ SetZeroIgnOffTime();
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+
+ res_db()->OnSuspend();
+ ign_off_count_++;
+ CheckSavedDB();
+
+ res_db()->OnSuspend();
+ ign_off_count_++;
+ CheckSavedDB();
+ res_db()->OnSuspend();
+ ign_off_count_++;
+ CheckSavedDB();
+
+ res_db()->OnSuspend();
+
+ ssize_t result = res_db()->IsApplicationSaved(policy_app_id_, device_id_);
+ EXPECT_EQ(-1, result);
+}
+
+TEST_F(ResumptionDataDBTest, OnSuspendOnAwake) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ SetZeroIgnOffTime();
+
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+
+ res_db()->OnSuspend();
+
+ ign_off_count_++;
+ CheckSavedDB();
+ res_db()->OnAwake();
+ ign_off_count_ = 0;
+ CheckSavedDB();
+}
+
+TEST_F(ResumptionDataDBTest, Awake_AppNotSuspended) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ SetZeroIgnOffTime();
+
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+
+ res_db()->OnAwake();
+ ign_off_count_ = 0;
+ CheckSavedDB();
+}
+
+TEST_F(ResumptionDataDBTest, TwiceAwake_AppNotSuspended) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ SetZeroIgnOffTime();
+
+ res_db()->SaveApplication(app_mock);
+ CheckSavedDB();
+
+ res_db()->OnSuspend();
+ res_db()->OnAwake();
+ ign_off_count_ = 0;
+ CheckSavedDB();
+
+ res_db()->OnAwake();
+ CheckSavedDB();
+}
+
+TEST_F(ResumptionDataDBTest, GetHashId) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+
+ res_db()->SaveApplication(app_mock);
+
+ std::string test_hash;
+ EXPECT_TRUE(res_db()->GetHashId(policy_app_id_, device_id_, test_hash));
+ EXPECT_EQ(hash_, test_hash);
+}
+
+TEST_F(ResumptionDataDBTest, GetIgnOffTime_AfterSuspendAndAwake) {
+ PrepareData();
+ EXPECT_TRUE(res_db()->Init());
+ SetZeroIgnOffTime();
+ uint32_t last_ign_off_time;
+
+ res_db()->SaveApplication(app_mock);
+
+ last_ign_off_time = res_db()->GetIgnOffTime();
+ EXPECT_EQ(0u, last_ign_off_time);
+
+ res_db()->OnSuspend();
+
+ uint32_t after_suspend;
+ after_suspend = res_db()->GetIgnOffTime();
+ EXPECT_LE(last_ign_off_time, after_suspend);
+
+ uint32_t after_awake;
+ res_db()->OnAwake();
+
+ after_awake = res_db()->GetIgnOffTime();
+ EXPECT_LE(after_suspend, after_awake);
+}
+
+} // namespace resumption_test
+} // namespace components
+} // namespace test
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
new file mode 100644
index 000000000..24a16596e
--- /dev/null
+++ b/src/components/application_manager/test/resumption/resumption_data_json_test.cc
@@ -0,0 +1,394 @@
+/*
+ * 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>
+#include <algorithm>
+#include "gtest/gtest.h"
+
+#include "application_manager/usage_statistics.h"
+#include "include/application_mock.h"
+#include "include/resumption_data_mock.h"
+#include "interfaces/MOBILE_API.h"
+#include "resumption/last_state.h"
+
+#include "include/resumption_data_test.h"
+#include "formatters/CFormatterJsonBase.hpp"
+#include "config_profile/profile.h"
+#include "utils/file_system.h"
+
+#include "application_manager/resumption/resumption_data_json.h"
+namespace test {
+namespace components {
+namespace resumption_test {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::NiceMock;
+
+namespace am = application_manager;
+using namespace Json;
+using namespace file_system;
+
+using namespace resumption;
+using namespace mobile_apis;
+namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+
+class ResumptionDataJsonTest : public ResumptionDataTest {
+ protected:
+ virtual void SetUp() {
+ app_mock = new NiceMock<ApplicationMock>();
+
+ policy_app_id_ = "test_policy_app_id";
+ app_id_ = 10;
+ is_audio_ = true;
+ grammar_id_ = 20;
+ hash_ = "saved_hash";
+ hmi_level_ = HMILevel::eType::HMI_FULL;
+ hmi_app_id_ = 8;
+ ign_off_count_ = 0;
+ }
+
+ void CheckSavedJson() {
+ Value& dictionary = LastState::instance()->dictionary;
+ ASSERT_TRUE(dictionary[am::strings::resumption].isObject());
+ ASSERT_TRUE(
+ dictionary[am::strings::resumption][am::strings::resume_app_list]
+ .isArray());
+ Value& resume_app_list =
+ 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],
+ res_app_list);
+ CheckSavedApp(res_app_list);
+ }
+ }
+
+ void SetZeroIgnOff() {
+ Value& dictionary = LastState::instance()->dictionary;
+ Value& res = dictionary[am::strings::resumption];
+ res[am::strings::last_ign_off_time] = 0;
+ LastState::instance()->SaveToFileSystem();
+ }
+};
+
+TEST_F(ResumptionDataJsonTest, SaveApplication) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+}
+
+TEST_F(ResumptionDataJsonTest, SavedApplicationTwice) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+}
+
+TEST_F(ResumptionDataJsonTest, SavedApplicationTwice_UpdateApp) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+ (*vr_help_)[0][am::strings::position] = 2;
+
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+}
+
+TEST_F(ResumptionDataJsonTest, RemoveApplicationFromSaved) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ EXPECT_TRUE(res_json.RemoveApplicationFromSaved(policy_app_id_, device_id_));
+
+ // Check that application was deleted
+ smart_objects::SmartObject remove_app;
+ EXPECT_FALSE(
+ res_json.GetSavedApplication(policy_app_id_, device_id_, remove_app));
+ EXPECT_TRUE(remove_app.empty());
+}
+
+TEST_F(ResumptionDataJsonTest, RemoveApplicationFromSaved_AppNotSaved) {
+ ResumptionDataJson res_json;
+ EXPECT_FALSE(res_json.RemoveApplicationFromSaved(policy_app_id_, "54321"));
+}
+
+TEST_F(ResumptionDataJsonTest, IsApplicationSaved_ApplicationSaved) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+ ssize_t result = res_json.IsApplicationSaved(policy_app_id_, device_id_);
+ EXPECT_EQ(0, result);
+}
+
+TEST_F(ResumptionDataJsonTest, IsApplicationSaved_ApplicationRemoved) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+ EXPECT_TRUE(res_json.RemoveApplicationFromSaved(policy_app_id_, device_id_));
+ ssize_t result = res_json.IsApplicationSaved(policy_app_id_, device_id_);
+ EXPECT_EQ(-1, result);
+}
+
+TEST_F(ResumptionDataJsonTest, GetSavedApplication) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ smart_objects::SmartObject saved_app;
+ EXPECT_TRUE(
+ res_json.GetSavedApplication(policy_app_id_, device_id_, saved_app));
+ CheckSavedApp(saved_app);
+}
+
+TEST_F(ResumptionDataJsonTest, GetSavedApplication_AppNotSaved) {
+ ResumptionDataJson res_json;
+ smart_objects::SmartObject saved_app;
+ EXPECT_FALSE(
+ res_json.GetSavedApplication(policy_app_id_, "54321", saved_app));
+ EXPECT_TRUE(saved_app.empty());
+}
+
+TEST_F(ResumptionDataJsonTest, GetDataForLoadResumeData) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+ smart_objects::SmartObject saved_app;
+ res_json.GetDataForLoadResumeData(saved_app);
+
+ EXPECT_EQ(policy_app_id_, saved_app[0][am::strings::app_id].asString());
+ EXPECT_EQ(device_id_, saved_app[0][am::strings::device_id].asString());
+ EXPECT_EQ(hmi_level_, static_cast<HMILevel::eType>(
+ saved_app[0][am::strings::hmi_level].asInt()));
+ EXPECT_EQ(ign_off_count_, saved_app[0][am::strings::ign_off_count].asUInt());
+}
+
+TEST_F(ResumptionDataJsonTest, GetDataForLoadResumeData_AppRemove) {
+ ResumptionDataJson res_json;
+ smart_objects::SmartObject saved_app;
+
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+ EXPECT_TRUE(res_json.RemoveApplicationFromSaved(policy_app_id_, device_id_));
+ res_json.GetDataForLoadResumeData(saved_app);
+ EXPECT_TRUE(saved_app.empty());
+}
+
+TEST_F(ResumptionDataJsonTest, UpdateHmiLevel) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+ HMILevel::eType new_hmi_level = HMILevel::HMI_LIMITED;
+ res_json.UpdateHmiLevel(policy_app_id_, device_id_, new_hmi_level);
+ hmi_level_ = new_hmi_level;
+
+ CheckSavedJson();
+}
+
+TEST_F(ResumptionDataJsonTest, IsHMIApplicationIdExist_AppIsSaved) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+ EXPECT_TRUE(res_json.IsHMIApplicationIdExist(hmi_app_id_));
+}
+
+TEST_F(ResumptionDataJsonTest, IsHMIApplicationIdExist_AppNotSaved) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+
+ CheckSavedJson();
+ uint32_t new_hmi_app_id_ = hmi_app_id_ + 10;
+ EXPECT_FALSE(res_json.IsHMIApplicationIdExist(new_hmi_app_id_));
+}
+
+TEST_F(ResumptionDataJsonTest, GetHMIApplicationID) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+ EXPECT_EQ(hmi_app_id_,
+ res_json.GetHMIApplicationID(policy_app_id_, device_id_));
+}
+
+TEST_F(ResumptionDataJsonTest, GetHMIApplicationID_AppNotSaved) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ EXPECT_EQ(0u, res_json.GetHMIApplicationID(policy_app_id_, "other_dev_id"));
+}
+
+TEST_F(ResumptionDataJsonTest, OnSuspend) {
+ ResumptionDataJson res_json;
+ ::profile::Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+ SetZeroIgnOff();
+ PrepareData();
+
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+
+ res_json.OnSuspend();
+ ign_off_count_++;
+ CheckSavedJson();
+
+ EXPECT_TRUE(FileExists("./test_app_info.dat"));
+ EXPECT_TRUE(DirectoryExists("./test_storage"));
+ EXPECT_TRUE(RemoveDirectory("./test_storage", true));
+ EXPECT_TRUE(DeleteFile("./test_app_info.dat"));
+ ::profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
+}
+
+TEST_F(ResumptionDataJsonTest, OnSuspendFourTimes) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ ::profile::Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+ SetZeroIgnOff();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+
+ res_json.OnSuspend();
+ ign_off_count_++;
+ CheckSavedJson();
+
+ res_json.OnSuspend();
+ res_json.OnSuspend();
+ res_json.OnSuspend();
+
+ ssize_t result = res_json.IsApplicationSaved(policy_app_id_, device_id_);
+ EXPECT_EQ(-1, result);
+
+ EXPECT_TRUE(FileExists("./test_app_info.dat"));
+ EXPECT_TRUE(DirectoryExists("./test_storage"));
+ EXPECT_TRUE(RemoveDirectory("./test_storage", true));
+ EXPECT_TRUE(DeleteFile("./test_app_info.dat"));
+ ::profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
+}
+
+TEST_F(ResumptionDataJsonTest, OnSuspendOnAwake) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ ::profile::Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+ SetZeroIgnOff();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+
+ res_json.OnSuspend();
+ ign_off_count_++;
+ CheckSavedJson();
+
+ res_json.OnAwake();
+ ign_off_count_ = 0;
+ CheckSavedJson();
+ EXPECT_TRUE(RemoveDirectory("./test_storage", true));
+ EXPECT_TRUE(DeleteFile("./test_app_info.dat"));
+ ::profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
+}
+
+TEST_F(ResumptionDataJsonTest, Awake_AppNotSuspended) {
+ ResumptionDataJson res_json;
+ SetZeroIgnOff();
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+
+ res_json.OnAwake();
+ ign_off_count_ = 0;
+ CheckSavedJson();
+}
+
+TEST_F(ResumptionDataJsonTest, TwiceAwake_AppNotSuspended) {
+ ResumptionDataJson res_json;
+ SetZeroIgnOff();
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+
+ res_json.OnSuspend();
+ res_json.OnAwake();
+ ign_off_count_ = 0;
+ CheckSavedJson();
+
+ res_json.OnAwake();
+ CheckSavedJson();
+}
+
+TEST_F(ResumptionDataJsonTest, GetHashId) {
+ ResumptionDataJson res_json;
+ PrepareData();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+
+ std::string test_hash;
+ EXPECT_TRUE(res_json.GetHashId(policy_app_id_, device_id_, test_hash));
+ EXPECT_EQ(hash_, test_hash);
+}
+
+TEST_F(ResumptionDataJsonTest, GetIgnOffTime_AfterSuspendAndAwake) {
+ ResumptionDataJson res_json;
+ uint32_t last_ign_off_time;
+ PrepareData();
+ ::profile::Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+ SetZeroIgnOff();
+ res_json.SaveApplication(app_mock);
+ CheckSavedJson();
+ last_ign_off_time = res_json.GetIgnOffTime();
+ EXPECT_EQ(0u, last_ign_off_time);
+
+ res_json.OnSuspend();
+
+ uint32_t after_suspend;
+ after_suspend = res_json.GetIgnOffTime();
+ EXPECT_LE(last_ign_off_time, after_suspend);
+
+ uint32_t after_awake;
+ res_json.OnAwake();
+
+ after_awake = res_json.GetIgnOffTime();
+ EXPECT_LE(after_suspend, after_awake);
+
+ EXPECT_TRUE(RemoveDirectory("./test_storage", true));
+ EXPECT_TRUE(DeleteFile("./test_app_info.dat"));
+ ::profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
+}
+
+} // namespace resumption_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/resumption/resumption_data_test.cc b/src/components/application_manager/test/resumption/resumption_data_test.cc
new file mode 100644
index 000000000..b8054b0d8
--- /dev/null
+++ b/src/components/application_manager/test/resumption/resumption_data_test.cc
@@ -0,0 +1,549 @@
+/*
+ * 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>
+#include <algorithm>
+#include "gtest/gtest.h"
+
+#include "application_manager/usage_statistics.h"
+#include "include/application_mock.h"
+#include "include/resumption_data_mock.h"
+
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application.h"
+#include "utils/data_accessor.h"
+#include "application_manager/message_helper.h"
+
+#include "include/resumption_data_test.h"
+
+std::string application_manager::MessageHelper::GetDeviceMacAddressForHandle(
+ const uint32_t device_handle) {
+ std::string device_mac_address = "12345";
+ return device_mac_address;
+}
+
+namespace test {
+namespace components {
+namespace resumption_test {
+
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::ReturnPointee;
+
+void ResumptionDataTest::CheckSavedApp(sm::SmartObject& resume_app_list) {
+ EXPECT_EQ(policy_app_id_, resume_app_list[am::strings::app_id].asString());
+ EXPECT_EQ(grammar_id_, resume_app_list[am::strings::grammar_id].asUInt());
+ EXPECT_EQ(app_id_, resume_app_list[am::strings::connection_key].asUInt());
+ EXPECT_EQ(hmi_app_id_, resume_app_list[am::strings::hmi_app_id].asUInt());
+ EXPECT_EQ(ign_off_count_,
+ resume_app_list[am::strings::ign_off_count].asUInt());
+ EXPECT_EQ(hmi_level_, static_cast<HMILevel::eType>(
+ resume_app_list[am::strings::hmi_level].asInt()));
+ EXPECT_EQ(is_audio_,
+ resume_app_list[am::strings::is_media_application].asBool());
+ EXPECT_EQ("12345", resume_app_list[am::strings::device_id].asString());
+
+ CheckCommands(resume_app_list[am::strings::application_commands]);
+ CheckSubmenues(resume_app_list[am::strings::application_submenus]);
+ CheckChoiceSet(resume_app_list[am::strings::application_choice_sets]);
+ CheckAppFiles(resume_app_list[am::strings::application_files]);
+
+ CheckGlobalProporties(
+ resume_app_list[am::strings::application_global_properties]);
+ CheckSubscriptions(resume_app_list[am::strings::application_subscribtions]);
+}
+
+void ResumptionDataTest::CheckCommands(sm::SmartObject& res_list) {
+ for (uint32_t i = 0; i < count_of_commands; ++i) {
+ EXPECT_EQ(i, res_list[i][am::strings::cmd_id].asUInt());
+ std::string name =
+ (*test_commands_map[i])[am::strings::menu_params]
+ [am::strings::menu_name].asString();
+ EXPECT_EQ(name,
+ res_list[i][am::strings::menu_params][am::strings::menu_name]
+ .asString());
+ int position =
+ (*test_commands_map[i])[am::strings::menu_params][am::strings::position]
+ .asInt();
+ EXPECT_EQ(
+ position,
+ res_list[i][am::strings::menu_params][am::strings::position].asInt());
+
+ int parent_id = (*test_commands_map[i])[am::strings::menu_params]
+ [am::hmi_request::parent_id].asInt();
+ EXPECT_EQ(parent_id,
+ res_list[i][am::strings::menu_params][am::hmi_request::parent_id]
+ .asInt());
+
+ std::string icon_name =
+ (*test_commands_map[i])[am::strings::cmd_icon][am::strings::value]
+ .asString();
+ EXPECT_EQ(
+ icon_name,
+ res_list[i][am::strings::cmd_icon][am::strings::value].asString());
+
+ int icon_type =
+ (*test_commands_map[i])[am::strings::cmd_icon][am::strings::image_type]
+ .asInt();
+ EXPECT_EQ(
+ icon_type,
+ res_list[i][am::strings::cmd_icon][am::strings::image_type].asInt());
+
+ for (uint32_t j = 0; j < count_of_choice; ++j) {
+ std::string vr =
+ (*test_commands_map[i])[am::strings::vr_commands][j].asString();
+ EXPECT_EQ(vr, res_list[i][am::strings::vr_commands][j].asString());
+ }
+ }
+}
+
+void ResumptionDataTest::CheckSubmenues(sm::SmartObject& res_list) {
+ for (uint32_t i = 0; i < count_of_submenues; ++i) {
+ uint32_t test_id =
+ (*test_submenu_map[i + 10])[am::strings::menu_id].asUInt();
+ std::string name =
+ (*test_submenu_map[i + 10])[am::strings::menu_name].asString();
+ int position = (*test_submenu_map[i + 10])[am::strings::position].asInt();
+ EXPECT_EQ(position, res_list[i][am::strings::position].asInt());
+ EXPECT_EQ(test_id, res_list[i][am::strings::menu_id].asUInt());
+ EXPECT_EQ(name, res_list[i][am::strings::menu_name].asString());
+ }
+}
+
+void ResumptionDataTest::CheckSubscriptions(sm::SmartObject& res_list) {
+ EXPECT_EQ(static_cast<uint32_t>(ButtonName::eType::OK),
+ 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) {
+ for (uint32_t i = 0; i < res_list.length(); ++i) {
+ for (uint32_t j = 0; j < res_list[i][am::strings::choice_set].length();
+ ++j) {
+ sm::SmartObject command = res_list[i][am::strings::choice_set][j];
+ EXPECT_EQ(i + j, command[am::strings::choice_id].asUInt());
+ char numb[12];
+ std::snprintf(numb, 12, "%d", i + j);
+ std::string test_choice =
+ (*test_choiceset_map[i])[am::strings::choice_set][j]
+ [am::strings::vr_commands][0].asString();
+ EXPECT_EQ(test_choice, command[am::strings::vr_commands][0].asString());
+ std::string menu_name =
+ (*test_choiceset_map[i])[am::strings::choice_set][j]
+ [am::strings::menu_name].asString();
+ EXPECT_EQ(menu_name, command[am::strings::menu_name].asString());
+ std::string secondary_text =
+ (*test_choiceset_map[i])[am::strings::choice_set][j]
+ [am::strings::secondary_text].asString();
+ EXPECT_EQ(secondary_text,
+ command[am::strings::secondary_text].asString());
+ std::string tertiary_text =
+ (*test_choiceset_map[i])[am::strings::choice_set][j]
+ [am::strings::tertiary_text].asString();
+ EXPECT_EQ(tertiary_text, command[am::strings::tertiary_text].asString());
+
+ std::string image_value =
+ (*test_choiceset_map[i])[am::strings::choice_set][j]
+ [am::strings::image][am::strings::value]
+ .asString();
+ EXPECT_EQ(image_value,
+ command[am::strings::image][am::strings::value].asString());
+ int image_type =
+ (*test_choiceset_map[i])[am::strings::choice_set][j]
+ [am::strings::image][am::strings::image_type]
+ .asInt();
+ EXPECT_EQ(image_type,
+ command[am::strings::image][am::strings::image_type].asInt());
+
+ image_value = (*test_choiceset_map[i])[am::strings::choice_set][j]
+ [am::strings::secondary_image]
+ [am::strings::value].asString();
+ EXPECT_EQ(
+ image_value,
+ command[am::strings::secondary_image][am::strings::value].asString());
+ image_type = (*test_choiceset_map[i])[am::strings::choice_set][j]
+ [am::strings::secondary_image]
+ [am::strings::image_type].asInt();
+ EXPECT_EQ(image_type,
+ command[am::strings::secondary_image][am::strings::image_type]
+ .asInt());
+ }
+
+ int choice_set_id =
+ (*test_choiceset_map[i])[am::strings::interaction_choice_set_id]
+ .asUInt();
+ EXPECT_EQ(choice_set_id,
+ res_list[i][am::strings::interaction_choice_set_id].asInt());
+
+ int grammar_id = (*test_choiceset_map[i])[am::strings::grammar_id].asUInt();
+ EXPECT_EQ(grammar_id, res_list[i][am::strings::grammar_id].asInt());
+ }
+}
+
+void ResumptionDataTest::CheckAppFiles(sm::SmartObject& res_list) {
+ am::AppFile check_file;
+
+ for (uint i = 0; i < count_of_files; ++i) {
+ char numb[12];
+ std::snprintf(numb, 12, "%d", i);
+ check_file = app_files_map_["test_file " + std::string(numb)];
+ EXPECT_EQ(check_file.file_name,
+ res_list[i][am::strings::sync_file_name].asString());
+ EXPECT_EQ(check_file.file_type,
+ static_cast<FileType::eType>(
+ res_list[i][am::strings::file_type].asInt()));
+ EXPECT_EQ(check_file.is_download_complete,
+ res_list[i][am::strings::is_download_complete].asBool());
+ EXPECT_EQ(check_file.is_persistent,
+ res_list[i][am::strings::persistent_file].asBool());
+ }
+}
+
+void ResumptionDataTest::CheckGlobalProporties(sm::SmartObject& res_list) {
+ CheckHelpPrompt(res_list[am::strings::help_prompt]);
+ CheckTimeoutPrompt(res_list[am::strings::timeout_prompt]);
+ CheckVRHelp(res_list[am::strings::vr_help]);
+ CheckVRTitle(res_list[am::strings::vr_help_title]);
+ CheckKeyboardProperties(res_list[am::strings::keyboard_properties]);
+ CheckMenuTitle(res_list[am::strings::menu_title]);
+ CheckMenuIcon(res_list[am::strings::menu_icon]);
+}
+
+void ResumptionDataTest::CheckKeyboardProperties(sm::SmartObject& res_list) {
+ Language::eType testlanguage = static_cast<Language::eType>(
+ (*keyboard_props_)[am::strings::language].asInt());
+ KeyboardLayout::eType testlayout = static_cast<KeyboardLayout::eType>(
+ (*keyboard_props_)[am::hmi_request::keyboard_layout].asInt());
+ KeypressMode::eType testmode = static_cast<KeypressMode::eType>(
+ (*keyboard_props_)[am::strings::key_press_mode].asInt());
+
+ std::string auto_complete_text =
+ (*keyboard_props_)[am::strings::auto_complete_text].asString();
+
+ for (uint i = 0;
+ i < (*keyboard_props_)[am::strings::limited_character_list].length();
+ i++) {
+ std::string character =
+ (*keyboard_props_)[am::strings::limited_character_list][i].asString();
+ EXPECT_EQ(character,
+ res_list[am::strings::limited_character_list][i].asString());
+ }
+
+ EXPECT_EQ(testlanguage, static_cast<Language::eType>(
+ res_list[am::strings::language].asInt()));
+ EXPECT_EQ(testlayout,
+ static_cast<KeyboardLayout::eType>(
+ res_list[am::hmi_request::keyboard_layout].asInt()));
+ EXPECT_EQ(testmode, static_cast<KeypressMode::eType>(
+ res_list[am::strings::key_press_mode].asInt()));
+ EXPECT_EQ(auto_complete_text,
+ res_list[am::strings::auto_complete_text].asString());
+}
+
+void ResumptionDataTest::CheckMenuTitle(sm::SmartObject& res_list) {
+ std::string value = (*menu_title_)[am::strings::menu_title].asString();
+ EXPECT_EQ(value, res_list[am::strings::menu_title].asString());
+}
+
+void ResumptionDataTest::CheckMenuIcon(sm::SmartObject& res_list) {
+ std::string value = (*menu_icon_)[am::strings::value].asString();
+ ImageType::eType type = static_cast<ImageType::eType>(
+ (*menu_icon_)[am::strings::image_type].asInt());
+
+ EXPECT_EQ(value, res_list[am::strings::value].asString());
+ EXPECT_EQ(type, static_cast<ImageType::eType>(
+ res_list[am::strings::image_type].asInt()));
+}
+
+void ResumptionDataTest::CheckHelpPrompt(sm::SmartObject& res_list) {
+ for (uint i = 0; i < tts_chunks_count; ++i) {
+ std::string promt = (*help_prompt_)[i][am::strings::help_prompt].asString();
+ std::string dict_promt = res_list[i][am::strings::help_prompt].asString();
+ EXPECT_EQ(promt, dict_promt);
+ }
+}
+
+void ResumptionDataTest::CheckTimeoutPrompt(
+ NsSmartDeviceLink::NsSmartObjects::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>(
+ (*timeout_prompt_)[i][am::strings::type].asInt());
+ EXPECT_EQ(text, res_list[i][am::strings::text].asString());
+ EXPECT_EQ(speech, static_cast<SpeechCapabilities::eType>(
+ res_list[i][am::strings::type].asInt()));
+ }
+}
+
+void ResumptionDataTest::CheckVRHelp(sm::SmartObject& res_list) {
+ std::string text;
+ int position;
+ for (uint i = 0; i < count_of_vrhelptitle; ++i) {
+ text = (*vr_help_)[i][am::strings::text].asString();
+ EXPECT_EQ(text, res_list[i][am::strings::text].asString());
+ position = (*vr_help_)[i][am::strings::position].asInt();
+ EXPECT_EQ(position, res_list[i][am::strings::position].asInt());
+ }
+}
+
+void ResumptionDataTest::CheckVRTitle(
+ NsSmartDeviceLink::NsSmartObjects::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() {
+ 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_);
+
+ SetSubscriptions();
+ DataAccessor<am::ButtonSubscriptions> btn_sub(btn_subscr, btnlock_);
+ DataAccessor<am::VehicleInfoSubscriptions> ivi_access(ivi, ivilock_);
+
+ ON_CALL(*app_mock, is_application_data_changed()).WillByDefault(Return(true));
+
+ ON_CALL(*app_mock, policy_app_id()).WillByDefault(Return(policy_app_id_));
+ ON_CALL(*app_mock, curHash()).WillByDefault(ReturnRef(hash_));
+ ON_CALL(*app_mock, get_grammar_id()).WillByDefault(Return(grammar_id_));
+ ON_CALL(*app_mock, device()).WillByDefault(Return(device_handle_));
+ ON_CALL(*app_mock, hmi_level()).WillByDefault(Return(hmi_level_));
+ ON_CALL(*app_mock, app_id()).WillByDefault(Return(app_id_));
+ ON_CALL(*app_mock, hmi_app_id()).WillByDefault(Return(hmi_app_id_));
+ ON_CALL(*app_mock, IsAudioApplication()).WillByDefault(Return(is_audio_));
+ ON_CALL(*app_mock, commands_map()).WillByDefault(Return(commands_m));
+ ON_CALL(*app_mock, sub_menu_map()).WillByDefault(Return(sub_menu_m));
+ ON_CALL(*app_mock, choice_set_map()).WillByDefault(Return(choice_set_m));
+
+ ON_CALL(*app_mock, help_prompt()).WillByDefault(ReturnPointee(&help_prompt_));
+ ON_CALL(*app_mock, timeout_prompt())
+ .WillByDefault(ReturnPointee(&timeout_prompt_));
+ ON_CALL(*app_mock, vr_help()).WillByDefault(ReturnPointee(&vr_help_));
+ ON_CALL(*app_mock, vr_help_title())
+ .WillByDefault(ReturnPointee(&vr_help_title_));
+
+ ON_CALL(*app_mock, keyboard_props())
+ .WillByDefault(ReturnPointee(&keyboard_props_));
+ ON_CALL(*app_mock, menu_title()).WillByDefault(ReturnPointee(&menu_title_));
+ 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_));
+}
+
+void ResumptionDataTest::SetGlobalProporties() {
+ SetKeyboardProperties();
+ SetMenuTitleAndIcon();
+ SetHelpAndTimeoutPrompt();
+ SetVRHelpTitle();
+}
+
+void ResumptionDataTest::SetMenuTitleAndIcon() {
+ sm::SmartObject sm_icon;
+ sm_icon[am::strings::value] = "test icon";
+ sm_icon[am::strings::image_type] = ImageType::STATIC;
+
+ sm::SmartObject sm_title;
+ sm_title = "test title";
+ menu_title_ = new sm::SmartObject(sm_title);
+ menu_icon_ = new sm::SmartObject(sm_icon);
+}
+
+void ResumptionDataTest::SetHelpAndTimeoutPrompt() {
+ sm::SmartObject help_prompt;
+ sm::SmartObject timeout_prompt;
+
+ for (uint i = 0; i < tts_chunks_count + 3; ++i) {
+ char numb[12];
+ std::snprintf(numb, 12, "%d", i);
+ help_prompt[i][am::strings::text] = "help prompt name" + std::string(numb);
+ help_prompt[i][am::strings::type] = SpeechCapabilities::PRE_RECORDED;
+ }
+ help_prompt_ = new sm::SmartObject(help_prompt);
+ for (uint i = 0; i < tts_chunks_count; ++i) {
+ char numb[12];
+ std::snprintf(numb, 12, "%d", i);
+ timeout_prompt[i][am::strings::text] = "timeout test" + std::string(numb);
+ timeout_prompt[i][am::strings::type] = SpeechCapabilities::SC_TEXT;
+ }
+
+ timeout_prompt_ = new sm::SmartObject(timeout_prompt);
+}
+
+void ResumptionDataTest::SetVRHelpTitle() {
+ sm::SmartObject vr_help_title;
+ vr_help_title = "vr help title";
+
+ sm::SmartObject vr_help;
+ for (uint i = 0; i < count_of_vrhelptitle; ++i) {
+ char numb[12];
+ std::snprintf(numb, 12, "%d", i);
+ vr_help[i][am::strings::text] = "vr help " + std::string(numb);
+ vr_help[i][am::strings::position] = i;
+ }
+
+ vr_help_ = new sm::SmartObject(vr_help);
+ vr_help_title_ = new sm::SmartObject(vr_help_title);
+}
+
+void ResumptionDataTest::SetCommands() {
+ sm::SmartObject sm_comm;
+
+ sm::SmartObject vr_commandsvector;
+ sm::SmartObject sm_icon;
+ for (uint32_t i = 0; i < count_of_commands; ++i) {
+ char numb[12];
+ std::snprintf(numb, 12, "%d", i);
+ sm_comm[am::strings::cmd_id] = i;
+ sm_comm[am::strings::menu_params][am::strings::position] = i;
+ sm_comm[am::strings::menu_params][am::hmi_request::parent_id] = i;
+ sm_comm[am::strings::menu_params][am::strings::menu_name] =
+ "Command" + std::string(numb);
+
+ for (uint32_t j = 0; j < count_of_choice; ++j) {
+ char vr[12];
+ std::snprintf(vr, 12, "%d", i + j);
+ vr_commandsvector[j] = "VrCommand " + std::string(vr);
+ }
+ sm_comm[am::strings::vr_commands] = vr_commandsvector;
+
+ sm_icon[am::strings::value] = "command icon " + std::string(numb);
+ sm_icon[am::strings::image_type] = ImageType::STATIC;
+
+ sm_comm[am::strings::cmd_icon] = sm_icon;
+
+ test_commands_map[i] = new sm::SmartObject(sm_comm);
+ }
+}
+
+void ResumptionDataTest::SetSubmenues() {
+ sm::SmartObject sm_comm;
+ for (uint32_t i = 10; i < count_of_submenues + 10; ++i) {
+ char numb[12];
+ std::snprintf(numb, 12, "%d", i);
+ sm_comm[am::strings::menu_id] = i;
+ sm_comm[am::strings::position] = i;
+ sm_comm[am::strings::menu_name] = "SubMenu" + std::string(numb);
+ test_submenu_map[i] = new sm::SmartObject(sm_comm);
+ }
+}
+
+void ResumptionDataTest::SetChoiceSet() {
+ sm::SmartObject choice_vector;
+ sm::SmartObject choice;
+ sm::SmartObject vr_commandsvector;
+ sm::SmartObject sm_icon;
+ sm::SmartObject sec_icon;
+ sm::SmartObject app_choice_set;
+ sm::SmartObject application_choice_sets;
+ for (uint32_t i = 0; i < count_of_choice_sets; ++i) {
+ for (uint32_t j = 0; j < count_of_choice; ++j) {
+ char numb[12];
+ std::snprintf(numb, 12, "%d", i + j);
+
+ choice[am::strings::choice_id] = i + j;
+ vr_commandsvector[0] = "ChoiceSet VrCommand " + std::string(numb);
+ choice[am::strings::vr_commands] = vr_commandsvector;
+ choice[am::strings::menu_name] = "Choice name " + std::string(numb);
+ choice[am::strings::secondary_text] =
+ "secondaryText " + std::string(numb);
+ choice[am::strings::tertiary_text] = "tertiaryText " + std::string(numb);
+
+ sm_icon[am::strings::value] = "Choiceset icon " + std::string(numb);
+ sm_icon[am::strings::image_type] = ImageType::STATIC;
+
+ sec_icon[am::strings::value] =
+ "Second choiceset icon " + std::string(numb);
+ sec_icon[am::strings::image_type] = ImageType::STATIC;
+
+ choice[am::strings::image] = sm_icon;
+ choice[am::strings::secondary_image] = sec_icon;
+
+ choice_vector[j] = choice;
+ }
+ app_choice_set[am::strings::interaction_choice_set_id] = i;
+ app_choice_set[am::strings::grammar_id] = 100 + i;
+ app_choice_set[am::strings::choice_set] = choice_vector;
+ application_choice_sets[i] = app_choice_set;
+
+ test_choiceset_map[i] = new sm::SmartObject(application_choice_sets[i]);
+ }
+}
+
+void ResumptionDataTest::SetAppFiles() {
+ am::AppFile test_file;
+ int file_types;
+ for (uint i = 0; i < count_of_files; ++i) {
+ char numb[12];
+ std::snprintf(numb, 12, "%d", i);
+ file_types = i;
+ test_file.is_persistent = true;
+ test_file.is_download_complete = true;
+ test_file.file_type = static_cast<FileType::eType>(file_types);
+ test_file.file_name = "test_file " + std::string(numb);
+
+ app_files_map_[test_file.file_name] = test_file;
+ }
+}
+
+void ResumptionDataTest::SetKeyboardProperties() {
+ sm::SmartObject keyboard;
+ keyboard[am::strings::language] = Language::EN_US;
+ keyboard[am::hmi_request::keyboard_layout] = KeyboardLayout::QWERTY;
+ keyboard[am::strings::key_press_mode] = KeypressMode::SINGLE_KEYPRESS;
+ keyboard[am::strings::auto_complete_text] = "complete";
+ keyboard[am::strings::limited_character_list][0] = "y";
+ keyboard[am::strings::limited_character_list][1] = "n";
+ keyboard_props_ = new sm::SmartObject(keyboard);
+}
+
+void ResumptionDataTest::SetSubscriptions() {
+ btn_subscr.insert(ButtonName::eType::CUSTOM_BUTTON);
+ btn_subscr.insert(ButtonName::eType::OK);
+ ivi.insert(0);
+ ivi.insert(5);
+}
+
+} // namespace resumption_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/resumption/smartDeviceLink_test.ini b/src/components/application_manager/test/resumption/smartDeviceLink_test.ini
new file mode 100644
index 000000000..cf51439d8
--- /dev/null
+++ b/src/components/application_manager/test/resumption/smartDeviceLink_test.ini
@@ -0,0 +1,37 @@
+[MAIN]
+
+; For resume_ctrl tests
+LogsEnabled = false
+; Contains .json/.ini files
+AppConfigFolder =
+; Contains output files, e.g. .wav. Changed for tests
+AppStorageFolder = test_storage
+
+[AppInfo]
+; The path for applications info storage. Changed for tests
+AppInfoStorage = test_app_info.dat
+
+[Resumption]
+
+# Timeout in milliseconds for resumption Application HMILevel
+# and resolving conflicts in case if multiple applications initiate resumption
+# Time changed for test onAppActivated
+ApplicationResumingTimeout = 30000000
+
+# Timeout in milliseconds for periodical saving resumption persistent data
+AppSavePersistentDataTimeout = 10000
+
+# Timeout in seconds to store hmi_level for media app before ign_off
+ResumptionDelayBeforeIgn = 30;
+
+# Timeout in seconds to restore hmi_level for media app after sdl run
+ResumptionDelayAfterIgn = 30;
+
+# Resumption ctrl uses JSON if UseDBForResumption=false for store data otherwise uses DB
+UseDBForResumption = false
+
+# Number of attempts to open resumption DB
+AttemptsToOpenResumptionDB = 5
+
+# Timeout between attempts during opening DB in milliseconds
+OpenAttemptTimeoutMsResumptionDB = 500
diff --git a/src/components/application_manager/test/state_controller/CMakeLists.txt b/src/components/application_manager/test/state_controller/CMakeLists.txt
new file mode 100644
index 000000000..243e6218e
--- /dev/null
+++ b/src/components/application_manager/test/state_controller/CMakeLists.txt
@@ -0,0 +1,51 @@
+# 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.
+
+if(BUILD_TESTS)
+
+set(appMain_DIR ${CMAKE_SOURCE_DIR}/src/appMain)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/application_manager/test/state_controller/include
+)
+
+set(LIBRARIES
+ gmock
+ ApplicationManager
+)
+
+set(SOURCES
+ state_controller_test.cc
+)
+
+create_test("state_controller_test" "${SOURCES}" "${LIBRARIES}")
+
+endif()
diff --git a/src/components/application_manager/test/state_controller/include/application_manager_mock.h b/src/components/application_manager/test/state_controller/include/application_manager_mock.h
new file mode 100644
index 000000000..22ff93687
--- /dev/null
+++ b/src/components/application_manager/test/state_controller/include/application_manager_mock.h
@@ -0,0 +1,80 @@
+/*
+ * 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_TEST_STATE_CONTROLLER_INCLUDE_APPLICATION_MANAGER_MOCK_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_APPLICATION_MANAGER_MOCK_H_
+#include <string>
+#include <vector>
+#include "gmock/gmock.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/usage_statistics.h"
+
+namespace state_controller_test {
+namespace am = application_manager;
+
+class ApplicationManagerMock : public application_manager::ApplicationManager {
+ public:
+ MOCK_METHOD0(Init, bool());
+ MOCK_METHOD0(Stop, bool());
+
+ MOCK_METHOD1(set_hmi_message_handler,
+ void(hmi_message_handler::HMIMessageHandler*));
+ MOCK_METHOD1(set_protocol_handler, void(protocol_handler::ProtocolHandler*));
+ MOCK_METHOD1(set_connection_handler,
+ void(connection_handler::ConnectionHandler*));
+ MOCK_CONST_METHOD0(applications, DataAccessor<am::ApplicationSet>());
+ MOCK_CONST_METHOD1(application_by_hmi_app,
+ am::ApplicationSharedPtr(uint32_t));
+ MOCK_CONST_METHOD1(application, am::ApplicationSharedPtr(uint32_t));
+
+ MOCK_CONST_METHOD0(active_application, am::ApplicationSharedPtr());
+ MOCK_CONST_METHOD1(application_by_policy_id,
+ am::ApplicationSharedPtr(const std::string&));
+ MOCK_METHOD1(applications_by_button,
+ std::vector<am::ApplicationSharedPtr>(uint32_t));
+ MOCK_METHOD0(applications_with_navi, std::vector<am::ApplicationSharedPtr>());
+ MOCK_CONST_METHOD0(get_limited_media_application, am::ApplicationSharedPtr());
+ MOCK_CONST_METHOD0(get_limited_navi_application, am::ApplicationSharedPtr());
+ MOCK_CONST_METHOD0(get_limited_voice_application, am::ApplicationSharedPtr());
+ MOCK_METHOD2(set_application_id, void(const int32_t, const uint32_t));
+ MOCK_METHOD1(application_id, uint32_t(const int32_t));
+ MOCK_METHOD3(OnHMILevelChanged, void(uint32_t, mobile_apis::HMILevel::eType,
+ mobile_apis::HMILevel::eType));
+ MOCK_METHOD1(SendHMIStatusNotification, void(const am::ApplicationSharedPtr));
+ MOCK_CONST_METHOD1(GetDefaultHmiLevel, mobile_apis::HMILevel::eType(
+ am::ApplicationConstSharedPtr));
+ MOCK_METHOD0(hmi_capabilities, am::HMICapabilities&());
+ MOCK_METHOD0(is_attenuated_supported, bool());
+ MOCK_CONST_METHOD1(IsAppTypeExistsInFullOrLimited, bool(am::ApplicationConstSharedPtr));
+};
+} // namespace state_controller_test
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_APPLICATION_MANAGER_MOCK_H_
diff --git a/src/components/application_manager/test/state_controller/include/application_mock.h b/src/components/application_manager/test/state_controller/include/application_mock.h
new file mode 100644
index 000000000..01dafd10f
--- /dev/null
+++ b/src/components/application_manager/test/state_controller/include/application_mock.h
@@ -0,0 +1,252 @@
+/*
+ * 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_TEST_STATE_CONTROLLER_INCLUDE_APPLICATION_MOCK_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_APPLICATION_MOCK_H_
+
+#include <string>
+
+#include "gmock/gmock.h"
+#include "application_manager/application.h"
+namespace state_controller_test {
+namespace am = application_manager;
+
+class ApplicationMock : public am::Application {
+ public:
+ MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(curHash, const std::string&());
+ MOCK_METHOD0(UpdateHash, void());
+ MOCK_CONST_METHOD0(flag_sending_hash_change_after_awake, bool());
+ MOCK_METHOD1(set_flag_sending_hash_change_after_awake, void(bool flag));
+ 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_METHOD1(StartStreaming,
+ void(protocol_handler::ServiceType service_type));
+ MOCK_METHOD1(StopStreaming, 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 am::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 std::string&());
+ 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_METHOD0(tts_speak_state, bool());
+ MOCK_CONST_METHOD0(CurrentHmiState, am::HmiStatePtr());
+ MOCK_CONST_METHOD0(RegularHmiState, am::HmiStatePtr());
+ MOCK_CONST_METHOD0(PostponedHmiState, am::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 am::Version& version));
+ MOCK_METHOD1(set_name, void(const std::string& 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 am::ProtocolVersion& protocol_version));
+ MOCK_CONST_METHOD0(protocol_version, am::ProtocolVersion());
+ MOCK_METHOD1(set_is_resuming, void(bool));
+ MOCK_CONST_METHOD0(is_resuming, bool());
+ MOCK_METHOD1(AddFile, bool(const am::AppFile& file));
+ MOCK_CONST_METHOD0(getAppFiles, const am::AppFilesMap&());
+ MOCK_METHOD1(UpdateFile, bool(const am::AppFile& file));
+ MOCK_METHOD1(DeleteFile, bool(const std::string& file_name));
+ MOCK_METHOD1(GetFile, const am::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(IsCommandLimitsExceeded,
+ bool(mobile_apis::FunctionID::eType cmd_id,
+ am::TLimitSource source));
+ MOCK_METHOD0(usage_report, am::UsageStatistics&());
+ MOCK_METHOD1(SetRegularState, void(am::HmiStatePtr state));
+ MOCK_METHOD1(SetPostponedState, void(am::HmiStatePtr state));
+ MOCK_METHOD1(AddHMIState, void(am::HmiStatePtr state));
+ MOCK_METHOD1(RemoveHMIState, void(am::HmiState::StateID state_id));
+ MOCK_METHOD2(SubscribeToSoftButtons,
+ void(int32_t cmd_id, const am::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<am::ButtonSubscriptions>());
+ MOCK_CONST_METHOD0(SubscribedIVI,
+ DataAccessor<am::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<am::PerformChoiceSetMap>());
+ MOCK_CONST_METHOD0(commands_map, DataAccessor<am::CommandsMap>());
+ MOCK_CONST_METHOD0(sub_menu_map, DataAccessor<am::SubMenuMap>());
+ MOCK_CONST_METHOD0(choice_set_map, DataAccessor<am::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_reset_global_properties_active, void(bool active));
+ MOCK_CONST_METHOD0(is_reset_global_properties_active, bool());
+ MOCK_CONST_METHOD0(app_id, uint32_t());
+};
+
+} // namespace state_controller_test
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_APPLICATION_MOCK_H_
diff --git a/src/components/application_manager/test/state_controller/include/state_controller_mock.h b/src/components/application_manager/test/state_controller/include/state_controller_mock.h
new file mode 100644
index 000000000..b9f7dd30d
--- /dev/null
+++ b/src/components/application_manager/test/state_controller/include/state_controller_mock.h
@@ -0,0 +1,60 @@
+/*
+ * 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_TEST_STATE_CONTROLLER_INCLUDE_STATE_CONTROLLER_MOCK
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_STATE_CONTROLLER_MOCK
+
+#include "gmock/gmock.h"
+#include "application_manager/application.h"
+#include "application_manager/hmi_state.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/application_manager.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace state_controller_test {
+namespace am = application_manager;
+
+class StateControllerMock :public am::StateController {
+ public:
+ MOCK_METHOD2(SetRegularState, void (
+ am::ApplicationSharedPtr, const mobile_apis::AudioStreamingState::eType));
+ MOCK_METHOD2(SetRegularState, void (
+ am::ApplicationSharedPtr, const mobile_apis::SystemContext::eType));
+ MOCK_METHOD3(OnStateChanged, void (
+ am::ApplicationSharedPtr, am::HmiStatePtr, am::HmiStatePtr));
+ MOCK_METHOD1(ApplyStatesForApp, void (am::ApplicationSharedPtr));
+ MOCK_METHOD0(OnNaviStreamingStarted, void ());
+ MOCK_METHOD0(OnNaviStreamingStopped, void ());
+};
+
+}
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_STATE_CONTROLLER_MOCK
diff --git a/src/components/application_manager/test/state_controller/include/statistics_manager_mock.h b/src/components/application_manager/test/state_controller/include/statistics_manager_mock.h
new file mode 100644
index 000000000..4e2dae78d
--- /dev/null
+++ b/src/components/application_manager/test/state_controller/include/statistics_manager_mock.h
@@ -0,0 +1,52 @@
+/*
+ * 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_TEST_STATE_CONTROLLER_INCLUDE_STATISTICS_MANAGER_MOCK_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_STATISTICS_MANAGER_MOCK_H_
+
+#include <string>
+#include "gmock/gmock.h"
+#include "usage_statistics/statistics_manager.h"
+
+namespace state_controller_test {
+namespace us = usage_statistics;
+
+class StatisticsManagerMock : public us::StatisticsManager {
+ public:
+ MOCK_METHOD1(Increment, void (us::GlobalCounterId));
+ MOCK_METHOD2(Increment, void (const std::string&, us::AppCounterId));
+ MOCK_METHOD3(Set, void (const std::string&, us::AppInfoId, const std::string&));
+ MOCK_METHOD3(Add, void (const std::string&, us::AppStopwatchId, int32_t));
+};
+
+} // namespace state_controller_test
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_STATISTICS_MANAGER_MOCK_H_
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
new file mode 100644
index 000000000..488d12b50
--- /dev/null
+++ b/src/components/application_manager/test/state_controller/state_controller_test.cc
@@ -0,0 +1,1483 @@
+/*
+ * 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 "application_manager/hmi_state.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/usage_statistics.h"
+#include "application_manager_mock.h"
+#include "application_mock.h"
+#include "statistics_manager_mock.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"
+
+namespace am = application_manager;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::ReturnPointee;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::InSequence;
+using ::testing::Truly;
+
+class MessageHelperMock {
+ public:
+ MOCK_METHOD3(SendActivateAppToHMI,
+ uint32_t(uint32_t const app_id,
+ hmi_apis::Common_HMILevel::eType level,
+ bool send_policy_priority));
+ MOCK_METHOD1(SendOnResumeAudioSourceToHMI, void(const uint32_t app_id));
+};
+
+static MessageHelperMock* message_helper_mock_;
+
+uint32_t application_manager::MessageHelper::SendActivateAppToHMI(
+ uint32_t const app_id, hmi_apis::Common_HMILevel::eType level,
+ bool send_policy_priority) {
+ return message_helper_mock_->SendActivateAppToHMI(app_id, level,
+ send_policy_priority);
+}
+
+void application_manager::MessageHelper::SendOnResumeAudioSourceToHMI(
+ const uint32_t app_id) {
+ message_helper_mock_->SendOnResumeAudioSourceToHMI(app_id);
+}
+
+namespace state_controller_test {
+
+struct HmiStatesComparator {
+ mobile_apis::HMILevel::eType hmi_level_;
+ mobile_apis::AudioStreamingState::eType audio_streaming_state_;
+ mobile_apis::SystemContext::eType system_context_;
+
+ HmiStatesComparator(
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::AudioStreamingState::eType audio_streaming_state,
+ mobile_apis::SystemContext::eType system_context)
+ : hmi_level_(hmi_level),
+ audio_streaming_state_(audio_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()),
+ 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->system_context() == system_context_;
+ }
+};
+
+struct HmiStatesIDComparator {
+ am::HmiState::StateID state_id_;
+
+ HmiStatesIDComparator(am::HmiState::StateID state_id)
+ : state_id_(state_id) {}
+
+ bool operator()(am::HmiStatePtr state_ptr) const {
+ return state_ptr->state_id() == state_id_;
+ }
+};
+
+#define MEDIA true
+#define NOT_MEDIA false
+#define VC true
+#define NOT_VC false
+#define NAVI true
+#define NOT_NAVI false
+
+class StateControllerTest : public ::testing::Test {
+ public:
+ StateControllerTest()
+ : ::testing::Test(),
+ usage_stat("0", utils::SharedPtr<us::StatisticsManager>(
+ new StatisticsManagerMock)),
+ applications_(application_set_, applications_lock_),
+ state_ctrl_(&app_manager_mock_) {}
+ NiceMock<ApplicationManagerMock> app_manager_mock_;
+
+ am::UsageStatistics usage_stat;
+
+ am::ApplicationSet application_set_;
+ mutable sync_primitives::Lock applications_lock_;
+ DataAccessor<am::ApplicationSet> applications_;
+ am::StateController state_ctrl_;
+
+ am::ApplicationSharedPtr simple_app_;
+ NiceMock<ApplicationMock>* simple_app_ptr_;
+ uint32_t simple_app_id_ = 1721;
+
+ am::ApplicationSharedPtr navi_app_;
+ NiceMock<ApplicationMock>* navi_app_ptr_;
+ uint32_t navi_app_id_ = 1762;
+
+ am::ApplicationSharedPtr media_app_;
+ NiceMock<ApplicationMock>* media_app_ptr_;
+ uint32_t media_app_id_ = 1801;
+
+ am::ApplicationSharedPtr vc_app_;
+ NiceMock<ApplicationMock>* vc_app_ptr_;
+ uint32_t vc_app_id_ = 1825;
+
+ am::ApplicationSharedPtr media_navi_app_;
+ NiceMock<ApplicationMock>* media_navi_app_ptr_;
+ uint32_t media_navi_app_id_ = 1855;
+
+ am::ApplicationSharedPtr media_vc_app_;
+ NiceMock<ApplicationMock>* media_vc_app_ptr_;
+ uint32_t media_vc_app_id_ = 1881;
+
+ am::ApplicationSharedPtr navi_vc_app_;
+ NiceMock<ApplicationMock>* navi_vc_app_ptr_;
+ uint32_t navi_vc_app_id_ = 1894;
+
+ am::ApplicationSharedPtr media_navi_vc_app_;
+ NiceMock<ApplicationMock>* media_navi_vc_app_ptr_;
+ uint32_t media_navi_vc_app_id_ = 1922;
+
+ std::vector<am::HmiStatePtr> valid_states_for_audio_app_;
+ std::vector<am::HmiStatePtr> valid_states_for_not_audio_app_;
+ std::vector<am::HmiStatePtr> common_invalid_states_;
+ std::vector<am::HmiStatePtr> invalid_states_for_not_audio_app;
+ std::vector<am::HmiStatePtr> invalid_states_for_audio_app;
+ std::vector<am::HmiState::StateID> valid_state_ids_;
+
+ am::HmiStatePtr createHmiState(
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::AudioStreamingState::eType aidio_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_id_, &app_manager_mock_);
+ state->set_hmi_level(hmi_level);
+ state->set_audio_streaming_state(aidio_ss);
+ state->set_system_context(system_context);
+ return state;
+ }
+
+ protected:
+ am::ApplicationSharedPtr ConfigureApp(NiceMock<ApplicationMock>** app_mock,
+ uint32_t app_id, bool media, bool navi,
+ bool vc) {
+ *app_mock = new NiceMock<ApplicationMock>;
+
+ 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));
+
+ EXPECT_CALL(**app_mock, usage_report())
+ .WillRepeatedly(ReturnRef(usage_stat));
+
+ return app;
+ }
+
+ void FillStatesLists() {
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+ // Valid states for not audio app
+ message_helper_mock_ = new MessageHelperMock;
+ valid_states_for_not_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ valid_states_for_not_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_VRSESSION));
+ valid_states_for_not_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MENU));
+ valid_states_for_not_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_HMI_OBSCURED));
+ valid_states_for_not_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_ALERT));
+ valid_states_for_not_audio_app_.push_back(createHmiState(
+ HMILevel::HMI_BACKGROUND, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ valid_states_for_not_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_FULL, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+
+ // Valid states audio app
+ valid_states_for_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ valid_states_for_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_VRSESSION));
+ valid_states_for_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MENU));
+ valid_states_for_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_HMI_OBSCURED));
+ valid_states_for_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_ALERT));
+ valid_states_for_audio_app_.push_back(createHmiState(
+ HMILevel::HMI_BACKGROUND, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ valid_states_for_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_LIMITED, AudioStreamingState::AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ valid_states_for_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_LIMITED, AudioStreamingState::ATTENUATED,
+ SystemContext::SYSCTXT_MAIN));
+ valid_states_for_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_FULL, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ valid_states_for_audio_app_.push_back(
+ createHmiState(HMILevel::HMI_FULL, AudioStreamingState::AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+
+ // Common Invalid States
+ common_invalid_states_.push_back(
+ createHmiState(HMILevel::INVALID_ENUM, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ common_invalid_states_.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::INVALID_ENUM,
+ SystemContext::SYSCTXT_MAIN));
+ common_invalid_states_.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::INVALID_ENUM));
+ common_invalid_states_.push_back(createHmiState(
+ HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM,
+ SystemContext::SYSCTXT_MAIN));
+ common_invalid_states_.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::INVALID_ENUM,
+ SystemContext::INVALID_ENUM));
+ common_invalid_states_.push_back(createHmiState(
+ HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM,
+ SystemContext::INVALID_ENUM));
+ common_invalid_states_.push_back(createHmiState(
+ HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM,
+ SystemContext::INVALID_ENUM));
+ // Invalid States for audio apps
+ invalid_states_for_audio_app.push_back(
+ createHmiState(HMILevel::HMI_LIMITED, AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ invalid_states_for_audio_app.push_back(
+ createHmiState(HMILevel::HMI_BACKGROUND, AudioStreamingState::AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ invalid_states_for_audio_app.push_back(createHmiState(
+ HMILevel::HMI_BACKGROUND, AudioStreamingState::ATTENUATED,
+ SystemContext::SYSCTXT_MAIN));
+ invalid_states_for_audio_app.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ invalid_states_for_audio_app.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::ATTENUATED,
+ SystemContext::SYSCTXT_MAIN));
+ invalid_states_for_audio_app.push_back(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::ATTENUATED,
+ SystemContext::SYSCTXT_MAIN));
+ // Invalid States for not audio apps
+ invalid_states_for_not_audio_app.push_back(
+ createHmiState(HMILevel::HMI_LIMITED, AudioStreamingState::ATTENUATED,
+ SystemContext::SYSCTXT_MAIN));
+ invalid_states_for_not_audio_app.push_back(
+ createHmiState(HMILevel::HMI_LIMITED, AudioStreamingState::AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+ invalid_states_for_not_audio_app.push_back(
+ createHmiState(HMILevel::HMI_FULL, AudioStreamingState::ATTENUATED,
+ SystemContext::SYSCTXT_MAIN));
+ invalid_states_for_not_audio_app.push_back(
+ createHmiState(HMILevel::HMI_FULL, AudioStreamingState::AUDIBLE,
+ SystemContext::SYSCTXT_MAIN));
+
+ // Valid state ids
+ valid_state_ids_.push_back(am::HmiState::StateID::STATE_ID_VR_SESSION);
+ valid_state_ids_.push_back(am::HmiState::StateID::STATE_ID_TTS_SESSION);
+ valid_state_ids_.push_back(am::HmiState::StateID::STATE_ID_PHONE_CALL);
+ valid_state_ids_.push_back(am::HmiState::StateID::STATE_ID_SAFETY_MODE);
+ valid_state_ids_.push_back(am::HmiState::StateID::STATE_ID_NAVI_STREAMING);
+ }
+
+ void ConfigureApps() {
+ simple_app_ = ConfigureApp(&simple_app_ptr_, simple_app_id_, NOT_MEDIA,
+ NOT_NAVI, NOT_VC);
+ media_app_ =
+ ConfigureApp(&media_app_ptr_, media_app_id_, MEDIA, NOT_NAVI, NOT_VC);
+ navi_app_ =
+ ConfigureApp(&navi_app_ptr_, navi_app_id_, NOT_MEDIA, NAVI, NOT_VC);
+ vc_app_ = ConfigureApp(&vc_app_ptr_, vc_app_id_, NOT_MEDIA, NOT_NAVI, VC);
+ media_navi_app_ = ConfigureApp(&media_navi_app_ptr_, media_navi_app_id_,
+ MEDIA, NAVI, NOT_VC);
+ media_vc_app_ =
+ ConfigureApp(&media_vc_app_ptr_, media_vc_app_id_, MEDIA, NOT_NAVI, VC);
+ navi_vc_app_ =
+ ConfigureApp(&navi_vc_app_ptr_, navi_vc_app_id_, NOT_MEDIA, NAVI, VC);
+ media_navi_vc_app_ = ConfigureApp(&media_navi_vc_app_ptr_,
+ media_navi_vc_app_id_, MEDIA, NAVI, VC);
+ }
+ void CheckAppConfiguration() {
+ ASSERT_EQ(simple_app_.get(), simple_app_ptr_);
+ ASSERT_EQ(media_app_.get(), media_app_ptr_);
+ ASSERT_EQ(navi_app_.get(), navi_app_ptr_);
+ ASSERT_EQ(vc_app_.get(), vc_app_ptr_);
+ ASSERT_EQ(media_navi_app_.get(), media_navi_app_ptr_);
+ ASSERT_EQ(media_vc_app_.get(), media_vc_app_ptr_);
+ ASSERT_EQ(navi_vc_app_.get(), navi_vc_app_ptr_);
+ ASSERT_EQ(media_navi_vc_app_.get(), media_navi_vc_app_ptr_);
+
+ ASSERT_EQ(simple_app_->app_id(), simple_app_id_);
+ ASSERT_EQ(media_app_->app_id(), media_app_id_);
+ ASSERT_EQ(navi_app_->app_id(), navi_app_id_);
+ ASSERT_EQ(vc_app_->app_id(), vc_app_id_);
+ ASSERT_EQ(media_navi_app_->app_id(), media_navi_app_id_);
+ ASSERT_EQ(media_vc_app_->app_id(), media_vc_app_id_);
+ ASSERT_EQ(navi_vc_app_->app_id(), navi_vc_app_id_);
+ ASSERT_EQ(media_navi_vc_app_->app_id(), media_navi_vc_app_id_);
+
+ ASSERT_FALSE(simple_app_->IsAudioApplication());
+ ASSERT_TRUE(media_app_->IsAudioApplication());
+ ASSERT_TRUE(navi_app_->IsAudioApplication());
+ ASSERT_TRUE(vc_app_->IsAudioApplication());
+ ASSERT_TRUE(media_navi_app_->IsAudioApplication());
+ ASSERT_TRUE(media_vc_app_->IsAudioApplication());
+ ASSERT_TRUE(navi_vc_app_->IsAudioApplication());
+ ASSERT_TRUE(media_navi_vc_app_->IsAudioApplication());
+
+ ASSERT_FALSE(simple_app_->is_media_application());
+ ASSERT_TRUE(media_app_->is_media_application());
+ ASSERT_FALSE(navi_app_->is_media_application());
+ ASSERT_FALSE(vc_app_->is_media_application());
+ ASSERT_TRUE(media_navi_app_->is_media_application());
+ ASSERT_TRUE(media_vc_app_->is_media_application());
+ ASSERT_FALSE(navi_vc_app_->is_media_application());
+ ASSERT_TRUE(media_navi_vc_app_->is_media_application());
+
+ ASSERT_FALSE(simple_app_->is_navi());
+ ASSERT_TRUE(navi_app_->is_navi());
+ ASSERT_FALSE(media_app_->is_navi());
+ ASSERT_FALSE(vc_app_->is_navi());
+ ASSERT_TRUE(media_navi_app_->is_navi());
+ ASSERT_FALSE(media_vc_app_->is_navi());
+ ASSERT_TRUE(navi_vc_app_->is_navi());
+ ASSERT_TRUE(media_navi_vc_app_->is_navi());
+
+ ASSERT_FALSE(simple_app_->is_voice_communication_supported());
+ ASSERT_FALSE(navi_app_->is_voice_communication_supported());
+ ASSERT_FALSE(media_app_->is_voice_communication_supported());
+ ASSERT_TRUE(vc_app_->is_voice_communication_supported());
+ ASSERT_FALSE(media_navi_app_->is_voice_communication_supported());
+ ASSERT_TRUE(media_vc_app_->is_voice_communication_supported());
+ ASSERT_TRUE(navi_vc_app_->is_voice_communication_supported());
+ ASSERT_TRUE(media_navi_vc_app_->is_voice_communication_supported());
+ }
+
+ void SetUp() {
+ ON_CALL(app_manager_mock_, applications())
+ .WillByDefault(Return(applications_));
+ ConfigureApps();
+ CheckAppConfiguration();
+ FillStatesLists();
+ }
+
+ void TearDown() { delete message_helper_mock_; }
+
+ void ExpectSuccesfullSetHmiState(am::ApplicationSharedPtr app,
+ NiceMock<ApplicationMock>* app_mock,
+ am::HmiStatePtr old_state,
+ am::HmiStatePtr new_state) {
+ EXPECT_CALL(*app_mock, CurrentHmiState())
+ .WillOnce(Return(old_state))
+ .WillOnce(Return(new_state));
+ EXPECT_CALL(*app_mock,
+ SetRegularState(Truly(HmiStatesComparator(new_state))));
+ if (!HmiStatesComparator(old_state)(new_state)) {
+ EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(app));
+ EXPECT_CALL(app_manager_mock_,
+ OnHMILevelChanged(app->app_id(), old_state->hmi_level(),
+ new_state->hmi_level()));
+ }
+ }
+
+ void ExpectAppChangeHmiStateDueToConflictResolving(
+ am::ApplicationSharedPtr app, NiceMock<ApplicationMock>* app_mock,
+ am::HmiStatePtr old_state, am::HmiStatePtr new_state) {
+ EXPECT_CALL(*app_mock, RegularHmiState())
+ .WillOnce(Return(old_state))
+ .WillOnce(Return(old_state));
+ ExpectSuccesfullSetHmiState(app, app_mock, old_state, new_state);
+ }
+
+ void ExpectAppWontChangeHmiStateDueToConflictResolving(
+ am::ApplicationSharedPtr app, NiceMock<ApplicationMock>* app_mock,
+ am::HmiStatePtr state) {
+ EXPECT_CALL(*app_mock, RegularHmiState()).WillOnce(Return(state));
+ EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(app)).Times(0);
+ EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(app->app_id(), _, _))
+ .Times(0);
+ }
+
+ void InsertApplication(am::ApplicationSharedPtr app) {
+ application_set_.insert(app);
+ ON_CALL(app_manager_mock_, application(app->app_id()))
+ .WillByDefault(Return(app));
+ }
+
+ am::HmiStatePtr NoneNotAudibleState() {
+ return createHmiState(mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
+ }
+
+ am::HmiStatePtr FullAudibleState() {
+ return createHmiState(mobile_apis::HMILevel::HMI_FULL,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
+ }
+
+ am::HmiStatePtr FullNotAudibleState() {
+ return createHmiState(mobile_apis::HMILevel::HMI_FULL,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
+ }
+
+ am::HmiStatePtr LimitedState() {
+ return createHmiState(mobile_apis::HMILevel::HMI_LIMITED,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
+ }
+
+ am::HmiStatePtr BackgroundState() {
+ return createHmiState(mobile_apis::HMILevel::HMI_BACKGROUND,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
+ }
+
+ void CheckStateApplyingForApplication(
+ NiceMock<ApplicationMock>& application,
+ std::vector<am::HmiState::StateID>& state_ids) {
+ using smart_objects::SmartObject;
+ using am::event_engine::Event;
+ namespace FunctionID = hmi_apis::FunctionID;
+
+ EXPECT_CALL(application, 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);
+
+ switch (state_id) {
+ case am::HmiState::StateID::STATE_ID_VR_SESSION: {
+ Event vr_start_event(FunctionID::VR_Started);
+ state_ctrl_.on_event(vr_start_event);
+ break;
+ }
+ case am::HmiState::StateID::STATE_ID_TTS_SESSION: {
+ Event tts_start_event(FunctionID::TTS_Started);
+ state_ctrl_.on_event(tts_start_event);
+ break;
+ }
+ case am::HmiState::StateID::STATE_ID_PHONE_CALL: {
+ Event phone_call_event(
+ FunctionID::BasicCommunication_OnPhoneCall);
+ SmartObject message;
+ message[am::strings::msg_params][am::hmi_notification::is_active] = true;
+ phone_call_event.set_smart_object(message);
+ state_ctrl_.on_event(phone_call_event);
+ break;
+ }
+ case am::HmiState::StateID::STATE_ID_SAFETY_MODE: {
+ Event emergency_event(
+ FunctionID::BasicCommunication_OnEmergencyEvent);
+ SmartObject message;
+ message[am::strings::msg_params][am::hmi_response::enabled] = true;
+ emergency_event.set_smart_object(message);
+ state_ctrl_.on_event(emergency_event);
+ break;
+ }
+ case am::HmiState::StateID::STATE_ID_NAVI_STREAMING: {
+ state_ctrl_.OnNaviStreamingStarted();
+ break;
+ }
+ default:
+ break;
+ }
+
+ EXPECT_CALL(application, 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);
+
+ switch (state_id) {
+ case am::HmiState::StateID::STATE_ID_VR_SESSION: {
+ Event vr_stop_event(FunctionID::VR_Stopped);
+ state_ctrl_.on_event(vr_stop_event);
+ break;
+ }
+ case am::HmiState::StateID::STATE_ID_TTS_SESSION: {
+ Event tts_stop_event(FunctionID::TTS_Stopped);
+ state_ctrl_.on_event(tts_stop_event);
+ break;
+ }
+ case am::HmiState::StateID::STATE_ID_PHONE_CALL: {
+ Event phone_call_event(
+ FunctionID::BasicCommunication_OnPhoneCall);
+ SmartObject message;
+ message[am::strings::msg_params][am::hmi_notification::is_active] = false;
+ phone_call_event.set_smart_object(message);
+ state_ctrl_.on_event(phone_call_event);
+ break;
+ }
+ case am::HmiState::StateID::STATE_ID_SAFETY_MODE: {
+ Event emergency_event(
+ FunctionID::BasicCommunication_OnEmergencyEvent);
+ SmartObject message;
+ message[am::strings::msg_params][am::hmi_response::enabled] = false;
+ emergency_event.set_smart_object(message);
+ state_ctrl_.on_event(emergency_event);
+ break;
+ }
+ case am::HmiState::StateID::STATE_ID_NAVI_STREAMING: {
+ state_ctrl_.OnNaviStreamingStopped();
+ break;
+ }
+ default:
+ break;
+ }
+
+ EXPECT_CALL(application, RemoveHMIState(_)).Times(0);
+ }
+ }
+};
+
+TEST_F(StateControllerTest, OnStateChangedWithEqualStates) {
+ EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(_)).Times(0);
+ EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(0);
+
+ for (uint32_t i = 0; i < valid_states_for_not_audio_app_.size(); ++i) {
+ state_ctrl_.OnStateChanged(simple_app_,
+ valid_states_for_not_audio_app_[i],
+ valid_states_for_not_audio_app_[i]);
+ }
+}
+
+TEST_F(StateControllerTest, OnStateChangedWithDifferentStates) {
+ for (uint32_t i = 0; i < valid_states_for_not_audio_app_.size(); ++i) {
+ for (uint32_t j = 0; j < valid_states_for_not_audio_app_.size(); ++j) {
+ HmiStatesComparator comp(valid_states_for_not_audio_app_[i]);
+ if (!comp(valid_states_for_not_audio_app_[j])) {
+ EXPECT_CALL(app_manager_mock_,
+ SendHMIStatusNotification(simple_app_)).Times(1);
+ EXPECT_CALL(app_manager_mock_,
+ OnHMILevelChanged(
+ simple_app_id_,
+ valid_states_for_not_audio_app_[i]->hmi_level(),
+ valid_states_for_not_audio_app_[j]->hmi_level())).Times(1);
+ if (mobile_apis::HMILevel::HMI_NONE ==
+ valid_states_for_not_audio_app_[j]->hmi_level()) {
+ EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(1);
+ }
+ state_ctrl_.OnStateChanged(simple_app_,
+ valid_states_for_not_audio_app_[i],
+ valid_states_for_not_audio_app_[j]);
+
+ EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(_)).Times(0);
+ EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(0);
+ }
+ }
+ }
+}
+
+TEST_F(StateControllerTest, OnStateChangedToNone) {
+ using namespace am;
+ using namespace mobile_apis;
+
+ HmiStatePtr none_state = createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN);
+ HmiStatePtr not_none_state = createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN);
+
+ EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(0);
+ state_ctrl_.OnStateChanged(simple_app_, none_state, not_none_state);
+
+ EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(1);
+ state_ctrl_.OnStateChanged(simple_app_, not_none_state, none_state);
+}
+
+TEST_F(StateControllerTest, MoveSimpleAppToValidStates) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ using am::UsageStatistics;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+ HmiStatePtr initial_state =
+ createHmiState(HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM,
+ SystemContext::INVALID_ENUM);
+
+ for (std::vector<HmiStatePtr>::iterator it =
+ valid_states_for_not_audio_app_.begin();
+ it != valid_states_for_not_audio_app_.end(); ++it) {
+ HmiStatePtr state_to_setup = *it;
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(initial_state))
+ .WillOnce(Return(state_to_setup));
+ EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(simple_app_));
+ EXPECT_CALL(app_manager_mock_,
+ OnHMILevelChanged(simple_app_id_, initial_state->hmi_level(),
+ state_to_setup->hmi_level()));
+
+ EXPECT_CALL(*simple_app_ptr_,
+ SetRegularState(Truly(HmiStatesComparator(state_to_setup))));
+ state_ctrl_.SetRegularState<false>(simple_app_, state_to_setup);
+ initial_state = state_to_setup;
+ }
+}
+
+TEST_F(StateControllerTest, MoveAudioAppAppToValidStates) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ using am::UsageStatistics;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+
+ am::ApplicationSharedPtr audio_app = media_navi_vc_app_;
+ NiceMock<ApplicationMock>* audio_app_mock = media_navi_vc_app_ptr_;
+
+ HmiStatePtr initial_state =
+ createHmiState(HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM,
+ SystemContext::INVALID_ENUM);
+
+ for (std::vector<HmiStatePtr>::iterator it =
+ valid_states_for_audio_app_.begin();
+ it != valid_states_for_audio_app_.end(); ++it) {
+ HmiStatePtr state_to_setup = *it;
+ EXPECT_CALL(*audio_app_mock, CurrentHmiState())
+ .WillOnce(Return(initial_state))
+ .WillOnce(Return(state_to_setup));
+ EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(audio_app));
+ EXPECT_CALL(
+ app_manager_mock_,
+ OnHMILevelChanged(audio_app->app_id(), initial_state->hmi_level(),
+ state_to_setup->hmi_level()));
+
+ EXPECT_CALL(*audio_app_mock,
+ SetRegularState(Truly(HmiStatesComparator(state_to_setup))));
+ state_ctrl_.SetRegularState<false>(media_navi_vc_app_, state_to_setup);
+ initial_state = state_to_setup;
+ }
+}
+/*
+TEST_F(StateControllerTest, MoveAppFromValidStateToInvalid) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ using am::UsageStatistics;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+
+ for (std::vector<HmiStatePtr>::iterator valid_state_it =
+ valid_states_for_not_audio_app_.begin();
+ valid_state_it != valid_states_for_not_audio_app_.end();
+ ++valid_state_it) {
+ for (std::vector<HmiStatePtr>::iterator invalid_state_it =
+ common_invalid_states_.begin();
+ invalid_state_it != common_invalid_states_.end(); ++invalid_state_it) {
+ HmiStatePtr initial_state = *valid_state_it;
+ HmiStatePtr invalid_state = *invalid_state_it;
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(initial_state));
+ EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
+ state_ctrl_.SetRegularState<false>(simple_app_, invalid_state);
+ }
+ }
+
+ NiceMock<ApplicationMock>* audio_app_mock = media_navi_vc_app_ptr_;
+ am::ApplicationSharedPtr audio_app = media_navi_vc_app_;
+ for (std::vector<HmiStatePtr>::iterator valid_state_it =
+ valid_states_for_audio_app_.begin();
+ valid_state_it != valid_states_for_audio_app_.end(); ++valid_state_it) {
+ for (std::vector<HmiStatePtr>::iterator invalid_state_it =
+ invalid_states_for_audio_app.begin();
+ invalid_state_it != invalid_states_for_audio_app.end();
+ ++invalid_state_it) {
+ HmiStatePtr initial_state = *valid_state_it;
+ HmiStatePtr invalid_state = *invalid_state_it;
+ EXPECT_CALL(*audio_app_mock, CurrentHmiState())
+ .WillOnce(Return(initial_state));
+ EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
+ EXPECT_CALL(*audio_app_mock, SetRegularState(_)).Times(0);
+ state_ctrl_.SetRegularState<false>(audio_app, invalid_state);
+ }
+ }
+
+ for (std::vector<HmiStatePtr>::iterator valid_state_it =
+ valid_states_for_not_audio_app_.begin();
+ valid_state_it != valid_states_for_not_audio_app_.end();
+ ++valid_state_it) {
+ for (std::vector<HmiStatePtr>::iterator invalid_state_it =
+ invalid_states_for_not_audio_app.begin();
+ invalid_state_it != invalid_states_for_not_audio_app.end();
+ ++invalid_state_it) {
+ HmiStatePtr initial_state = *valid_state_it;
+ HmiStatePtr invalid_state = *invalid_state_it;
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(initial_state));
+ EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
+ state_ctrl_.SetRegularState<false>(simple_app_, invalid_state);
+ }
+ }
+}
+
+TEST_F(StateControllerTest, MoveAppFromInValidStateToValid) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ using am::UsageStatistics;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+
+ NiceMock<ApplicationMock>* audio_app_mock = media_navi_vc_app_ptr_;
+ am::ApplicationSharedPtr audio_app = media_navi_vc_app_;
+ HmiStatePtr invalid_state =
+ createHmiState(HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM,
+ SystemContext::INVALID_ENUM);
+
+ for (std::vector<HmiStatePtr>::iterator it =
+ valid_states_for_audio_app_.begin();
+ it != valid_states_for_audio_app_.end(); ++it) {
+ HmiStatePtr initial_state = *it;
+ EXPECT_CALL(*audio_app_mock, CurrentHmiState())
+ .WillOnce(Return(initial_state));
+ EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
+ EXPECT_CALL(*audio_app_mock, SetRegularState(_)).Times(0);
+ state_ctrl_.SetRegularState<false>(audio_app, invalid_state);
+ }
+
+ for (std::vector<HmiStatePtr>::iterator it =
+ valid_states_for_not_audio_app_.begin();
+ it != valid_states_for_not_audio_app_.end(); ++it) {
+ HmiStatePtr initial_state = *it;
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(initial_state));
+ EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
+ EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
+ state_ctrl_.SetRegularState<false>(simple_app_, invalid_state);
+ }
+}
+
+TEST_F(StateControllerTest, MoveAppFromInValidStateToInvalid) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ using am::UsageStatistics;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+ NiceMock<ApplicationMock>* audio_app_mock = media_navi_vc_app_ptr_;
+ am::ApplicationSharedPtr audio_app = media_navi_vc_app_;
+ HmiStatePtr initial_invalid_state =
+ createHmiState(HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM,
+ SystemContext::INVALID_ENUM);
+
+ am::ApplicationConstSharedPtr const_audio_app(audio_app);
+
+ for (std::vector<HmiStatePtr>::iterator it =
+ invalid_states_for_audio_app.begin();
+ it != invalid_states_for_audio_app.end(); ++it) {
+ HmiStatePtr state_to_setup = *it;
+ HmiStatePtr default_state =
+ createHmiState(HMILevel::HMI_LIMITED, AudioStreamingState::AUDIBLE,
+ SystemContext::SYSCTXT_MAIN);
+ EXPECT_CALL(app_manager_mock_, GetDefaultHmiLevel(const_audio_app))
+ .WillOnce(Return(HMILevel::HMI_LIMITED));
+ EXPECT_CALL(*audio_app_mock, CurrentHmiState())
+ .WillOnce(Return(initial_invalid_state))
+ .WillOnce(Return(initial_invalid_state))
+ .WillOnce(Return(default_state));
+ EXPECT_CALL(app_manager_mock_,
+ OnHMILevelChanged(audio_app->app_id(),
+ initial_invalid_state->hmi_level(),
+ default_state->hmi_level()));
+ EXPECT_CALL(*audio_app_mock,
+ SetRegularState(Truly(HmiStatesComparator(default_state))));
+ state_ctrl_.SetRegularState<false>(audio_app, state_to_setup);
+ }
+
+ for (std::vector<HmiStatePtr>::iterator it =
+ invalid_states_for_not_audio_app.begin();
+ it != invalid_states_for_not_audio_app.end(); ++it) {
+ HmiStatePtr state_to_setup = *it;
+ HmiStatePtr default_state = createHmiState(HMILevel::HMI_BACKGROUND,
+ AudioStreamingState::NOT_AUDIBLE,
+ SystemContext::SYSCTXT_MAIN);
+ am::ApplicationConstSharedPtr const_simple_app(simple_app_);
+ EXPECT_CALL(app_manager_mock_, GetDefaultHmiLevel(const_simple_app))
+ .WillOnce(Return(HMILevel::HMI_BACKGROUND));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(initial_invalid_state))
+ .WillOnce(Return(initial_invalid_state))
+ .WillOnce(Return(default_state));
+ EXPECT_CALL(app_manager_mock_,
+ OnHMILevelChanged(simple_app_ptr_->app_id(),
+ initial_invalid_state->hmi_level(),
+ default_state->hmi_level()));
+ EXPECT_CALL(*simple_app_ptr_,
+ SetRegularState(Truly(HmiStatesComparator(default_state))));
+ state_ctrl_.SetRegularState<false>(simple_app_, state_to_setup);
+ }
+}
+*/
+TEST_F(StateControllerTest, SetFullToSimpleAppWhileAnotherSimpleAppIsInFull) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+ am::ApplicationSharedPtr app_in_full;
+ NiceMock<ApplicationMock>* app_in_full_mock;
+
+ am::ApplicationSharedPtr app_moved_to_full;
+ NiceMock<ApplicationMock>* app_moved_to_full_mock;
+
+ app_in_full =
+ ConfigureApp(&app_in_full_mock, 1761, NOT_MEDIA, NOT_NAVI, NOT_VC);
+ app_moved_to_full =
+ ConfigureApp(&app_moved_to_full_mock, 1796, NOT_MEDIA, NOT_NAVI, NOT_VC);
+
+ InsertApplication(app_in_full);
+ InsertApplication(app_moved_to_full);
+
+ ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
+ BackgroundState(), FullNotAudibleState());
+
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ app_in_full, app_in_full_mock, FullNotAudibleState(), BackgroundState());
+
+ state_ctrl_.SetRegularState<false>(app_moved_to_full, FullNotAudibleState());
+}
+
+TEST_F(StateControllerTest, SetFullToSimpleAppWhileAudioAppAppIsInFull) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ 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<ApplicationMock>* app_in_full_mock = media_navi_vc_app_ptr_;
+
+ am::ApplicationSharedPtr app_moved_to_full = simple_app_;
+ NiceMock<ApplicationMock>* app_moved_to_full_mock = simple_app_ptr_;
+
+ InsertApplication(app_in_full);
+ InsertApplication(app_moved_to_full);
+
+ ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
+ BackgroundState(), FullNotAudibleState());
+
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ app_in_full, app_in_full_mock, FullAudibleState(), LimitedState());
+ state_ctrl_.SetRegularState<false>(app_moved_to_full, FullNotAudibleState());
+}
+
+TEST_F(StateControllerTest,
+ SetFullToAudioAppAppWhileAnotherTypeAudioAppAppIsInFull) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+
+ am::ApplicationSharedPtr app_in_full = media_app_;
+ NiceMock<ApplicationMock>* app_in_full_mock = media_app_ptr_;
+
+ am::ApplicationSharedPtr app_moved_to_full = navi_app_;
+ NiceMock<ApplicationMock>* app_moved_to_full_mock = navi_app_ptr_;
+
+ InsertApplication(app_in_full);
+ InsertApplication(app_moved_to_full);
+
+ ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
+ BackgroundState(), FullAudibleState());
+
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ app_in_full, app_in_full_mock, FullAudibleState(), LimitedState());
+ state_ctrl_.SetRegularState<false>(app_moved_to_full, FullAudibleState());
+}
+
+TEST_F(StateControllerTest,
+ SetFullToAudioAppAppWhileSameTypeAudioAppAppIsInFull) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+ NiceMock<ApplicationMock>* app_in_full_mock;
+ am::ApplicationSharedPtr app_in_full =
+ ConfigureApp(&app_in_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC);
+
+ NiceMock<ApplicationMock>* app_moved_to_full_mock;
+ am::ApplicationSharedPtr app_moved_to_full =
+ ConfigureApp(&app_moved_to_full_mock, 1796, MEDIA, NOT_NAVI, NOT_VC);
+
+ InsertApplication(app_in_full);
+ InsertApplication(app_moved_to_full);
+ ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
+ BackgroundState(), FullAudibleState());
+
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ app_in_full, app_in_full_mock, FullAudibleState(), BackgroundState());
+
+ state_ctrl_.SetRegularState<false>(app_moved_to_full, FullAudibleState());
+}
+
+TEST_F(StateControllerTest,
+ SetFullToAudioAppAppWhileSameTypeAudioAppAppIsInLimited) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+
+ NiceMock<ApplicationMock>* app_in_limited_mock;
+ am::ApplicationSharedPtr app_in_limited =
+ ConfigureApp(&app_in_limited_mock, 1761, NOT_MEDIA, NAVI, NOT_VC);
+
+ NiceMock<ApplicationMock>* app_moved_to_full_mock;
+ am::ApplicationSharedPtr app_moved_to_full =
+ ConfigureApp(&app_moved_to_full_mock, 1796, NOT_MEDIA, NAVI, VC);
+
+ InsertApplication(app_in_limited);
+ InsertApplication(app_moved_to_full);
+ ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
+ BackgroundState(), FullAudibleState());
+
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ app_in_limited, app_in_limited_mock, LimitedState(), BackgroundState());
+
+ state_ctrl_.SetRegularState<false>(app_moved_to_full, FullAudibleState());
+}
+
+TEST_F(StateControllerTest,
+ SetLimitedToAudioAppAppWhileSameTypeAudioAppAppIsInLimited) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+ NiceMock<ApplicationMock>* app_in_limited_mock;
+ am::ApplicationSharedPtr app_in_limited =
+ ConfigureApp(&app_in_limited_mock, 1761, NOT_MEDIA, NOT_NAVI, VC);
+
+ NiceMock<ApplicationMock>* app_moved_to_limited_mock;
+ am::ApplicationSharedPtr app_moved_to_limited =
+ ConfigureApp(&app_moved_to_limited_mock, 1796, NOT_MEDIA, NOT_NAVI, VC);
+
+ InsertApplication(app_in_limited);
+ InsertApplication(app_moved_to_limited);
+
+ ExpectSuccesfullSetHmiState(app_moved_to_limited, app_moved_to_limited_mock,
+ BackgroundState(), LimitedState());
+
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ app_in_limited, app_in_limited_mock, LimitedState(), BackgroundState());
+
+ state_ctrl_.SetRegularState<false>(app_moved_to_limited, LimitedState());
+}
+
+TEST_F(StateControllerTest,
+ SetLimitedToAudioAppAppWhileOtherTypeAudioAppAppIsInLimited) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+
+ am::ApplicationSharedPtr app_in_limited = navi_app_;
+ NiceMock<ApplicationMock>* app_in_limited_mock = navi_app_ptr_;
+
+ am::ApplicationSharedPtr app_moved_to_limited = vc_app_;
+ NiceMock<ApplicationMock>* app_moved_to_limited_mock = vc_app_ptr_;
+
+ InsertApplication(app_in_limited);
+ InsertApplication(app_moved_to_limited);
+ ExpectSuccesfullSetHmiState(app_moved_to_limited, app_moved_to_limited_mock,
+ BackgroundState(), LimitedState());
+ ExpectAppWontChangeHmiStateDueToConflictResolving(
+ app_in_limited, app_in_limited_mock, LimitedState());
+ state_ctrl_.SetRegularState<false>(app_moved_to_limited, LimitedState());
+}
+
+TEST_F(StateControllerTest,
+ SetLimitedToAudioAppAppWhileOtherTypeAudioAppAppIsInFull) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+ am::ApplicationSharedPtr app_in_full = navi_app_;
+ NiceMock<ApplicationMock>* app_in_full_mock = navi_app_ptr_;
+
+ am::ApplicationSharedPtr app_moved_to_limited = vc_app_;
+ NiceMock<ApplicationMock>* app_moved_to_limited_mock = vc_app_ptr_;
+
+ InsertApplication(app_in_full);
+ InsertApplication(app_moved_to_limited);
+
+ ExpectSuccesfullSetHmiState(app_moved_to_limited, app_moved_to_limited_mock,
+ BackgroundState(), LimitedState());
+
+ ExpectAppWontChangeHmiStateDueToConflictResolving(
+ app_in_full, app_in_full_mock, FullAudibleState());
+ state_ctrl_.SetRegularState<false>(app_moved_to_limited, LimitedState());
+}
+
+TEST_F(StateControllerTest, SetFullToSimpleAppWhile2AudioAppsInLimited) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+
+ am::ApplicationSharedPtr app_moved_to_full = simple_app_;
+ NiceMock<ApplicationMock>* app_moved_to_full_mock = simple_app_ptr_;
+
+ am::ApplicationSharedPtr limited_app1 = media_app_;
+ NiceMock<ApplicationMock>* limited_app1_mock = media_app_ptr_;
+
+ am::ApplicationSharedPtr limited_app2 = navi_vc_app_;
+ NiceMock<ApplicationMock>* limited_app2_mock = navi_vc_app_ptr_;
+
+ InsertApplication(app_moved_to_full);
+ InsertApplication(limited_app1);
+ InsertApplication(limited_app2);
+
+ ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
+ BackgroundState(), FullNotAudibleState());
+
+ ExpectAppWontChangeHmiStateDueToConflictResolving(
+ limited_app1, limited_app1_mock, LimitedState());
+ ExpectAppWontChangeHmiStateDueToConflictResolving(
+ limited_app2, limited_app2_mock, LimitedState());
+
+ state_ctrl_.SetRegularState<false>(app_moved_to_full, FullNotAudibleState());
+}
+
+TEST_F(StateControllerTest,
+ SetFullToSimpleAppWhile1AudioAppInLimitedAnd1AudioAppInFull) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+
+ am::ApplicationSharedPtr app_moved_to_full = simple_app_;
+ NiceMock<ApplicationMock>* app_moved_to_full_mock = simple_app_ptr_;
+
+ am::ApplicationSharedPtr limited_app = media_app_;
+ NiceMock<ApplicationMock>* limited_app_mock = media_app_ptr_;
+
+ am::ApplicationSharedPtr full_app = navi_vc_app_;
+ NiceMock<ApplicationMock>* full_app_mock = navi_vc_app_ptr_;
+
+ InsertApplication(app_moved_to_full);
+ InsertApplication(limited_app);
+ InsertApplication(full_app);
+
+ ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
+ BackgroundState(), FullNotAudibleState());
+
+ ExpectAppWontChangeHmiStateDueToConflictResolving(
+ limited_app, limited_app_mock, LimitedState());
+
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ full_app, full_app_mock, FullAudibleState(), LimitedState());
+
+ state_ctrl_.SetRegularState<false>(app_moved_to_full, FullNotAudibleState());
+}
+
+TEST_F(StateControllerTest,
+ SetFullToSimpleAppWhile1AudioAppInLimitedAnd1SimpleAppInFull) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+
+ NiceMock<ApplicationMock>* app_moved_to_full_mock;
+ am::ApplicationSharedPtr app_moved_to_full =
+ ConfigureApp(&app_moved_to_full_mock, 1761, NOT_MEDIA, NOT_NAVI, NOT_VC);
+
+ am::ApplicationSharedPtr limited_app = media_app_;
+ NiceMock<ApplicationMock>* limited_app_mock = media_app_ptr_;
+
+ NiceMock<ApplicationMock>* full_app_mock;
+ am::ApplicationSharedPtr full_app =
+ ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NOT_NAVI, NOT_VC);
+
+ InsertApplication(app_moved_to_full);
+ InsertApplication(limited_app);
+ InsertApplication(full_app);
+
+ ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
+ BackgroundState(), FullNotAudibleState());
+
+ ExpectAppWontChangeHmiStateDueToConflictResolving(
+ limited_app, limited_app_mock, LimitedState());
+
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ full_app, full_app_mock, FullNotAudibleState(), BackgroundState());
+
+ state_ctrl_.SetRegularState<false>(app_moved_to_full, FullNotAudibleState());
+}
+
+TEST_F(
+ StateControllerTest,
+ SetFullToAudioAppWhile1AudioAppWithSameTypeInLimitedAnd1SimpleAppInFull) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+
+ NiceMock<ApplicationMock>* app_moved_to_full_mock;
+ am::ApplicationSharedPtr app_moved_to_full =
+ ConfigureApp(&app_moved_to_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC);
+
+ NiceMock<ApplicationMock>* limited_app_mock;
+ am::ApplicationSharedPtr limited_app =
+ ConfigureApp(&limited_app_mock, 1762, MEDIA, NOT_NAVI, NOT_VC);
+
+ NiceMock<ApplicationMock>* full_app_mock;
+ am::ApplicationSharedPtr full_app =
+ ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NOT_NAVI, NOT_VC);
+
+ InsertApplication(app_moved_to_full);
+ InsertApplication(limited_app);
+ InsertApplication(full_app);
+
+ ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
+ BackgroundState(), FullAudibleState());
+
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ limited_app, limited_app_mock, LimitedState(), BackgroundState());
+
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ full_app, full_app_mock, FullNotAudibleState(), BackgroundState());
+
+ state_ctrl_.SetRegularState<false>(app_moved_to_full, FullAudibleState());
+}
+
+TEST_F(
+ StateControllerTest,
+ SetFullToAudioAppWhileAudioAppWithSameTypeInLimitedAndAudioAppWithOtherTypeInFull) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+
+ NiceMock<ApplicationMock>* app_moved_to_full_mock;
+ am::ApplicationSharedPtr app_moved_to_full =
+ ConfigureApp(&app_moved_to_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC);
+
+ NiceMock<ApplicationMock>* limited_app_mock;
+ am::ApplicationSharedPtr limited_app =
+ ConfigureApp(&limited_app_mock, 1762, MEDIA, NOT_NAVI, NOT_VC);
+
+ NiceMock<ApplicationMock>* full_app_mock;
+ am::ApplicationSharedPtr full_app =
+ ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NAVI, NOT_VC);
+
+ InsertApplication(app_moved_to_full);
+ InsertApplication(limited_app);
+ InsertApplication(full_app);
+
+ ExpectSuccesfullSetHmiState(app_moved_to_full, app_moved_to_full_mock,
+ BackgroundState(), FullAudibleState());
+
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ limited_app, limited_app_mock, LimitedState(), BackgroundState());
+
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ full_app, full_app_mock, FullAudibleState(), LimitedState());
+
+ state_ctrl_.SetRegularState<false>(app_moved_to_full, FullAudibleState());
+}
+
+TEST_F(StateControllerTest,
+ SetFullToAudioAppWhile3AudioAppsWithSameTypeInLimited) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+
+ InsertApplication(media_navi_vc_app_);
+ InsertApplication(media_app_);
+ InsertApplication(navi_app_);
+ InsertApplication(vc_app_);
+ ExpectSuccesfullSetHmiState(media_navi_vc_app_, media_navi_vc_app_ptr_,
+ BackgroundState(), FullAudibleState());
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ media_app_, media_app_ptr_, LimitedState(), BackgroundState());
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ navi_app_, navi_app_ptr_, LimitedState(), BackgroundState());
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ vc_app_, vc_app_ptr_, LimitedState(), BackgroundState());
+ state_ctrl_.SetRegularState<false>(media_navi_vc_app_, FullAudibleState());
+}
+
+TEST_F(StateControllerTest,
+ SetFullToAudioAppWhile2AudioAppsWithSameTypeInLimitedAndOneInFull) {
+ using am::HmiState;
+ using am::HmiStatePtr;
+ namespace HMILevel = mobile_apis::HMILevel;
+ namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace SystemContext = mobile_apis::SystemContext;
+
+ InsertApplication(media_navi_vc_app_);
+ InsertApplication(media_app_);
+ InsertApplication(navi_app_);
+ InsertApplication(vc_app_);
+ ExpectSuccesfullSetHmiState(media_navi_vc_app_, media_navi_vc_app_ptr_,
+ BackgroundState(), FullAudibleState());
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ media_app_, media_app_ptr_, LimitedState(), BackgroundState());
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ navi_app_, navi_app_ptr_, LimitedState(), BackgroundState());
+ ExpectAppChangeHmiStateDueToConflictResolving(
+ vc_app_, vc_app_ptr_, FullAudibleState(), BackgroundState());
+ state_ctrl_.SetRegularState<false>(media_navi_vc_app_, FullAudibleState());
+}
+
+TEST_F(StateControllerTest, ActivateAppSuccessReceivedFromHMI) {
+ using namespace hmi_apis;
+ using namespace mobile_apis;
+
+ const uint32_t corr_id = 314;
+ const uint32_t hmi_app_id = 2718;
+ typedef std::pair<am::HmiStatePtr, Common_HMILevel::eType> StateLevelPair;
+ std::vector<StateLevelPair> hmi_states;
+ hmi_states.push_back(
+ StateLevelPair(FullAudibleState(), Common_HMILevel::FULL));
+ hmi_states.push_back(
+ StateLevelPair(FullNotAudibleState(), Common_HMILevel::FULL));
+ hmi_states.push_back(
+ StateLevelPair(LimitedState(), Common_HMILevel::LIMITED));
+ hmi_states.push_back(
+ StateLevelPair(BackgroundState(), Common_HMILevel::BACKGROUND));
+ hmi_states.push_back(StateLevelPair(
+ createHmiState(HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE,
+ 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();
+ for (; it != hmi_states.end(); ++it) {
+ for (; it2 != initial_hmi_states.end(); ++it2) {
+ am::HmiStatePtr hmi_state = it->first;
+ am::HmiStatePtr initial_hmi_state = it->first;
+ Common_HMILevel::eType hmi_level = it->second;
+
+ EXPECT_CALL(*message_helper_mock_,
+ SendActivateAppToHMI(media_app_->app_id(), hmi_level, _))
+ .WillOnce(Return(corr_id));
+ EXPECT_CALL(app_manager_mock_, application_id(corr_id))
+ .WillOnce(Return(hmi_app_id));
+ EXPECT_CALL(app_manager_mock_, application_by_hmi_app(hmi_app_id))
+ .WillOnce(Return(media_app_));
+ ExpectSuccesfullSetHmiState(media_app_, media_app_ptr_, initial_hmi_state,
+ hmi_state);
+ state_ctrl_.SetRegularState<true>(media_app_, hmi_state);
+ smart_objects::SmartObject message;
+ message[am::strings::params][am::hmi_response::code] =
+ Common_Result::SUCCESS;
+ message[am::strings::params][am::strings::correlation_id] = corr_id;
+ am::event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp);
+ event.set_smart_object(message);
+ state_ctrl_.on_event(event);
+ }
+ }
+}
+/*
+TEST_F(StateControllerTest, ActivateAppErrorReceivedFromHMI) {
+ using namespace hmi_apis;
+ const uint32_t corr_id = 314;
+ const uint32_t hmi_app_id = 2718;
+ std::vector<Common_Result::eType> hmi_results;
+ hmi_results.push_back(Common_Result::ABORTED);
+ hmi_results.push_back(Common_Result::APPLICATION_NOT_REGISTERED);
+ hmi_results.push_back(Common_Result::CHAR_LIMIT_EXCEEDED);
+ hmi_results.push_back(Common_Result::DATA_NOT_AVAILABLE);
+ hmi_results.push_back(Common_Result::DISALLOWED);
+ hmi_results.push_back(Common_Result::DUPLICATE_NAME);
+ hmi_results.push_back(Common_Result::GENERIC_ERROR);
+ hmi_results.push_back(Common_Result::IGNORED);
+ hmi_results.push_back(Common_Result::INVALID_DATA);
+ hmi_results.push_back(Common_Result::INVALID_ENUM);
+ hmi_results.push_back(Common_Result::INVALID_ID);
+ hmi_results.push_back(Common_Result::IN_USE);
+ hmi_results.push_back(Common_Result::NO_APPS_REGISTERED);
+ hmi_results.push_back(Common_Result::NO_DEVICES_CONNECTED);
+ hmi_results.push_back(Common_Result::OUT_OF_MEMORY);
+ hmi_results.push_back(Common_Result::REJECTED);
+ hmi_results.push_back(Common_Result::RETRY);
+ hmi_results.push_back(Common_Result::TIMED_OUT);
+ hmi_results.push_back(Common_Result::TOO_MANY_PENDING_REQUESTS);
+ hmi_results.push_back(Common_Result::TRUNCATED_DATA);
+ hmi_results.push_back(Common_Result::UNSUPPORTED_REQUEST);
+ hmi_results.push_back(Common_Result::UNSUPPORTED_RESOURCE);
+ hmi_results.push_back(Common_Result::USER_DISALLOWED);
+ hmi_results.push_back(Common_Result::WARNINGS);
+ hmi_results.push_back(Common_Result::WRONG_LANGUAGE);
+
+ std::vector<Common_Result::eType>::iterator it = hmi_results.begin();
+ for (; it != hmi_results.end(); ++it) {
+ EXPECT_CALL(
+ *message_helper_mock_,
+ SendActivateAppToHMI(simple_app_->app_id(), Common_HMILevel::FULL, _))
+ .WillOnce(Return(corr_id));
+ EXPECT_CALL(app_manager_mock_, application_id(corr_id))
+ .WillOnce(Return(hmi_app_id));
+ EXPECT_CALL(app_manager_mock_, application_by_hmi_app(hmi_app_id))
+ .WillOnce(Return(simple_app_));
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
+ .WillOnce(Return(BackgroundState()));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(BackgroundState()))
+ .WillOnce(Return(BackgroundState()));
+ EXPECT_CALL(*simple_app_ptr_,
+ SetRegularState(Truly(HmiStatesComparator(BackgroundState()))));
+ EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(simple_app_))
+ .Times(0);
+ EXPECT_CALL(app_manager_mock_,
+ OnHMILevelChanged(simple_app_->app_id(), _, _)).Times(0);
+ state_ctrl_.SetRegularState<true>(simple_app_, FullNotAudibleState());
+ smart_objects::SmartObject message;
+ message[am::strings::params][am::hmi_response::code] = *it;
+ message[am::strings::params][am::strings::correlation_id] = corr_id;
+ am::event_engine::Event event(FunctionID::BasicCommunication_ActivateApp);
+ event.set_smart_object(message);
+ state_ctrl_.on_event(event);
+ }
+}
+*/
+TEST_F(StateControllerTest, ActivateAppInvalidCorrelationId) {
+ using namespace hmi_apis;
+ const uint32_t corr_id = 314;
+ const uint32_t hmi_app_id = 2718;
+ EXPECT_CALL(*message_helper_mock_,
+ SendActivateAppToHMI(simple_app_->app_id(), Common_HMILevel::FULL,
+ _)).WillOnce(Return(hmi_app_id));
+ EXPECT_CALL(app_manager_mock_, application_id(corr_id))
+ .WillOnce(Return(hmi_app_id));
+ EXPECT_CALL(app_manager_mock_, application_by_hmi_app(hmi_app_id))
+ .WillOnce(Return(am::ApplicationSharedPtr()));
+ EXPECT_CALL(*simple_app_ptr_, SetRegularState(_)).Times(0);
+ EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(simple_app_))
+ .Times(0);
+ EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(simple_app_->app_id(), _, _))
+ .Times(0);
+ state_ctrl_.SetRegularState<true>(simple_app_, FullNotAudibleState());
+ smart_objects::SmartObject message;
+ message[am::strings::params][am::hmi_response::code] = Common_Result::SUCCESS;
+ message[am::strings::params][am::strings::correlation_id] = corr_id;
+ am::event_engine::Event event(FunctionID::BasicCommunication_ActivateApp);
+ event.set_smart_object(message);
+ state_ctrl_.on_event(event);
+}
+/*
+TEST_F(StateControllerTest, ApplyTempStatesForSimpleApp) {
+ InsertApplication(simple_app_);
+ CheckStateApplyingForApplication(*simple_app_ptr_, valid_state_ids_);
+}
+
+TEST_F(StateControllerTest, ApplyTempStatesForMediaApp) {
+ InsertApplication(media_app_);
+ CheckStateApplyingForApplication(*media_app_ptr_, valid_state_ids_);
+}
+
+TEST_F(StateControllerTest, ApplyTempStatesForNaviApp) {
+ InsertApplication(navi_app_);
+ CheckStateApplyingForApplication(*navi_app_ptr_, valid_state_ids_);
+}
+
+TEST_F(StateControllerTest, ApplyTempStatesForVCApp) {
+ InsertApplication(vc_app_);
+ CheckStateApplyingForApplication(*vc_app_ptr_, valid_state_ids_);
+}
+
+TEST_F(StateControllerTest, ApplyTempStatesForMediaNaviApp) {
+ InsertApplication(media_navi_app_);
+ CheckStateApplyingForApplication(*media_navi_app_ptr_, valid_state_ids_);
+}
+
+TEST_F(StateControllerTest, ApplyTempStatesForMediaVCApp) {
+ InsertApplication(media_vc_app_);
+ CheckStateApplyingForApplication(*media_vc_app_ptr_, valid_state_ids_);
+}
+
+TEST_F(StateControllerTest, ApplyTempStatesForNaviVCApp) {
+ InsertApplication(navi_vc_app_);
+ CheckStateApplyingForApplication(*navi_vc_app_ptr_, valid_state_ids_);
+}
+
+TEST_F(StateControllerTest, ApplyTempStatesForMediaNaviVCApp) {
+ InsertApplication(media_navi_vc_app_);
+ CheckStateApplyingForApplication(*media_navi_vc_app_ptr_, valid_state_ids_);
+}
+*/
+} // namespace state_controller_test
diff --git a/src/components/config_profile/CMakeLists.txt b/src/components/config_profile/CMakeLists.txt
index 2f7f77144..fe6f373b3 100644
--- a/src/components/config_profile/CMakeLists.txt
+++ b/src/components/config_profile/CMakeLists.txt
@@ -1,13 +1,48 @@
+# 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_directories (
- ./include
- ../utils/include/
+ include
+ ${COMPONENTS_DIR}/utils/include/
${LOG4CXX_INCLUDE_DIRECTORY}
)
set (SOURCES
- ./src/profile.cc
- ./src/ini_file.cc
+ ${COMPONENTS_DIR}/config_profile/src/profile.cc
+ ${COMPONENTS_DIR}/config_profile/src/ini_file.cc
)
add_library("ConfigProfile" ${SOURCES})
target_link_libraries("ConfigProfile" Utils)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif() \ No newline at end of file
diff --git a/src/components/config_profile/include/config_profile/ini_file.h b/src/components/config_profile/include/config_profile/ini_file.h
index 764ff2f6c..1b6248246 100644
--- a/src/components/config_profile/include/config_profile/ini_file.h
+++ b/src/components/config_profile/include/config_profile/ini_file.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index 5be14d400..6a43cafdd 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -58,10 +58,21 @@ class Profile : public utils::Singleton<Profile> {
virtual ~Profile();
/**
+ * @brief Returns sdl version represented
+ * by git commit or value specified by user
+ */
+ const std::string& sdl_version() const;
+
+ /**
* @brief Returns true if HMI should be started, otherwise false
*/
bool launch_hmi() const;
-
+#ifdef WEB_HMI
+ /**
+ * @brief Returns link to web hmi
+ */
+ std::string link_to_web_hmi() const;
+#endif // WEB_HMI
/**
* @brief Returns application configuration path
*/
@@ -78,6 +89,27 @@ class Profile : public utils::Singleton<Profile> {
const std::string& app_resourse_folder() const;
/**
+ * @brief Returns true, if SDL 4.0 is enabled
+ */
+ bool enable_protocol_4() const;
+
+ /**
+ * @brief Returns application icons folder path
+ */
+ const std::string& app_icons_folder() const;
+
+ /**
+ * @brief Returns application icons folder maximum size
+ */
+ const uint32_t& app_icons_folder_max_size() const;
+
+ /**
+ * @brief Returns application icons amount to remove from icon folder,
+ * if maximum size exceeded
+ */
+ const uint32_t& app_icons_amount_to_remove() const;
+
+ /**
* @brief Returns the path to the config file
*/
const std::string& config_file_name() const;
@@ -108,6 +140,11 @@ class Profile : public utils::Singleton<Profile> {
const uint16_t& audio_streaming_port() const;
/**
+ * @brief Returns streaming timeout
+ */
+ uint32_t stop_streaming_timeout() const;
+
+ /**
* @brief Returns port for time reports
*/
const uint16_t& time_testing_port() const;
@@ -147,6 +184,7 @@ class Profile : public utils::Singleton<Profile> {
* @brief Default timeout for waiting for resuming
*/
const uint32_t& app_resuming_timeout() const;
+ const uint32_t& app_resumption_save_persistent_data_timeout() const;
/**
* @brief Returns desirable thread stack size
@@ -208,6 +246,19 @@ class Profile : public utils::Singleton<Profile> {
* @brief Returns path to testing file to which redirects audio stream
*/
const std::string& audio_stream_file() const;
+
+ /**
+ * @brief Returns timeout for SDL to wait for the next package of raw data
+ * over audio service
+ */
+ const std::uint32_t audio_data_stopped_timeout() const;
+
+ /**
+ * @brief Returns timeout for SDL to wait for the next package of raw data
+ * over video service
+ */
+ const std::uint32_t video_data_stopped_timeout() const;
+
/**
* @brief Returns allowable max amount of requests per time scale for
* application in hmi level none
@@ -439,6 +490,37 @@ class Profile : public utils::Singleton<Profile> {
*/
int iap_hub_connection_wait_timeout() const;
+ /*
+ * ProtocolHandler section
+ */
+ size_t maximum_payload_size() const;
+
+ size_t message_frequency_count() const;
+
+ size_t message_frequency_time() const;
+
+ bool malformed_message_filtering() const;
+
+ size_t malformed_frequency_count() const;
+
+ size_t malformed_frequency_time() const;
+
+ uint16_t attempts_to_open_policy_db() const;
+
+ uint16_t open_attempt_timeout_ms() const;
+
+ uint32_t resumption_delay_before_ign() const;
+
+ uint32_t resumption_delay_after_ign() const;
+
+ uint32_t hash_string_size() const;
+
+ /*
+ * @brief Updates all related values from ini file
+ */
+ void UpdateValues();
+
+
private:
/**
* Default constructor
@@ -448,10 +530,6 @@ class Profile : public utils::Singleton<Profile> {
*/
Profile();
- /*
- * @brief Updates all related values from ini file
- */
- void UpdateValues();
/**
* @brief Reads a boolean value from the profile
@@ -525,23 +603,45 @@ class Profile : public utils::Singleton<Profile> {
const char* const pKey) const;
/**
- * @brief Write to log content of container
- * @param array Source array
- * @param log Log string
+ * @brief Checks, if path is relative
+ * @param path Path
+ * @return true, if is relative, otherwise - false
+ */
+ bool IsRelativePath(const std::string& path);
+
+ /**
+ * @brief Makes relative path absolute
+ * @param path Path
+ */
+ void MakeAbsolutePath(std::string& path);
+
+ /**
+ * @brief Converts input string to number
+ * @param input Input string
+ * @param output Output number
+ * @return true, if successfully converted, otherwise - false
*/
- void LogContainer(const std::vector<std::string>& container,
- std::string* log);
+ bool StringToNumber(const std::string& input, uint64_t& output) const;
- // Members section
+private:
+ std::string sdl_version_;
bool launch_hmi_;
+#ifdef WEB_HMI
+ std::string link_to_web_hmi_;
+#endif // WEB_HMI
std::string app_config_folder_;
std::string app_storage_folder_;
std::string app_resourse_folder_;
+ bool enable_protocol_4_;
+ std::string app_icons_folder_;
+ uint32_t app_icons_folder_max_size_;
+ uint32_t app_icons_amount_to_remove_;
std::string config_file_name_;
std::string server_address_;
uint16_t server_port_;
uint16_t video_streaming_port_;
uint16_t audio_streaming_port_;
+ uint32_t stop_streaming_timeout_;
uint16_t time_testing_port_;
std::string hmi_capabilities_file_name_;
std::vector<std::string> help_prompt_;
@@ -553,6 +653,7 @@ class Profile : public utils::Singleton<Profile> {
uint32_t max_cmd_id_;
uint32_t default_timeout_;
uint32_t app_resuming_timeout_;
+ uint32_t app_resumption_save_persistent_data_timeout_;
std::string vr_help_title_;
uint32_t app_dir_quota_;
std::string video_consumer_type_;
@@ -580,6 +681,8 @@ class Profile : public utils::Singleton<Profile> {
std::string system_files_path_;
uint16_t transport_manager_tcp_adapter_port_;
std::string tts_delimiter_;
+ std::uint32_t audio_data_stopped_timeout_;
+ std::uint32_t video_data_stopped_timeout_;
std::string mme_db_name_;
std::string event_mq_name_;
std::string ack_mq_name_;
@@ -614,6 +717,11 @@ class Profile : public utils::Singleton<Profile> {
int iap2_hub_connect_attempts_;
int iap_hub_connection_wait_timeout_;
uint16_t tts_global_properties_timeout_;
+ uint16_t attempts_to_open_policy_db_;
+ uint16_t open_attempt_timeout_ms_;
+ uint32_t resumption_delay_before_ign_;
+ uint32_t resumption_delay_after_ign_;
+ uint32_t hash_string_size_;
FRIEND_BASE_SINGLETON_CLASS(Profile);
DISALLOW_COPY_AND_ASSIGN(Profile);
diff --git a/src/components/config_profile/src/ini_file.cc b/src/components/config_profile/src/ini_file.cc
index 63c9668bc..236dd1ae2 100644
--- a/src/components/config_profile/src/ini_file.cc
+++ b/src/components/config_profile/src/ini_file.cc
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (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) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#include "config_profile/ini_file.h"
#include <stdlib.h>
@@ -200,8 +200,10 @@ char ini_write_value(const char *fname,
}
#else // #if USE_MKSTEMP
tmpnam(temp_fname);
- if (0 == (wr_fp = fopen(temp_fname, "w")))
+ if (0 == (wr_fp = fopen(temp_fname, "w"))) {
+ fclose(rd_fp);
return FALSE;
+ }
#endif // #else #if USE_MKSTEMP
snprintf(tag, INI_LINE_LEN, "%s", chapter);
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index 49b41cf23..700c52fff 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,14 +46,14 @@
namespace {
#define LOG_UPDATED_VALUE(value, key, section) {\
LOG4CXX_INFO(logger_, "Setting value '" << value\
- << "' for key '" << key\
- << "' in section '" << section << "'.");\
+ << "' for key '" << key\
+ << "' in section '" << section << "'.");\
}
#define LOG_UPDATED_BOOL_VALUE(value, key, section) {\
LOG4CXX_INFO(logger_, "Setting value '" << std::boolalpha << value\
- << "' for key '" << key\
- << "' in section '" << section << "'.");\
+ << "' for key '" << key\
+ << "' in section '" << section << "'.");\
}
const char* kDefaultConfigFileName = "smartDeviceLink.ini";
@@ -69,17 +69,29 @@ const char* kTransportManagerSection = "TransportManager";
const char* kApplicationManagerSection = "ApplicationManager";
const char* kFilesystemRestrictionsSection = "FILESYSTEM RESTRICTIONS";
const char* kIAPSection = "IAP";
+const char* kProtocolHandlerSection = "ProtocolHandler";
+const char* kSDL4Section = "SDL4";
+const char* kResumptionSection = "Resumption";
+const char* kSDLVersionKey = "SDLVersion";
const char* kHmiCapabilitiesKey = "HMICapabilities";
const char* kPathToSnapshotKey = "PathToSnapshot";
const char* kPreloadedPTKey = "PreloadedPT";
-//const char* kPoliciesTableKey = "PoliciesTable";
+const char* kAttemptsToOpenPolicyDBKey = "AttemptsToOpenPolicyDB";
+const char* kOpenAttemptTimeoutMsKey = "OpenAttemptTimeoutMs";
const char* kServerAddressKey = "ServerAddress";
const char* kAppInfoStorageKey = "AppInfoStorage";
const char* kAppStorageFolderKey = "AppStorageFolder";
const char* kAppResourseFolderKey = "AppResourceFolder";
const char* kAppConfigFolderKey = "AppConfigFolder";
+const char* kEnableProtocol4Key = "EnableProtocol4";
+const char* kAppIconsFolderKey = "AppIconsFolder";
+const char* kAppIconsFolderMaxSizeKey = "AppIconsFolderMaxSize";
+const char* kAppIconsAmountToRemoveKey = "AppIconsAmountToRemove";
const char* kLaunchHMIKey = "LaunchHMI";
+#ifdef WEB_HMI
+const char* kLinkToWebHMI = "LinkToWebHMI";
+#endif // WEB_HMI
const char* kStartStreamRetry = "StartStreamRetry";
const char* kEnableRedecodingKey = "EnableRedecoding";
const char* kVideoStreamConsumerKey = "VideoStreamConsumer";
@@ -88,8 +100,8 @@ const char* kNamedVideoPipePathKey = "NamedVideoPipePath";
const char* kNamedAudioPipePathKey = "NamedAudioPipePath";
const char* kVideoStreamFileKey = "VideoStreamFile";
const char* kAudioStreamFileKey = "AudioStreamFile";
-
-
+const char* kAudioDataStoppedTimeoutKey = "AudioDataStoppedTimeout";
+const char* kVideoDataStoppedTimeoutKey = "VideoDataStoppedTimeout";
const char* kMixingAudioSupportedKey = "MixingAudioSupported";
const char* kHelpPromptKey = "HelpPromt";
const char* kTimeoutPromptKey = "TimeOutPromt";
@@ -102,6 +114,7 @@ const char* kTCPAdapterPortKey = "TCPAdapterPort";
const char* kServerPortKey = "ServerPort";
const char* kVideoStreamingPortKey = "VideoStreamingPort";
const char* kAudioStreamingPortKey = "AudioStreamingPort";
+const char* kStopStreamingTimeout = "StopStreamingTimeout";
const char* kTimeTestingPortKey = "TimeTestingPort";
const char* kThreadStackSizeKey = "ThreadStackSize";
const char* kMaxCmdIdKey = "MaxCmdID";
@@ -110,13 +123,16 @@ const char* kDeleteFileRequestKey = "DeleteFileRequest";
const char* kListFilesRequestKey = "ListFilesRequest";
const char* kDefaultTimeoutKey = "DefaultTimeout";
const char* kAppResumingTimeoutKey = "ApplicationResumingTimeout";
+const char* kAppSavePersistentDataTimeoutKey = "AppSavePersistentDataTimeout";
+const char* kResumptionDelayBeforeIgnKey = "ResumptionDelayBeforeIgn";
+const char* kResumptionDelayAfterIgnKey = "ResumptionDelayAfterIgn";
const char* kAppDirectoryQuotaKey = "AppDirectoryQuota";
const char* kAppTimeScaleMaxRequestsKey = "AppTimeScaleMaxRequests";
const char* kAppRequestsTimeScaleKey = "AppRequestsTimeScale";
const char* kAppHmiLevelNoneTimeScaleMaxRequestsKey =
- "AppHMILevelNoneTimeScaleMaxRequests";
+ "AppHMILevelNoneTimeScaleMaxRequests";
const char* kAppHmiLevelNoneRequestsTimeScaleKey =
- "AppHMILevelNoneRequestsTimeScale";
+ "AppHMILevelNoneRequestsTimeScale";
const char* kPendingRequestsAmoundKey = "PendingRequestsAmount";
const char* kSupportedDiagModesKey = "SupportedDiagModes";
const char* kTransportManagerDisconnectTimeoutKey = "DisconnectTimeout";
@@ -139,7 +155,18 @@ const char* kIAP2HubConnectAttemptskey = "IAP2HubConnectAttempts";
const char* kIAPHubConnectionWaitTimeoutKey = "ConnectionWaitTimeout";
const char* kDefaultHubProtocolIndexKey = "DefaultHubProtocolIndex";
const char* kTTSGlobalPropertiesTimeoutKey = "TTSGlobalPropertiesTimeout";
-
+const char* kMaximumPayloadSizeKey = "MaximumPayloadSize";
+const char* kFrequencyCount = "FrequencyCount";
+const char* kFrequencyTime = "FrequencyTime";
+const char* kMalformedMessageFiltering = "MalformedMessageFiltering";
+const char* kMalformedFrequencyCount = "MalformedFrequencyCount";
+const char* kMalformedFrequencyTime = "MalformedFrequencyTime";
+const char* kHashStringSizeKey = "HashStringSize";
+
+#ifdef WEB_HMI
+const char* kDefaultLinkToWebHMI = "HMI/index.html";
+#endif // WEB_HMI
+const char* kDefaultSDLVersion = "";
const char* kDefaultPoliciesSnapshotFileName = "sdl_snapshot.json";
const char* kDefaultHmiCapabilitiesFileName = "hmi_capabilities.json";
const char* kDefaultPreloadedPTFileName = "sdl_preloaded_pt.json";
@@ -147,6 +174,8 @@ const char* kDefaultServerAddress = "127.0.0.1";
const char* kDefaultAppInfoFileName = "app_info.dat";
const char* kDefaultSystemFilesPath = "/tmp/fs/mp/images/ivsu_cache";
const char* kDefaultTtsDelimiter = ",";
+const uint32_t kDefaultAudioDataStoppedTimeout = 1000;
+const uint32_t kDefaultVideoDataStoppedTimeout = 1000;
const char* kDefaultMmeDatabaseName = "/dev/qdb/mediaservice_db";
const char* kDefaultEventMQ = "/dev/mqueue/ToSDLCoreUSBAdapter";
const char* kDefaultAckMQ = "/dev/mqueue/FromSDLCoreUSBAdapter";
@@ -165,28 +194,45 @@ const uint16_t kDefautTransportManagerTCPPort = 12345;
const uint16_t kDefaultServerPort = 8087;
const uint16_t kDefaultVideoStreamingPort = 5050;
const uint16_t kDefaultAudioStreamingPort = 5080;
+const uint32_t kDefaultStopStreamingTimeout = 1;
const uint16_t kDefaultTimeTestingPort = 5090;
const uint32_t kDefaultMaxCmdId = 2000000000;
const uint32_t kDefaultPutFileRequestInNone = 5;
const uint32_t kDefaultDeleteFileRequestInNone = 5;
const uint32_t kDefaultListFilesRequestInNone = 5;
-const uint32_t kDefaultTimeout = 10;
-const uint32_t kDefaultAppResumingTimeout = 5;
+const uint32_t kDefaultTimeout = 10000;
+const uint32_t kDefaultAppResumingTimeout = 3;
+const uint32_t kDefaultAppSavePersistentDataTimeout = 10;
+const uint32_t kDefaultResumptionDelayBeforeIgn = 30;
+const uint32_t kDefaultResumptionDelayAfterIgn = 30;
+const uint32_t kDefaultHashStringSize = 32;
+
const uint32_t kDefaultDirQuota = 104857600;
-const uint32_t kDefaultAppTimeScaleMaxRequests = 100;
-const uint32_t kDefaultAppRequestsTimeScale = 10;
+const uint32_t kDefaultAppTimeScaleMaxRequests = 0;
+const uint32_t kDefaultAppRequestsTimeScale = 0;
const uint32_t kDefaultAppHmiLevelNoneTimeScaleMaxRequests = 100;
const uint32_t kDefaultAppHmiLevelNoneRequestsTimeScale = 10;
-const uint32_t kDefaultPendingRequestsAmount = 1000;
+const uint32_t kDefaultPendingRequestsAmount = 0;
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> kStartStreamRetryAmount = {3 , 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> kStartStreamRetryAmount = { 3, 1 };
const uint32_t kDefaultMaxThreadPoolSize = 2;
const int kDefaultIAP2HubConnectAttempts = 0;
const int kDefaultIAPHubConnectionWaitTimeout = 10;
const uint16_t kDefaultTTSGlobalPropertiesTimeout = 20;
+// TCP MTU - header size = 1500 - 12
+const size_t kDefaultMaximumPayloadSize = 1500 - 12;
+const size_t kDefaultFrequencyCount = 1000;
+const size_t kDefaultFrequencyTime = 1000;
+const bool kDefaulMalformedMessageFiltering = true;
+const size_t kDefaultMalformedFrequencyCount = 10;
+const size_t kDefaultMalformedFrequencyTime = 1000;
+const uint16_t kDefaultAttemptsToOpenPolicyDB = 5;
+const uint16_t kDefaultOpenAttemptTimeoutMsKey = 500;
+const uint32_t kDefaultAppIconsFolderMaxSize = 1048576;
+const uint32_t kDefaultAppIconsAmountToRemove = 1;
} // namespace
@@ -195,68 +241,85 @@ namespace profile {
CREATE_LOGGERPTR_GLOBAL(logger_, "Profile")
Profile::Profile()
- : launch_hmi_(true),
- app_config_folder_(),
- app_storage_folder_(),
- app_resourse_folder_(),
- config_file_name_(kDefaultConfigFileName),
- server_address_(kDefaultServerAddress),
- server_port_(kDefaultServerPort),
- video_streaming_port_(kDefaultVideoStreamingPort),
- audio_streaming_port_(kDefaultAudioStreamingPort),
- time_testing_port_(kDefaultTimeTestingPort),
- hmi_capabilities_file_name_(kDefaultHmiCapabilitiesFileName),
- help_prompt_(),
- time_out_promt_(),
- min_tread_stack_size_(threads::Thread::kMinStackSize),
- is_mixing_audio_supported_(false),
- is_redecoding_enabled_(false),
- max_cmd_id_(kDefaultMaxCmdId),
- default_timeout_(kDefaultTimeout),
- app_resuming_timeout_(kDefaultAppResumingTimeout),
- app_dir_quota_(kDefaultDirQuota),
- app_hmi_level_none_time_scale_max_requests_(
- kDefaultAppHmiLevelNoneTimeScaleMaxRequests),
- app_hmi_level_none_requests_time_scale_(
- kDefaultAppHmiLevelNoneRequestsTimeScale),
- app_time_scale_max_requests_(kDefaultAppTimeScaleMaxRequests),
- app_requests_time_scale_(kDefaultAppRequestsTimeScale),
- pending_requests_amount_(kDefaultPendingRequestsAmount),
- put_file_in_none_(kDefaultPutFileRequestInNone),
- delete_file_in_none_(kDefaultDeleteFileRequestInNone),
- list_files_in_none_(kDefaultListFilesRequestInNone),
- app_info_storage_(kDefaultAppInfoFileName),
- heart_beat_timeout_(kDefaultHeartBeatTimeout),
- policy_snapshot_file_name_(kDefaultPoliciesSnapshotFileName),
- enable_policy_(false),
- transport_manager_disconnect_timeout_(
- kDefaultTransportManagerDisconnectTimeout),
- use_last_state_(false),
- supported_diag_modes_(),
- system_files_path_(kDefaultSystemFilesPath),
- transport_manager_tcp_adapter_port_(kDefautTransportManagerTCPPort),
- tts_delimiter_(kDefaultTtsDelimiter),
- mme_db_name_(kDefaultMmeDatabaseName),
- event_mq_name_(kDefaultEventMQ),
- ack_mq_name_(kDefaultAckMQ),
- recording_file_source_(kDefaultRecordingFileSourceName),
- recording_file_name_(kDefaultRecordingFileName),
- application_list_update_timeout_(kDefaultApplicationListUpdateTimeout),
- iap_legacy_protocol_mask_(kDefaultLegacyProtocolMask),
- iap_hub_protocol_mask_(kDefaultHubProtocolMask),
- iap_pool_protocol_mask_(kDefaultPoolProtocolMask),
- iap_system_config_(kDefaultIAPSystemConfig),
- iap2_system_config_(kDefaultIAP2SystemConfig),
- iap2_hub_connect_attempts_(kDefaultIAP2HubConnectAttempts),
- iap_hub_connection_wait_timeout_(kDefaultIAPHubConnectionWaitTimeout),
- tts_global_properties_timeout_(kDefaultTTSGlobalPropertiesTimeout) {
+ : sdl_version_(kDefaultSDLVersion),
+ launch_hmi_(true),
+#ifdef WEB_HMI
+ link_to_web_hmi_(kDefaultLinkToWebHMI),
+#endif // WEB_HMI
+ app_config_folder_(),
+ app_storage_folder_(),
+ app_resourse_folder_(),
+ enable_protocol_4_(false),
+ app_icons_folder_(),
+ app_icons_folder_max_size_(kDefaultAppIconsFolderMaxSize),
+ app_icons_amount_to_remove_(kDefaultAppIconsAmountToRemove),
+ config_file_name_(kDefaultConfigFileName),
+ server_address_(kDefaultServerAddress),
+ server_port_(kDefaultServerPort),
+ video_streaming_port_(kDefaultVideoStreamingPort),
+ audio_streaming_port_(kDefaultAudioStreamingPort),
+ time_testing_port_(kDefaultTimeTestingPort),
+ hmi_capabilities_file_name_(kDefaultHmiCapabilitiesFileName),
+ help_prompt_(),
+ time_out_promt_(),
+ min_tread_stack_size_(threads::Thread::kMinStackSize),
+ is_mixing_audio_supported_(false),
+ is_redecoding_enabled_(false),
+ max_cmd_id_(kDefaultMaxCmdId),
+ default_timeout_(kDefaultTimeout),
+ app_resuming_timeout_(kDefaultAppResumingTimeout),
+ app_dir_quota_(kDefaultDirQuota),
+ app_hmi_level_none_time_scale_max_requests_(
+ kDefaultAppHmiLevelNoneTimeScaleMaxRequests),
+ app_hmi_level_none_requests_time_scale_(
+ kDefaultAppHmiLevelNoneRequestsTimeScale),
+ app_time_scale_max_requests_(kDefaultAppTimeScaleMaxRequests),
+ app_requests_time_scale_(kDefaultAppRequestsTimeScale),
+ pending_requests_amount_(kDefaultPendingRequestsAmount),
+ put_file_in_none_(kDefaultPutFileRequestInNone),
+ delete_file_in_none_(kDefaultDeleteFileRequestInNone),
+ list_files_in_none_(kDefaultListFilesRequestInNone),
+ app_info_storage_(kDefaultAppInfoFileName),
+ heart_beat_timeout_(kDefaultHeartBeatTimeout),
+ policy_snapshot_file_name_(kDefaultPoliciesSnapshotFileName),
+ enable_policy_(false),
+ transport_manager_disconnect_timeout_(
+ kDefaultTransportManagerDisconnectTimeout),
+ use_last_state_(false),
+ supported_diag_modes_(),
+ system_files_path_(kDefaultSystemFilesPath),
+ transport_manager_tcp_adapter_port_(kDefautTransportManagerTCPPort),
+ tts_delimiter_(kDefaultTtsDelimiter),
+ audio_data_stopped_timeout_(kDefaultAudioDataStoppedTimeout),
+ video_data_stopped_timeout_(kDefaultVideoDataStoppedTimeout),
+ mme_db_name_(kDefaultMmeDatabaseName),
+ event_mq_name_(kDefaultEventMQ),
+ ack_mq_name_(kDefaultAckMQ),
+ recording_file_source_(kDefaultRecordingFileSourceName),
+ recording_file_name_(kDefaultRecordingFileName),
+ application_list_update_timeout_(kDefaultApplicationListUpdateTimeout),
+ iap_legacy_protocol_mask_(kDefaultLegacyProtocolMask),
+ iap_hub_protocol_mask_(kDefaultHubProtocolMask),
+ iap_pool_protocol_mask_(kDefaultPoolProtocolMask),
+ iap_system_config_(kDefaultIAPSystemConfig),
+ iap2_system_config_(kDefaultIAP2SystemConfig),
+ iap2_hub_connect_attempts_(kDefaultIAP2HubConnectAttempts),
+ iap_hub_connection_wait_timeout_(kDefaultIAPHubConnectionWaitTimeout),
+ tts_global_properties_timeout_(kDefaultTTSGlobalPropertiesTimeout),
+ attempts_to_open_policy_db_(kDefaultAttemptsToOpenPolicyDB),
+ open_attempt_timeout_ms_(kDefaultAttemptsToOpenPolicyDB),
+ hash_string_size_(kDefaultHashStringSize) {
+ ReadStringValue(&sdl_version_, kDefaultSDLVersion,
+ kMainSection, kSDLVersionKey);
}
+
+
Profile::~Profile() {
}
void Profile::config_file_name(const std::string& fileName) {
- if (false == fileName.empty()) {
+ if (false == fileName.empty()) {
config_file_name_ = fileName;
UpdateValues();
}
@@ -266,10 +329,20 @@ const std::string& Profile::config_file_name() const {
return config_file_name_;
}
+const std::string& Profile::sdl_version() const {
+ return sdl_version_;
+}
+
bool Profile::launch_hmi() const {
return launch_hmi_;
}
+#ifdef WEB_HMI
+std::string Profile::link_to_web_hmi() const {
+ return link_to_web_hmi_;
+}
+#endif // WEB_HMI
+
const std::string& Profile::app_config_folder() const {
return app_config_folder_;
}
@@ -282,6 +355,22 @@ const std::string& Profile::app_resourse_folder() const {
return app_resourse_folder_;
}
+bool Profile::enable_protocol_4() const {
+ return enable_protocol_4_;
+}
+
+const std::string&Profile::app_icons_folder() const {
+ return app_icons_folder_;
+}
+
+const uint32_t&Profile::app_icons_folder_max_size() const {
+ return app_icons_folder_max_size_;
+}
+
+const uint32_t&Profile::app_icons_amount_to_remove() const {
+ return app_icons_amount_to_remove_;
+}
+
const std::string& Profile::hmi_capabilities_file_name() const {
return hmi_capabilities_file_name_;
}
@@ -314,6 +403,10 @@ const uint32_t& Profile::app_resuming_timeout() const {
return app_resuming_timeout_;
}
+const uint32_t& Profile::app_resumption_save_persistent_data_timeout() const {
+ return app_resumption_save_persistent_data_timeout_;
+}
+
const std::string& Profile::vr_help_title() const {
return vr_help_title_;
}
@@ -330,11 +423,14 @@ const uint16_t& Profile::audio_streaming_port() const {
return audio_streaming_port_;
}
+uint32_t Profile::stop_streaming_timeout() const {
+ return stop_streaming_timeout_;
+}
+
const uint16_t& Profile::time_testing_port() const {
return time_testing_port_;
}
-
const uint64_t& Profile::thread_min_stack_size() const {
return min_tread_stack_size_;
}
@@ -383,6 +479,13 @@ const std::string& Profile::audio_stream_file() const {
return audio_stream_file_;
}
+const std::uint32_t Profile::audio_data_stopped_timeout() const {
+ return audio_data_stopped_timeout_;
+}
+
+const std::uint32_t Profile::video_data_stopped_timeout() const {
+ return video_data_stopped_timeout_;
+}
const uint32_t& Profile::app_time_scale() const {
return app_requests_time_scale_;
@@ -476,24 +579,24 @@ uint32_t Profile::application_list_update_timeout() const {
return application_list_update_timeout_;
}
-const std::pair<uint32_t, int32_t>& Profile::read_did_frequency() const {
+const std::pair<uint32_t, int32_t>& Profile::read_did_frequency() const {
return read_did_frequency_;
}
-const std::pair<uint32_t, int32_t>& Profile::get_vehicle_data_frequency() const {
+const std::pair<uint32_t, int32_t>& Profile::get_vehicle_data_frequency() const {
return get_vehicle_data_frequency_;
}
-const std::pair<uint32_t, int32_t>& Profile::start_stream_retry_amount() const {
+const std::pair<uint32_t, int32_t>& Profile::start_stream_retry_amount() const {
return start_stream_retry_amount_;
}
-uint32_t Profile::thread_pool_size() const {
+uint32_t Profile::thread_pool_size() const {
return max_thread_pool_size_;
}
-uint32_t Profile::default_hub_protocol_index() const{
- return default_hub_protocol_index_;
+uint32_t Profile::default_hub_protocol_index() const {
+ return default_hub_protocol_index_;
}
const std::string& Profile::iap_legacy_protocol_mask() const {
@@ -524,12 +627,80 @@ int Profile::iap_hub_connection_wait_timeout() const {
return iap_hub_connection_wait_timeout_;
}
+size_t Profile::maximum_payload_size() const {
+ size_t maximum_payload_size = 0;
+ ReadUIntValue(&maximum_payload_size, kDefaultMaximumPayloadSize,
+ kProtocolHandlerSection, kMaximumPayloadSizeKey);
+ return maximum_payload_size;
+}
+
+size_t Profile::message_frequency_count() const {
+ size_t message_frequency_count = 0;
+ ReadUIntValue(&message_frequency_count, kDefaultFrequencyCount,
+ kProtocolHandlerSection, kFrequencyCount);
+ return message_frequency_count;
+}
+
+size_t Profile::message_frequency_time() const {
+ size_t message_frequency_time = 0;
+ ReadUIntValue(&message_frequency_time, kDefaultFrequencyTime,
+ kProtocolHandlerSection, kFrequencyTime);
+ return message_frequency_time;
+}
+
+bool Profile::malformed_message_filtering() const {
+ bool malformed_message_filtering = 0;
+ ReadBoolValue(&malformed_message_filtering, kDefaulMalformedMessageFiltering,
+ kProtocolHandlerSection, kMalformedMessageFiltering);
+ return malformed_message_filtering;
+}
+
+size_t Profile::malformed_frequency_count() const {
+ size_t malformed_frequency_count = 0;
+ ReadUIntValue(&malformed_frequency_count, kDefaultMalformedFrequencyCount,
+ kProtocolHandlerSection, kMalformedFrequencyCount);
+ return malformed_frequency_count;
+}
+
+size_t Profile::malformed_frequency_time() const {
+ size_t malformed_frequency_time = 0;
+ ReadUIntValue(&malformed_frequency_time, kDefaultMalformedFrequencyTime,
+ kProtocolHandlerSection, kMalformedFrequencyTime);
+ return malformed_frequency_time;
+}
+
+uint16_t Profile::attempts_to_open_policy_db() const {
+ return attempts_to_open_policy_db_;
+}
+
+uint16_t Profile::open_attempt_timeout_ms() const {
+ return open_attempt_timeout_ms_;
+}
+
+uint32_t Profile::resumption_delay_before_ign() const {
+ return resumption_delay_before_ign_;
+}
+
+uint32_t Profile::resumption_delay_after_ign() const {
+ return resumption_delay_after_ign_;
+}
+
+uint32_t Profile::hash_string_size() const {
+ return hash_string_size_;
+}
+
uint16_t Profile::tts_global_properties_timeout() const {
return tts_global_properties_timeout_;
}
void Profile::UpdateValues() {
- LOG4CXX_INFO(logger_, "Profile::UpdateValues");
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // SDL version
+ ReadStringValue(&sdl_version_, kDefaultSDLVersion,
+ kMainSection, kSDLVersionKey);
+
+ LOG_UPDATED_VALUE(sdl_version_, kSDLVersionKey, kMainSection);
// Launch HMI parameter
std::string launch_value;
@@ -540,13 +711,24 @@ void Profile::UpdateValues() {
launch_hmi_ = false;
}
- LOG_UPDATED_BOOL_VALUE(launch_hmi_, kLaunchHMIKey, kHmiSection);
+ LOG_UPDATED_BOOL_VALUE(launch_hmi_, kLaunchHMIKey, kHmiSection);
+
+#ifdef WEB_HMI
+ // Link to web HMI parameter
+ ReadStringValue(&link_to_web_hmi_, kDefaultLinkToWebHMI,
+ kHmiSection, kLinkToWebHMI);
+ LOG_UPDATED_BOOL_VALUE(link_to_web_hmi_, kLinkToWebHMI, kHmiSection);
+#endif // WEB_HMI
// Application config folder
ReadStringValue(&app_config_folder_,
file_system::CurrentWorkingDirectory().c_str(),
kMainSection, kAppConfigFolderKey);
+ if (IsRelativePath(app_config_folder_)) {
+ MakeAbsolutePath(app_config_folder_);
+ }
+
LOG_UPDATED_VALUE(app_config_folder_, kAppConfigFolderKey, kMainSection);
// Application storage folder
@@ -554,6 +736,10 @@ void Profile::UpdateValues() {
file_system::CurrentWorkingDirectory().c_str(),
kMainSection, kAppStorageFolderKey);
+ if (IsRelativePath(app_storage_folder_)) {
+ MakeAbsolutePath(app_storage_folder_);
+ }
+
LOG_UPDATED_VALUE(app_storage_folder_, kAppStorageFolderKey, kMainSection);
// Application resourse folder
@@ -561,43 +747,82 @@ void Profile::UpdateValues() {
file_system::CurrentWorkingDirectory().c_str(),
kMainSection, kAppResourseFolderKey);
-LOG_UPDATED_VALUE(app_resourse_folder_, kAppResourseFolderKey,
+ if (IsRelativePath(app_resourse_folder_)) {
+ MakeAbsolutePath(app_resourse_folder_);
+ }
+
+ LOG_UPDATED_VALUE(app_resourse_folder_, kAppResourseFolderKey,
kMainSection);
-LOG_UPDATED_VALUE(app_info_storage_, kAppInfoStorageKey,
- kAppInfoSection);
- app_info_storage_ = app_storage_folder_ + "/" + app_info_storage_;
+ // Enable protocol ver.4 parameter
+ std::string enable_protocol_4_value;
+ if (ReadValue(&enable_protocol_4_value, kSDL4Section, kEnableProtocol4Key) &&
+ 0 == strcmp("true", enable_protocol_4_value.c_str())) {
+ enable_protocol_4_ = true;
+ } else {
+ enable_protocol_4_ = false;
+ }
+
+ LOG_UPDATED_BOOL_VALUE(enable_protocol_4_, kEnableProtocol4Key, kSDL4Section);
+
+ // Application icon folder
+ ReadStringValue(&app_icons_folder_,
+ file_system::CurrentWorkingDirectory().c_str(),
+ kSDL4Section, kAppIconsFolderKey);
-// Application info file name
-ReadStringValue(&app_info_storage_, kDefaultAppInfoFileName,
+ if (IsRelativePath(app_icons_folder_)) {
+ MakeAbsolutePath(app_icons_folder_);
+ }
+
+ LOG_UPDATED_VALUE(app_icons_folder_, kAppIconsFolderKey,
+ kSDL4Section);
+
+ // Application icon folder maximum size
+ ReadUIntValue(&app_icons_folder_max_size_, kDefaultAppIconsFolderMaxSize,
+ kSDL4Section, kAppIconsFolderMaxSizeKey);
+
+ if (app_icons_folder_max_size_ < kDefaultAppIconsFolderMaxSize) {
+ app_icons_folder_max_size_ = kDefaultAppIconsFolderMaxSize;
+ }
+
+ LOG_UPDATED_VALUE(app_icons_folder_max_size_, kAppIconsFolderMaxSizeKey,
+ kSDL4Section);
+
+ // Application icon folder maximum size
+ ReadUIntValue(&app_icons_amount_to_remove_, kDefaultAppIconsAmountToRemove,
+ kSDL4Section, kAppIconsAmountToRemoveKey);
+
+ LOG_UPDATED_VALUE(app_icons_amount_to_remove_, kAppIconsAmountToRemoveKey,
+ kSDL4Section);
+
+ // Application info file name
+ ReadStringValue(&app_info_storage_, kDefaultAppInfoFileName,
kAppInfoSection,
kAppInfoStorageKey);
- LOG_UPDATED_VALUE(app_info_storage_, kAppInfoStorageKey,
+ LOG_UPDATED_VALUE(app_info_storage_, kAppInfoStorageKey,
kAppInfoSection);
-// Server address
- ReadStringValue(&server_address_, kDefaultServerAddress, kHmiSection,
- kServerAddressKey);
+ // Server address
+ ReadStringValue(&server_address_, kDefaultServerAddress, kHmiSection,
+ kServerAddressKey);
LOG_UPDATED_VALUE(server_address_, kServerAddressKey, kHmiSection);
- LOG_UPDATED_VALUE(server_address_, kServerAddressKey, kHmiSection);
-
-// HMI capabilities
+ // HMI capabilities
ReadStringValue(&hmi_capabilities_file_name_ ,
kDefaultHmiCapabilitiesFileName,
kMainSection, kHmiCapabilitiesKey);
- hmi_capabilities_file_name_ = app_config_folder_ + "/" +
- hmi_capabilities_file_name_;
+ hmi_capabilities_file_name_ = app_config_folder_ + "/" +
+ hmi_capabilities_file_name_;
- LOG_UPDATED_VALUE(hmi_capabilities_file_name_, kHmiCapabilitiesKey,
- kMainSection);
+ LOG_UPDATED_VALUE(hmi_capabilities_file_name_, kHmiCapabilitiesKey,
+ kMainSection);
- // Server port
- ReadUIntValue(&server_port_, kDefaultServerPort, kHmiSection,
- kServerPortKey);
+ // Server port
+ ReadUIntValue(&server_port_, kDefaultServerPort, kHmiSection,
+ kServerPortKey);
LOG_UPDATED_VALUE(server_port_, kServerPortKey, kHmiSection);
@@ -606,97 +831,116 @@ ReadStringValue(&app_info_storage_, kDefaultAppInfoFileName,
kHmiSection, kVideoStreamingPortKey);
LOG_UPDATED_VALUE(video_streaming_port_, kVideoStreamingPortKey,
- kHmiSection);
+ kHmiSection);
// Audio streaming port
ReadUIntValue(&audio_streaming_port_, kDefaultAudioStreamingPort,
kHmiSection, kAudioStreamingPortKey);
- LOG_UPDATED_VALUE(audio_streaming_port_, kAudioStreamingPortKey,
- kHmiSection);
+ LOG_UPDATED_VALUE(audio_streaming_port_, kAudioStreamingPortKey,
+ kHmiSection);
+ // Streaming timeout
+ ReadUIntValue(&stop_streaming_timeout_, kDefaultStopStreamingTimeout,
+ kMediaManagerSection, kStopStreamingTimeout);
- // Time testing port
- ReadUIntValue(&time_testing_port_, kDefaultTimeTestingPort, kMainSection,
- kTimeTestingPortKey);
+ stop_streaming_timeout_ = std::max(kDefaultStopStreamingTimeout, stop_streaming_timeout_);
- LOG_UPDATED_VALUE(time_testing_port_, kTimeTestingPortKey, kMainSection);
+ LOG_UPDATED_VALUE(stop_streaming_timeout_, kStopStreamingTimeout,
+ kHmiSection);
- // Minimum thread stack size
- ReadUIntValue(&min_tread_stack_size_, threads::Thread::kMinStackSize,
- kMainSection, kThreadStackSizeKey);
+ // Time testing port
+ ReadUIntValue(&time_testing_port_, kDefaultTimeTestingPort, kMainSection,
+ kTimeTestingPortKey);
- if (min_tread_stack_size_ < threads::Thread::kMinStackSize) {
- min_tread_stack_size_ = threads::Thread::kMinStackSize;
- }
+ LOG_UPDATED_VALUE(time_testing_port_, kTimeTestingPortKey, kMainSection);
- LOG_UPDATED_VALUE(min_tread_stack_size_, kThreadStackSizeKey, kMainSection);
+ // Minimum thread stack size
+ ReadUIntValue(&min_tread_stack_size_, threads::Thread::kMinStackSize,
+ kMainSection, kThreadStackSizeKey);
- // Start stream retry frequency
- ReadUintIntPairValue(&start_stream_retry_amount_, kStartStreamRetryAmount,
- kMediaManagerSection, kStartStreamRetry);
+ if (min_tread_stack_size_ < threads::Thread::kMinStackSize) {
+ min_tread_stack_size_ = threads::Thread::kMinStackSize;
+ }
- // Redecoding parameter
- std::string redecoding_value;
- if (ReadValue(&redecoding_value, kMediaManagerSection, kEnableRedecodingKey)
- && 0 == strcmp("true", redecoding_value.c_str())) {
- is_redecoding_enabled_ = true;
- } else {
- is_redecoding_enabled_ = false;
- }
+ LOG_UPDATED_VALUE(min_tread_stack_size_, kThreadStackSizeKey, kMainSection);
+
+ // Start stream retry frequency
+ ReadUintIntPairValue(&start_stream_retry_amount_, kStartStreamRetryAmount,
+ kMediaManagerSection, kStartStreamRetry);
+
+ // Redecoding parameter
+ std::string redecoding_value;
+ if (ReadValue(&redecoding_value, kMediaManagerSection, kEnableRedecodingKey)
+ && 0 == strcmp("true", redecoding_value.c_str())) {
+ is_redecoding_enabled_ = true;
+ } else {
+ is_redecoding_enabled_ = false;
+ }
- LOG_UPDATED_BOOL_VALUE(is_redecoding_enabled_, kEnableRedecodingKey,
- kMediaManagerSection);
+ LOG_UPDATED_BOOL_VALUE(is_redecoding_enabled_, kEnableRedecodingKey,
+ kMediaManagerSection);
- // Video consumer type
- ReadStringValue(&video_consumer_type_, "", kMediaManagerSection,
- kVideoStreamConsumerKey);
+ // Video consumer type
+ ReadStringValue(&video_consumer_type_, "", kMediaManagerSection,
+ kVideoStreamConsumerKey);
LOG_UPDATED_VALUE(video_consumer_type_, kVideoStreamConsumerKey,
- kMediaManagerSection);
+ kMediaManagerSection);
- // Audio stream consumer
- ReadStringValue(&audio_consumer_type_, "", kMediaManagerSection,
- kAudioStreamConsumerKey);
+ // Audio stream consumer
+ ReadStringValue(&audio_consumer_type_, "", kMediaManagerSection,
+ kAudioStreamConsumerKey);
- LOG_UPDATED_VALUE(audio_consumer_type_, kAudioStreamConsumerKey,
- kMediaManagerSection);
+ LOG_UPDATED_VALUE(audio_consumer_type_, kAudioStreamConsumerKey,
+ kMediaManagerSection);
- // Named video pipe path
- ReadStringValue(&named_video_pipe_path_, "" , kMediaManagerSection,
- kNamedVideoPipePathKey);
+ // Named video pipe path
+ ReadStringValue(&named_video_pipe_path_, "", kMediaManagerSection,
+ kNamedVideoPipePathKey);
- named_video_pipe_path_ = app_storage_folder_ + "/" + named_video_pipe_path_;
+ named_video_pipe_path_ = app_storage_folder_ + "/" + named_video_pipe_path_;
- LOG_UPDATED_VALUE(named_video_pipe_path_, kNamedVideoPipePathKey,
- kMediaManagerSection);
+ LOG_UPDATED_VALUE(named_video_pipe_path_, kNamedVideoPipePathKey,
+ kMediaManagerSection);
- // Named audio pipe path
- ReadStringValue(&named_audio_pipe_path_, "" , kMediaManagerSection,
- kNamedAudioPipePathKey);
+ // Named audio pipe path
+ ReadStringValue(&named_audio_pipe_path_, "", kMediaManagerSection,
+ kNamedAudioPipePathKey);
- named_audio_pipe_path_ = app_storage_folder_ + "/" + named_audio_pipe_path_;
+ named_audio_pipe_path_ = app_storage_folder_ + "/" + named_audio_pipe_path_;
- LOG_UPDATED_VALUE(named_audio_pipe_path_, kNamedAudioPipePathKey,
- kMediaManagerSection);
+ LOG_UPDATED_VALUE(named_audio_pipe_path_, kNamedAudioPipePathKey,
+ kMediaManagerSection);
- // Video stream file
- ReadStringValue(&video_stream_file_, "", kMediaManagerSection,
- kVideoStreamFileKey);
+ // Video stream file
+ ReadStringValue(&video_stream_file_, "", kMediaManagerSection,
+ kVideoStreamFileKey);
- video_stream_file_ = app_storage_folder_ + "/" + video_stream_file_;
+ video_stream_file_ = app_storage_folder_ + "/" + video_stream_file_;
- LOG_UPDATED_VALUE(video_stream_file_, kVideoStreamFileKey,
- kMediaManagerSection);
+ LOG_UPDATED_VALUE(video_stream_file_, kVideoStreamFileKey,
+ kMediaManagerSection);
- // Audio stream file
- ReadStringValue(&audio_stream_file_, "", kMediaManagerSection,
- kAudioStreamFileKey);
+ // Audio stream file
+ ReadStringValue(&audio_stream_file_, "", kMediaManagerSection,
+ kAudioStreamFileKey);
- audio_stream_file_ = app_storage_folder_ + "/" + audio_stream_file_;
+ audio_stream_file_ = app_storage_folder_ + "/" + audio_stream_file_;
- LOG_UPDATED_VALUE(audio_stream_file_, kAudioStreamFileKey,
- kMediaManagerSection);
+ LOG_UPDATED_VALUE(audio_stream_file_, kAudioStreamFileKey,
+ kMediaManagerSection);
+
+ ReadUIntValue(&audio_data_stopped_timeout_, kDefaultAudioDataStoppedTimeout,
+ kMediaManagerSection, kAudioDataStoppedTimeoutKey);
+ LOG_UPDATED_VALUE(audio_data_stopped_timeout_, kAudioDataStoppedTimeoutKey,
+ kMediaManagerSection);
+
+ ReadUIntValue(&video_data_stopped_timeout_, kDefaultVideoDataStoppedTimeout,
+ kMediaManagerSection, kVideoDataStoppedTimeoutKey);
+
+ LOG_UPDATED_VALUE(video_data_stopped_timeout_, kVideoDataStoppedTimeoutKey,
+ kMediaManagerSection);
// Mixing audio parameter
std::string mixing_audio_value;
@@ -707,211 +951,222 @@ ReadStringValue(&app_info_storage_, kDefaultAppInfoFileName,
is_mixing_audio_supported_ = false;
}
- LOG_UPDATED_BOOL_VALUE(is_mixing_audio_supported_, kMixingAudioSupportedKey,
- kMainSection);
-
- // Maximum command id value
- ReadUIntValue(&max_cmd_id_, kDefaultMaxCmdId, kMainSection, kMaxCmdIdKey);
+ LOG_UPDATED_BOOL_VALUE(is_mixing_audio_supported_, kMixingAudioSupportedKey,
+ kMainSection);
- if (max_cmd_id_ < 0) {
- max_cmd_id_ = kDefaultMaxCmdId;
- }
+ // Maximum command id value
+ ReadUIntValue(&max_cmd_id_, kDefaultMaxCmdId, kMainSection, kMaxCmdIdKey);
- LOG_UPDATED_VALUE(max_cmd_id_, kMaxCmdIdKey, kMainSection);
+ LOG_UPDATED_VALUE(max_cmd_id_, kMaxCmdIdKey, kMainSection);
- // PutFile restrictions
- ReadUIntValue(&put_file_in_none_, kDefaultPutFileRequestInNone,
- kFilesystemRestrictionsSection, kPutFileRequestKey);
+ // PutFile restrictions
+ ReadUIntValue(&put_file_in_none_, kDefaultPutFileRequestInNone,
+ kFilesystemRestrictionsSection, kPutFileRequestKey);
- if (put_file_in_none_ < 0) {
- put_file_in_none_ = kDefaultPutFileRequestInNone;
- }
+ LOG_UPDATED_VALUE(put_file_in_none_, kPutFileRequestKey,
+ kFilesystemRestrictionsSection);
- LOG_UPDATED_VALUE(put_file_in_none_, kPutFileRequestKey,
- kFilesystemRestrictionsSection);
+ // DeleteFileRestrictions
+ ReadUIntValue(&delete_file_in_none_, kDefaultDeleteFileRequestInNone,
+ kFilesystemRestrictionsSection, kDeleteFileRequestKey);
- // DeleteFileRestrictions
- ReadUIntValue(&delete_file_in_none_, kDefaultDeleteFileRequestInNone,
- kFilesystemRestrictionsSection, kDeleteFileRequestKey);
+ LOG_UPDATED_VALUE(delete_file_in_none_, kDeleteFileRequestKey,
+ kFilesystemRestrictionsSection);
- if (delete_file_in_none_ < 0) {
- delete_file_in_none_ = kDefaultDeleteFileRequestInNone;
- }
+ // ListFiles restrictions
+ ReadUIntValue(&list_files_in_none_, kDefaultListFilesRequestInNone,
+ kFilesystemRestrictionsSection, kListFilesRequestKey);
- LOG_UPDATED_VALUE(delete_file_in_none_, kDeleteFileRequestKey,
- kFilesystemRestrictionsSection);
+ LOG_UPDATED_VALUE(list_files_in_none_, kListFilesRequestKey,
+ kFilesystemRestrictionsSection);
- // ListFiles restrictions
- ReadUIntValue(&list_files_in_none_, kDefaultListFilesRequestInNone,
- kFilesystemRestrictionsSection, kListFilesRequestKey);
+ // Default timeout
+ ReadUIntValue(&default_timeout_, kDefaultTimeout, kMainSection,
+ kDefaultTimeoutKey);
- if (list_files_in_none_ < 0) {
- list_files_in_none_ = kDefaultListFilesRequestInNone;
+ if (default_timeout_ == 0) {
+ default_timeout_ = kDefaultTimeout;
}
- LOG_UPDATED_VALUE(list_files_in_none_, kListFilesRequestKey,
- kFilesystemRestrictionsSection);
+ LOG_UPDATED_VALUE(default_timeout_, kDefaultTimeoutKey, kMainSection);
- // Default timeout
- ReadUIntValue(&default_timeout_, kDefaultTimeout, kMainSection,
- kDefaultTimeoutKey);
+ // Application resuming timeout
+ ReadUIntValue(&app_resuming_timeout_, kDefaultAppResumingTimeout,
+ kResumptionSection, kAppResumingTimeoutKey);
- if (default_timeout_ <= 0) {
- default_timeout_ = kDefaultTimeout;
+ if (app_resuming_timeout_ == 0) {
+ app_resuming_timeout_ = kDefaultAppResumingTimeout;
+ }
+ // Save resumption info to File System
+ LOG_UPDATED_VALUE(app_resuming_timeout_, kAppSavePersistentDataTimeoutKey,
+ kResumptionSection);
+
+ ReadUIntValue(&app_resumption_save_persistent_data_timeout_,
+ kDefaultAppSavePersistentDataTimeout,
+ kResumptionSection, kAppSavePersistentDataTimeoutKey);
+ if (app_resuming_timeout_ == 0) {
+ app_resuming_timeout_ = kDefaultAppSavePersistentDataTimeout;
}
- LOG_UPDATED_VALUE(default_timeout_, kDefaultTimeoutKey, kMainSection);
+ LOG_UPDATED_VALUE(app_resuming_timeout_, kAppResumingTimeoutKey,
+ kResumptionSection);
+ // Open attempt timeout in ms
+ ReadUIntValue(&resumption_delay_before_ign_,
+ kDefaultResumptionDelayBeforeIgn,
+ kResumptionSection,
+ kResumptionDelayBeforeIgnKey);
- // Application resuming timeout
- ReadUIntValue(&app_resuming_timeout_, kDefaultAppResumingTimeout,
- kMainSection, kAppResumingTimeoutKey);
+ LOG_UPDATED_VALUE(resumption_delay_before_ign_,
+ kResumptionDelayBeforeIgnKey, kResumptionSection);
- if (app_resuming_timeout_ <= 0) {
- app_resuming_timeout_ = kDefaultAppResumingTimeout;
- }
+ // Open attempt timeout in ms
+ ReadUIntValue(&resumption_delay_after_ign_,
+ kDefaultResumptionDelayAfterIgn,
+ kResumptionSection,
+ kResumptionDelayAfterIgnKey);
- LOG_UPDATED_VALUE(app_resuming_timeout_, kAppResumingTimeoutKey,
- kMainSection);
+ LOG_UPDATED_VALUE(resumption_delay_after_ign_,
+ kResumptionDelayAfterIgnKey, kResumptionSection);
- // Application directory quota
- ReadUIntValue(&app_dir_quota_, kDefaultDirQuota, kMainSection,
- kAppDirectoryQuotaKey);
+ // Application directory quota
+ ReadUIntValue(&app_dir_quota_, kDefaultDirQuota, kMainSection,
+ kAppDirectoryQuotaKey);
- if (app_dir_quota_ <= 0) {
- app_dir_quota_ = kDefaultDirQuota;
+ if (app_dir_quota_ == 0) {
+ app_dir_quota_ = kDefaultDirQuota;
}
- LOG_UPDATED_VALUE(app_dir_quota_, kAppDirectoryQuotaKey, kMainSection);
+ LOG_UPDATED_VALUE(app_dir_quota_, kAppDirectoryQuotaKey, kMainSection);
- // TTS delimiter
- // Should be gotten before any TTS prompts, since it should be appended back
- ReadStringValue(&tts_delimiter_, kDefaultTtsDelimiter,
- kGlobalPropertiesSection, kTTSDelimiterKey);
+ // TTS delimiter
+ // Should be gotten before any TTS prompts, since it should be appended back
+ ReadStringValue(&tts_delimiter_, kDefaultTtsDelimiter,
+ kGlobalPropertiesSection, kTTSDelimiterKey);
- LOG_UPDATED_VALUE(tts_delimiter_, kTTSDelimiterKey,
- kGlobalPropertiesSection);
+ LOG_UPDATED_VALUE(tts_delimiter_, kTTSDelimiterKey,
+ kGlobalPropertiesSection);
- // Help prompt
+ // Help prompt
help_prompt_.clear();
- std::string help_prompt_value;
- if (ReadValue(&help_prompt_value, kGlobalPropertiesSection,
- kHelpPromptKey)) {
+ std::string help_prompt_value;
+ if (ReadValue(&help_prompt_value, kGlobalPropertiesSection,
+ kHelpPromptKey)) {
char* str = NULL;
- str = strtok(const_cast<char*>(help_prompt_value.c_str()), ",");
+ str = strtok(const_cast<char*>(help_prompt_value.c_str()), ",");
while (str != NULL) {
- // Default prompt should have delimiter included for each item
- const std::string prompt_item = std::string(str)+tts_delimiter_;
- help_prompt_.push_back(prompt_item);
- LOG_UPDATED_VALUE(prompt_item, kHelpPromptKey,
- kGlobalPropertiesSection);
+ // Default prompt should have delimiter included for each item
+ const std::string prompt_item = std::string(str) + tts_delimiter_;
+ help_prompt_.push_back(prompt_item);
+ LOG_UPDATED_VALUE(prompt_item, kHelpPromptKey,
+ kGlobalPropertiesSection);
str = strtok(NULL, ",");
}
- } else {
- help_prompt_value.clear();
- LOG_UPDATED_VALUE(help_prompt_value, kHelpPromptKey,
- kGlobalPropertiesSection);
+ } else {
+ help_prompt_value.clear();
+ LOG_UPDATED_VALUE(help_prompt_value, kHelpPromptKey,
+ kGlobalPropertiesSection);
}
- // Timeout prompt
+ // Timeout prompt
time_out_promt_.clear();
- std::string timeout_prompt_value;
- if (ReadValue(&timeout_prompt_value, kGlobalPropertiesSection,
- kTimeoutPromptKey)) {
+ std::string timeout_prompt_value;
+ if (ReadValue(&timeout_prompt_value, kGlobalPropertiesSection,
+ kTimeoutPromptKey)) {
char* str = NULL;
- str = strtok(const_cast<char*>(timeout_prompt_value.c_str()), ",");
+ str = strtok(const_cast<char*>(timeout_prompt_value.c_str()), ",");
while (str != NULL) {
- // Default prompt should have delimiter included for each item
- const std::string prompt_item = std::string(str)+tts_delimiter_;
- time_out_promt_.push_back(prompt_item);
- LOG_UPDATED_VALUE(prompt_item, kTimeoutPromptKey,
- kGlobalPropertiesSection);
+ // Default prompt should have delimiter included for each item
+ const std::string prompt_item = std::string(str) + tts_delimiter_;
+ time_out_promt_.push_back(prompt_item);
+ LOG_UPDATED_VALUE(prompt_item, kTimeoutPromptKey,
+ kGlobalPropertiesSection);
str = strtok(NULL, ",");
}
- } else {
- timeout_prompt_value.clear();
- LOG_UPDATED_VALUE(timeout_prompt_value, kTimeoutPromptKey,
- kGlobalPropertiesSection);
+ } else {
+ timeout_prompt_value.clear();
+ LOG_UPDATED_VALUE(timeout_prompt_value, kTimeoutPromptKey,
+ kGlobalPropertiesSection);
}
- // Voice recognition help title
- ReadStringValue(&vr_help_title_, "", kGlobalPropertiesSection,
- kHelpTitleKey);
+ // Voice recognition help title
+ ReadStringValue(&vr_help_title_, "", kGlobalPropertiesSection,
+ kHelpTitleKey);
- LOG_UPDATED_VALUE(vr_help_title_, kHelpTitleKey,
- kGlobalPropertiesSection);
+ LOG_UPDATED_VALUE(vr_help_title_, kHelpTitleKey,
+ kGlobalPropertiesSection);
- // Voice recognition help command
+ // Voice recognition help command
vr_commands_.clear();
- std::string vr_help_command_value;
- if (ReadValue(&vr_help_command_value, kVrCommandsSection,
- kHelpCommandKey)) {
+ std::string vr_help_command_value;
+ if (ReadValue(&vr_help_command_value, kVrCommandsSection,
+ kHelpCommandKey)) {
char* str = NULL;
- str = strtok(const_cast<char*>(vr_help_command_value.c_str()), ",");
+ str = strtok(const_cast<char*>(vr_help_command_value.c_str()), ",");
while (str != NULL) {
- const std::string vr_item = str;
- vr_commands_.push_back(vr_item);
- LOG_UPDATED_VALUE(vr_item, kHelpCommandKey, kVrCommandsSection);
+ const std::string vr_item = str;
+ vr_commands_.push_back(vr_item);
+ LOG_UPDATED_VALUE(vr_item, kHelpCommandKey, kVrCommandsSection);
str = strtok(NULL, ",");
}
- } else {
- vr_help_command_value.clear();
- LOG_UPDATED_VALUE(vr_help_command_value, kHelpCommandKey,
- kVrCommandsSection);
- }
+ } else {
+ vr_help_command_value.clear();
+ LOG_UPDATED_VALUE(vr_help_command_value, kHelpCommandKey,
+ kVrCommandsSection);
+ }
- //TTS GlobalProperties timeout
- ReadUIntValue(&tts_global_properties_timeout_,
- kDefaultTTSGlobalPropertiesTimeout,
- kGlobalPropertiesSection,
- kTTSGlobalPropertiesTimeoutKey);
+ //TTS GlobalProperties timeout
+ ReadUIntValue(&tts_global_properties_timeout_,
+ kDefaultTTSGlobalPropertiesTimeout,
+ kGlobalPropertiesSection,
+ kTTSGlobalPropertiesTimeoutKey);
- LOG_UPDATED_VALUE(tts_global_properties_timeout_, kTTSGlobalPropertiesTimeoutKey,
- kGlobalPropertiesSection);
+ LOG_UPDATED_VALUE(tts_global_properties_timeout_, kTTSGlobalPropertiesTimeoutKey,
+ kGlobalPropertiesSection);
- // Application time scale maximum requests
- ReadUIntValue(&app_time_scale_max_requests_,
- kDefaultAppTimeScaleMaxRequests,
- kMainSection,
- kAppTimeScaleMaxRequestsKey);
+ // Application time scale maximum requests
+ ReadUIntValue(&app_time_scale_max_requests_,
+ kDefaultAppTimeScaleMaxRequests,
+ kMainSection,
+ kAppTimeScaleMaxRequestsKey);
- LOG_UPDATED_VALUE(app_time_scale_max_requests_, kAppTimeScaleMaxRequestsKey,
- kMainSection);
+ LOG_UPDATED_VALUE(app_time_scale_max_requests_, kAppTimeScaleMaxRequestsKey,
+ kMainSection);
- // Application time scale
- ReadUIntValue(&app_requests_time_scale_, kDefaultAppRequestsTimeScale,
- kMainSection, kAppRequestsTimeScaleKey);
+ // Application time scale
+ ReadUIntValue(&app_requests_time_scale_, kDefaultAppRequestsTimeScale,
+ kMainSection, kAppRequestsTimeScaleKey);
- LOG_UPDATED_VALUE(app_requests_time_scale_, kAppRequestsTimeScaleKey,
- kMainSection);
+ LOG_UPDATED_VALUE(app_requests_time_scale_, kAppRequestsTimeScaleKey,
+ kMainSection);
- // Application HMI level NONE time scale maximum requests
- ReadUIntValue(&app_hmi_level_none_time_scale_max_requests_,
- kDefaultAppHmiLevelNoneTimeScaleMaxRequests,
- kMainSection,
- kAppHmiLevelNoneTimeScaleMaxRequestsKey);
+ // Application HMI level NONE time scale maximum requests
+ ReadUIntValue(&app_hmi_level_none_time_scale_max_requests_,
+ kDefaultAppHmiLevelNoneTimeScaleMaxRequests,
+ kMainSection,
+ kAppHmiLevelNoneTimeScaleMaxRequestsKey);
- LOG_UPDATED_VALUE(app_hmi_level_none_time_scale_max_requests_,
- kAppHmiLevelNoneTimeScaleMaxRequestsKey,
- kMainSection);
+ LOG_UPDATED_VALUE(app_hmi_level_none_time_scale_max_requests_,
+ kAppHmiLevelNoneTimeScaleMaxRequestsKey,
+ kMainSection);
- // Application HMI level NONE requests time scale
- ReadUIntValue(&app_hmi_level_none_requests_time_scale_,
- kDefaultAppHmiLevelNoneRequestsTimeScale,
- kMainSection,
- kAppHmiLevelNoneRequestsTimeScaleKey);
+ // Application HMI level NONE requests time scale
+ ReadUIntValue(&app_hmi_level_none_requests_time_scale_,
+ kDefaultAppHmiLevelNoneRequestsTimeScale,
+ kMainSection,
+ kAppHmiLevelNoneRequestsTimeScaleKey);
- LOG_UPDATED_VALUE(app_hmi_level_none_requests_time_scale_,
- kAppHmiLevelNoneRequestsTimeScaleKey,
- kMainSection);
+ LOG_UPDATED_VALUE(app_hmi_level_none_requests_time_scale_,
+ kAppHmiLevelNoneRequestsTimeScaleKey,
+ kMainSection);
- // Amount of pending requests
- ReadUIntValue(&pending_requests_amount_, kDefaultPendingRequestsAmount,
- kMainSection, kPendingRequestsAmoundKey);
+ // Amount of pending requests
+ ReadUIntValue(&pending_requests_amount_, kDefaultPendingRequestsAmount,
+ kMainSection, kPendingRequestsAmoundKey);
- if (pending_requests_amount_ <= 0) {
- pending_requests_amount_ = kDefaultPendingRequestsAmount;
+ if (pending_requests_amount_ == 0) {
+ pending_requests_amount_ = kDefaultPendingRequestsAmount;
}
LOG_UPDATED_VALUE(pending_requests_amount_, kPendingRequestsAmoundKey,
@@ -922,11 +1177,12 @@ ReadStringValue(&app_info_storage_, kDefaultAppInfoFileName,
std::string supported_diag_modes_value;
std::string correct_diag_modes;
if (ReadStringValue(&supported_diag_modes_value, "", kMainSection,
- kSupportedDiagModesKey)) {
+ kSupportedDiagModesKey)) {
char* str = NULL;
str = strtok(const_cast<char*>(supported_diag_modes_value.c_str()), ",");
while (str != NULL) {
- uint32_t user_value = strtol(str, NULL, 16);
+ errno = 0;
+ uint32_t user_value = strtol(str, NULL, 16);
if (user_value && errno != ERANGE) {
correct_diag_modes += str;
correct_diag_modes += ",";
@@ -976,14 +1232,14 @@ ReadStringValue(&app_info_storage_, kDefaultAppInfoFileName,
kTransportManagerSection,
kMmeDatabaseNameKey);
-LOG_UPDATED_VALUE(mme_db_name_, kMmeDatabaseNameKey, kTransportManagerSection);
-// Event MQ
-ReadStringValue(&event_mq_name_,
-kDefaultEventMQ,
-kTransportManagerSection,
-kEventMQKey);
+ LOG_UPDATED_VALUE(mme_db_name_, kMmeDatabaseNameKey, kTransportManagerSection);
+ // Event MQ
+ ReadStringValue(&event_mq_name_,
+ kDefaultEventMQ,
+ kTransportManagerSection,
+ kEventMQKey);
-LOG_UPDATED_VALUE(event_mq_name_, kEventMQKey, kTransportManagerSection);
+ LOG_UPDATED_VALUE(event_mq_name_, kEventMQKey, kTransportManagerSection);
// Ack MQ
ReadStringValue(&ack_mq_name_,
@@ -993,15 +1249,15 @@ LOG_UPDATED_VALUE(event_mq_name_, kEventMQKey, kTransportManagerSection);
LOG_UPDATED_VALUE(ack_mq_name_, kAckMQKey, kTransportManagerSection);
- // Transport manager disconnect timeout
- ReadUIntValue(&transport_manager_disconnect_timeout_,
- kDefaultTransportManagerDisconnectTimeout,
- kTransportManagerSection,
- kTransportManagerDisconnectTimeoutKey);
+ // Transport manager disconnect timeout
+ ReadUIntValue(&transport_manager_disconnect_timeout_,
+ kDefaultTransportManagerDisconnectTimeout,
+ kTransportManagerSection,
+ kTransportManagerDisconnectTimeoutKey);
- LOG_UPDATED_VALUE(transport_manager_disconnect_timeout_,
- kTransportManagerDisconnectTimeoutKey,
- kTransportManagerSection);
+ LOG_UPDATED_VALUE(transport_manager_disconnect_timeout_,
+ kTransportManagerDisconnectTimeoutKey,
+ kTransportManagerSection);
// Recording file
ReadStringValue(&recording_file_name_, kDefaultRecordingFileName,
@@ -1033,6 +1289,24 @@ LOG_UPDATED_VALUE(event_mq_name_, kEventMQKey, kTransportManagerSection);
LOG_UPDATED_VALUE(policy_snapshot_file_name_, kPathToSnapshotKey,
kPolicySection);
+ // Attempts number for opening policy DB
+ ReadUIntValue(&attempts_to_open_policy_db_,
+ kDefaultAttemptsToOpenPolicyDB,
+ kPolicySection,
+ kAttemptsToOpenPolicyDBKey);
+
+ LOG_UPDATED_VALUE(attempts_to_open_policy_db_,
+ kAttemptsToOpenPolicyDBKey, kPolicySection);
+
+ // Open attempt timeout in ms
+ ReadUIntValue(&open_attempt_timeout_ms_,
+ kDefaultOpenAttemptTimeoutMsKey,
+ kPolicySection,
+ kOpenAttemptTimeoutMsKey);
+
+ LOG_UPDATED_VALUE(open_attempt_timeout_ms_,
+ kOpenAttemptTimeoutMsKey, kPolicySection);
+
// Turn Policy Off?
std::string enable_policy_string;
if (ReadValue(&enable_policy_string, kPolicySection, kEnablePolicy) &&
@@ -1045,18 +1319,18 @@ LOG_UPDATED_VALUE(event_mq_name_, kEventMQKey, kTransportManagerSection);
LOG_UPDATED_BOOL_VALUE(enable_policy_, kEnablePolicy, kPolicySection);
ReadUIntValue(&application_list_update_timeout_,
- kDefaultApplicationListUpdateTimeout,
- kApplicationManagerSection,
- kApplicationListUpdateTimeoutKey);
+ kDefaultApplicationListUpdateTimeout,
+ kApplicationManagerSection,
+ kApplicationListUpdateTimeoutKey);
LOG_UPDATED_VALUE(application_list_update_timeout_,
- kApplicationListUpdateTimeoutKey, kMainSection);
+ kApplicationListUpdateTimeoutKey, kMainSection);
ReadUintIntPairValue(&read_did_frequency_, kReadDIDFrequency,
- kMainSection, kReadDIDFrequencykey);
+ kMainSection, kReadDIDFrequencykey);
ReadUintIntPairValue(&get_vehicle_data_frequency_, kGetVehicleDataFrequency,
- kMainSection, kGetVehicleDataFrequencyKey);
+ kMainSection, kGetVehicleDataFrequencyKey);
ReadUIntValue(&max_thread_pool_size_,
kDefaultMaxThreadPoolSize,
@@ -1066,54 +1340,54 @@ LOG_UPDATED_VALUE(event_mq_name_, kEventMQKey, kTransportManagerSection);
max_thread_pool_size_ = kDefaultMaxThreadPoolSize;
}
LOG_UPDATED_VALUE(max_thread_pool_size_,
- kDefaultMaxThreadPoolSize, kApplicationManagerSection);
+ kDefaultMaxThreadPoolSize, kApplicationManagerSection);
ReadStringValue(&iap_legacy_protocol_mask_,
- kDefaultLegacyProtocolMask,
- kIAPSection,
- kLegacyProtocolMaskKey);
+ kDefaultLegacyProtocolMask,
+ kIAPSection,
+ kLegacyProtocolMaskKey);
LOG_UPDATED_VALUE(iap_legacy_protocol_mask_, kLegacyProtocolMaskKey, kIAPSection);
ReadStringValue(&iap_hub_protocol_mask_,
- kDefaultHubProtocolMask,
- kIAPSection,
- kHubProtocolMaskKey);
+ kDefaultHubProtocolMask,
+ kIAPSection,
+ kHubProtocolMaskKey);
LOG_UPDATED_VALUE(iap_hub_protocol_mask_, kHubProtocolMaskKey, kIAPSection);
ReadStringValue(&iap_pool_protocol_mask_,
- kDefaultPoolProtocolMask,
- kIAPSection,
- kPoolProtocolMaskKey);
+ kDefaultPoolProtocolMask,
+ kIAPSection,
+ kPoolProtocolMaskKey);
LOG_UPDATED_VALUE(iap_pool_protocol_mask_, kPoolProtocolMaskKey, kIAPSection);
ReadStringValue(&iap_system_config_,
- kDefaultIAPSystemConfig,
- kIAPSection,
- kIAPSystemConfigKey);
+ kDefaultIAPSystemConfig,
+ kIAPSection,
+ kIAPSystemConfigKey);
LOG_UPDATED_VALUE(iap_system_config_, kIAPSystemConfigKey, kIAPSection);
ReadStringValue(&iap2_system_config_,
- kDefaultIAP2SystemConfig,
- kIAPSection,
- kIAP2SystemConfigKey);
+ kDefaultIAP2SystemConfig,
+ kIAPSection,
+ kIAP2SystemConfigKey);
LOG_UPDATED_VALUE(iap2_system_config_, kIAP2SystemConfigKey, kIAPSection);
ReadIntValue(&iap2_hub_connect_attempts_,
- kDefaultIAP2HubConnectAttempts,
- kIAPSection,
- kIAP2HubConnectAttemptskey);
+ kDefaultIAP2HubConnectAttempts,
+ kIAPSection,
+ kIAP2HubConnectAttemptskey);
LOG_UPDATED_VALUE(iap2_hub_connect_attempts_, kIAP2HubConnectAttemptskey, kIAPSection);
ReadIntValue(&iap_hub_connection_wait_timeout_,
- kDefaultIAPHubConnectionWaitTimeout,
- kIAPSection,
- kIAPHubConnectionWaitTimeoutKey);
+ kDefaultIAPHubConnectionWaitTimeout,
+ kIAPSection,
+ kIAPHubConnectionWaitTimeoutKey);
LOG_UPDATED_VALUE(iap_hub_connection_wait_timeout_,
kIAPHubConnectionWaitTimeoutKey, kIAPSection);
@@ -1121,6 +1395,15 @@ LOG_UPDATED_VALUE(event_mq_name_, kEventMQKey, kTransportManagerSection);
ReadUIntValue(&default_hub_protocol_index_, kDefaultHubProtocolIndex, kIAPSection, kDefaultHubProtocolIndexKey);
LOG_UPDATED_VALUE(default_hub_protocol_index_, kDefaultHubProtocolIndexKey, kIAPSection);
+
+ ReadUIntValue(&hash_string_size_,
+ kDefaultHashStringSize,
+ kApplicationManagerSection,
+ kHashStringSizeKey);
+
+ LOG_UPDATED_VALUE(hash_string_size_,
+ kHashStringSizeKey,
+ kApplicationManagerSection);
}
bool Profile::ReadValue(bool* value, const char* const pSection,
@@ -1132,7 +1415,7 @@ bool Profile::ReadValue(bool* value, const char* const pSection,
*buf = '\0';
if ((0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf))
&& ('\0' != *buf)) {
- const int32_t tmpVal = atoi(buf);
+ const int32_t tmpVal = atoi(buf);
if (0 == tmpVal) {
*value = false;
} else {
@@ -1184,7 +1467,7 @@ bool Profile::ReadIntValue(int32_t* value, const int32_t default_value,
}
bool Profile::ReadUintIntPairValue(std::pair<uint32_t, int32_t>* value,
- const std::pair<uint32_t, uint32_t>& default_value,
+ const std::pair<uint32_t, uint32_t>& default_value,
const char *const pSection,
const char *const pKey) const {
std::string string_value;
@@ -1201,8 +1484,8 @@ bool Profile::ReadUintIntPairValue(std::pair<uint32_t, int32_t>* value,
}
bool Profile::ReadBoolValue(bool* value, const bool default_value,
- const char* const pSection,
- const char* const pKey) const {
+ const char* const pSection,
+ const char* const pKey) const {
DCHECK(value);
bool read_value;
const bool result = ReadValue(&read_value, pSection, pKey);
@@ -1217,7 +1500,7 @@ int32_t hex_to_int(const std::string& value) {
std::list<int> Profile::ReadIntContainer(
const char * const pSection, const char * const pKey,
- bool *out_result) const {
+ bool *out_result) const {
const std::list<std::string> string_list =
ReadStringContainer(pSection, pKey, out_result);
std::list<int> value_list;
@@ -1229,12 +1512,12 @@ std::list<int> Profile::ReadIntContainer(
std::list<std::string> Profile::ReadStringContainer(
const char * const pSection, const char * const pKey,
- bool *out_result) const {
+ bool *out_result) const {
std::string string;
const bool result = ReadValue(&string, pSection, pKey);
if (out_result)
*out_result = result;
- std::list<std::string> value_container;
+ std::list < std::string > value_container;
if (result) {
std::istringstream iss(string);
std::string temp_str;
@@ -1247,20 +1530,20 @@ std::list<std::string> Profile::ReadStringContainer(
}
bool Profile::ReadUIntValue(uint16_t* value, uint16_t default_value,
- const char* const pSection,
- const char* const pKey) const {
+ const char* const pSection,
+ const char* const pKey) const {
std::string string_value;
if (!ReadValue(&string_value, pSection, pKey)) {
*value = default_value;
return false;
} else {
- uint16_t user_value = strtoul(string_value.c_str(), NULL, 10);
- if (!user_value || errno == ERANGE) {
+ uint64_t user_value;
+ if (!StringToNumber(string_value, user_value)) {
*value = default_value;
return false;
}
- *value = user_value;
+ *value = static_cast<uint16_t>(user_value);
return true;
}
}
@@ -1272,14 +1555,14 @@ bool Profile::ReadUIntValue(uint32_t* value, uint32_t default_value,
if (!ReadValue(&string_value, pSection, pKey)) {
*value = default_value;
return false;
- } else {
- uint32_t user_value = strtoul(string_value.c_str(), NULL, 10);
- if (!user_value || errno == ERANGE) {
- *value = default_value;
+ } else {
+ uint64_t user_value;
+ if (!StringToNumber(string_value, user_value)) {
+ *value = default_value;
return false;
}
- *value = user_value;
+ *value = static_cast<uint32_t>(user_value);
return true;
}
}
@@ -1292,8 +1575,8 @@ bool Profile::ReadUIntValue(uint64_t* value, uint64_t default_value,
*value = default_value;
return false;
} else {
- uint64_t user_value = strtoull(string_value.c_str(), NULL, 10);
- if (!user_value || errno == ERANGE) {
+ uint64_t user_value;
+ if (!StringToNumber(string_value, user_value)) {
*value = default_value;
return false;
}
@@ -1303,21 +1586,31 @@ bool Profile::ReadUIntValue(uint64_t* value, uint64_t default_value,
}
}
-void Profile::LogContainer(const std::vector<std::string>& container,
- std::string* log) {
- if (container.empty()) {
- return;
- }
- if (NULL == log) {
- return;
+bool Profile::StringToNumber(const std::string& input, uint64_t& output) const {
+ const char* input_value = input.c_str();
+ char* endptr;
+ const int8_t base = 10;
+ errno = 0;
+ uint64_t user_value = strtoull(input_value, &endptr, base);
+ bool is_real_zero_value =
+ (!user_value && endptr != input_value && *endptr == '\0');
+ if (!is_real_zero_value && (!user_value || errno == ERANGE)) {
+ return false;
}
- std::vector<std::string>::const_iterator it = container.begin();
- std::vector<std::string>::const_iterator it_end = container.end();
- for (; it != it_end-1; ++it) {
- log->append(*it);
- log->append(" ; ");
+ output = user_value;
+ return true;
+}
+
+bool Profile::IsRelativePath(const std::string& path) {
+ if (path.empty()) {
+ LOG4CXX_ERROR(logger_, "Empty path passed.");
+ return false;
}
+ return '/' != path[0];
+}
- log->append(container.back());
+void Profile::MakeAbsolutePath(std::string& path) {
+ path = file_system::CurrentWorkingDirectory() + "/" + path;
}
-} // namespace profile
+
+}// namespace profile
diff --git a/src/components/config_profile/test/CMakeLists.txt b/src/components/config_profile/test/CMakeLists.txt
new file mode 100644
index 000000000..e474d3fc2
--- /dev/null
+++ b/src/components/config_profile/test/CMakeLists.txt
@@ -0,0 +1,59 @@
+# 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.
+
+if(BUILD_TESTS)
+
+include_directories (
+ ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/include
+ ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/gtest/include
+ ${COMPONENTS_DIR}/include/utils
+ ${COMPONENTS_DIR}/config_profile/include
+ )
+
+
+set(testSources
+ profile_test.cc
+ ini_file_test.cc
+)
+
+set(testLibraries
+ gmock
+ ConfigProfile
+)
+
+file(COPY smartDeviceLink.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY smartDeviceLink_invalid_pairs.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY smartDeviceLink_invalid_string.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY smartDeviceLink_invalid_int.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY smartDeviceLink_invalid_boolean.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+create_test("config_profile_test" "${testSources}" "${testLibraries}")
+
+endif()
diff --git a/src/components/config_profile/test/ini_file_test.cc b/src/components/config_profile/test/ini_file_test.cc
new file mode 100644
index 000000000..10d500df7
--- /dev/null
+++ b/src/components/config_profile/test/ini_file_test.cc
@@ -0,0 +1,335 @@
+/*
+ * 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
+ * FERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 "config_profile/ini_file.h"
+#include "utils/file_system.h"
+
+namespace test {
+namespace components {
+namespace profile {
+
+using namespace ::profile;
+
+TEST(IniFileTest, DISABLED_WriteItemReadItem) {
+ // Write line in chapter
+ const char * fname = "./test_ini_file.ini";
+ const char *chapter = "Chapter";
+ const char * item = "Test_item";
+ const char * value = "test_value";
+ const bool write_result = ini_write_value(fname, chapter, item, value,
+ INI_FLAG_ITEM_UP_CREA);
+ EXPECT_TRUE(write_result);
+
+ // Read value from file
+ char search_value[INI_LINE_LEN] = "";
+ const bool read_result = ini_read_value(fname, chapter, item, search_value);
+
+ EXPECT_TRUE(read_result);
+ EXPECT_EQ(*search_value, *value);
+ EXPECT_TRUE(file_system::DeleteFile("./test_ini_file.ini"));
+}
+
+TEST(IniFileTest, DISABLED_WriteItemWithoutValueReadItem) {
+ // Write line in chapter
+ const char * fname = "./test_ini_file.ini";
+ const char *chapter = "Chapter";
+ const char * test_item = "Test_item";
+ const char * value = "";
+ const bool write_result = ini_write_value(fname, chapter, test_item, value,
+ INI_FLAG_ITEM_UP_CREA);
+ EXPECT_TRUE(write_result);
+
+ // Read value from file
+ char search_value[INI_LINE_LEN] = "";
+ const bool read_result = ini_read_value(fname, chapter, test_item, search_value);
+
+ EXPECT_TRUE(read_result);
+ EXPECT_EQ(*search_value, *value);
+
+ EXPECT_TRUE(file_system::DeleteFile("./test_ini_file.ini"));
+}
+
+TEST(IniFileTest, DISABLED_WriteSameItemInDifferentChapters) {
+ // Write line in chapter
+ const char * fname = "./test_ini_file.ini";
+ const char *chapter1 = "Chapter1";
+ const char * test_item = "Test_item";
+ const char * value = "test_value";
+ const bool write_result = ini_write_value(fname, chapter1, test_item, value,
+ INI_FLAG_ITEM_UP_CREA);
+ EXPECT_TRUE(write_result);
+
+ char search_value[INI_LINE_LEN] = "";
+ const bool read_result = ini_read_value(fname, chapter1, test_item, search_value);
+
+ EXPECT_TRUE(read_result);
+ EXPECT_EQ(*search_value, *value);
+
+ // Create new chapter and write the same value
+ const char *chapter2 = "Chapter2";
+
+ const bool write_result2 = ini_write_value(fname, chapter2, test_item, value,
+ INI_FLAG_ITEM_UP_CREA);
+
+ EXPECT_TRUE(write_result2);
+
+ char value2[INI_LINE_LEN] = "test_value";
+ const bool read_result2 = ini_read_value(fname, chapter2, test_item, value2);
+
+ EXPECT_TRUE(read_result2);
+ EXPECT_EQ(*value2, *value);
+
+ EXPECT_TRUE(file_system::DeleteFile("./test_ini_file.ini"));
+}
+
+TEST(IniFileTest, DISABLED_RewriteItem) {
+ // Write line in chapter
+ const char * fname = "./test_ini_file.ini";
+ const char *chapter = "Chapter";
+ const char * item = "Test_item";
+ const char * value = "test_value";
+ bool write_result = ini_write_value(fname, chapter, item, value,
+ INI_FLAG_ITEM_UP_CREA);
+
+ EXPECT_TRUE(write_result);
+
+ char search_value[INI_LINE_LEN] = "";
+ bool read_result = ini_read_value(fname, chapter, item, search_value);
+
+ EXPECT_TRUE(read_result);
+ EXPECT_EQ(*search_value, *value);
+
+ // Write item again
+ const char * newvalue = "new_test_value";
+ write_result = ini_write_value(fname, chapter, item, newvalue,
+ INI_FLAG_ITEM_UP_CREA);
+
+ EXPECT_TRUE(write_result);
+
+ char new_search_value[INI_LINE_LEN] = "";
+ read_result = ini_read_value(fname, chapter, item, new_search_value);
+
+ EXPECT_TRUE(read_result);
+ EXPECT_EQ(*new_search_value, *newvalue);
+ EXPECT_TRUE(file_system::DeleteFile("./test_ini_file.ini"));
+}
+
+TEST(IniFileTest, DISABLED_WriteTwoItemsInOneChapter) {
+ // Write line in chapter
+ const char * fname = "./test_ini_file.ini";
+ const char *chapter = "Chapter";
+ const char * item = "Test_item";
+ const char * value1 = "test_value";
+
+ bool write_result = ini_write_value(fname, chapter, item, value1,
+ INI_FLAG_ITEM_UP_CREA);
+ EXPECT_TRUE(write_result);
+
+ // Write another line in the same chapter
+ const char * item2 = "Test_item2";
+ const char * value2 = "test_value2";
+
+ write_result = ini_write_value(fname, chapter, item2, value2,
+ INI_FLAG_ITEM_UP_CREA);
+ EXPECT_TRUE(write_result);
+
+ // Search both values
+ char search_value[INI_LINE_LEN] = "";
+ bool read_result = ini_read_value(fname, chapter, item, search_value);
+
+ EXPECT_TRUE(read_result);
+ EXPECT_EQ(*search_value, *value1);
+
+ char search_value2[INI_LINE_LEN] = "";
+ read_result = ini_read_value(fname, chapter, item2, search_value2);
+
+ EXPECT_TRUE(read_result);
+ EXPECT_EQ(*search_value2, *value2);
+
+ EXPECT_TRUE(file_system::DeleteFile("./test_ini_file.ini"));
+}
+
+TEST(IniFileTest, WriteEmptyItemWithValueReadItem) {
+ const char * fname = "./test_ini_file.ini";
+ const char *chapter = "Chapter";
+ const char * test_item = "";
+ const char * value = "test_value";
+ bool result = ini_write_value(fname, chapter, test_item, value,
+ INI_FLAG_ITEM_UP_CREA);
+ EXPECT_FALSE(result);
+}
+
+TEST(IniFileTest, WriteEmptyItemWithEmptyValue_ExpectFalse) {
+ // Write empty line in chapter
+ const char * fname = "./test_ini_file.ini";
+ const char *chapter = "Chapter";
+ const char * test_item = "";
+ const char * value = "";
+ bool result = ini_write_value(fname, chapter, test_item, value,
+ INI_FLAG_ITEM_UP_CREA);
+ EXPECT_FALSE(result);
+}
+
+TEST(IniFileTest, WriteItemInEmptyChapter_ExpectFalse) {
+ // Write line in empty chapter
+ const char * fname = "./test_ini_file.ini";
+ const char *chapter = "";
+ const char * test_item = "Test_item";
+ const char * value = "test_value";
+ bool result = ini_write_value(fname, chapter, test_item, value,
+ INI_FLAG_ITEM_UP_CREA);
+ EXPECT_FALSE(result);
+}
+
+TEST(IniFileTest,ParseEmptyLine) {
+ char line[INI_LINE_LEN] = "";
+ char val[INI_LINE_LEN] = "";
+ char tag[INI_LINE_LEN] = "HMI";
+
+ Ini_search_id result;
+ result = ini_parse_line(line, tag, val);
+ EXPECT_EQ(INI_NOTHING, result);
+}
+
+TEST(IniFileTest,ParseChapter) {
+ char line[INI_LINE_LEN] = "[HMI]";
+ char val[INI_LINE_LEN] = "";
+ char tag[INI_LINE_LEN] = "HMI";
+
+ Ini_search_id result;
+ result = ini_parse_line(line, tag, val);
+ EXPECT_EQ(INI_RIGHT_CHAPTER, result);
+}
+
+TEST(IniFileTest,ParseChapterTagEmpty) {
+ char line[INI_LINE_LEN] = "[HMI]";
+ char val[INI_LINE_LEN] = "";
+ char tag[INI_LINE_LEN] = "";
+
+ Ini_search_id result;
+ result = ini_parse_line(line, tag, val);
+ EXPECT_EQ(INI_WRONG_CHAPTER, result);
+}
+
+TEST(IniFileTest,ParseChapterWithUppercaseTag) {
+ char line[INI_LINE_LEN] = "[Security Manager]";
+ char val[INI_LINE_LEN] = "";
+ char tag[INI_LINE_LEN] = "SECURITY MANAGER";
+
+ Ini_search_id result;
+ result = ini_parse_line(line, tag, val);
+ EXPECT_EQ(INI_RIGHT_CHAPTER, result);
+}
+
+TEST(IniFileTest,ParseChapterWithLowcaseTag) {
+ char line[INI_LINE_LEN] = "[Security Manager]";
+ char val[INI_LINE_LEN] = "";
+ char tag[INI_LINE_LEN] = "Security Manager";
+
+ Ini_search_id result;
+ result = ini_parse_line(line, tag, val);
+ EXPECT_EQ(INI_WRONG_CHAPTER, result);
+}
+
+TEST(IniFileTest,ParseWithWrongChapter) {
+ char line[INI_LINE_LEN] = "[HMI]";
+ char val[INI_LINE_LEN] = "";
+ char tag[INI_LINE_LEN] = "MAIN";
+
+ Ini_search_id result;
+ result = ini_parse_line(line, tag, val);
+ EXPECT_EQ(INI_WRONG_CHAPTER, result);
+}
+
+TEST(IniFileTest,ParseLineWithItem) {
+ char line[INI_LINE_LEN] = "LaunchHMI = true";
+ char val[INI_LINE_LEN] = "";
+ char tag[INI_LINE_LEN] = "LAUNCHHMI";
+
+ Ini_search_id result;
+ result = ini_parse_line(line, tag, val);
+ EXPECT_EQ(INI_RIGHT_ITEM, result);
+
+ char check_val[INI_LINE_LEN] = "true";
+ EXPECT_EQ(*check_val, *val);
+}
+
+TEST(IniFileTest,ParseLineWithoutItem) {
+ char line[INI_LINE_LEN] = "LaunchHMI = ";
+ char val[INI_LINE_LEN] = "";
+ char tag[INI_LINE_LEN] = "LAUNCHHMI";
+
+ Ini_search_id result;
+ result = ini_parse_line(line, tag, val);
+ EXPECT_EQ(INI_RIGHT_ITEM, result);
+
+ char check_val[INI_LINE_LEN] = "";
+ EXPECT_EQ(*check_val, *val);
+}
+
+TEST(IniFileTest,ParseLineWithEmptytag) {
+ char line[INI_LINE_LEN] = "LaunchHMI = true";
+ char val[INI_LINE_LEN] = "";
+ char tag[INI_LINE_LEN] = "";
+
+ Ini_search_id result;
+ result = ini_parse_line(line, tag, val);
+ EXPECT_EQ(INI_WRONG_ITEM, result);
+}
+
+TEST(IniFileTest,ParseLineWithLowcaseTag) {
+ char line[INI_LINE_LEN] = "LaunchHMI = true";
+ char val[INI_LINE_LEN] = "";
+ char tag[INI_LINE_LEN] = "LaunchHmi";
+
+ Ini_search_id result;
+ result = ini_parse_line(line, tag, val);
+ EXPECT_EQ(INI_WRONG_ITEM, result);
+}
+
+TEST(IniFileTest,ParseLineWithComment) {
+ char line[INI_LINE_LEN] = "; [HMI]";
+ char val[INI_LINE_LEN] = "";
+ char tag[INI_LINE_LEN] = "HMI";
+
+ Ini_search_id result;
+ result = ini_parse_line(line, tag, val);
+ EXPECT_EQ(INI_REMARK, result);
+
+ char check_val[INI_LINE_LEN] = ";";
+ EXPECT_EQ(*check_val, *val);
+}
+
+} // namespace profile
+} // namespace components
+} // namespace test
diff --git a/src/components/config_profile/test/profile_test.cc b/src/components/config_profile/test/profile_test.cc
new file mode 100644
index 000000000..9d9eca755
--- /dev/null
+++ b/src/components/config_profile/test/profile_test.cc
@@ -0,0 +1,789 @@
+/*
+ * 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 "config_profile/profile.h"
+#include <algorithm>
+#include "utils/file_system.h"
+#include "utils/threads/thread.h"
+
+namespace test {
+namespace components {
+namespace profile {
+
+using namespace ::profile;
+
+class ProfileTest : public ::testing::Test {
+ protected:
+ virtual void SetUp() {
+ profile::Profile::destroy();
+ }
+ virtual void TearDown() {
+ profile::Profile::destroy();
+ }
+
+};
+
+TEST_F(ProfileTest, SingletonProfile) {
+ Profile::instance();
+ EXPECT_TRUE(Profile::exists());
+ profile::Profile::destroy();
+ EXPECT_FALSE(Profile::exists());
+}
+
+TEST_F(ProfileTest, UpdateConfigWithDefaultFile) {
+ // Default value
+ uint32_t thread_min_stack_size = threads::Thread::kMinStackSize;
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+ EXPECT_FALSE(profile::Profile::instance()->enable_policy());
+ std::string vr_help_title_ = "";
+ EXPECT_EQ(vr_help_title_, Profile::instance()->vr_help_title());
+ EXPECT_EQ("smartDeviceLink.ini", Profile::instance()->config_file_name());
+
+ profile::Profile::instance()->UpdateValues();
+ // Value was updated
+ thread_min_stack_size = 20480;
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+ EXPECT_TRUE(profile::Profile::instance()->enable_policy());
+ vr_help_title_ = "Available Vr Commands List";
+ EXPECT_EQ(vr_help_title_, Profile::instance()->vr_help_title());
+}
+
+TEST_F(ProfileTest, SetConfigFileWithoutCallUpdate) {
+ // Default value
+ uint32_t thread_min_stack_size = threads::Thread::kMinStackSize;
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+ EXPECT_FALSE(profile::Profile::instance()->enable_policy());
+ std::string vr_help_title_ = "";
+ EXPECT_EQ(vr_help_title_, Profile::instance()->vr_help_title());
+ EXPECT_EQ("smartDeviceLink.ini", Profile::instance()->config_file_name());
+
+ Profile::instance()->config_file_name("smartDeviceLink.ini");
+ EXPECT_EQ("smartDeviceLink.ini", Profile::instance()->config_file_name());
+
+ // Value was updated
+ thread_min_stack_size = 20480;
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+ EXPECT_TRUE(profile::Profile::instance()->enable_policy());
+ vr_help_title_ = "Available Vr Commands List";
+ EXPECT_EQ(vr_help_title_, Profile::instance()->vr_help_title());
+}
+
+TEST_F(ProfileTest, SetConfigFileWithUpdate) {
+ // Default value
+ uint32_t thread_min_stack_size = threads::Thread::kMinStackSize;
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+ Profile::instance()->config_file_name("smartDeviceLink.ini");
+ EXPECT_EQ("smartDeviceLink.ini", Profile::instance()->config_file_name());
+
+ // Value was updated
+ thread_min_stack_size = 20480;
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+
+ // Update config file again
+ profile::Profile::instance()->UpdateValues();
+
+ // Value should be the same
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+}
+
+TEST_F(ProfileTest, UpdateManyTimesDefaultFile) {
+ //using for check logger's work - core dump when this test was started and log4cxx exists in test derictory
+ Profile::instance()->config_file_name("smartDeviceLink.ini");
+ EXPECT_EQ("smartDeviceLink.ini", Profile::instance()->config_file_name());
+ // Update config many times
+ for (int i = 0; i < 10; i++) {
+ profile::Profile::instance()->UpdateValues();
+ }
+}
+
+TEST_F(ProfileTest, UpdateIntValues) {
+ // Default value
+ EXPECT_EQ("smartDeviceLink.ini", Profile::instance()->config_file_name());
+ uint32_t thread_min_stack_size = threads::Thread::kMinStackSize;
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+
+ // Set config file with default name
+ Profile::instance()->config_file_name("smartDeviceLink.ini");
+ EXPECT_EQ("smartDeviceLink.ini", Profile::instance()->config_file_name());
+
+ // Value changes
+ thread_min_stack_size = 20480;
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+
+ // Update config file again
+ profile::Profile::instance()->UpdateValues();
+ // Values are same
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+
+ // Set new config file
+ Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+ EXPECT_EQ("smartDeviceLink_test.ini",
+ Profile::instance()->config_file_name());
+
+ // Value changes
+ thread_min_stack_size = 21000;
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+
+ // Update config file again
+ profile::Profile::instance()->UpdateValues();
+ EXPECT_EQ("smartDeviceLink_test.ini",
+ Profile::instance()->config_file_name());
+
+ // Value should be the same
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+
+ // Set config file with default name again
+ Profile::instance()->config_file_name("smartDeviceLink.ini");
+ EXPECT_EQ("smartDeviceLink.ini", Profile::instance()->config_file_name());
+
+ // Value should be changed
+ thread_min_stack_size = 20480;
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+}
+
+TEST_F(ProfileTest, UpdateBoolValues) {
+ // Default values
+ EXPECT_EQ("smartDeviceLink.ini", Profile::instance()->config_file_name());
+ EXPECT_TRUE(profile::Profile::instance()->launch_hmi());
+ EXPECT_FALSE(profile::Profile::instance()->enable_policy());
+
+ // Set config file
+ Profile::instance()->config_file_name("smartDeviceLink.ini");
+ // Check values
+ EXPECT_TRUE(profile::Profile::instance()->launch_hmi());
+ EXPECT_TRUE(profile::Profile::instance()->enable_policy());
+ EXPECT_FALSE(profile::Profile::instance()->is_redecoding_enabled());
+
+ // Update config file again
+ profile::Profile::instance()->UpdateValues();
+ // Values are same
+ EXPECT_TRUE(profile::Profile::instance()->launch_hmi());
+ EXPECT_TRUE(profile::Profile::instance()->enable_policy());
+ EXPECT_FALSE(profile::Profile::instance()->is_redecoding_enabled());
+
+ // Change config file
+ Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+ EXPECT_EQ("smartDeviceLink_test.ini",
+ Profile::instance()->config_file_name());
+
+ // Parameters after updating
+ EXPECT_FALSE(profile::Profile::instance()->launch_hmi());
+ EXPECT_FALSE(profile::Profile::instance()->enable_policy());
+ EXPECT_TRUE(profile::Profile::instance()->is_redecoding_enabled());
+
+ // Update config file
+ profile::Profile::instance()->UpdateValues();
+
+ // Parameters are same
+ EXPECT_FALSE(profile::Profile::instance()->launch_hmi());
+ EXPECT_FALSE(profile::Profile::instance()->enable_policy());
+ EXPECT_TRUE(profile::Profile::instance()->is_redecoding_enabled());
+}
+
+TEST_F(ProfileTest, UpdateStringValue) {
+ // Default values
+ std::string config_folder = "";
+ std::string tts_delimiter_ = "";
+ std::string vr_help_title_ = "";
+ std::string server_address = "127.0.0.1";
+ std::string app_resourse_folder = "";
+ EXPECT_EQ(config_folder, Profile::instance()->app_resourse_folder());
+ EXPECT_EQ(server_address, profile::Profile::instance()->server_address());
+
+ Profile::instance()->config_file_name("smartDeviceLink.ini");
+ EXPECT_EQ("smartDeviceLink.ini", Profile::instance()->config_file_name());
+
+ // Check values
+ config_folder = file_system::CurrentWorkingDirectory();
+ EXPECT_EQ(config_folder, Profile::instance()->app_resourse_folder());
+ tts_delimiter_ = ",";
+ EXPECT_EQ(tts_delimiter_, Profile::instance()->tts_delimiter());
+ vr_help_title_ = "Available Vr Commands List";
+ EXPECT_EQ(vr_help_title_, Profile::instance()->vr_help_title());
+
+ EXPECT_EQ(server_address, profile::Profile::instance()->server_address());
+ app_resourse_folder = file_system::CurrentWorkingDirectory();
+ EXPECT_EQ(app_resourse_folder, Profile::instance()->app_resourse_folder());
+
+ // Update config file
+ profile::Profile::instance()->UpdateValues();
+
+ // Values are the same
+ EXPECT_EQ(config_folder, Profile::instance()->app_resourse_folder());
+ EXPECT_EQ(tts_delimiter_, Profile::instance()->tts_delimiter());
+ EXPECT_EQ(vr_help_title_, Profile::instance()->vr_help_title());
+ EXPECT_EQ(server_address, profile::Profile::instance()->server_address());
+ EXPECT_EQ(app_resourse_folder, Profile::instance()->app_resourse_folder());
+}
+
+TEST_F(ProfileTest, UpdateInt_ValueAppearsInFileTwice) {
+ // Default values
+ uint32_t server_port = 8087;
+ EXPECT_EQ(server_port, Profile::instance()->server_port());
+ // Change config file
+ Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+ EXPECT_EQ("smartDeviceLink_test.ini",
+ Profile::instance()->config_file_name());
+ // Update config file
+ // First server_port = 8088
+ server_port = 8088;
+ EXPECT_EQ(server_port, Profile::instance()->server_port());
+}
+
+TEST_F(ProfileTest, UpdateBool_ValueAppearsInFileTwice) {
+ // Default values
+ EXPECT_FALSE(Profile::instance()->is_mixing_audio_supported());
+ // Change config file
+ Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+ EXPECT_EQ("smartDeviceLink_test.ini",
+ Profile::instance()->config_file_name());
+ // Update config file
+ // First value is false
+ EXPECT_FALSE(profile::Profile::instance()->is_mixing_audio_supported());
+}
+
+TEST_F(ProfileTest, UpdateVectorOfString_ValueAppearsInFileTwice) {
+ // Default values
+ std::vector < std::string > time_out_promt;
+ EXPECT_EQ(time_out_promt, Profile::instance()->time_out_promt());
+ // Change config file
+ Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+ EXPECT_EQ("smartDeviceLink_test.ini",
+ Profile::instance()->config_file_name());
+ // Update config file
+ time_out_promt.push_back("Please say a command,");
+ EXPECT_EQ(time_out_promt, Profile::instance()->time_out_promt());
+}
+
+TEST_F(ProfileTest, UpdateString_ValueAppearsInFileTwice) {
+ // Default values
+ std::string recording_file_name = "record.wav";
+ EXPECT_EQ(recording_file_name, Profile::instance()->recording_file_name());
+ // Change config file
+ Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+ EXPECT_EQ("smartDeviceLink_test.ini",
+ Profile::instance()->config_file_name());
+ // Update config file
+ recording_file_name = "video.wav";
+ EXPECT_EQ(recording_file_name, Profile::instance()->recording_file_name());
+}
+
+TEST_F(ProfileTest, UpdatePairsValue) {
+ // Default values
+ std::pair < uint32_t, int32_t > value;
+ value.first = 0;
+ value.second = 0;
+ EXPECT_EQ(value, Profile::instance()->get_vehicle_data_frequency());
+
+ Profile::instance()->config_file_name("smartDeviceLink.ini");
+ EXPECT_EQ("smartDeviceLink.ini", Profile::instance()->config_file_name());
+
+ value.first = 5;
+ value.second = 1;
+ EXPECT_EQ(value, Profile::instance()->get_vehicle_data_frequency());
+
+ // Update config file
+ profile::Profile::instance()->UpdateValues();
+ EXPECT_EQ(value, Profile::instance()->get_vehicle_data_frequency());
+}
+
+// Section with negative tests
+
+TEST_F(ProfileTest, PairsValueEmpty) {
+ // Default values
+ std::pair < uint32_t, int32_t > value;
+ value.first = 0;
+ value.second = 0;
+ EXPECT_EQ(value, Profile::instance()->read_did_frequency());
+
+ Profile::instance()->config_file_name("smartDeviceLink_invalid_pairs.ini");
+ EXPECT_EQ("smartDeviceLink_invalid_pairs.ini",
+ Profile::instance()->config_file_name());
+
+ // Default values
+ value.first = 5;
+ value.second = 1;
+ EXPECT_EQ(value, Profile::instance()->read_did_frequency());
+
+ // Update config file
+ profile::Profile::instance()->UpdateValues();
+ // Values are same
+ EXPECT_EQ(value, Profile::instance()->read_did_frequency());
+}
+
+TEST_F(ProfileTest, CharValueInPairInsteadOfInt) {
+ std::pair < uint32_t, int32_t > value;
+ value.first = 0;
+ value.second = 0;
+ EXPECT_EQ(value, Profile::instance()->get_vehicle_data_frequency());
+
+ Profile::instance()->config_file_name("smartDeviceLink_invalid_string.ini");
+ EXPECT_EQ("smartDeviceLink_invalid_string.ini",
+ Profile::instance()->config_file_name());
+
+ EXPECT_EQ(value, Profile::instance()->get_vehicle_data_frequency());
+
+ // Update config file
+ profile::Profile::instance()->UpdateValues();
+ // Values are same
+ EXPECT_EQ(value, Profile::instance()->get_vehicle_data_frequency());
+}
+
+TEST_F(ProfileTest, EmptyValuesInPair) {
+ Profile::instance()->config_file_name("smartDeviceLink_invalid_pairs.ini");
+ EXPECT_EQ("smartDeviceLink_invalid_pairs.ini",
+ Profile::instance()->config_file_name());
+
+ std::pair < uint32_t, int32_t > value;
+ value.first = 0;
+ value.second = 0;
+ EXPECT_EQ(value, Profile::instance()->get_vehicle_data_frequency());
+
+ // Update config file
+ profile::Profile::instance()->UpdateValues();
+ // Values are same
+ EXPECT_EQ(value, Profile::instance()->get_vehicle_data_frequency());
+}
+
+TEST_F(ProfileTest, DISABLED_IntInsteadOfPair) {
+ // Default values
+ std::pair < uint32_t, int32_t > value;
+ value.first = 0;
+ value.second = 0;
+ EXPECT_EQ(value, Profile::instance()->start_stream_retry_amount());
+
+ Profile::instance()->config_file_name("smartDeviceLink_invalid_pairs.ini");
+ EXPECT_EQ("smartDeviceLink_invalid_pairs.ini",
+ Profile::instance()->config_file_name());
+ // Ini file includes only one element
+ value.first = 9;
+ value.second = 1000;
+ EXPECT_EQ(value, Profile::instance()->start_stream_retry_amount());
+
+ // Update config file
+ profile::Profile::instance()->UpdateValues();
+ // Values are same
+ EXPECT_EQ(value, Profile::instance()->start_stream_retry_amount());
+}
+
+TEST_F(ProfileTest, WrongIntValue) {
+ // Default value
+ int32_t heart_beat_timeout = 0;
+ EXPECT_EQ(heart_beat_timeout, Profile::instance()->heart_beat_timeout());
+
+ // Change config file
+ Profile::instance()->config_file_name("smartDeviceLink_invalid_int.ini");
+ EXPECT_EQ("smartDeviceLink_invalid_int.ini",
+ Profile::instance()->config_file_name());
+
+ // Value in file includes letters. Check that value is default
+ heart_beat_timeout = 0;
+ EXPECT_EQ(heart_beat_timeout, Profile::instance()->heart_beat_timeout());
+
+ // Update config file
+ profile::Profile::instance()->UpdateValues();
+ EXPECT_EQ(heart_beat_timeout, Profile::instance()->heart_beat_timeout());
+}
+
+TEST_F(ProfileTest, DISABLED_WrongMaxIntValue) {
+ // Default value
+ uint32_t maxvalue = 2000000000;
+ EXPECT_EQ(maxvalue, Profile::instance()->max_cmd_id());
+
+ // Change config file
+ Profile::instance()->config_file_name("smartDeviceLink_invalid_int.ini");
+ EXPECT_EQ("smartDeviceLink_invalid_int.ini",
+ Profile::instance()->config_file_name());
+
+ // Value in file is more than could be saved.
+ // Check that value is default
+ EXPECT_EQ(maxvalue, Profile::instance()->max_cmd_id());
+
+ // Update config file
+ profile::Profile::instance()->UpdateValues();
+ EXPECT_EQ(maxvalue, Profile::instance()->max_cmd_id());
+}
+
+TEST_F(ProfileTest, DISABLED_WrongMinIntValue) {
+ // Default value
+ uint32_t minvalue = threads::Thread::kMinStackSize;
+ EXPECT_EQ(minvalue, Profile::instance()->thread_min_stack_size());
+
+ uint16_t server_port = 8087;
+ EXPECT_EQ(server_port, Profile::instance()->server_port());
+
+ // Change config file
+ Profile::instance()->config_file_name("smartDeviceLink_invalid_int.ini");
+ EXPECT_EQ("smartDeviceLink_invalid_int.ini",
+ Profile::instance()->config_file_name());
+
+ //File include 0, value should be lefted as default
+ EXPECT_EQ(minvalue, Profile::instance()->thread_min_stack_size());
+ //File include -1, value should be lefted as default
+ EXPECT_EQ(server_port, Profile::instance()->server_port());
+
+ // Update config file
+ profile::Profile::instance()->UpdateValues();
+
+ // Default value should be lefted
+ EXPECT_EQ(minvalue, Profile::instance()->thread_min_stack_size());
+ EXPECT_EQ(server_port, Profile::instance()->server_port());
+}
+
+TEST_F(ProfileTest, DISABLED_CheckCorrectValueWhenOtherValueInvalid) {
+ // Default value
+ uint32_t maxvalue = 2000000000;
+ EXPECT_EQ(maxvalue, Profile::instance()->max_cmd_id());
+
+ uint32_t thread_min_stack_size = threads::Thread::kMinStackSize;
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+
+ // Change config file
+ Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+ EXPECT_EQ("smartDeviceLink_test.ini",
+ Profile::instance()->config_file_name());
+
+ // Check that value is default
+ maxvalue = 2000000000;
+ EXPECT_EQ(maxvalue, Profile::instance()->max_cmd_id());
+
+ // Other value is correct
+ thread_min_stack_size = 21000;
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+
+ // Update config file
+ profile::Profile::instance()->UpdateValues();
+
+ // In file the number is bigger than can be, default value should be lefted
+ EXPECT_EQ(maxvalue, Profile::instance()->max_cmd_id());
+ EXPECT_EQ(thread_min_stack_size,
+ Profile::instance()->thread_min_stack_size());
+}
+
+TEST_F(ProfileTest, PairsValueInsteadOfInt) {
+ // Set new config file
+ Profile::instance()->config_file_name("smartDeviceLink_invalid_int.ini");
+ EXPECT_EQ("smartDeviceLink_invalid_int.ini",
+ Profile::instance()->config_file_name());
+ // Get first number
+ uint32_t list_files_in_none = 5;
+ EXPECT_EQ(list_files_in_none, Profile::instance()->list_files_in_none());
+
+ // Update config file
+ profile::Profile::instance()->UpdateValues();
+ // Values are same
+ EXPECT_EQ(list_files_in_none, Profile::instance()->list_files_in_none());
+}
+
+TEST_F(ProfileTest, DISABLED_StringValueIncludeSlashesAndRussianLetters) {
+ // Default values
+ std::string config_folder = "";
+ EXPECT_EQ(config_folder, Profile::instance()->app_resourse_folder());
+ std::string tts_delimiter_ = "";
+ std::string app_resourse_folder = "";
+ std::string app_storage_folder = "";
+
+ Profile::instance()->config_file_name("smartDeviceLink_invalid_string.ini");
+ EXPECT_EQ("smartDeviceLink_invalid_string.ini",
+ Profile::instance()->config_file_name());
+
+ // Check values
+ config_folder = "///";
+ EXPECT_EQ(config_folder, Profile::instance()->app_config_folder());
+ tts_delimiter_ = "coma and point";
+ EXPECT_EQ(tts_delimiter_, Profile::instance()->tts_delimiter());
+ std::string server_address = "127.0.0.1 + слово";
+ EXPECT_EQ(server_address, profile::Profile::instance()->server_address());
+ app_resourse_folder = "new folder/";
+ EXPECT_EQ(app_resourse_folder, Profile::instance()->app_resourse_folder());
+ app_storage_folder = "\" \"";
+ EXPECT_EQ(app_storage_folder, Profile::instance()->app_storage_folder());
+
+ // Update config file
+ profile::Profile::instance()->UpdateValues();
+
+ // Values are the same
+ EXPECT_EQ(config_folder, Profile::instance()->app_config_folder());
+ EXPECT_EQ(tts_delimiter_, Profile::instance()->tts_delimiter());
+ EXPECT_EQ(server_address, profile::Profile::instance()->server_address());
+ EXPECT_EQ(app_resourse_folder, Profile::instance()->app_resourse_folder());
+}
+
+TEST_F(ProfileTest, StringUpperBoundValue) {
+ // Default values
+ std::string vr_help_title = "";
+ std::string recording_file_name = "record.wav";
+ EXPECT_EQ(vr_help_title, Profile::instance()->vr_help_title());
+ EXPECT_EQ(recording_file_name, Profile::instance()->recording_file_name());
+
+ Profile::instance()->config_file_name("smartDeviceLink_invalid_string.ini");
+ EXPECT_EQ("smartDeviceLink_invalid_string.ini",
+ Profile::instance()->config_file_name());
+
+ // Total count of elements in ini file's string will be less 512
+ vr_help_title =
+ "0/0/0/1/2345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890abc!def@ghi";
+ EXPECT_EQ(vr_help_title, Profile::instance()->vr_help_title());
+ EXPECT_NE(vr_help_title, Profile::instance()->recording_file_name());
+ recording_file_name =
+ "0/0/0/1/2345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890abc";
+ EXPECT_EQ(recording_file_name, Profile::instance()->recording_file_name());
+ // Update config file
+ profile::Profile::instance()->UpdateValues();
+ // Values are the same
+ EXPECT_EQ(vr_help_title, Profile::instance()->vr_help_title());
+ EXPECT_EQ(recording_file_name, Profile::instance()->recording_file_name());
+}
+
+TEST_F(ProfileTest, CapitalLetterInBoolValue) {
+ // Default values
+ EXPECT_EQ("smartDeviceLink.ini", Profile::instance()->config_file_name());
+ EXPECT_TRUE(profile::Profile::instance()->launch_hmi());
+ EXPECT_FALSE(profile::Profile::instance()->enable_policy());
+
+ // Set config file
+ Profile::instance()->config_file_name("smartDeviceLink.ini");
+ // Check values
+ EXPECT_TRUE(profile::Profile::instance()->launch_hmi());
+ EXPECT_TRUE(profile::Profile::instance()->enable_policy());
+ EXPECT_FALSE(profile::Profile::instance()->is_redecoding_enabled());
+
+ // Change config file
+ Profile::instance()->config_file_name("smartDeviceLink_invalid_boolean.ini");
+ EXPECT_EQ("smartDeviceLink_invalid_boolean.ini",
+ Profile::instance()->config_file_name());
+
+ // Parameters after updating
+ // Parameter launch_hmi = True
+ EXPECT_FALSE(profile::Profile::instance()->launch_hmi());
+ // EnablePolicy = TRUE
+ EXPECT_FALSE(profile::Profile::instance()->enable_policy());
+ // EnableRedecoding = FALSE
+ EXPECT_FALSE(profile::Profile::instance()->is_redecoding_enabled());
+}
+
+TEST_F(ProfileTest, CheckReadStringValue) {
+ // Set new config file
+ Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+ EXPECT_EQ("smartDeviceLink_test.ini",
+ Profile::instance()->config_file_name());
+
+ std::string app_resourse_folder_;
+ profile::Profile::instance()->ReadStringValue(
+ &app_resourse_folder_, file_system::CurrentWorkingDirectory().c_str(),
+ "MAIN", "AppResourceFolder");
+ // Get default value
+ EXPECT_EQ(app_resourse_folder_, file_system::CurrentWorkingDirectory());
+
+ // Get value from file
+ std::string server_address;
+ profile::Profile::instance()->ReadStringValue(&server_address, "", "HMI",
+ "ServerAddress");
+ EXPECT_EQ("127.0.0.1", server_address);
+}
+
+TEST_F(ProfileTest, DISABLED_CheckReadBoolValue) {
+ // Set new config file
+ Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+ EXPECT_EQ("smartDeviceLink_test.ini",
+ Profile::instance()->config_file_name());
+
+ bool enable_policy;
+ profile::Profile::instance()->ReadBoolValue(&enable_policy, false, "Policy",
+ "EnablePolicy");
+ EXPECT_FALSE(enable_policy);
+
+ // Change config back
+ profile::Profile::destroy();
+ EXPECT_EQ("smartDeviceLink.ini", Profile::instance()->config_file_name());
+
+ //get default value
+ bool launch_hmi;
+ profile::Profile::instance()->ReadBoolValue(&launch_hmi, true, "HMI",
+ "LaunchHMI");
+ EXPECT_TRUE(launch_hmi);
+}
+
+TEST_F(ProfileTest, CheckReadIntValue) {
+ // Set new config file
+ Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+ EXPECT_EQ("smartDeviceLink_test.ini",
+ Profile::instance()->config_file_name());
+
+ int server_port = 0;
+ profile::Profile::instance()->ReadIntValue(&server_port, 0, "HMI",
+ "ServerPort");
+
+ EXPECT_EQ(8088, server_port);
+}
+
+//TEST_F(ProfileTest, CheckIntContainer) {
+// // Set new config file
+// Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+// EXPECT_EQ("smartDeviceLink_test.ini",
+// Profile::instance()->config_file_name());
+
+// bool isread = false;
+// std::vector<int> diagmodes_list =
+// profile::Profile::instance()->ReadIntContainer("MAIN",
+// "SupportedDiagModes",
+// &isread);
+// EXPECT_TRUE(isread);
+
+// std::vector<int>::iterator diag_mode = std::find(diagmodes_list.begin(),
+// diagmodes_list.end(), 0x12);
+
+// // This element doesn't appear in list
+// EXPECT_EQ(diag_mode, diagmodes_list.end());
+
+// // List includes 0x01
+// diag_mode = std::find(diagmodes_list.begin(), diagmodes_list.end(), 0x01);
+// EXPECT_EQ(diag_mode, diagmodes_list.begin());
+
+// // List includes 0x03
+// std::vector<int>::iterator element_mode = diagmodes_list.begin();
+// element_mode++;
+// element_mode++;
+
+// diag_mode = std::find(diagmodes_list.begin(), diagmodes_list.end(), 0x03);
+// EXPECT_EQ(diag_mode, element_mode);
+//}
+
+//TEST_F(ProfileTest, CheckVectorContainer) {
+// Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+// EXPECT_EQ("smartDeviceLink_test.ini",
+// Profile::instance()->config_file_name());
+
+// // Get diag_modes after updating
+// const std::vector<uint32_t> &diag_modes = profile::Profile::instance()
+// ->supported_diag_modes();
+
+// bool isread = false;
+// std::vector<int> diagmodes_list =
+// profile::Profile::instance()->ReadIntContainer("MAIN",
+// "SupportedDiagModes",
+// &isread);
+// EXPECT_TRUE(isread);
+// // Compare with result of ReadIntContainer
+// ASSERT_EQ(diag_modes.size(), diagmodes_list.size());
+// bool isEqual = true;
+// std::vector<int>::iterator iter = diagmodes_list.begin();
+
+// for (std::vector<uint32_t>::const_iterator it = diag_modes.begin();
+// it != diag_modes.end(); it++) {
+
+// if ((uint32_t)(*iter) != (*it)) {
+// isEqual = false;
+// break;
+// }
+// iter++;
+// }
+// EXPECT_TRUE(isEqual);
+//}
+
+//TEST_F(ProfileTest, CheckStringContainer) {
+// // Set new config file
+// Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+// EXPECT_EQ("smartDeviceLink_test.ini",
+// Profile::instance()->config_file_name());
+
+// bool isread = false;
+// std::vector < std::string > diagmodes_list = profile::Profile::instance()
+// ->ReadStringContainer("MAIN", "SupportedDiagModes", &isread);
+// EXPECT_TRUE(isread);
+
+// std::vector<std::string>::iterator diag_mode =
+// std::find(diagmodes_list.begin(), diagmodes_list.end(), "0x12");
+
+// // This element doesn't appear in list
+// EXPECT_EQ(diag_mode, diagmodes_list.end());
+
+// // List includes 0x01
+// diag_mode = std::find(diagmodes_list.begin(), diagmodes_list.end(), "0x01");
+// EXPECT_EQ(diag_mode, diagmodes_list.begin());
+
+// // List includes 0x03
+// 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");
+// EXPECT_EQ(diag_mode, element_mode);
+//}
+
+//#ifdef ENABLE_SECURITY
+//TEST_F(ProfileTest, CheckIntContainerInSecurityData) {
+// // Set new config file
+// Profile::instance()->config_file_name("smartDeviceLink_test.ini");
+// EXPECT_EQ("smartDeviceLink_test.ini",
+// Profile::instance()->config_file_name());
+
+// std::vector<int> force_unprotected_list =
+// profile::Profile::instance()->ReadIntContainer(
+// "Security Manager", "ForceUnprotectedService", NULL);
+
+// std::vector<int> force_protected_list =
+// profile::Profile::instance()->ReadIntContainer(
+// "Security Manager", "ForceProtectedService", NULL);
+
+// std::vector<int>::iterator res_unprotect = std::find(force_unprotected_list.begin(), force_unprotected_list.end(), 0x07);
+// std::vector<int>::iterator res_protect = std::find(force_protected_list.begin(), force_protected_list.end(), 0x07);
+// // This element doesn't appear in both lists
+// EXPECT_EQ(res_unprotect, force_unprotected_list.end() );
+// EXPECT_EQ(res_protect, force_protected_list.end() );
+
+// // Both lists include 0
+// res_unprotect = std::find(force_unprotected_list.begin(), force_unprotected_list.end(), 0);
+// res_protect = std::find(force_protected_list.begin(), force_protected_list.end(), 0);
+// EXPECT_EQ(res_unprotect, force_unprotected_list.begin() );
+// EXPECT_EQ(res_protect, force_protected_list.begin() );
+//}
+//#endif
+
+} // namespace profile
+} // namespace components
+} // namespace test
diff --git a/src/components/config_profile/test/smartDeviceLink.ini b/src/components/config_profile/test/smartDeviceLink.ini
new file mode 100644
index 000000000..41dabaa53
--- /dev/null
+++ b/src/components/config_profile/test/smartDeviceLink.ini
@@ -0,0 +1,185 @@
+ ; The INI-file consists of different chapters.
+; Each chapter begins with the line containing
+; the name in square brackets. Syntax:
+; [chapter]
+; The chapters consists of a set of items with a
+; assinged value. The syntax is:
+; item=value
+; All white spaces an second encounters of chapters
+; or items will be ignored.
+; Remarks start with semicolon or star as first character.
+; It is alowed for names of chapters and items to
+; contain semicolon and star. Possible syntax is:
+; [ chapter ] ;Remark
+; item = value ;Remark
+
+[HMI]
+LaunchHMI = true
+ServerAddress = 127.0.0.1
+ServerPort = 8087
+VideoStreamingPort = 5050
+AudioStreamingPort = 5080
+
+[MAIN]
+; Contains .json/.ini files
+AppConfigFolder =
+; Contains output files, e.g. .wav
+AppStorageFolder = storage
+; Contains resourses, e.g. audio8bit.wav
+AppResourceFolder =
+; Standard min stack size
+; in Ubuntu : PTHREAD_STACK_MIN = 16384
+; in QNX : PTHREAD_STACK_MIN = 256
+;The value of a variable ThreadStackSize used only if its realy needed, other way stack size will be PTHREAD_STACK_MIN
+;
+ThreadStackSize = 20480
+MixingAudioSupported = true
+HMICapabilities = hmi_capabilities.json
+MaxCmdID = 2000000000
+; Default request timeout in milliseconds
+DefaultTimeout = 10000
+
+AppDirectoryQuota = 104857600
+; Allowed requests amount in HMI level NONE during time scale.
+; If value is 0 check will be skipped
+AppHMILevelNoneTimeScaleMaxRequests = 100
+AppHMILevelNoneRequestsTimeScale = 10
+; Allowed requests amount during time scale.
+; If value is 0 check will be skipped
+AppTimeScaleMaxRequests = 1000
+AppRequestsTimeScale = 10
+; Allowed pending requests amount. If value is 0 check will be skipped
+PendingRequestsAmount = 5000
+HeartBeatTimeout = 7
+SupportedDiagModes = 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x09, 0x0A, 0x18, 0x19, 0x22, 0x3E
+SystemFilesPath = /tmp/fs/mp/images/ivsu_cache
+UseLastState = true
+TimeTestingPort = 8090
+ReadDIDRequest = 5, 1
+GetVehicleDataRequest = 5, 1
+
+[MEDIA MANAGER]
+; where 3 is a number of retries and 1 is a timeout in seconds for request frequency
+StartStreamRetry = 3, 1
+EnableRedecoding = false
+VideoStreamConsumer = socket
+AudioStreamConsumer = socket
+;VideoStreamConsumer = file
+;AudioStreamConsumer = file
+;VideoStreamConsumer = pipe
+;AudioStreamConsumer = pipe
+;Temp solution: if you change NamedPipePath also change path to pipe in src/components/qt_hmi/qml_model_qtXX/views/SDLNavi.qml
+;Named pipe path will be constructed using AppStorageFolder + name
+NamedVideoPipePath = video_stream_pipe
+NamedAudioPipePath = audio_stream_pipe
+;File path will be constructed using AppStorageFolder + name
+VideoStreamFile = video_stream_file
+AudioStreamFile = audio_stream_file
+; Recording file source (used for audio pass thru emulation only)
+RecordingFileSource = audio.8bit.wav
+; Recording file for audio pass thru
+RecordingFileName = audio.wav
+
+; HelpPromt and TimeOutPrompt is a vector of strings separated by comma
+[GLOBAL PROPERTIES]
+
+; Delimiter, which will be appended to each TTS chunck, e.g. helpPrompt/timeoutPrompt
+TTSDelimiter = ,
+; Default prompt items, separated by comma
+HelpPromt = Please speak one of the following commands,Please say a command
+; Default prompt items, separated by comma
+TimeOutPromt = Please speak one of the following commands,Please say a command
+HelpTitle = Available Vr Commands List
+; In case mobile app didn't send global properties default global properties will be sent after this timeout
+; max value TTSGlobalPropertiesTimeout 64K
+TTSGlobalPropertiesTimeout = 20
+
+[FILESYSTEM RESTRICTIONS]
+; Max allowed number of PutFile requests for one application in NONE
+PutFileRequest = 5
+; Max allowed number of DeleteFile requests for one application in NONE
+DeleteFileRequest = 5
+; Max allowed number of ListFiles requests for one application in NONE
+ListFilesRequest = 5
+
+[VR COMMANDS]
+HelpCommand = Help
+
+[AppInfo]
+; The path for applications info storage.
+AppInfoStorage = app_info.dat
+
+[Security Manager]
+Protocol = TLSv1.2
+; Certificate and key path to pem file
+CertificatePath = mycert.pem
+KeyPath = mykey.pem
+; SSL mode could be SERVER or CLIENT
+SSLMode = CLIENT
+; Could be ALL ciphers or list of chosen
+;CipherList = AES256-GCM-SHA384
+CipherList = ALL
+; Verify Mobile app certificate (could be used in both SSLMode Server and Client)
+VerifyPeer = false
+; If VerifyPeer is enable - terminate handshake if mobile app did not return a certificate
+FialOnNoCert = false
+; If VerifyPeer is enable - do not ask for a mobile app certificate again in case of a renegotiation
+VerifyClientOnce = false
+; Force protected services (could be id's from 0x01 to 0xFF)
+;ForceProtectedService = 0x0A, 0x0B
+ForceProtectedService = Non
+; Force unprotected services
+;ForceUnprotectedService = 0x07
+ForceUnprotectedService = Non
+
+[Policy]
+EnablePolicy = true
+PreloadedPT = sdl_preloaded_pt.json
+PathToSnapshot = sdl_snapshot.json
+; Number of attempts to open policy DB
+AttemptsToOpenPolicyDB = 5
+; Timeout between attempts during opening DB in milliseconds
+OpenAttemptTimeoutMs = 500
+
+[TransportManager]
+TCPAdapterPort = 12345
+MMEDatabase = /dev/qdb/mediaservice_db
+EventMQ = /dev/mqueue/ToSDLCoreUSBAdapter
+AckMQ = /dev/mqueue/FromSDLCoreUSBAdapter
+
+[IAP]
+LegacyProtocol = com.ford.sync.prot[0-29]
+HubProtocol = com.smartdevicelink.prot0
+PoolProtocol = com.smartdevicelink.prot[1-29]
+IAPSystemConfig = /fs/mp/etc/mm/ipod.cfg
+IAP2SystemConfig = /fs/mp/etc/mm/iap2.cfg
+IAP2HubConnectAttempts = 3
+
+[ProtocolHandler]
+; Packet with payload bigger than next value will be marked as a malformed
+; 1488 = 1500 - 12 = TCP MTU - header size
+MaximumPayloadSize = 1488
+; Application shall send less #FrequencyCount messages per #FrequencyTime mSecs
+; Frequency check could be disable by setting FrequencyTime to Zero
+FrequencyCount = 1000
+FrequencyTime = 1000
+
+[ApplicationManager]
+ApplicationListUpdateTimeout = 2
+; Max allowed threads for handling mobile requests. Currently max allowed is 2
+ThreadPoolSize = 1
+
+[Resumption]
+
+# Timeout in seconds for resumption Application HMILevel
+# and resolving conflicts in case if multiple applications initiate resumption
+ApplicationResumingTimeout = 3
+
+# Timeout in seconds for pereodical saving resumption persisten data
+AppSavePersistentDataTimeout = 10 #seconds
+
+# Timeout in seconds to store hmi_level for media app before ign_off
+ResumptionDelayBeforeIgn = 30;
+
+# Timeout in seconds to restore hmi_level for media app after sdl run
+ResumptionDelayAfterIgn = 30;
diff --git a/src/components/config_profile/test/smartDeviceLink_invalid_boolean.ini b/src/components/config_profile/test/smartDeviceLink_invalid_boolean.ini
new file mode 100644
index 000000000..560fb5117
--- /dev/null
+++ b/src/components/config_profile/test/smartDeviceLink_invalid_boolean.ini
@@ -0,0 +1,185 @@
+ ; The INI-file consists of different chapters.
+; Each chapter begins with the line containing
+; the name in square brackets. Syntax:
+; [chapter]
+; The chapters consists of a set of items with a
+; assinged value. The syntax is:
+; item=value
+; All white spaces an second encounters of chapters
+; or items will be ignored.
+; Remarks start with semicolon or star as first character.
+; It is alowed for names of chapters and items to
+; contain semicolon and star. Possible syntax is:
+; [ chapter ] ;Remark
+; item = value ;Remark
+
+[HMI]
+LaunchHMI = True
+ServerAddress = 127.0.0.1
+ServerPort = 8087
+VideoStreamingPort = 5050
+AudioStreamingPort = 5080
+
+[MAIN]
+; Contains .json/.ini files
+AppConfigFolder =
+; Contains output files, e.g. .wav
+AppStorageFolder = storage
+; Contains resourses, e.g. audio8bit.wav
+AppResourceFolder =
+; Standard min stack size
+; in Ubuntu : PTHREAD_STACK_MIN = 16384
+; in QNX : PTHREAD_STACK_MIN = 256
+;The value of a variable ThreadStackSize used only if its realy needed, other way stack size will be PTHREAD_STACK_MIN
+;
+ThreadStackSize = 20480
+MixingAudioSupported = true
+HMICapabilities = hmi_capabilities.json
+MaxCmdID = 2000000000
+; Default request timeout in milliseconds
+DefaultTimeout = 10000
+
+AppDirectoryQuota = 104857600
+; Allowed requests amount in HMI level NONE during time scale.
+; If value is 0 check will be skipped
+AppHMILevelNoneTimeScaleMaxRequests = 100
+AppHMILevelNoneRequestsTimeScale = 10
+; Allowed requests amount during time scale.
+; If value is 0 check will be skipped
+AppTimeScaleMaxRequests = 1000
+AppRequestsTimeScale = 10
+; Allowed pending requests amount. If value is 0 check will be skipped
+PendingRequestsAmount = 5000
+HeartBeatTimeout = 7
+SupportedDiagModes = 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x09, 0x0A, 0x18, 0x19, 0x22, 0x3E
+SystemFilesPath = /tmp/fs/mp/images/ivsu_cache
+UseLastState = true
+TimeTestingPort = 8090
+ReadDIDRequest = 5, 1
+GetVehicleDataRequest = 5, 1
+
+[MEDIA MANAGER]
+; where 3 is a number of retries and 1 is a timeout in seconds for request frequency
+StartStreamRetry = 3, 1
+EnableRedecoding = FALSE
+VideoStreamConsumer = socket
+AudioStreamConsumer = socket
+;VideoStreamConsumer = file
+;AudioStreamConsumer = file
+;VideoStreamConsumer = pipe
+;AudioStreamConsumer = pipe
+;Temp solution: if you change NamedPipePath also change path to pipe in src/components/qt_hmi/qml_model_qtXX/views/SDLNavi.qml
+;Named pipe path will be constructed using AppStorageFolder + name
+NamedVideoPipePath = video_stream_pipe
+NamedAudioPipePath = audio_stream_pipe
+;File path will be constructed using AppStorageFolder + name
+VideoStreamFile = video_stream_file
+AudioStreamFile = audio_stream_file
+; Recording file source (used for audio pass thru emulation only)
+RecordingFileSource = audio.8bit.wav
+; Recording file for audio pass thru
+RecordingFileName = audio.wav
+
+; HelpPromt and TimeOutPrompt is a vector of strings separated by comma
+[GLOBAL PROPERTIES]
+
+; Delimiter, which will be appended to each TTS chunck, e.g. helpPrompt/timeoutPrompt
+TTSDelimiter = ,
+; Default prompt items, separated by comma
+HelpPromt = Please speak one of the following commands,Please say a command
+; Default prompt items, separated by comma
+TimeOutPromt = Please speak one of the following commands,Please say a command
+HelpTitle = Available Vr Commands List
+; In case mobile app didn't send global properties default global properties will be sent after this timeout
+; max value TTSGlobalPropertiesTimeout 64K
+TTSGlobalPropertiesTimeout = 20
+
+[FILESYSTEM RESTRICTIONS]
+; Max allowed number of PutFile requests for one application in NONE
+PutFileRequest = 5
+; Max allowed number of DeleteFile requests for one application in NONE
+DeleteFileRequest = 5
+; Max allowed number of ListFiles requests for one application in NONE
+ListFilesRequest = 5
+
+[VR COMMANDS]
+HelpCommand = Help
+
+[AppInfo]
+; The path for applications info storage.
+AppInfoStorage = app_info.dat
+
+[Security Manager]
+Protocol = TLSv1.2
+; Certificate and key path to pem file
+CertificatePath = mycert.pem
+KeyPath = mykey.pem
+; SSL mode could be SERVER or CLIENT
+SSLMode = CLIENT
+; Could be ALL ciphers or list of chosen
+;CipherList = AES256-GCM-SHA384
+CipherList = ALL
+; Verify Mobile app certificate (could be used in both SSLMode Server and Client)
+VerifyPeer = false
+; If VerifyPeer is enable - terminate handshake if mobile app did not return a certificate
+FialOnNoCert = false
+; If VerifyPeer is enable - do not ask for a mobile app certificate again in case of a renegotiation
+VerifyClientOnce = false
+; Force protected services (could be id's from 0x01 to 0xFF)
+;ForceProtectedService = 0x0A, 0x0B
+ForceProtectedService = Non
+; Force unprotected services
+;ForceUnprotectedService = 0x07
+ForceUnprotectedService = Non
+
+[Policy]
+EnablePolicy = TRUE
+PreloadedPT = sdl_preloaded_pt.json
+PathToSnapshot = sdl_snapshot.json
+; Number of attempts to open policy DB
+AttemptsToOpenPolicyDB = 5
+; Timeout between attempts during opening DB in milliseconds
+OpenAttemptTimeoutMs = 500
+
+[TransportManager]
+TCPAdapterPort = 12345
+MMEDatabase = /dev/qdb/mediaservice_db
+EventMQ = /dev/mqueue/ToSDLCoreUSBAdapter
+AckMQ = /dev/mqueue/FromSDLCoreUSBAdapter
+
+[IAP]
+LegacyProtocol = com.ford.sync.prot[0-29]
+HubProtocol = com.smartdevicelink.prot0
+PoolProtocol = com.smartdevicelink.prot[1-29]
+IAPSystemConfig = /fs/mp/etc/mm/ipod.cfg
+IAP2SystemConfig = /fs/mp/etc/mm/iap2.cfg
+IAP2HubConnectAttempts = 3
+
+[ProtocolHandler]
+; Packet with payload bigger than next value will be marked as a malformed
+; 1488 = 1500 - 12 = TCP MTU - header size
+MaximumPayloadSize = 1488
+; Application shall send less #FrequencyCount messages per #FrequencyTime mSecs
+; Frequency check could be disable by setting FrequencyTime to Zero
+FrequencyCount = 1000
+FrequencyTime = 1000
+
+[ApplicationManager]
+ApplicationListUpdateTimeout = 2
+; Max allowed threads for handling mobile requests. Currently max allowed is 2
+ThreadPoolSize = 1
+
+[Resumption]
+
+# Timeout in seconds for resumption Application HMILevel
+# and resolving conflicts in case if multiple applications initiate resumption
+ApplicationResumingTimeout = 3
+
+# Timeout in seconds for pereodical saving resumption persisten data
+AppSavePersistentDataTimeout = 10 #seconds
+
+# Timeout in seconds to store hmi_level for media app before ign_off
+ResumptionDelayBeforeIgn = 30;
+
+# Timeout in seconds to restore hmi_level for media app after sdl run
+ResumptionDelayAfterIgn = 30;
diff --git a/src/components/config_profile/test/smartDeviceLink_invalid_int.ini b/src/components/config_profile/test/smartDeviceLink_invalid_int.ini
new file mode 100644
index 000000000..76bcc5a0f
--- /dev/null
+++ b/src/components/config_profile/test/smartDeviceLink_invalid_int.ini
@@ -0,0 +1,187 @@
+ ; The INI-file consists of different chapters.
+; Each chapter begins with the line containing
+; the name in square brackets. Syntax:
+; [chapter]
+; The chapters consists of a set of items with a
+; assinged value. The syntax is:
+; item=value
+; All white spaces an second encounters of chapters
+; or items will be ignored.
+; Remarks start with semicolon or star as first character.
+; It is alowed for names of chapters and items to
+; contain semicolon and star. Possible syntax is:
+; [ chapter ] ;Remark
+; item = value ;Remark
+
+[HMI]
+LaunchHMI = true
+ServerAddress = 127.0.0.1
+ServerPort = -1
+VideoStreamingPort = 5050
+AudioStreamingPort = 5080
+
+[MAIN]
+; Contains .json/.ini files
+AppConfigFolder =
+; Contains output files, e.g. .wav
+AppStorageFolder = storage
+; Contains resourses, e.g. audio8bit.wav
+AppResourceFolder =
+; Standard min stack size
+; in Ubuntu : PTHREAD_STACK_MIN = 16384
+; in QNX : PTHREAD_STACK_MIN = 256
+;The value of a variable ThreadStackSize used only if its realy needed, other way stack size will be PTHREAD_STACK_MIN
+;
+ThreadStackSize = 0
+MixingAudioSupported = true
+HMICapabilities = hmi_capabilities.json
+MaxCmdID = 20000000000
+; Default request timeout in milliseconds
+DefaultTimeout = 10000
+
+AppDirectoryQuota = 104857600
+; Allowed requests amount in HMI level NONE during time scale.
+; If value is 0 check will be skipped
+AppHMILevelNoneTimeScaleMaxRequests = 100
+AppHMILevelNoneRequestsTimeScale = 10
+; Allowed requests amount during time scale.
+; If value is 0 check will be skipped
+AppTimeScaleMaxRequests = 1000
+AppRequestsTimeScale = 10
+; Allowed pending requests amount. If value is 0 check will be skipped
+PendingRequestsAmount = 5000
+; word instead of number
+HeartBeatTimeout = seven
+SupportedDiagModes = 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x09, 0x0A, 0x18, 0x19, 0x22, 0x3E
+SystemFilesPath = /tmp/fs/mp/images/ivsu_cache
+UseLastState = true
+TimeTestingPort = 8090
+ReadDIDRequest = 5, 1
+GetVehicleDataRequest = 5, 1
+
+[MEDIA MANAGER]
+; where 3 is a number of retries and 1 is a timeout in seconds for request frequency
+StartStreamRetry = 3, 1
+EnableRedecoding = false
+VideoStreamConsumer = socket
+AudioStreamConsumer = socket
+;VideoStreamConsumer = file
+;AudioStreamConsumer = file
+;VideoStreamConsumer = pipe
+;AudioStreamConsumer = pipe
+;Temp solution: if you change NamedPipePath also change path to pipe in src/components/qt_hmi/qml_model_qtXX/views/SDLNavi.qml
+;Named pipe path will be constructed using AppStorageFolder + name
+NamedVideoPipePath = video_stream_pipe
+NamedAudioPipePath = audio_stream_pipe
+;File path will be constructed using AppStorageFolder + name
+VideoStreamFile = video_stream_file
+AudioStreamFile = audio_stream_file
+; Recording file source (used for audio pass thru emulation only)
+RecordingFileSource = audio.8bit.wav
+; Recording file for audio pass thru
+RecordingFileName = audio.wav
+
+; HelpPromt and TimeOutPrompt is a vector of strings separated by comma
+[GLOBAL PROPERTIES]
+
+; Delimiter, which will be appended to each TTS chunck, e.g. helpPrompt/timeoutPrompt
+TTSDelimiter = ,
+; Default prompt items, separated by comma
+HelpPromt = Please speak one of the following commands,Please say a command
+; Default prompt items, separated by comma
+TimeOutPromt = Please speak one of the following commands,Please say a command
+HelpTitle = Available Vr Commands List
+; In case mobile app didn't send global properties default global properties will be sent after this timeout
+; max value TTSGlobalPropertiesTimeout 64K
+TTSGlobalPropertiesTimeout = 20
+
+[FILESYSTEM RESTRICTIONS]
+; Max allowed number of PutFile requests for one application in NONE
+PutFileRequest = 5
+; Max allowed number of DeleteFile requests for one application in NONE
+DeleteFileRequest = 5
+; Max allowed number of ListFiles requests for one application in NONE
+;--------------- should be int
+ListFilesRequest = 5,1
+
+[VR COMMANDS]
+HelpCommand = Help
+
+[AppInfo]
+; The path for applications info storage.
+AppInfoStorage = app_info.dat
+
+[Security Manager]
+Protocol = TLSv1.2
+; Certificate and key path to pem file
+CertificatePath = mycert.pem
+KeyPath = mykey.pem
+; SSL mode could be SERVER or CLIENT
+SSLMode = CLIENT
+; Could be ALL ciphers or list of chosen
+;CipherList = AES256-GCM-SHA384
+CipherList = ALL
+; Verify Mobile app certificate (could be used in both SSLMode Server and Client)
+VerifyPeer = false
+; If VerifyPeer is enable - terminate handshake if mobile app did not return a certificate
+FialOnNoCert = false
+; If VerifyPeer is enable - do not ask for a mobile app certificate again in case of a renegotiation
+VerifyClientOnce = false
+; Force protected services (could be id's from 0x01 to 0xFF)
+;ForceProtectedService = 0x0A, 0x0B
+ForceProtectedService = Non
+; Force unprotected services
+;ForceUnprotectedService = 0x07
+ForceUnprotectedService = Non
+
+[Policy]
+EnablePolicy = true
+PreloadedPT = sdl_preloaded_pt.json
+PathToSnapshot = sdl_snapshot.json
+; Number of attempts to open policy DB
+AttemptsToOpenPolicyDB = 5
+; Timeout between attempts during opening DB in milliseconds
+OpenAttemptTimeoutMs = 500
+
+[TransportManager]
+TCPAdapterPort = 12345
+MMEDatabase = /dev/qdb/mediaservice_db
+EventMQ = /dev/mqueue/ToSDLCoreUSBAdapter
+AckMQ = /dev/mqueue/FromSDLCoreUSBAdapter
+
+[IAP]
+LegacyProtocol = com.ford.sync.prot[0-29]
+HubProtocol = com.smartdevicelink.prot0
+PoolProtocol = com.smartdevicelink.prot[1-29]
+IAPSystemConfig = /fs/mp/etc/mm/ipod.cfg
+IAP2SystemConfig = /fs/mp/etc/mm/iap2.cfg
+IAP2HubConnectAttempts = 3
+
+[ProtocolHandler]
+; Packet with payload bigger than next value will be marked as a malformed
+; 1488 = 1500 - 12 = TCP MTU - header size
+MaximumPayloadSize = 1488
+; Application shall send less #FrequencyCount messages per #FrequencyTime mSecs
+; Frequency check could be disable by setting FrequencyTime to Zero
+FrequencyCount = 1000
+FrequencyTime = 1000
+
+[ApplicationManager]
+ApplicationListUpdateTimeout = 2
+; Max allowed threads for handling mobile requests. Currently max allowed is 2
+ThreadPoolSize = 1
+
+[Resumption]
+
+# Timeout in seconds for resumption Application HMILevel
+# and resolving conflicts in case if multiple applications initiate resumption
+ApplicationResumingTimeout = 3
+
+# Timeout in seconds for pereodical saving resumption persisten data
+AppSavePersistentDataTimeout = 10 #seconds
+
+# Timeout in seconds to store hmi_level for media app before ign_off
+ResumptionDelayBeforeIgn = 30;
+
+# Timeout in seconds to restore hmi_level for media app after sdl run
+ResumptionDelayAfterIgn = 30;
diff --git a/src/components/config_profile/test/smartDeviceLink_invalid_pairs.ini b/src/components/config_profile/test/smartDeviceLink_invalid_pairs.ini
new file mode 100644
index 000000000..1507b2a84
--- /dev/null
+++ b/src/components/config_profile/test/smartDeviceLink_invalid_pairs.ini
@@ -0,0 +1,187 @@
+ ; The INI-file consists of different chapters.
+; Each chapter begins with the line containing
+; the name in square brackets. Syntax:
+; [chapter]
+; The chapters consists of a set of items with a
+; assinged value. The syntax is:
+; item=value
+; All white spaces an second encounters of chapters
+; or items will be ignored.
+; Remarks start with semicolon or star as first character.
+; It is alowed for names of chapters and items to
+; contain semicolon and star. Possible syntax is:
+; [ chapter ] ;Remark
+; item = value ;Remark
+
+[HMI]
+LaunchHMI = true
+ServerAddress = 127.0.0.1
+ServerPort = 8087
+VideoStreamingPort = 5050
+AudioStreamingPort = 5080
+
+[MAIN]
+; Contains .json/.ini files
+AppConfigFolder =
+; Contains output files, e.g. .wav
+AppStorageFolder = storage
+; Contains resourses, e.g. audio8bit.wav
+AppResourceFolder =
+; Standard min stack size
+; in Ubuntu : PTHREAD_STACK_MIN = 16384
+; in QNX : PTHREAD_STACK_MIN = 256
+;The value of a variable ThreadStackSize used only if its realy needed, other way stack size will be PTHREAD_STACK_MIN
+;
+ThreadStackSize = 20480
+MixingAudioSupported = true
+HMICapabilities = hmi_capabilities.json
+MaxCmdID = 2000000000
+; Default request timeout in milliseconds
+DefaultTimeout = 10000
+
+AppDirectoryQuota = 104857600
+; Allowed requests amount in HMI level NONE during time scale.
+; If value is 0 check will be skipped
+AppHMILevelNoneTimeScaleMaxRequests = 100
+AppHMILevelNoneRequestsTimeScale = 10
+; Allowed requests amount during time scale.
+; If value is 0 check will be skipped
+AppTimeScaleMaxRequests = 1000
+AppRequestsTimeScale = 10
+; Allowed pending requests amount. If value is 0 check will be skipped
+PendingRequestsAmount = 5000
+HeartBeatTimeout = 7
+SupportedDiagModes = 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x09, 0x0A, 0x18, 0x19, 0x22, 0x3E
+SystemFilesPath = /tmp/fs/mp/images/ivsu_cache
+UseLastState = true
+TimeTestingPort = 8090
+;----------------------
+ReadDIDRequest =
+GetVehicleDataRequest = ,
+
+[MEDIA MANAGER]
+; where 3 is a number of retries and 1 is a timeout in seconds for request frequency
+;------------------------ should be pair
+StartStreamRetry = 9
+EnableRedecoding = false
+VideoStreamConsumer = socket
+AudioStreamConsumer = socket
+;VideoStreamConsumer = file
+;AudioStreamConsumer = file
+;VideoStreamConsumer = pipe
+;AudioStreamConsumer = pipe
+;Temp solution: if you change NamedPipePath also change path to pipe in src/components/qt_hmi/qml_model_qtXX/views/SDLNavi.qml
+;Named pipe path will be constructed using AppStorageFolder + name
+NamedVideoPipePath = video_stream_pipe
+NamedAudioPipePath = audio_stream_pipe
+;File path will be constructed using AppStorageFolder + name
+VideoStreamFile = video_stream_file
+AudioStreamFile = audio_stream_file
+; Recording file source (used for audio pass thru emulation only)
+RecordingFileSource = audio.8bit.wav
+; Recording file for audio pass thru
+RecordingFileName = audio.wav
+
+; HelpPromt and TimeOutPrompt is a vector of strings separated by comma
+[GLOBAL PROPERTIES]
+
+; Delimiter, which will be appended to each TTS chunck, e.g. helpPrompt/timeoutPrompt
+TTSDelimiter = ,
+; Default prompt items, separated by comma
+HelpPromt = Please speak one of the following commands,Please say a command
+; Default prompt items, separated by comma
+TimeOutPromt = Please speak one of the following commands,Please say a command
+HelpTitle = Available Vr Commands List
+; In case mobile app didn't send global properties default global properties will be sent after this timeout
+; max value TTSGlobalPropertiesTimeout 64K
+TTSGlobalPropertiesTimeout = 20
+
+[FILESYSTEM RESTRICTIONS]
+; Max allowed number of PutFile requests for one application in NONE
+PutFileRequest = 5
+; Max allowed number of DeleteFile requests for one application in NONE
+DeleteFileRequest = 5
+; Max allowed number of ListFiles requests for one application in NONE
+ListFilesRequest = 5
+
+[VR COMMANDS]
+HelpCommand = Help
+
+[AppInfo]
+; The path for applications info storage.
+AppInfoStorage = app_info.dat
+
+[Security Manager]
+Protocol = TLSv1.2
+; Certificate and key path to pem file
+CertificatePath = mycert.pem
+KeyPath = mykey.pem
+; SSL mode could be SERVER or CLIENT
+SSLMode = CLIENT
+; Could be ALL ciphers or list of chosen
+;CipherList = AES256-GCM-SHA384
+CipherList = ALL
+; Verify Mobile app certificate (could be used in both SSLMode Server and Client)
+VerifyPeer = false
+; If VerifyPeer is enable - terminate handshake if mobile app did not return a certificate
+FialOnNoCert = false
+; If VerifyPeer is enable - do not ask for a mobile app certificate again in case of a renegotiation
+VerifyClientOnce = false
+; Force protected services (could be id's from 0x01 to 0xFF)
+;ForceProtectedService = 0x0A, 0x0B
+ForceProtectedService = Non
+; Force unprotected services
+;ForceUnprotectedService = 0x07
+ForceUnprotectedService = Non
+
+[Policy]
+EnablePolicy = true
+PreloadedPT = sdl_preloaded_pt.json
+PathToSnapshot = sdl_snapshot.json
+; Number of attempts to open policy DB
+AttemptsToOpenPolicyDB = 5
+; Timeout between attempts during opening DB in milliseconds
+OpenAttemptTimeoutMs = 500
+
+[TransportManager]
+TCPAdapterPort = 12345
+MMEDatabase = /dev/qdb/mediaservice_db
+EventMQ = /dev/mqueue/ToSDLCoreUSBAdapter
+AckMQ = /dev/mqueue/FromSDLCoreUSBAdapter
+
+[IAP]
+LegacyProtocol = com.ford.sync.prot[0-29]
+HubProtocol = com.smartdevicelink.prot0
+PoolProtocol = com.smartdevicelink.prot[1-29]
+IAPSystemConfig = /fs/mp/etc/mm/ipod.cfg
+IAP2SystemConfig = /fs/mp/etc/mm/iap2.cfg
+IAP2HubConnectAttempts = 3
+
+[ProtocolHandler]
+; Packet with payload bigger than next value will be marked as a malformed
+; 1488 = 1500 - 12 = TCP MTU - header size
+MaximumPayloadSize = 1488
+; Application shall send less #FrequencyCount messages per #FrequencyTime mSecs
+; Frequency check could be disable by setting FrequencyTime to Zero
+FrequencyCount = 1000
+FrequencyTime = 1000
+
+[ApplicationManager]
+ApplicationListUpdateTimeout = 2
+; Max allowed threads for handling mobile requests. Currently max allowed is 2
+ThreadPoolSize = 1
+
+[Resumption]
+
+# Timeout in seconds for resumption Application HMILevel
+# and resolving conflicts in case if multiple applications initiate resumption
+ApplicationResumingTimeout = 3
+
+# Timeout in seconds for pereodical saving resumption persisten data
+AppSavePersistentDataTimeout = 10 #seconds
+
+# Timeout in seconds to store hmi_level for media app before ign_off
+ResumptionDelayBeforeIgn = 30;
+
+# Timeout in seconds to restore hmi_level for media app after sdl run
+ResumptionDelayAfterIgn = 30;
diff --git a/src/components/config_profile/test/smartDeviceLink_invalid_string.ini b/src/components/config_profile/test/smartDeviceLink_invalid_string.ini
new file mode 100644
index 000000000..6669b580c
--- /dev/null
+++ b/src/components/config_profile/test/smartDeviceLink_invalid_string.ini
@@ -0,0 +1,190 @@
+ ; The INI-file consists of different chapters.
+; Each chapter begins with the line containing
+; the name in square brackets. Syntax:
+; [chapter]
+; The chapters consists of a set of items with a
+; assinged value. The syntax is:
+; item=value
+; All white spaces an second encounters of chapters
+; or items will be ignored.
+; Remarks start with semicolon or star as first character.
+; It is alowed for names of chapters and items to
+; contain semicolon and star. Possible syntax is:
+; [ chapter ] ;Remark
+; item = value ;Remark
+
+[HMI]
+LaunchHMI = true
+ServerAddress = 127.0.0.1 + слово
+ServerPort = 8087
+VideoStreamingPort = 5050
+AudioStreamingPort = 5080
+
+[MAIN]
+; Contains .json/.ini files
+; forbidden name for directory
+AppConfigFolder = ///
+; Contains output files, e.g. .wav
+;
+AppStorageFolder = " "
+; Contains resourses, e.g. audio8bit.wav
+;-----
+AppResourceFolder = new folder/
+; Standard min stack size
+; in Ubuntu : PTHREAD_STACK_MIN = 16384
+; in QNX : PTHREAD_STACK_MIN = 256
+;The value of a variable ThreadStackSize used only if its realy needed, other way stack size will be PTHREAD_STACK_MIN
+;
+ThreadStackSize = 20480
+MixingAudioSupported = true
+HMICapabilities = hmi_capabilities.json
+MaxCmdID = 2000000000
+; Default request timeout in milliseconds
+DefaultTimeout = 10000
+
+AppDirectoryQuota = 104857600
+; Allowed requests amount in HMI level NONE during time scale.
+; If value is 0 check will be skipped
+AppHMILevelNoneTimeScaleMaxRequests = 100
+AppHMILevelNoneRequestsTimeScale = 10
+; Allowed requests amount during time scale.
+; If value is 0 check will be skipped
+AppTimeScaleMaxRequests = 1000
+AppRequestsTimeScale = 10
+; Allowed pending requests amount. If value is 0 check will be skipped
+PendingRequestsAmount = 5000
+HeartBeatTimeout = 7
+SupportedDiagModes = 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x09, 0x0A, 0x18, 0x19, 0x22, 0x3E
+SystemFilesPath = /tmp/fs/mp/images/ivsu_cache
+UseLastState = true
+TimeTestingPort = 8090
+ReadDIDRequest = 5, 1
+;Check wrong pair value
+GetVehicleDataRequest = A, 0
+
+[MEDIA MANAGER]
+; where 3 is a number of retries and 1 is a timeout in seconds for request frequency
+StartStreamRetry = 3, 1
+EnableRedecoding = false
+VideoStreamConsumer = socket
+AudioStreamConsumer = socket
+;VideoStreamConsumer = file
+;AudioStreamConsumer = file
+;VideoStreamConsumer = pipe
+;AudioStreamConsumer = pipe
+;Temp solution: if you change NamedPipePath also change path to pipe in src/components/qt_hmi/qml_model_qtXX/views/SDLNavi.qml
+;Named pipe path will be constructed using AppStorageFolder + name
+NamedVideoPipePath = video_stream_pipe
+NamedAudioPipePath = audio_stream_pipe
+;File path will be constructed using AppStorageFolder + name
+VideoStreamFile = video_stream_file
+AudioStreamFile = audio_stream_file
+; Recording file source (used for audio pass thru emulation only)
+RecordingFileSource = 00012\\345/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012\\345/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012\\345/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012\\345/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012\\345/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a
+; Recording file for audio pass thru
+RecordingFileName = 0/0/0/1/2345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890abc!def@ghi
+
+; HelpPromt and TimeOutPrompt is a vector of strings separated by comma
+[GLOBAL PROPERTIES]
+
+; Delimiter, which will be appended to each TTS chunck, e.g. helpPrompt/timeoutPrompt
+; ---------- words instead of coma
+TTSDelimiter = coma and point
+; Default prompt items, separated by comma
+HelpPromt = Please speak one of the following commands,Please say a command
+; Default prompt items, separated by comma
+TimeOutPromt = Please speak one of the following commands,Please say a command
+HelpTitle = 0/0/0/1/2345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890abc!def@ghi
+; In case mobile app didn't send global properties default global properties will be sent after this timeout
+; max value TTSGlobalPropertiesTimeout 64K
+TTSGlobalPropertiesTimeout = 20
+
+[FILESYSTEM RESTRICTIONS]
+; Max allowed number of PutFile requests for one application in NONE
+PutFileRequest = 5
+; Max allowed number of DeleteFile requests for one application in NONE
+DeleteFileRequest = 5
+; Max allowed number of ListFiles requests for one application in NONE
+ListFilesRequest = 5
+
+[VR COMMANDS]
+HelpCommand = Help
+
+[AppInfo]
+; The path for applications info storage.
+AppInfoStorage = app_info.dat
+
+[Security Manager]
+Protocol = TLSv1.2
+; Certificate and key path to pem file
+CertificatePath = mycert.pem
+KeyPath = mykey.pem
+; SSL mode could be SERVER or CLIENT
+SSLMode = CLIENT
+; Could be ALL ciphers or list of chosen
+;CipherList = AES256-GCM-SHA384
+CipherList = ALL
+; Verify Mobile app certificate (could be used in both SSLMode Server and Client)
+VerifyPeer = false
+; If VerifyPeer is enable - terminate handshake if mobile app did not return a certificate
+FialOnNoCert = false
+; If VerifyPeer is enable - do not ask for a mobile app certificate again in case of a renegotiation
+VerifyClientOnce = false
+; Force protected services (could be id's from 0x01 to 0xFF)
+;ForceProtectedService = 0x0A, 0x0B
+ForceProtectedService = Non
+; Force unprotected services
+;ForceUnprotectedService = 0x07
+ForceUnprotectedService = Non
+
+[Policy]
+EnablePolicy = true
+PreloadedPT = sdl_preloaded_pt.json
+PathToSnapshot = sdl_snapshot.json
+; Number of attempts to open policy DB
+AttemptsToOpenPolicyDB = 5
+; Timeout between attempts during opening DB in milliseconds
+OpenAttemptTimeoutMs = 500
+
+[TransportManager]
+TCPAdapterPort = 12345
+MMEDatabase = /dev/qdb/mediaservice_db
+EventMQ = /dev/mqueue/ToSDLCoreUSBAdapter
+AckMQ = /dev/mqueue/FromSDLCoreUSBAdapter
+
+[IAP]
+LegacyProtocol = com.ford.sync.prot[0-29]
+HubProtocol = com.smartdevicelink.prot0
+PoolProtocol = com.smartdevicelink.prot[1-29]
+IAPSystemConfig = /fs/mp/etc/mm/ipod.cfg
+IAP2SystemConfig = /fs/mp/etc/mm/iap2.cfg
+IAP2HubConnectAttempts = 3
+
+[ProtocolHandler]
+; Packet with payload bigger than next value will be marked as a malformed
+; 1488 = 1500 - 12 = TCP MTU - header size
+MaximumPayloadSize = 1488
+; Application shall send less #FrequencyCount messages per #FrequencyTime mSecs
+; Frequency check could be disable by setting FrequencyTime to Zero
+FrequencyCount = 1000
+FrequencyTime = 1000
+
+[ApplicationManager]
+ApplicationListUpdateTimeout = 2
+; Max allowed threads for handling mobile requests. Currently max allowed is 2
+ThreadPoolSize = 1
+
+[Resumption]
+
+# Timeout in seconds for resumption Application HMILevel
+# and resolving conflicts in case if multiple applications initiate resumption
+ApplicationResumingTimeout = 3
+
+# Timeout in seconds for pereodical saving resumption persisten data
+AppSavePersistentDataTimeout = 10 #seconds
+
+# Timeout in seconds to store hmi_level for media app before ign_off
+ResumptionDelayBeforeIgn = 30;
+
+# Timeout in seconds to restore hmi_level for media app after sdl run
+ResumptionDelayAfterIgn = 30;
diff --git a/src/components/config_profile/test/smartDeviceLink_test.ini b/src/components/config_profile/test/smartDeviceLink_test.ini
new file mode 100644
index 000000000..6e2943b56
--- /dev/null
+++ b/src/components/config_profile/test/smartDeviceLink_test.ini
@@ -0,0 +1,192 @@
+ ; The INI-file consists of different chapters.
+; Each chapter begins with the line containing
+; the name in square brackets. Syntax:
+; [chapter]
+; The chapters consists of a set of items with a
+; assinged value. The syntax is:
+; item=value
+; All white spaces an second encounters of chapters
+; or items will be ignored.
+; Remarks start with semicolon or star as first character.
+; It is alowed for names of chapters and items to
+; contain semicolon and star. Possible syntax is:
+; [ chapter ] ;Remark
+; item = value ;Remark
+
+[HMI]
+;--------------------
+LaunchHMI = false
+ServerAddress = 127.0.0.1
+ServerPort = 8088
+ServerPort = 8087
+VideoStreamingPort = 5050
+AudioStreamingPort = 5080
+
+[MAIN]
+; Contains .json/.ini files
+AppConfigFolder =
+; Contains output files, e.g. .wav
+AppStorageFolder = storage
+; Contains resourses, e.g. audio8bit.wav
+AppResourceFolder =
+; Standard min stack size
+; in Ubuntu : PTHREAD_STACK_MIN = 16384
+; in QNX : PTHREAD_STACK_MIN = 256
+;The value of a variable ThreadStackSize used only if its realy needed, other way stack size will be PTHREAD_STACK_MIN
+;
+ThreadStackSize = 21000
+MixingAudioSupported = false
+HMICapabilities = hmi_capabilities.json
+;-----------------------
+MaxCmdID = 20000000000
+; Default request timeout in milliseconds
+;-----------------------
+DefaultTimeout =
+
+AppDirectoryQuota = 104857600
+; Allowed requests amount in HMI level NONE during time scale.
+; If value is 0 check will be skipped
+AppHMILevelNoneTimeScaleMaxRequests = 100
+AppHMILevelNoneRequestsTimeScale = 10
+; Allowed requests amount during time scale.
+; If value is 0 check will be skipped
+AppTimeScaleMaxRequests = 1000
+AppRequestsTimeScale = 10
+; Allowed pending requests amount. If value is 0 check will be skipped
+PendingRequestsAmount = 5000
+HeartBeatTimeout = 7
+SupportedDiagModes = 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x09, 0x0A, 0x18, 0x19, 0x22, 0x3E
+SystemFilesPath = /tmp/fs/mp/images/ivsu_cache
+UseLastState = true
+TimeTestingPort = 8090
+ReadDIDRequest = 5, 1
+GetVehicleDataRequest = 5, 1
+
+[MEDIA MANAGER]
+; where 3 is a number of retries and 1 is a timeout in seconds for request frequency
+StartStreamRetry = 3, 1
+EnableRedecoding = true
+VideoStreamConsumer = socket
+AudioStreamConsumer = socket
+;VideoStreamConsumer = file
+;AudioStreamConsumer = file
+;VideoStreamConsumer = pipe
+;AudioStreamConsumer = pipe
+;Temp solution: if you change NamedPipePath also change path to pipe in src/components/qt_hmi/qml_model_qtXX/views/SDLNavi.qml
+;Named pipe path will be constructed using AppStorageFolder + name
+NamedVideoPipePath = video_stream_pipe
+NamedAudioPipePath = audio_stream_pipe
+;File path will be constructed using AppStorageFolder + name
+VideoStreamFile = video_stream_file
+AudioStreamFile = audio_stream_file
+; Recording file source (used for audio pass thru emulation only)
+RecordingFileSource = audio.8bit.wav
+; Recording file for audio pass thru
+RecordingFileName = video.wav
+RecordingFileName = audio.wav
+
+; HelpPromt and TimeOutPrompt is a vector of strings separated by comma
+[GLOBAL PROPERTIES]
+
+; Delimiter, which will be appended to each TTS chunck, e.g. helpPrompt/timeoutPrompt
+TTSDelimiter = ,
+; Default prompt items, separated by comma
+HelpPromt = Please speak one of the following commands,Please say a command
+; Default prompt items, separated by comma
+TimeOutPromt = Please say a command
+TimeOutPromt = Please speak one of the following commands,Please say a command
+HelpTitle = Available Vr Commands List
+; In case mobile app didn't send global properties default global properties will be sent after this timeout
+; max value TTSGlobalPropertiesTimeout 64K
+TTSGlobalPropertiesTimeout = 20
+
+[FILESYSTEM RESTRICTIONS]
+; Max allowed number of PutFile requests for one application in NONE
+PutFileRequest = 5
+; Max allowed number of DeleteFile requests for one application in NONE
+DeleteFileRequest = 5
+; Max allowed number of ListFiles requests for one application in NONE
+ListFilesRequest = 5
+
+[VR COMMANDS]
+HelpCommand = Help
+
+[AppInfo]
+; The path for applications info storage.
+AppInfoStorage = app_info.dat
+
+[Security Manager]
+Protocol = TLSv1.2
+; Certificate and key path to pem file
+CertificatePath = mycert.pem
+KeyPath = mykey.pem
+; SSL mode could be SERVER or CLIENT
+SSLMode = CLIENT
+; Could be ALL ciphers or list of chosen
+;CipherList = AES256-GCM-SHA384
+CipherList = ALL
+; Verify Mobile app certificate (could be used in both SSLMode Server and Client)
+VerifyPeer = false
+; If VerifyPeer is enable - terminate handshake if mobile app did not return a certificate
+FialOnNoCert = false
+; If VerifyPeer is enable - do not ask for a mobile app certificate again in case of a renegotiation
+VerifyClientOnce = false
+; Force protected services (could be id's from 0x01 to 0xFF)
+;ForceProtectedService = 0x0A, 0x0B
+ForceProtectedService = Non
+; Force unprotected services
+;ForceUnprotectedService = 0x07
+ForceUnprotectedService = Non
+
+[Policy]
+;-----------------------------
+EnablePolicy = false
+PreloadedPT = sdl_preloaded_pt.json
+PathToSnapshot = sdl_snapshot.json
+; Number of attempts to open policy DB
+AttemptsToOpenPolicyDB = 5
+; Timeout between attempts during opening DB in milliseconds
+OpenAttemptTimeoutMs = 500
+
+[TransportManager]
+TCPAdapterPort = 12345
+MMEDatabase = /dev/qdb/mediaservice_db
+EventMQ = /dev/mqueue/ToSDLCoreUSBAdapter
+AckMQ = /dev/mqueue/FromSDLCoreUSBAdapter
+
+[IAP]
+LegacyProtocol = com.ford.sync.prot[0-29]
+HubProtocol = com.smartdevicelink.prot0
+PoolProtocol = com.smartdevicelink.prot[1-29]
+IAPSystemConfig = /fs/mp/etc/mm/ipod.cfg
+IAP2SystemConfig = /fs/mp/etc/mm/iap2.cfg
+IAP2HubConnectAttempts = 3
+
+[ProtocolHandler]
+; Packet with payload bigger than next value will be marked as a malformed
+; 1488 = 1500 - 12 = TCP MTU - header size
+MaximumPayloadSize = 1488
+; Application shall send less #FrequencyCount messages per #FrequencyTime mSecs
+; Frequency check could be disable by setting FrequencyTime to Zero
+FrequencyCount = 1000
+FrequencyTime = 1000
+
+[ApplicationManager]
+ApplicationListUpdateTimeout = 2
+; Max allowed threads for handling mobile requests. Currently max allowed is 2
+ThreadPoolSize = 1
+
+[Resumption]
+
+# Timeout in seconds for resumption Application HMILevel
+# and resolving conflicts in case if multiple applications initiate resumption
+ApplicationResumingTimeout = 3
+
+# Timeout in seconds for pereodical saving resumption persisten data
+AppSavePersistentDataTimeout = 10 #seconds
+
+# Timeout in seconds to store hmi_level for media app before ign_off
+ResumptionDelayBeforeIgn = 30;
+
+# Timeout in seconds to restore hmi_level for media app after sdl run
+ResumptionDelayAfterIgn = 30;
diff --git a/src/components/connection_handler/CMakeLists.txt b/src/components/connection_handler/CMakeLists.txt
index 18946ac34..657c90d10 100644
--- a/src/components/connection_handler/CMakeLists.txt
+++ b/src/components/connection_handler/CMakeLists.txt
@@ -1,23 +1,60 @@
+# 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.
+
+
+set(CH_SRC_DIR ${COMPONENTS_DIR}/connection_handler/src)
+
include_directories (
- ./include/
- ../protocol_handler/include/
- ../config_profile/include/
- ../utils/include/
- ${ENCRYPTION_INCLUDE_DIRECTORY}
- ${LOG4CXX_INCLUDE_DIRECTORY}
+ include
+ ${COMPONENTS_DIR}/protocol_handler/include/
+ ${COMPONENTS_DIR}/config_profile/include/
+ ${COMPONENTS_DIR}/utils/include/
+ ${ENCRYPTION_INCLUDE_DIRECTORY}
+ ${LOG4CXX_INCLUDE_DIRECTORY}
)
set (SOURCES
- ./src/connection_handler_impl.cc
- ./src/connection.cc
- ./src/device.cc
- ./src/heartbeat_monitor.cc
+ ${CH_SRC_DIR}/connection_handler_impl.cc
+ ${CH_SRC_DIR}/connection.cc
+ ${CH_SRC_DIR}/device.cc
+ ${CH_SRC_DIR}/heartbeat_monitor.cc
)
set(LIBRARIES
- ConfigProfile
- ProtocolLibrary
+ ConfigProfile
+ ProtocolLibrary
)
add_library(connectionHandler ${SOURCES})
target_link_libraries(connectionHandler encryption)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif() \ No newline at end of file
diff --git a/src/components/connection_handler/include/connection_handler/connection.h b/src/components/connection_handler/include/connection_handler/connection.h
index 6bcbc3fdc..d20ddc1c0 100644
--- a/src/components/connection_handler/include/connection_handler/connection.h
+++ b/src/components/connection_handler/include/connection_handler/connection.h
@@ -37,6 +37,7 @@
#include <vector>
#include "utils/lock.h"
+#include "utils/threads/thread.h"
#include "connection_handler/device.h"
#include "connection_handler/heartbeat_monitor.h"
#include "protocol/service_type.h"
@@ -48,26 +49,25 @@ class SSLContext;
#endif // ENABLE_SECURITY
/**
- * \namespace connection_handler
- * \brief SmartDeviceLink connection_handler namespace.
+ *@brief SmartDeviceLink connection_handler namespace.
*/
namespace connection_handler {
class ConnectionHandler;
/**
- * \brief Type for ConnectionHandle
+ * @brief Type for ConnectionHandle
*/
typedef int32_t ConnectionHandle;
/**
- * \brief Type for Connections map
+ * @brief Type for Connections map
* Key is ConnectionHandle which is unique
*/
typedef std::map<int32_t, Connection*> ConnectionList;
/**
- * \brief ServiceType
+ * @brief ServiceType
*/
struct Service {
protocol_handler::ServiceType service_type;
@@ -86,7 +86,7 @@ struct Service {
};
/**
- * \brief Type for Session Services
+ * @brief Type for Session Services
*/
typedef std::vector<Service> ServiceList;
@@ -114,18 +114,17 @@ struct Session {
};
/**
- * \brief Type for Session map
+ * @brief Type for Session map
*/
typedef std::map<uint8_t, Session> SessionMap;
/**
- * \class Connection
- * \brief Stores connection information
+ * @brief Stores connection information
*/
class Connection {
public:
/**
- * \brief Class constructor
+ * @brief Class constructor
*/
Connection(ConnectionHandle connection_handle,
DeviceHandle connection_device_handle,
@@ -133,162 +132,171 @@ class Connection {
int32_t heartbeat_timeout);
/**
- * \brief Destructor
+ * @brief Destructor
*/
~Connection();
/**
- * \brief Returns device handle
- * \return DeviceHandle
+ * @brief Returns device handle
+ * @return DeviceHandle
*/
ConnectionHandle connection_handle() const;
/**
- * \brief Returns connection device handle
- * \return ConnectionDeviceHandle
+ * @brief Returns connection device handle
+ * @return ConnectionDeviceHandle
*/
DeviceHandle connection_device_handle();
/**
- * \brief Adds session to connection
- * \return new session id or 0 in case of issues
+ * @brief Adds session to connection
+ * @return new session id or 0 in case of issues
*/
uint32_t AddNewSession();
/**
- * \brief Removes session from connection
- * \param session session ID
- * \return session_id or 0 in case of issues
+ * @brief Removes session from connection
+ * @param session session ID
+ * @return session_id or 0 in case of issues
*/
uint32_t RemoveSession(uint8_t session_id);
/**
- * \brief Adds uprotected service to session or
+ * @brief Adds uprotected service to session or
* check protection to service has been started before
- * \param session_id session ID
- * \param service_type Type of service
- * \param is_protected protection state
- * \return TRUE on success, otherwise FALSE
+ * @param session_id session ID
+ * @param service_type Type of service
+ * @param is_protected protection state
+ * @return TRUE on success, otherwise FALSE
*/
bool AddNewService(uint8_t session_id,
protocol_handler::ServiceType service_type,
const bool is_protected);
/**
- * \brief Removes service from session
- * \param session_id session ID
- * \param service_type Type of service
- * \return TRUE on success, otherwise FALSE
+ * @brief Removes service from session
+ * @param session_id session ID
+ * @param service_type Type of service
+ * @return TRUE on success, otherwise FALSE
*/
bool RemoveService(uint8_t session_id,
protocol_handler::ServiceType service_type);
#ifdef ENABLE_SECURITY
/**
- * \brief Sets crypto context of service
- * \param session_id Identifier of the session
- * \param context SSL for connection
- * \return \c true in case of service is protected or \c false otherwise
+ * @brief Sets crypto context of service
+ * @param session_id Identifier of the session
+ * @param context SSL for connection
+ * @return \c true in case of service is protected or \c false otherwise
*/
int SetSSLContext(uint8_t session_id,
security_manager::SSLContext *context);
/**
- * \brief Gets crypto context of session, use service_type to get NULL
+ * @brief Gets crypto context of session, use service_type to get NULL
* SSLContext for not protected services or ControlService (0x0)
* to get current SSLContext of connection
- * \param session_id Identifier of the session
- * \param service_type Type of service
- * \return \ref SSLContext of connection
+ * @param session_id Identifier of the session
+ * @param service_type Type of service
+ * @return \ref SSLContext of connection
*/
security_manager::SSLContext *GetSSLContext(
const uint8_t session_id,
const protocol_handler::ServiceType &service_type) const;
/**
- * \brief Set protection flag to service in session by key
+ * @brief Set protection flag to service in session by key
* to get current SSLContext of connection
- * \param session_id Identifier of the session
- * \param service_type Type of service
+ * @param session_id Identifier of the session
+ * @param service_type Type of service
*/
void SetProtectionFlag(
const uint8_t session_id,
const protocol_handler::ServiceType &service_type);
#endif // ENABLE_SECURITY
/**
- * \brief Returns map of sessions which have been opened in
+ * @brief Returns map of sessions which have been opened in
* current connection.
*/
const SessionMap session_map() const;
/**
- * \brief Close session
- * \param session_id session id
+ * @brief Close session
+ * @param session_id session id
*/
void CloseSession(uint8_t session_id);
/**
- * \brief Prevent session from being closed by heartbeat timeout
- * \param session_id session id
+ * @brief Prevent session from being closed by heartbeat timeout
+ * @param session_id session id
*/
void KeepAlive(uint8_t session_id);
/**
- * \brief Start heartbeat for specified session
- * \param session_id session id
+ * @brief Start heartbeat for specified session
+ * @param session_id session id
*/
void StartHeartBeat(uint8_t session_id);
/**
- * \brief Send heartbeat to mobile app
- * \param session_id session id
+ * @brief Send heartbeat to mobile app
+ * @param session_id session id
*/
void SendHeartBeat(uint8_t session_id);
/**
- * Sets heart beat timeout
+ * @brief Sets heart beat timeout
* @param timeout in seconds
*/
- void SetHeartBeatTimeout(int32_t timeout);
+ void SetHeartBeatTimeout(int32_t timeout, uint8_t session_id);
/**
- * \brief changes protocol version in session
- * \param session_id session id
- * \param protocol_version protocol version registered application
+ * @brief changes protocol version in session
+ * @param session_id session id
+ * @param protocol_version protocol version registered application
*/
void UpdateProtocolVersionSession(uint8_t session_id, uint8_t protocol_version);
/**
- * \brief checks if session supports heartbeat
- * \param session_id session id
- * \return TRUE on success, otherwise FALSE
+ * @brief checks if session supports heartbeat
+ * @param session_id session id
+ * @return TRUE on success, otherwise FALSE
*/
bool SupportHeartBeat(uint8_t session_id);
+ /**
+ * @brief find protocol version for session
+ * @param session_id id of session which is launched on mobile side
+ * @param protocol_version method writes value protocol version
+ * @return TRUE if session exists otherwise
+ * return FALSE
+ */
+ bool ProtocolVersion(uint8_t session_id, uint8_t& protocol_version);
+
private:
/**
- * \brief Current connection handler.
+ * @brief Current connection handler.
*/
ConnectionHandler *connection_handler_;
/**
- * \brief Current connection handle.
+ * @brief Current connection handle.
*/
ConnectionHandle connection_handle_;
/**
- * \brief DeviceHandle of this connection.
+ * @brief DeviceHandle of this connection.
*/
DeviceHandle connection_device_handle_;
/**
- * \brief session/services map
+ * @brief session/services map
*/
SessionMap session_map_;
mutable sync_primitives::Lock session_map_lock_;
/**
- * \brief monitor that closes connection if there is no traffic over it
+ * @brief monitor that closes connection if there is no traffic over it
*/
- HeartBeatMonitor *heartbeat_monitor_;
+ HeartBeatMonitor* heartbeat_monitor_;
threads::Thread *heart_beat_monitor_thread_;
DISALLOW_COPY_AND_ASSIGN(Connection);
diff --git a/src/components/connection_handler/include/connection_handler/connection_handler.h b/src/components/connection_handler/include/connection_handler/connection_handler.h
index 08bef9715..4a7965887 100644
--- a/src/components/connection_handler/include/connection_handler/connection_handler.h
+++ b/src/components/connection_handler/include/connection_handler/connection_handler.h
@@ -35,7 +35,6 @@
#include "transport_manager/transport_manager_listener.h"
#include "protocol_handler/session_observer.h"
-#include "connection_handler/connection_handler_observer.h"
#include "connection_handler/device.h"
#include "connection_handler/connection.h"
#include "connection_handler/devices_discovery_starter.h"
@@ -45,6 +44,16 @@
* \brief SmartDeviceLink connection_handler namespace.
*/
namespace connection_handler {
+
+ enum CloseSessionReason {
+ kCommon = 0,
+ kFlood,
+ kMalformed,
+ kUnauthorizedApp
+ };
+
+ class ConnectionHandlerObserver;
+
/**
* \class ConnectionHandler
* \brief SmartDeviceLink ConnectionHandler interface class
@@ -100,13 +109,23 @@ class ConnectionHandler {
/**
* Close session associated with the key
*/
- virtual void CloseSession(uint32_t key) = 0;
+ virtual void CloseSession(uint32_t key, CloseSessionReason close_reason) = 0;
/**
* Close session
*/
virtual void CloseSession(ConnectionHandle connection_handle,
- uint8_t session_id) = 0;
+ uint8_t session_id,
+ CloseSessionReason close_reason) = 0;
+
+ /**
+ * @brief SendEndService allows to end up specific service.
+ *
+ * @param key application identifier whose service should be closed.
+ *
+ * @param service_type the service that should be closed.
+ */
+ virtual void SendEndService(uint32_t key, uint8_t service_type) = 0;
/**
* \brief Start heartbeat for specified session
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 00ebdf0ab..8ddc6e5a5 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
@@ -189,6 +189,20 @@ class ConnectionHandlerImpl : public ConnectionHandler,
const protocol_handler::ServiceType &service_type);
/**
+ * \brief Callback function used by ProtocolHandler
+ * when Mobile Application start message flood
+ * \param connection_key used by other components as application identifier
+ */
+ void OnApplicationFloodCallBack(const uint32_t &connection_key) OVERRIDE;
+
+ /**
+ * \brief Callback function used by ProtocolHandler
+ * when Mobile Application sends malformed message
+ * \param connection_key used by other components as application identifier
+ */
+ void OnMalformedMessageCallback(const uint32_t &connection_key) OVERRIDE;
+
+ /**
* \brief Creates unique identifier of session (can be used as hash)
* from given connection identifier
* within which session exists and session number.
@@ -298,7 +312,7 @@ class ConnectionHandlerImpl : public ConnectionHandler,
* \brief Close session associated with the key
* \param key Unique key used by other components as session identifier
*/
- virtual void CloseSession(uint32_t key);
+ virtual void CloseSession(uint32_t key, CloseSessionReason close_reason);
/**
* \brief Function used by HearbeatMonitior to close session on HB timeout
@@ -306,7 +320,18 @@ class ConnectionHandlerImpl : public ConnectionHandler,
* \param session_id Identifier of the session to be ended
*/
virtual void CloseSession(ConnectionHandle connection_handle,
- uint8_t session_id);
+ uint8_t session_id,
+ CloseSessionReason close_reason);
+
+ /**
+ * \brief Function used by OnApplicationFloodCallback and
+ * OnMalformedMessageCallback to close all connection sessions before
+ * connection closing
+ * \param connection_handle Connection identifier within which session exists
+ * \param close_reason The reason of connection closing
+ */
+ virtual void CloseConnectionSessions(
+ ConnectionHandle connection_handle, CloseSessionReason close_reason);
/**
* \brief Return count of session for specified connection
@@ -321,6 +346,16 @@ class ConnectionHandlerImpl : public ConnectionHandler,
uint8_t session_id);
/**
+ * @brief SendEndService allows to end up specific service.
+ *
+ * @param key application identifier whose service should be closed.
+ *
+ * @param service_type the service that should be closed.
+ */
+ virtual void SendEndService(uint32_t key,
+ uint8_t service_type);
+
+ /**
* \brief Start heartbeat for specified session
*
* \param connection_key pair of connection and session id
@@ -358,7 +393,17 @@ class ConnectionHandlerImpl : public ConnectionHandler,
virtual bool IsHeartBeatSupported(
transport_manager::ConnectionUID connection_handle,
uint8_t session_id);
- private:
+
+ /**
+ * @brief returns protocol version which application supports
+ * @param connection_id id of connection
+ * @param session_id id of session
+ * @param method writes value protocol version to protocol_version
+ * @return TRUE if session and connection exist otherwise returns FALSE
+ */
+ virtual bool ProtocolVersionUsed(uint32_t connection_id,
+ uint8_t session_id, uint8_t& protocol_version);
+ private:
/**
* \brief Default class constructor
*/
@@ -401,6 +446,7 @@ class ConnectionHandlerImpl : public ConnectionHandler,
* \brief Lock for applications list
*/
mutable sync_primitives::Lock connection_list_lock_;
+ mutable sync_primitives::Lock connection_handler_observer_lock_;
/**
* \brief Cleans connection list on destruction
diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_observer.h b/src/components/connection_handler/include/connection_handler/connection_handler_observer.h
index cd419c124..556a2dc4e 100644
--- a/src/components/connection_handler/include/connection_handler/connection_handler_observer.h
+++ b/src/components/connection_handler/include/connection_handler/connection_handler_observer.h
@@ -35,6 +35,7 @@
#include "connection_handler/device.h"
#include "connection_handler/connection.h"
+#include "connection_handler/connection_handler.h"
#include "protocol/service_type.h"
/**
@@ -90,11 +91,14 @@ class ConnectionHandlerObserver {
/**
* \brief Callback function used by connection_handler
* when Mobile Application initiates service ending.
- * \param sessionKey Key of session which should be ended
+ * \param session_key Key of session which should be ended
+ * \param type Type of service which should be ended
+ * \param close_reson Service close reason
*/
virtual void OnServiceEndedCallback(
- const int32_t &session_key,
- const protocol_handler::ServiceType &type) = 0;
+ const int32_t& session_key,
+ const protocol_handler::ServiceType& type,
+ const connection_handler::CloseSessionReason& close_reason) = 0;
protected:
/**
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 9b641ce01..0233e269d 100644
--- a/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
+++ b/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
@@ -72,39 +72,50 @@ class HeartBeatMonitor: public threads::ThreadDelegate {
/**
* \brief Thread exit procedure.
*/
- virtual bool exitThreadMain();
+ virtual void exitThreadMain();
- void set_heartbeat_timeout_seconds(int32_t timeout);
+ void set_heartbeat_timeout_seconds(int32_t timeout, uint8_t session_id);
private:
- struct SessionState;
- typedef std::map<uint8_t, SessionState> SessionMap;
// \brief Heartbeat timeout, should be read from profile
- int32_t heartbeat_timeout_seconds_;
+ int32_t default_heartbeat_timeout_;
// \brief Connection that must be closed when timeout elapsed
Connection *connection_;
- static const int32_t kDefaultCycleTimeout = 100000;
+ //Default HeartBeat cycle timeout (in miliseconds)
+ static const int32_t kDefaultCycleTimeout = 100;
+
+ class SessionState {
+ public:
+ explicit SessionState(int32_t heartbeat_timeout_seconds = 0);
+ void UpdateTimeout(int32_t heartbeat_timeout_seconds);
+ void PrepareToClose();
+ bool IsReadyToClose() const;
+ void KeepAlive();
+ bool HasTimeoutElapsed();
+ private:
+ void RefreshExpiration();
+
+ int32_t heartbeat_timeout_seconds_;
+ TimevalStruct heartbeat_expiration;
+ bool is_heartbeat_sent;
- struct SessionState {
- TimevalStruct heartbeat_expiration;
- bool is_heartbeat_sent;
};
// \brief monitored sessions collection
+ typedef std::map<uint8_t, SessionState> SessionMap;
SessionMap sessions_;
sync_primitives::Lock sessions_list_lock_; // recurcive
sync_primitives::Lock main_thread_lock_;
mutable sync_primitives::Lock heartbeat_timeout_seconds_lock_;
+ sync_primitives::ConditionalVariable heartbeat_monitor_;
volatile bool run_;
void Process();
- void RefreshExpiration(TimevalStruct* expiration) const;
- inline bool HasTimeoutElapsed(const TimevalStruct& expiration) const;
DISALLOW_COPY_AND_ASSIGN(HeartBeatMonitor);
};
diff --git a/src/components/connection_handler/src/connection.cc b/src/components/connection_handler/src/connection.cc
index 0b248e5e5..de8c7edb0 100644
--- a/src/components/connection_handler/src/connection.cc
+++ b/src/components/connection_handler/src/connection.cc
@@ -37,6 +37,7 @@
#include "connection_handler/connection.h"
#include "connection_handler/connection_handler.h"
#include "protocol_handler/protocol_packet.h"
+#include "config_profile/profile.h"
#include "utils/logger.h"
#include "utils/macro.h"
@@ -45,7 +46,6 @@
#include "security_manager/security_manager.h"
#endif // ENABLE_SECURITY
-#include "utils/threads/thread_manager.h"
/**
* \namespace connection_handler
@@ -79,23 +79,24 @@ Connection::Connection(ConnectionHandle connection_handle,
int32_t heartbeat_timeout)
: connection_handler_(connection_handler),
connection_handle_(connection_handle),
- connection_device_handle_(connection_device_handle) {
- LOG4CXX_TRACE_ENTER(logger_);
+ connection_device_handle_(connection_device_handle),
+ session_map_lock_(true) {
+ LOG4CXX_AUTO_TRACE(logger_);
DCHECK(connection_handler_);
heartbeat_monitor_ = new HeartBeatMonitor(heartbeat_timeout, this);
heart_beat_monitor_thread_ = threads::CreateThread("HeartBeatMonitor",
- heartbeat_monitor_);
+ heartbeat_monitor_);
heart_beat_monitor_thread_->start();
}
Connection::~Connection() {
- LOG4CXX_TRACE_ENTER(logger_);
- heart_beat_monitor_thread_->stop();
+ LOG4CXX_AUTO_TRACE(logger_);
+ heart_beat_monitor_thread_->join();
+ delete heartbeat_monitor_;
threads::DeleteThread(heart_beat_monitor_thread_);
sync_primitives::AutoLock lock(session_map_lock_);
session_map_.clear();
- LOG4CXX_TRACE_EXIT(logger_);
}
// Finds a key not presented in std::map<unsigned char, T>
@@ -113,7 +114,7 @@ uint32_t findGap(const std::map<unsigned char, T> &map) {
} // namespace
uint32_t Connection::AddNewSession() {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(session_map_lock_);
const uint32_t session_id = findGap(session_map_);
if (session_id > 0) {
@@ -236,7 +237,7 @@ int Connection::SetSSLContext(uint8_t session_id,
security_manager::SSLContext *Connection::GetSSLContext(
const uint8_t session_id, const protocol_handler::ServiceType &service_type) const {
- LOG4CXX_TRACE(logger_, "Connection::GetSSLContext");
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(session_map_lock_);
SessionMap::const_iterator session_it = session_map_.find(session_id);
if (session_it == session_map_.end()) {
@@ -260,7 +261,7 @@ security_manager::SSLContext *Connection::GetSSLContext(
void Connection::SetProtectionFlag(
const uint8_t session_id, const protocol_handler::ServiceType &service_type) {
- LOG4CXX_TRACE(logger_, "Connection::SetProtectionFlag");
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(session_map_lock_);
SessionMap::iterator session_it = session_map_.find(session_id);
if (session_it == session_map_.end()) {
@@ -312,7 +313,9 @@ void Connection::CloseSession(uint8_t session_id) {
size = session_map_.size();
}
- connection_handler_->CloseSession(connection_handle_, session_id);
+ connection_handler_->CloseSession(connection_handle_,
+ session_id,
+ connection_handler::kCommon);
//Close connection if it is last session
if (1 == size) {
@@ -333,6 +336,7 @@ void Connection::UpdateProtocolVersionSession(
}
bool Connection::SupportHeartBeat(uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(session_map_lock_);
SessionMap::iterator session_it = session_map_.find(session_id);
if (session_map_.end() == session_it) {
@@ -340,7 +344,22 @@ bool Connection::SupportHeartBeat(uint8_t session_id) {
return false;
}
Session &session = session_it->second;
- return ::protocol_handler::PROTOCOL_VERSION_3 == session.protocol_version;
+
+ return ((::protocol_handler::PROTOCOL_VERSION_3 == session.protocol_version ||
+ ::protocol_handler::PROTOCOL_VERSION_4 == session.protocol_version) &&
+ (profile::Profile::instance()->heart_beat_timeout()));
+}
+
+bool Connection::ProtocolVersion(uint8_t session_id, uint8_t& protocol_version) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(session_map_lock_);
+ SessionMap::iterator session_it = session_map_.find(session_id);
+ if (session_map_.end() == session_it) {
+ LOG4CXX_WARN(logger_, "Session not found in this connection!");
+ return false;
+ }
+ protocol_version = (session_it->second).protocol_version;
+ return true;
}
void Connection::StartHeartBeat(uint8_t session_id) {
@@ -355,8 +374,8 @@ void Connection::KeepAlive(uint8_t session_id) {
heartbeat_monitor_->KeepAlive(session_id);
}
-void Connection::SetHeartBeatTimeout(int32_t timeout) {
- heartbeat_monitor_->set_heartbeat_timeout_seconds(timeout);
+void Connection::SetHeartBeatTimeout(int32_t timeout, uint8_t session_id) {
+ heartbeat_monitor_->set_heartbeat_timeout_seconds(timeout, session_id);
}
} // namespace connection_handler
diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index f1dae841a..70a50c589 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -34,6 +34,7 @@
#include <string>
#include <list>
#include <algorithm>
+#include <memory>
#include "connection_handler/connection_handler_impl.h"
#include "transport_manager/info.h"
@@ -70,27 +71,29 @@ ConnectionHandlerImpl::ConnectionHandlerImpl()
: connection_handler_observer_(NULL),
transport_manager_(NULL),
protocol_handler_(NULL),
+ connection_list_lock_(true),
+ connection_handler_observer_lock_(true),
connection_list_deleter_(&connection_list_) {
}
ConnectionHandlerImpl::~ConnectionHandlerImpl() {
- LOG4CXX_TRACE(logger_, "Destructing ConnectionHandlerImpl.");
+ LOG4CXX_AUTO_TRACE(logger_);
}
void ConnectionHandlerImpl::Stop() {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
ConnectionList::iterator itr = connection_list_.begin();
while (itr != connection_list_.end()) {
RemoveConnection(itr->second->connection_handle());
itr = connection_list_.begin();
}
- LOG4CXX_TRACE_EXIT(logger_);
}
void ConnectionHandlerImpl::set_connection_handler_observer(
ConnectionHandlerObserver *observer) {
LOG4CXX_DEBUG(logger_, "ConnectionHandlerImpl::set_connection_handler_observer() "
<< observer);
+ sync_primitives::AutoLock lock(connection_handler_observer_lock_);
if (!observer) {
LOG4CXX_WARN(logger_, "Set Null pointer to observer.");
}
@@ -120,13 +123,15 @@ void ConnectionHandlerImpl::set_protocol_handler(
void ConnectionHandlerImpl::OnDeviceListUpdated(
const std::vector<transport_manager::DeviceInfo>&) {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::OnDeviceListUpdated()");
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(connection_handler_observer_lock_);
if (connection_handler_observer_) {
connection_handler_observer_->OnDeviceListUpdated(device_list_);
}
}
void ConnectionHandlerImpl::OnFindNewApplicationsRequest() {
+ sync_primitives::AutoLock lock(connection_handler_observer_lock_);
if (connection_handler_observer_) {
connection_handler_observer_->OnFindNewApplicationsRequest();
}
@@ -134,17 +139,18 @@ void ConnectionHandlerImpl::OnFindNewApplicationsRequest() {
void ConnectionHandlerImpl::OnDeviceFound(
const transport_manager::DeviceInfo&) {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::OnDeviceFound()");
+ LOG4CXX_AUTO_TRACE(logger_);
}
void ConnectionHandlerImpl::OnDeviceAdded(
const transport_manager::DeviceInfo &device_info) {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::OnDeviceAdded()");
+ LOG4CXX_AUTO_TRACE(logger_);
device_list_.insert(
DeviceMap::value_type(
device_info.device_handle(),
Device(device_info.device_handle(), device_info.name(),
device_info.mac_address(), device_info.connection_type())));
+ sync_primitives::AutoLock lock(connection_handler_observer_lock_);
if (connection_handler_observer_) {
connection_handler_observer_->OnDeviceListUpdated(device_list_);
}
@@ -152,7 +158,7 @@ void ConnectionHandlerImpl::OnDeviceAdded(
void ConnectionHandlerImpl::OnDeviceRemoved(
const transport_manager::DeviceInfo &device_info) {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::OnDeviceRemoved()");
+ LOG4CXX_AUTO_TRACE(logger_);
// Device has been removed. Perform all needed actions.
// 1. Delete all the connections and sessions of this device
// 2. Delete device from a list
@@ -176,6 +182,7 @@ void ConnectionHandlerImpl::OnDeviceRemoved(
}
device_list_.erase(device_info.device_handle());
+ sync_primitives::AutoLock lock(connection_handler_observer_lock_);
if (connection_handler_observer_) {
connection_handler_observer_->RemoveDevice(device_info.device_handle());
connection_handler_observer_->OnDeviceListUpdated(device_list_);
@@ -183,7 +190,7 @@ void ConnectionHandlerImpl::OnDeviceRemoved(
}
void ConnectionHandlerImpl::OnScanDevicesFinished() {
- LOG4CXX_TRACE(logger_, "Scan devices finished successfully.");
+ LOG4CXX_AUTO_TRACE(logger_);
}
void ConnectionHandlerImpl::OnScanDevicesFailed(
@@ -194,14 +201,14 @@ void ConnectionHandlerImpl::OnScanDevicesFailed(
void ConnectionHandlerImpl::OnConnectionEstablished(
const transport_manager::DeviceInfo &device_info,
const transport_manager::ConnectionUID &connection_id) {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::OnConnectionEstablished()");
+ LOG4CXX_AUTO_TRACE(logger_);
DeviceMap::iterator it = device_list_.find(device_info.device_handle());
if (device_list_.end() == it) {
LOG4CXX_ERROR(logger_, "Unknown device!");
return;
}
- LOG4CXX_INFO(logger_, "Add Connection:" << connection_id << " to the list.");
+ LOG4CXX_DEBUG(logger_, "Add Connection #" << connection_id << " to the list.");
sync_primitives::AutoLock lock(connection_list_lock_);
connection_list_.insert(
ConnectionList::value_type(
@@ -219,7 +226,7 @@ void ConnectionHandlerImpl::OnConnectionFailed(
void ConnectionHandlerImpl::OnConnectionClosed(
transport_manager::ConnectionUID connection_id) {
- LOG4CXX_INFO(logger_, "ConnectionHandlerImpl::OnConnectionClosed");
+ LOG4CXX_AUTO_TRACE(logger_);
OnConnectionEnded(connection_id);
}
@@ -296,7 +303,7 @@ uint32_t 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) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
if (hash_id) {
*hash_id = protocol_handler::HASH_ID_WRONG;
@@ -306,12 +313,10 @@ uint32_t ConnectionHandlerImpl::OnSessionStartedCallback(
return 0;
}
#endif // ENABLE_SECURITY
-
sync_primitives::AutoLock lock(connection_list_lock_);
ConnectionList::iterator it = connection_list_.find(connection_handle);
if (connection_list_.end() == it) {
LOG4CXX_ERROR(logger_, "Unknown connection!");
- LOG4CXX_TRACE_EXIT(logger_);
return 0;
}
uint32_t new_session_id = 0;
@@ -321,7 +326,6 @@ uint32_t ConnectionHandlerImpl::OnSessionStartedCallback(
new_session_id = connection->AddNewSession();
if (0 == new_session_id) {
LOG4CXX_ERROR(logger_, "Couldn't start new session!");
- LOG4CXX_TRACE_EXIT(logger_);
return 0;
}
if (hash_id) {
@@ -335,7 +339,6 @@ uint32_t ConnectionHandlerImpl::OnSessionStartedCallback(
#endif // ENABLE_SECURITY
<< " service " << static_cast<int>(service_type)
<< " for session " << static_cast<int>(session_id));
- LOG4CXX_TRACE_EXIT(logger_);
return 0;
}
new_session_id = session_id;
@@ -343,38 +346,69 @@ uint32_t ConnectionHandlerImpl::OnSessionStartedCallback(
*hash_id = protocol_handler::HASH_ID_NOT_SUPPORTED;
}
}
-
+ sync_primitives::AutoLock lock2(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);
+ connection->connection_device_handle(), session_key, service_type);
if (!success) {
if (protocol_handler::kRpc == service_type) {
connection->RemoveSession(new_session_id);
} else {
connection->RemoveService(session_id, service_type);
}
- LOG4CXX_TRACE_EXIT(logger_);
return 0;
}
}
- LOG4CXX_TRACE_EXIT(logger_);
return new_session_id;
}
+void ConnectionHandlerImpl::OnApplicationFloodCallBack(
+ const uint32_t &connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ transport_manager::ConnectionUID connection_handle = 0;
+ uint8_t session_id = 0;
+ PairFromKey(connection_key, &connection_handle, &session_id);
+
+ LOG4CXX_INFO(logger_, "Disconnect flooding application");
+ if (session_id != 0) {
+ CloseSession(connection_handle, session_id, kFlood);
+ } else {
+ CloseConnectionSessions(connection_handle, kCommon);
+ CloseConnection(connection_handle);
+ }
+}
+
+void ConnectionHandlerImpl::OnMalformedMessageCallback(
+ const uint32_t &connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ transport_manager::ConnectionUID connection_handle = 0;
+ uint8_t session_id = 0;
+ PairFromKey(connection_key, &connection_handle, &session_id);
+
+ LOG4CXX_INFO(logger_, "Disconnect malformed messaging application");
+ CloseConnectionSessions(connection_handle, kCommon);
+ CloseConnection(connection_handle);
+}
+
uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
const uint32_t &connection_handle, const uint8_t session_id,
const uint32_t &hashCode,
const protocol_handler::ServiceType &service_type) {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::OnSessionEndedCallback()");
+ LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock lock(connection_list_lock_);
+ connection_list_lock_.Acquire();
ConnectionList::iterator it = connection_list_.find(connection_handle);
if (connection_list_.end() == it) {
LOG4CXX_WARN(logger_, "Unknown connection!");
return 0;
}
- Connection *connection = it->second;
+ std::pair<int32_t, Connection*> connection_item = *it;
+ connection_list_lock_.Release();
+
+ Connection *connection = connection_item.second;
const uint32_t session_key = KeyFromPair(connection_handle, session_id);
if (protocol_handler::kRpc == service_type) {
@@ -404,9 +438,10 @@ uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
}
}
+ sync_primitives::AutoLock lock2(connection_handler_observer_lock_);
if (connection_handler_observer_) {
- connection_handler_observer_->OnServiceEndedCallback(session_key,
- service_type);
+ connection_handler_observer_->OnServiceEndedCallback(
+ session_key, service_type, CloseSessionReason::kCommon);
}
return session_key;
}
@@ -414,7 +449,7 @@ uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
uint32_t ConnectionHandlerImpl::KeyFromPair(
transport_manager::ConnectionUID connection_handle, uint8_t session_id) {
const uint32_t key = connection_handle | (session_id << 16);
- LOG4CXX_TRACE(logger_, "Key for ConnectionHandle:"
+ LOG4CXX_DEBUG(logger_, "Key for ConnectionHandle:"
<< static_cast<uint32_t>(connection_handle)
<< " Session:" << static_cast<uint32_t>(session_id)
<< " is: " << static_cast<uint32_t>(key));
@@ -430,7 +465,7 @@ void ConnectionHandlerImpl::PairFromKey(uint32_t key,
uint8_t *session_id) {
*connection_handle = key & 0xFF00FFFF;
*session_id = key >> 16;
- LOG4CXX_TRACE(logger_, "ConnectionHandle:"
+ LOG4CXX_DEBUG(logger_, "ConnectionHandle:"
<< static_cast<int32_t>(*connection_handle)
<< " Session:" << static_cast<int32_t>(*session_id)
<< " for key:" << static_cast<int32_t>(key));
@@ -439,7 +474,7 @@ void ConnectionHandlerImpl::PairFromKey(uint32_t key,
int32_t ConnectionHandlerImpl::GetDataOnSessionKey(
uint32_t key, uint32_t *app_id, std::list<int32_t> *sessions_list,
uint32_t *device_id) {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::GetDataOnSessionKey");
+ LOG4CXX_AUTO_TRACE(logger_);
int32_t result = -1;
transport_manager::ConnectionUID conn_handle = 0;
@@ -520,7 +555,7 @@ int32_t ConnectionHandlerImpl::GetDataOnDeviceID(
std::string *device_name,
std::list<uint32_t> *applications_list, std::string *mac_address,
std::string* connection_type ) {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::GetDataOnDeviceID");
+ LOG4CXX_AUTO_TRACE(logger_);
int32_t result = -1;
DeviceMap::iterator it = device_list_.find(device_handle);
@@ -564,7 +599,7 @@ int32_t ConnectionHandlerImpl::GetDataOnDeviceID(
#ifdef ENABLE_SECURITY
int ConnectionHandlerImpl::SetSSLContext(
const uint32_t &key, security_manager::SSLContext *context) {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::SetSSLContext");
+ LOG4CXX_AUTO_TRACE(logger_);
transport_manager::ConnectionUID connection_handle = 0;
uint8_t session_id = 0;
PairFromKey(key, &connection_handle, &session_id);
@@ -581,7 +616,7 @@ int ConnectionHandlerImpl::SetSSLContext(
security_manager::SSLContext *ConnectionHandlerImpl::GetSSLContext(
const uint32_t &key, const protocol_handler::ServiceType &service_type) {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::GetSSLContext");
+ LOG4CXX_AUTO_TRACE(logger_);
transport_manager::ConnectionUID connection_handle = 0;
uint8_t session_id = 0;
PairFromKey(key, &connection_handle, &session_id);
@@ -598,7 +633,7 @@ security_manager::SSLContext *ConnectionHandlerImpl::GetSSLContext(
void ConnectionHandlerImpl::SetProtectionFlag(
const uint32_t &key, const protocol_handler::ServiceType &service_type) {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::SetProtectionFlag");
+ LOG4CXX_AUTO_TRACE(logger_);
transport_manager::ConnectionUID connection_handle = 0;
uint8_t session_id = 0;
PairFromKey(key, &connection_handle, &session_id);
@@ -615,13 +650,14 @@ void ConnectionHandlerImpl::SetProtectionFlag(
#endif // ENABLE_SECURITY
void ConnectionHandlerImpl::StartDevicesDiscovery() {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::StartDevicesDiscovery()");
+ LOG4CXX_AUTO_TRACE(logger_);
if (NULL == transport_manager_) {
LOG4CXX_ERROR(logger_, "Null pointer to TransportManager.");
return;
}
transport_manager_->SearchDevices();
+ sync_primitives::AutoLock lock(connection_handler_observer_lock_);
if (connection_handler_observer_) {
connection_handler_observer_->OnDeviceListUpdated(device_list_);
}
@@ -666,7 +702,7 @@ void ConnectionHandlerImpl::StartTransportManager() {
}
void ConnectionHandlerImpl::CloseRevokedConnection(uint32_t connection_key) {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::CloseRevokedConnection");
+ LOG4CXX_AUTO_TRACE(logger_);
uint32_t connection_handle = 0;
uint8_t session_id = 0;
@@ -677,7 +713,7 @@ void ConnectionHandlerImpl::CloseRevokedConnection(uint32_t connection_key) {
void ConnectionHandlerImpl::CloseConnection(
ConnectionHandle connection_handle) {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::CloseConnection");
+ LOG4CXX_AUTO_TRACE(logger_);
if (!transport_manager_) {
LOG4CXX_ERROR(logger_, "Null pointer to TransportManager.");
return;
@@ -685,6 +721,14 @@ void ConnectionHandlerImpl::CloseConnection(
transport_manager::ConnectionUID connection_uid =
ConnectionUIDFromHandle(connection_handle);
transport_manager_->DisconnectForce(connection_uid);
+
+ sync_primitives::AutoLock connection_list_lock(connection_list_lock_);
+
+ ConnectionList::iterator connection_list_itr =
+ connection_list_.find(connection_uid);
+ if (connection_list_.end() != connection_list_itr) {
+ connection_list_.erase(connection_list_itr);
+ }
}
uint32_t ConnectionHandlerImpl::GetConnectionSessionsCount(
@@ -703,45 +747,121 @@ uint32_t ConnectionHandlerImpl::GetConnectionSessionsCount(
return 0;
}
-void ConnectionHandlerImpl::CloseSession(uint32_t key) {
- LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::CloseSession");
-
+void ConnectionHandlerImpl::CloseSession(uint32_t key,
+ CloseSessionReason close_reason) {
uint32_t connection_handle = 0;
uint8_t session_id = 0;
PairFromKey(key, &connection_handle, &session_id);
- CloseSession(connection_handle, session_id);
+ CloseSession(connection_handle, session_id, close_reason);
}
void ConnectionHandlerImpl::CloseSession(ConnectionHandle connection_handle,
- uint8_t session_id) {
- if (protocol_handler_) {
+ uint8_t session_id,
+ CloseSessionReason close_reason) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Closing session with id: " << session_id);
+
+ // In case of malformed message the connection should be broke up without
+ // any other notification to mobile.
+ if (close_reason != kMalformed && protocol_handler_) {
protocol_handler_->SendEndSession(connection_handle, session_id);
}
transport_manager::ConnectionUID connection_id =
ConnectionUIDFromHandle(connection_handle);
- sync_primitives::AutoLock connection_list_lock(connection_list_lock_);
- ConnectionList::iterator itr = connection_list_.find(connection_id);
+ SessionMap session_map;
+ {
+ sync_primitives::AutoLock connection_list_lock(connection_list_lock_);
- if (connection_list_.end() != itr) {
- if (connection_handler_observer_) {
- SessionMap session_map = itr->second->session_map();
- SessionMap::iterator session_it = session_map.find(session_id);
- if (session_it != session_map.end()) {
- const Session &session = session_it->second;
- const ServiceList &service_list = session.service_list;
- ServiceList::const_iterator it = service_list.begin();
- for (;it != service_list.end(); ++it) {
- const uint32_t session_key = KeyFromPair(connection_id, session_id);
- const protocol_handler::ServiceType service_type = it->service_type;
- connection_handler_observer_->OnServiceEndedCallback(session_key,
- service_type);
- }
+ ConnectionList::iterator connection_list_itr =
+ connection_list_.find(connection_id);
+ if (connection_list_.end() != connection_list_itr) {
+ session_map = connection_list_itr->second->session_map();
+ connection_list_itr->second->RemoveSession(session_id);
+ } else {
+ LOG4CXX_ERROR(logger_, "Connection with id: " << connection_id
+ << " not found");
+ return;
+ }
+ }
+
+ if (!connection_handler_observer_) {
+ LOG4CXX_ERROR(logger_, "Connection handler observer not found");
+ return;
+ }
+
+ SessionMap::const_iterator session_map_itr = session_map.find(session_id);
+ if (session_map_itr != session_map.end()) {
+ const uint32_t session_key = KeyFromPair(connection_id, session_id);
+ const Session &session = session_map_itr->second;
+ const ServiceList &service_list = session.service_list;
+
+ ServiceList::const_iterator service_list_itr = service_list.begin();
+ for (;service_list_itr != service_list.end(); ++service_list_itr) {
+ const protocol_handler::ServiceType service_type =
+ service_list_itr->service_type;
+ connection_handler_observer_->OnServiceEndedCallback(
+ session_key, service_type, close_reason);
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "Session with id: "
+ << session_id << " not found");
+ return;
+ }
+ LOG4CXX_DEBUG(logger_, "Session with id: " << session_id
+ << " has been closed successfully");
+}
+
+void ConnectionHandlerImpl::CloseConnectionSessions(
+ ConnectionHandle connection_handle, CloseSessionReason close_reason) {
+
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ transport_manager::ConnectionUID connection_id =
+ ConnectionUIDFromHandle(connection_handle);
+
+ LOG4CXX_DEBUG(logger_, "Closing all sessions for connection with id: "
+ << connection_id);
+
+ typedef std::vector<uint8_t> SessionIdVector;
+ SessionIdVector session_id_vector;
+ {
+ sync_primitives::AutoLock connection_list_lock(connection_list_lock_);
+
+ ConnectionList::iterator connection_list_itr =
+ connection_list_.find(connection_id);
+ if (connection_list_.end() != connection_list_itr) {
+ const SessionMap session_map = connection_list_itr->second->session_map();
+
+ SessionMap::const_iterator session_map_itr = session_map.begin();
+ for (;session_map_itr != session_map.end(); ++session_map_itr) {
+ session_id_vector.push_back(session_map_itr->first);
}
+ } else {
+ LOG4CXX_ERROR(logger_, "Connection with id: " << connection_id
+ << " not found");
+ return;
}
- itr->second->RemoveSession(session_id);
+ }
+ SessionIdVector::const_iterator session_id_itr = session_id_vector.begin();
+ for(;session_id_itr != session_id_vector.end(); ++session_id_itr) {
+ CloseSession(connection_handle, *session_id_itr, close_reason);
+ }
+ session_id_vector.clear();
+
+ LOG4CXX_DEBUG(logger_, "All sessions for connection with id: " << connection_id
+ << " have been closed successfully");
+}
+
+void ConnectionHandlerImpl::SendEndService(uint32_t key,
+ uint8_t service_type) {
+ if (protocol_handler_) {
+ 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);
}
}
@@ -765,7 +885,7 @@ void ConnectionHandlerImpl::SetHeartBeatTimeout(uint32_t connection_key,
sync_primitives::AutoLock lock(connection_list_lock_);
ConnectionList::iterator it = connection_list_.find(connection_handle);
if (connection_list_.end() != it) {
- it->second->SetHeartBeatTimeout(timeout);
+ it->second->SetHeartBeatTimeout(timeout, session_id);
}
}
@@ -793,15 +913,18 @@ void ConnectionHandlerImpl::OnConnectionEnded(
LOG4CXX_INFO(logger_, "Delete Connection: " << static_cast<int32_t>(connection_id)
<< " from the list.");
- sync_primitives::AutoLock lock(connection_list_lock_);
+ connection_list_lock_.Acquire();
ConnectionList::iterator itr = connection_list_.find(connection_id);
if (connection_list_.end() == itr) {
LOG4CXX_ERROR(logger_, "Connection not found!");
return;
}
+ std::auto_ptr<Connection> connection(itr->second);
+ connection_list_.erase(itr);
+ connection_list_lock_.Release();
- if (connection_handler_observer_) {
- const Connection *connection = itr->second;
+ sync_primitives::AutoLock lock2(connection_handler_observer_lock_);
+ if (connection_handler_observer_ && connection.get() != NULL) {
const SessionMap session_map = connection->session_map();
for (SessionMap::const_iterator session_it = session_map.begin();
@@ -811,17 +934,15 @@ void ConnectionHandlerImpl::OnConnectionEnded(
for (ServiceList::const_iterator service_it = service_list.begin(), end =
service_list.end(); service_it != end; ++service_it) {
connection_handler_observer_->OnServiceEndedCallback(
- session_key, service_it->service_type);
+ session_key, service_it->service_type, CloseSessionReason::kCommon);
}
}
}
- delete itr->second;
- connection_list_.erase(itr);
}
void ConnectionHandlerImpl::BindProtocolVersionWithSession(
uint32_t connection_key, uint8_t protocol_version) {
- LOG4CXX_INFO(logger_, "ConnectionHandlerImpl::BindProtocolVersionWithSession()");
+ LOG4CXX_AUTO_TRACE(logger_);
uint32_t connection_handle = 0;
uint8_t session_id = 0;
PairFromKey(connection_key, &connection_handle, &session_id);
@@ -835,7 +956,7 @@ void ConnectionHandlerImpl::BindProtocolVersionWithSession(
bool ConnectionHandlerImpl::IsHeartBeatSupported(
transport_manager::ConnectionUID connection_handle,uint8_t session_id) {
- LOG4CXX_INFO(logger_, "ConnectionHandlerImpl::IsHeartBeatSupported()");
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(connection_list_lock_);
uint32_t connection = static_cast<uint32_t>(connection_handle);
ConnectionList::iterator it = connection_list_.find(connection);
@@ -846,6 +967,18 @@ bool ConnectionHandlerImpl::IsHeartBeatSupported(
return it->second->SupportHeartBeat(session_id);
}
+bool ConnectionHandlerImpl::ProtocolVersionUsed(uint32_t connection_id,
+ uint8_t session_id, uint8_t& protocol_version) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(connection_list_lock_);
+ ConnectionList::iterator it = connection_list_.find(connection_id);
+ if (connection_list_.end() != it) {
+ return it->second->ProtocolVersion(session_id, protocol_version);
+ }
+ LOG4CXX_WARN(logger_, "Connection not found !");
+ return false;
+}
+
#ifdef BUILD_TESTS
ConnectionList &ConnectionHandlerImpl::getConnectionList() {
return connection_list_;
diff --git a/src/components/connection_handler/src/device.cc b/src/components/connection_handler/src/device.cc
index 93638bd37..40a048654 100644
--- a/src/components/connection_handler/src/device.cc
+++ b/src/components/connection_handler/src/device.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file Device.cpp
* \brief Device class implementation.
*
@@ -52,7 +52,9 @@ Device::Device(DeviceHandle device_handle,
user_friendly_name_(user_friendly_name),
mac_address_(mac_address),
connection_type_(connection_type){
+ LOG4CXX_INFO(logger_, "Device MAC address is: " << mac_address_);
mac_address_ = encryption::MakeHash(mac_address);
+ LOG4CXX_INFO(logger_, "Device MAC address hash is: " << mac_address_);
}
DeviceHandle Device::device_handle() const {
diff --git a/src/components/connection_handler/src/heartbeat_monitor.cc b/src/components/connection_handler/src/heartbeat_monitor.cc
index 6a5a9e723..2349e0589 100644
--- a/src/components/connection_handler/src/heartbeat_monitor.cc
+++ b/src/components/connection_handler/src/heartbeat_monitor.cc
@@ -32,6 +32,7 @@
#include "connection_handler/heartbeat_monitor.h"
#include <unistd.h>
+#include <utility>
#include "utils/logger.h"
#include "connection_handler/connection.h"
@@ -44,60 +45,43 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "HeartBeatMonitor")
HeartBeatMonitor::HeartBeatMonitor(int32_t heartbeat_timeout_seconds,
Connection *connection)
- : heartbeat_timeout_seconds_(heartbeat_timeout_seconds),
+ : default_heartbeat_timeout_(heartbeat_timeout_seconds),
connection_(connection),
sessions_list_lock_(true),
run_(true) {
}
-bool HeartBeatMonitor::HasTimeoutElapsed(const TimevalStruct& expiration) const {
- TimevalStruct now = date_time::DateTime::getCurrentTime();
- return date_time::DateTime::Greater(now, expiration);
-}
-
void HeartBeatMonitor::Process() {
AutoLock auto_lock(sessions_list_lock_);
SessionMap::iterator it = sessions_.begin();
while (it != sessions_.end()) {
SessionState &state = it->second;
- if (HasTimeoutElapsed(state.heartbeat_expiration)) {
+ if (state.HasTimeoutElapsed()) {
const uint8_t session_id = it->first;
- if (state.is_heartbeat_sent) {
- LOG4CXX_DEBUG(logger_,
- "Session with id " << static_cast<int32_t>(session_id) << " timed out, closing");
+ if (state.IsReadyToClose()) {
+ LOG4CXX_WARN(logger_, "Will close session");
connection_->CloseSession(session_id);
it = sessions_.begin();
continue;
} else {
LOG4CXX_DEBUG(logger_,
"Send heart beat into session with id " << static_cast<int32_t>(session_id));
- RefreshExpiration(&state.heartbeat_expiration);
+ state.PrepareToClose();
connection_->SendHeartBeat(it->first);
- state.is_heartbeat_sent = true;
}
}
-
++it;
}
}
-void HeartBeatMonitor::RefreshExpiration(TimevalStruct* expiration) const {
- LOG4CXX_TRACE_ENTER(logger_);
- sync_primitives::AutoLock locker(heartbeat_timeout_seconds_lock_);
- DCHECK(expiration);
- *expiration = date_time::DateTime::getCurrentTime();
- expiration->tv_sec += heartbeat_timeout_seconds_;
- LOG4CXX_TRACE_EXIT(logger_);
-}
-
void HeartBeatMonitor::threadMain() {
AutoLock main_lock(main_thread_lock_);
LOG4CXX_DEBUG(
logger_,
- "Start heart beat monitor. Timeout is " << heartbeat_timeout_seconds_);
+ "Start heart beat monitor. Timeout is " << default_heartbeat_timeout_);
while (run_) {
- usleep(kDefaultCycleTimeout);
+ heartbeat_monitor_.WaitFor(main_lock, kDefaultCycleTimeout);
Process();
}
}
@@ -111,23 +95,21 @@ void HeartBeatMonitor::AddSession(uint8_t session_id) {
"Session with id " << static_cast<int32_t>(session_id) << " already exists");
return;
}
- SessionState session_state;
- RefreshExpiration(&session_state.heartbeat_expiration);
- session_state.is_heartbeat_sent = false;
- sessions_[session_id] = session_state;
-
- LOG4CXX_INFO(
- logger_,
- "Start heartbeat for session " << static_cast<int32_t>(session_id));
+ sessions_.insert(std::make_pair(session_id,
+ SessionState(default_heartbeat_timeout_)));
+ LOG4CXX_INFO(logger_, "Start heartbeat for session " << session_id);
}
void HeartBeatMonitor::RemoveSession(uint8_t session_id) {
AutoLock auto_lock(sessions_list_lock_);
- if (sessions_.end() != sessions_.find(session_id)) {
- LOG4CXX_INFO(logger_,
- "Remove session with id " << static_cast<int32_t>(session_id));
- sessions_.erase(session_id);
+ LOG4CXX_DEBUG(logger_,
+ "Remove session with id " << static_cast<int>(session_id));
+
+ if (sessions_.erase(session_id) == 0) {
+ LOG4CXX_WARN(logger_,
+ "Remove session with id " << static_cast<int>(session_id) <<
+ " was unsuccessful");
}
}
@@ -135,35 +117,73 @@ void HeartBeatMonitor::KeepAlive(uint8_t session_id) {
AutoLock auto_lock(sessions_list_lock_);
if (sessions_.end() != sessions_.find(session_id)) {
- LOG4CXX_INFO(
- logger_,
- "Resetting heart beat timer for session with id " << static_cast<int32_t>(session_id));
+ LOG4CXX_INFO( logger_, "Resetting heart beat timer for session with id " <<
+ static_cast<int32_t>(session_id));
- RefreshExpiration(&sessions_[session_id].heartbeat_expiration);
- sessions_[session_id].is_heartbeat_sent = false;
+ sessions_[session_id].KeepAlive();
}
}
-bool HeartBeatMonitor::exitThreadMain() {
- LOG4CXX_TRACE_ENTER(logger_);
- run_ = false;
+void HeartBeatMonitor::exitThreadMain() {
+ // FIXME (dchmerev@luxoft.com): thread requested to stop should stop as soon as possible,
+ // not running one more iteration before actual stop
+ LOG4CXX_AUTO_TRACE(logger_);
AutoLock main_lock(main_thread_lock_);
- LOG4CXX_TRACE_EXIT(logger_);
- return true;
+ run_ = false;
+ heartbeat_monitor_.NotifyOne();
}
-void HeartBeatMonitor::set_heartbeat_timeout_seconds(int32_t timeout) {
- LOG4CXX_DEBUG(logger_, "Set new heart beat timeout " << timeout);
- {
- AutoLock locker(heartbeat_timeout_seconds_lock_);
- heartbeat_timeout_seconds_ = timeout;
- }
+void HeartBeatMonitor::set_heartbeat_timeout_seconds(int32_t timeout,
+ uint8_t session_id) {
+ LOG4CXX_DEBUG(logger_, "Set new heart beat timeout " << timeout <<
+ "For session: " << session_id);
AutoLock session_locker(sessions_list_lock_);
- for (SessionMap::iterator i = sessions_.begin(); i != sessions_.end(); ++i) {
- SessionState& session_state = i->second;
- RefreshExpiration(&session_state.heartbeat_expiration);
+ if (sessions_.end() != sessions_.find(session_id)) {
+ sessions_[session_id].UpdateTimeout(timeout);
}
}
+HeartBeatMonitor::SessionState::SessionState(int32_t heartbeat_timeout_seconds)
+ : heartbeat_timeout_seconds_(heartbeat_timeout_seconds),
+ is_heartbeat_sent(false) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RefreshExpiration();
+}
+
+void HeartBeatMonitor::SessionState::RefreshExpiration () {
+ LOG4CXX_DEBUG(logger_, "Refresh expiration: " << heartbeat_timeout_seconds_);
+ heartbeat_expiration = date_time::DateTime::getCurrentTime();
+ heartbeat_expiration.tv_sec += heartbeat_timeout_seconds_;
+}
+
+void HeartBeatMonitor::SessionState::UpdateTimeout(
+ int32_t heartbeat_timeout_seconds) {
+ LOG4CXX_DEBUG(logger_, "Update timout with value " <<
+ heartbeat_timeout_seconds_);
+ heartbeat_timeout_seconds_ = heartbeat_timeout_seconds;
+ RefreshExpiration();
+}
+
+void HeartBeatMonitor::SessionState::PrepareToClose() {
+ is_heartbeat_sent = true;
+ LOG4CXX_DEBUG(logger_, "Prepare to close");
+ RefreshExpiration();
+}
+
+bool HeartBeatMonitor::SessionState::IsReadyToClose() const {
+ return is_heartbeat_sent;
+}
+
+void HeartBeatMonitor::SessionState::KeepAlive() {
+ is_heartbeat_sent = false;
+ LOG4CXX_DEBUG(logger_, "keep alive");
+ RefreshExpiration();
+}
+
+bool HeartBeatMonitor::SessionState::HasTimeoutElapsed() {
+ TimevalStruct now = date_time::DateTime::getCurrentTime();
+ return date_time::DateTime::Greater(now, heartbeat_expiration);
+}
+
} // namespace connection_handler
diff --git a/src/components/connection_handler/test/CMakeLists.txt b/src/components/connection_handler/test/CMakeLists.txt
new file mode 100644
index 000000000..7c0e1b2a9
--- /dev/null
+++ b/src/components/connection_handler/test/CMakeLists.txt
@@ -0,0 +1,64 @@
+# 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.
+
+if(BUILD_TESTS)
+
+set(appMain_DIR ${CMAKE_SOURCE_DIR}/src/appMain)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/connection_handler/include
+ ${COMPONENTS_DIR}/security_manager/test/include
+ ${COMPONENTS_DIR}/protocol_handler/test/include
+ ${COMPONENTS_DIR}/security_manager/include
+ ${COMPONENTS_DIR}/connection_handler/test/include
+ ${COMPONENTS_DIR}/transport_manager/test/include
+)
+
+set(LIBRARIES
+ gmock
+ connectionHandler
+ ConfigProfile
+ ProtocolHandler
+ TransportManager
+)
+
+set(SOURCES
+ #connection_handler_impl_test.cc
+ connection_test.cc
+ device_test.cc
+ #heart_beat_monitor_test.cc
+)
+
+file(COPY ${appMain_DIR}/smartDeviceLink.ini DESTINATION "./")
+
+create_test("connection_handler_test" "${SOURCES}" "${LIBRARIES}")
+
+endif()
diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc
new file mode 100644
index 000000000..94e4c816f
--- /dev/null
+++ b/src/components/connection_handler/test/connection_handler_impl_test.cc
@@ -0,0 +1,1043 @@
+/*
+ * 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 <fstream>
+#include <cstdint>
+#include "connection_handler/connection_handler_impl.h"
+#include "protocol/common.h"
+#include "config_profile/profile.h"
+// TODO(EZamakhov): move security test
+#include "security_manager_mock.h"
+#include "protocol_handler_mock.h"
+#include "connection_handler_observer_mock.h"
+#include "transport_manager_mock.h"
+
+namespace test {
+namespace components {
+namespace connection_handle_test {
+
+using namespace ::connection_handler;
+using ::protocol_handler::ServiceType;
+using namespace ::protocol_handler;
+using ::testing::_;
+using ::testing::InSequence;
+// For service types and PROTECTION_ON/OFF
+
+class ConnectionHandlerTest : public ::testing::Test {
+ protected:
+ void SetUp() OVERRIDE {
+ connection_handler_ = ConnectionHandlerImpl::instance();
+ uid_ = 1u;
+ connection_key_ = connection_handler_->KeyFromPair(0, 0u);
+ }
+ void TearDown() OVERRIDE {
+ ConnectionHandlerImpl::destroy();
+ }
+ // Additional SetUp
+ void AddTestDeviceConnection() {
+ device_handle_ = 0;
+
+ connection_type_ = "BTMAC";
+ device_name_ = "test_name";
+ mac_address_ = "test_address";
+
+ const transport_manager::DeviceInfo device_info(device_handle_,
+ mac_address_,
+ device_name_,
+ connection_type_);
+ // Add Device and connection
+ connection_handler_->addDeviceConnection(device_info, uid_);
+ connection_key_ = connection_handler_->KeyFromPair(uid_, 0u);
+ // Remove all specific services
+ SetSpecificServices("", "");
+ }
+ void AddTestSession() {
+ start_session_id_ = connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, &out_hash_id_);
+ EXPECT_NE(0u, start_session_id_);
+ EXPECT_EQ(SessionHash(uid_, start_session_id_), out_hash_id_);
+ connection_key_ = connection_handler_->KeyFromPair(uid_, start_session_id_);
+ CheckSessionExists(uid_, start_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, start_session_id_);
+ EXPECT_EQ(SessionHash(uid_, start_session_id_), out_hash_id_);
+ connection_key_ = connection_handler_->KeyFromPair(uid_, start_session_id_);
+ CheckSessionExists(uid_, start_session_id_);
+ uint32_t session_id = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, service_type, PROTECTION_OFF, 0);
+ EXPECT_EQ(session_id, start_session_id_);
+ }
+
+ // Additional SetUp
+ void SetSpecificServices(const std::string& protect, const std::string& not_protect) {
+ const char* config_file = "config.ini";
+ std::ofstream file_config(config_file);
+ ASSERT_TRUE(file_config.is_open());
+ const std::string non("NON");
+ file_config << "[Security Manager]" << std::endl
+ << "; Force protected services (could be id's from 0x01 to 0xFF)"
+ << std::endl << "ForceProtectedService = "
+ << (protect.empty() ? non : protect) << std::endl
+ << "; Force unprotected services" << std::endl
+ << "ForceUnprotectedService = "
+ << (not_protect.empty() ? non : not_protect) << std::endl;
+ file_config.close();
+ profile::Profile::instance()->config_file_name(config_file);
+ }
+ // Check Service Wrapper
+ // If session_id is NULL - check that there is no sessions in connection
+ void CheckSessionExists(const int connectionId, const int session_id) {
+ // Check all tree to find Session and check own protected value
+ const ConnectionList& connection_list = connection_handler_->getConnectionList();
+ ASSERT_FALSE(connection_list.empty());
+ ConnectionList::const_iterator conn_it = connection_list.find(connectionId);
+ ASSERT_NE(conn_it, connection_list.end());
+ const Connection& connection = *connection_list.begin()->second;
+
+ const SessionMap& session_map = connection.session_map();
+ SessionMap::const_iterator sess_it = session_map.find(session_id);
+ if (session_id == 0) {
+ ASSERT_TRUE(session_map.empty());
+ } else {
+ ASSERT_FALSE(session_map.empty());
+ ASSERT_NE(sess_it, session_map.end());
+ const Session& session = sess_it->second;
+ const ServiceList& service_list = session.service_list;
+ ASSERT_FALSE(service_list.empty());
+ // Check RPC and bulk services in session
+ ASSERT_NE(service_list.end(), std::find(service_list.begin(), service_list.end(), kRpc));
+ ASSERT_NE(service_list.end(), std::find(service_list.begin(), service_list.end(), kBulk));
+ }
+ }
+
+ // Check Service Wrapper
+ void CheckServiceExists(const int connectionId, const int session_id,
+ const ::protocol_handler::ServiceType serviceId,
+ const bool exists) {
+ // Check all trees to find Service and check own protected value
+ const ConnectionList& connection_list = connection_handler_->getConnectionList();
+ ASSERT_FALSE(connection_list.empty());
+ ConnectionList::const_iterator conn_it = connection_list.find(connectionId);
+ ASSERT_NE(conn_it, connection_list.end());
+ const Connection& connection = *connection_list.begin()->second;
+
+ const SessionMap& session_map = connection.session_map();
+ ASSERT_FALSE(session_map.empty());
+ SessionMap::const_iterator sess_it = session_map.find(session_id);
+ ASSERT_NE(sess_it, session_map.end());
+ const Session& session = sess_it->second;
+ const ServiceList& service_list = session.service_list;
+ ASSERT_FALSE(service_list.empty());
+ ServiceList::const_iterator serv_it = std::find(service_list.begin(), service_list.end(), serviceId);
+ if (exists) {
+ ASSERT_NE(serv_it, service_list.end());
+ } else {
+ ASSERT_EQ(serv_it, service_list.end());
+ }
+ }
+ // Check Service Wrapper
+ void CheckService(const int connectionId, const int session_id,
+ const ::protocol_handler::ServiceType serviceId,
+ const ::security_manager::SSLContext* ssl_context,
+ const bool is_protected) {
+ // Check all tree to find Service and check own protected value
+ const ConnectionList& connection_list = connection_handler_->getConnectionList();
+ ASSERT_FALSE(connection_list.empty());
+ ConnectionList::const_iterator conn_it = connection_list.find(connectionId);
+ ASSERT_NE(conn_it, connection_list.end());
+ const Connection& connection = *connection_list.begin()->second;
+
+ const SessionMap& session_map = connection.session_map();
+ ASSERT_FALSE(session_map.empty());
+ SessionMap::const_iterator sess_it = session_map.find(session_id);
+ ASSERT_NE(sess_it, session_map.end());
+ const Session& session = sess_it->second;
+#ifdef ENABLE_SECURITY
+ ASSERT_EQ(session.ssl_context, ssl_context);
+#endif // ENABLE_SECURITY
+ const ServiceList& service_list = session.service_list;
+ ASSERT_FALSE(service_list.empty());
+ ServiceList::const_iterator serv_it = std::find(service_list.begin(), service_list.end(), serviceId);
+ ASSERT_NE(serv_it, service_list.end());
+
+ const Service& service = *serv_it;
+ EXPECT_EQ(PROTECTION_OFF, service.is_protected_);
+#ifdef ENABLE_SECURITY
+ if (is_protected) {
+ // Emulate success protection - check enable service flag
+ const uint32_t connection_key_ = connection_handler_->KeyFromPair(
+ connectionId, session_id);
+ connection_handler_->SetProtectionFlag(connection_key_, serviceId);
+ }
+#endif // ENABLE_SECURITY
+ }
+
+ void ChangeProtocol(const int connectionId, const int session_id, const uint8_t protocol_version) {
+ ConnectionList connection_list = connection_handler_->getConnectionList();
+
+ ConnectionList::const_iterator conn_it = (connection_handler_->getConnectionList()).find(connectionId);
+ ASSERT_NE(conn_it, connection_list.end());
+ Connection * connection = conn_it->second;
+ ASSERT_TRUE(connection != NULL);
+ connection->UpdateProtocolVersionSession(session_id, protocol_version);
+ uint8_t check_protocol_version;
+ EXPECT_TRUE(connection->ProtocolVersion(session_id, check_protocol_version));
+ EXPECT_EQ(check_protocol_version,protocol_version);
+
+ }
+
+ ConnectionHandlerImpl* connection_handler_;
+ transport_manager::DeviceHandle device_handle_;
+ transport_manager::ConnectionUID uid_;
+ uint32_t connection_key_;
+ uint32_t start_session_id_;
+ uint32_t out_hash_id_;
+
+ std::string connection_type_;
+ std::string device_name_;
+ std::string mac_address_;
+
+};
+
+TEST_F(ConnectionHandlerTest, StartSession_NoConnection) {
+ // Null sessionId for start new session
+ const uint8_t sessionID = 0;
+ // Start new session with RPC service
+ const uint32_t result_fail = connection_handler_->OnSessionStartedCallback(uid_, sessionID, kRpc, PROTECTION_ON, &out_hash_id_);
+ // Unknown connection error is '0'
+ EXPECT_EQ(0u, result_fail);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
+ ASSERT_TRUE(connection_handler_->getConnectionList().empty());
+}
+
+TEST_F(ConnectionHandlerTest, StartSession) {
+ // Add virtual device and connection
+ AddTestDeviceConnection();
+ // Start new session with RPC service
+ AddTestSession();
+}
+
+TEST_F(ConnectionHandlerTest, GetConnectionSessionsCount) {
+ AddTestDeviceConnection();
+ EXPECT_EQ(0u, connection_handler_->GetConnectionSessionsCount(connection_key_));
+
+ AddTestSession();
+ EXPECT_EQ(1u, connection_handler_->GetConnectionSessionsCount(connection_key_));
+}
+
+TEST_F(ConnectionHandlerTest, GetAppIdOnSessionKey) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ uint32_t app_id = 0;
+ const uint32_t testid = SessionHash(uid_, start_session_id_);
+
+ EXPECT_EQ(0, connection_handler_->GetDataOnSessionKey(connection_key_, &app_id, NULL, NULL));
+ EXPECT_EQ(testid, app_id);
+}
+
+TEST_F(ConnectionHandlerTest,GetDeviceID) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ DeviceHandle test_handle;
+ const DeviceMap & devmap = connection_handler_->getDeviceList();
+ DeviceMap::const_iterator pos = devmap.find(device_handle_);
+ ASSERT_NE(pos, devmap.end());
+ const Device & devres = pos->second;
+ std::string test_mac_address = devres.mac_address();
+
+ EXPECT_TRUE(connection_handler_->GetDeviceID(test_mac_address, &test_handle));
+ EXPECT_EQ(device_handle_, test_handle);
+}
+
+TEST_F(ConnectionHandlerTest,GetDeviceName) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ std::string test_device_name;
+ DeviceHandle handle = 0;
+ EXPECT_EQ(0, connection_handler_->GetDataOnDeviceID(handle, &test_device_name));
+ EXPECT_EQ(device_name_, test_device_name);
+}
+
+TEST_F(ConnectionHandlerTest,GetConnectionType) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ const DeviceHandle handle = 0;
+ std::string test_connection_type;
+ EXPECT_EQ(0, connection_handler_->GetDataOnDeviceID(handle, NULL, NULL, NULL, &test_connection_type));
+ EXPECT_EQ(connection_type_, test_connection_type);
+}
+
+TEST_F(ConnectionHandlerTest, GetDefaultProtocolVersion) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ uint8_t protocol_version = 0;
+ EXPECT_TRUE(connection_handler_->ProtocolVersionUsed(uid_, start_session_id_, protocol_version));
+
+ EXPECT_EQ(PROTOCOL_VERSION_2, protocol_version);
+}
+
+TEST_F(ConnectionHandlerTest, GetProtocolVersion) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ ChangeProtocol(uid_, start_session_id_, PROTOCOL_VERSION_3);
+
+ uint8_t protocol_version = 0;
+ EXPECT_TRUE(connection_handler_->ProtocolVersionUsed(uid_, start_session_id_, protocol_version));
+
+ EXPECT_EQ(PROTOCOL_VERSION_3, protocol_version);
+}
+
+TEST_F(ConnectionHandlerTest, GetProtocolVersionAfterBinding) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ uint8_t protocol_version = 0;
+ EXPECT_TRUE(connection_handler_->ProtocolVersionUsed(uid_, start_session_id_, protocol_version));
+ EXPECT_EQ(PROTOCOL_VERSION_2, protocol_version);
+
+ connection_handler_->BindProtocolVersionWithSession(connection_key_, PROTOCOL_VERSION_3);
+
+ EXPECT_TRUE(connection_handler_->ProtocolVersionUsed(uid_, start_session_id_, protocol_version));
+ EXPECT_EQ(PROTOCOL_VERSION_3, protocol_version);
+}
+
+TEST_F(ConnectionHandlerTest, GetPairFromKey) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ uint8_t session_id = 0;
+ uint32_t test_uid = 0;
+ connection_handler_->PairFromKey(connection_key_, &test_uid, &session_id);
+ EXPECT_EQ(uid_, test_uid);
+ EXPECT_EQ(start_session_id_, session_id);
+}
+
+TEST_F(ConnectionHandlerTest, IsHeartBeatSupported) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ ChangeProtocol(uid_, start_session_id_, PROTOCOL_VERSION_3);
+ EXPECT_TRUE(connection_handler_->IsHeartBeatSupported(uid_, start_session_id_));
+}
+
+TEST_F(ConnectionHandlerTest,SendEndServiceWithoutSetProtocolHandler) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ protocol_handler_test::ProtocolHandlerMock mock_protocol_handler;
+
+ EXPECT_CALL(mock_protocol_handler, SendEndService(_,_,kRpc)).Times(0);
+ connection_handler_->SendEndService(connection_key_, kRpc);
+}
+
+TEST_F(ConnectionHandlerTest,SendEndService) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ protocol_handler_test::ProtocolHandlerMock mock_protocol_handler;
+
+ connection_handler_->set_protocol_handler(&mock_protocol_handler);
+ EXPECT_CALL(mock_protocol_handler, SendEndService(_,_,kRpc));
+ connection_handler_->SendEndService(connection_key_, kRpc);
+}
+
+TEST_F(ConnectionHandlerTest,OnFindNewApplicationsRequest) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ connection_handler_test::ConnectionHandlerObserverMock mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(&mock_connection_handler_observer);
+
+ EXPECT_CALL(mock_connection_handler_observer, OnFindNewApplicationsRequest());
+ connection_handler_->OnFindNewApplicationsRequest();
+}
+
+TEST_F(ConnectionHandlerTest,OnFindNewApplicationsRequestWithoutObserver) {
+ connection_handler_test::ConnectionHandlerObserverMock mock_connection_handler_observer;
+ EXPECT_CALL(mock_connection_handler_observer, OnFindNewApplicationsRequest()).Times(0);
+ connection_handler_->OnFindNewApplicationsRequest();
+}
+
+TEST_F(ConnectionHandlerTest,OnFindNewApplicationsRequestWithoutSession) {
+ connection_handler_test::ConnectionHandlerObserverMock mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(&mock_connection_handler_observer);
+
+ EXPECT_CALL(mock_connection_handler_observer, OnFindNewApplicationsRequest());
+ connection_handler_->OnFindNewApplicationsRequest();
+}
+
+TEST_F(ConnectionHandlerTest, OnMalformedMessageCallback) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ AddTestService(kAudio);
+ AddTestService(kMobileNav);
+ connection_handler_test::ConnectionHandlerObserverMock mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(&mock_connection_handler_observer);
+
+ InSequence seq;
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kMobileNav, kMalformed)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kAudio, kMalformed)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kBulk, kMalformed)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kRpc, kMalformed)).Times(1);
+ connection_handler_->OnMalformedMessageCallback(uid_);
+}
+
+TEST_F(ConnectionHandlerTest, OnApplicationFloodCallBack) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ AddTestService(kAudio);
+ AddTestService(kMobileNav);
+ connection_handler_test::ConnectionHandlerObserverMock mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(&mock_connection_handler_observer);
+
+ protocol_handler_test::ProtocolHandlerMock mock_protocol_handler;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler);
+
+ EXPECT_CALL(mock_protocol_handler, SendEndSession(uid_,start_session_id_));
+
+ InSequence seq;
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kMobileNav, kCommon)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kAudio, kCommon)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kBulk, kCommon)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kRpc, kCommon)).Times(1);
+ connection_handler_->OnApplicationFloodCallBack(uid_);
+}
+
+TEST_F(ConnectionHandlerTest, StartDevicesDiscovery) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ transport_manager_test::TransportManagerMock mock_transport_manager;
+ connection_handler_->set_transport_manager(&mock_transport_manager);
+ connection_handler_test::ConnectionHandlerObserverMock mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(&mock_connection_handler_observer);
+
+ EXPECT_CALL(mock_transport_manager, SearchDevices());
+ EXPECT_CALL(mock_connection_handler_observer, OnDeviceListUpdated(_));
+ connection_handler_->StartDevicesDiscovery();
+}
+
+TEST_F(ConnectionHandlerTest, StartTransportManager) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ transport_manager_test::TransportManagerMock mock_transport_manager;
+ connection_handler_->set_transport_manager(&mock_transport_manager);
+ EXPECT_CALL(mock_transport_manager, Visibility(true));
+ connection_handler_->StartTransportManager();
+}
+
+TEST_F(ConnectionHandlerTest, CloseConnection) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ transport_manager_test::TransportManagerMock mock_transport_manager;
+ connection_handler_->set_transport_manager(&mock_transport_manager);
+ EXPECT_CALL(mock_transport_manager, DisconnectForce(uid_));
+ connection_handler_->CloseConnection(uid_);
+}
+
+TEST_F(ConnectionHandlerTest, CloseRevokedConnection) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ transport_manager_test::TransportManagerMock mock_transport_manager;
+ connection_handler_->set_transport_manager(&mock_transport_manager);
+ EXPECT_CALL(mock_transport_manager, DisconnectForce(uid_));
+ connection_handler_->CloseRevokedConnection(connection_key_);
+}
+
+TEST_F(ConnectionHandlerTest, CloseSessionWithCommonReason) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ AddTestService(kAudio);
+ AddTestService(kMobileNav);
+ connection_handler_test::ConnectionHandlerObserverMock mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(&mock_connection_handler_observer);
+
+ protocol_handler_test::ProtocolHandlerMock mock_protocol_handler;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler);
+
+ EXPECT_CALL(mock_protocol_handler, SendEndSession(uid_,start_session_id_));
+
+ InSequence seq;
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kMobileNav, kCommon)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kAudio, kCommon)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kBulk, kCommon)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kRpc, kCommon)).Times(1);
+ connection_handler_->CloseSession(connection_key_, kCommon);
+}
+
+TEST_F(ConnectionHandlerTest, CloseSessionWithFloodReason) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ AddTestService(kAudio);
+ AddTestService(kMobileNav);
+ connection_handler_test::ConnectionHandlerObserverMock mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(&mock_connection_handler_observer);
+
+ protocol_handler_test::ProtocolHandlerMock mock_protocol_handler;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler);
+
+ EXPECT_CALL(mock_protocol_handler, SendEndSession(uid_,start_session_id_));
+
+ InSequence seq;
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kMobileNav, kFlood)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kAudio, kFlood)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kBulk, kFlood)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kRpc, kFlood)).Times(1);
+ connection_handler_->CloseSession(connection_key_, kFlood);
+}
+
+TEST_F(ConnectionHandlerTest, CloseSessionWithMalformedMessage) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ AddTestService(kAudio);
+ AddTestService(kMobileNav);
+ connection_handler_test::ConnectionHandlerObserverMock mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(&mock_connection_handler_observer);
+
+ protocol_handler_test::ProtocolHandlerMock mock_protocol_handler;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler);
+
+ EXPECT_CALL(mock_protocol_handler, SendEndSession(uid_,start_session_id_)).Times(0);
+
+ InSequence seq;
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kMobileNav, kMalformed)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kAudio, kMalformed)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kBulk, kMalformed)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kRpc, kMalformed)).Times(1);
+ connection_handler_->CloseSession(connection_key_, kMalformed);
+}
+
+TEST_F(ConnectionHandlerTest, CloseConnectionSessionsWithMalformedMessage) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ AddTestService(kAudio);
+ AddTestService(kMobileNav);
+ connection_handler_test::ConnectionHandlerObserverMock mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(&mock_connection_handler_observer);
+
+ protocol_handler_test::ProtocolHandlerMock mock_protocol_handler;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler);
+
+ EXPECT_CALL(mock_protocol_handler, SendEndSession(uid_,start_session_id_)).Times(0);
+
+ InSequence seq;
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kMobileNav, kMalformed)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kAudio, kMalformed)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kBulk, kMalformed)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kRpc, kMalformed)).Times(1);
+ connection_handler_->CloseConnectionSessions(uid_, kMalformed);
+}
+
+TEST_F(ConnectionHandlerTest, CloseConnectionSessionsWithCommonReason) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ AddTestService(kAudio);
+ AddTestService(kMobileNav);
+ connection_handler_test::ConnectionHandlerObserverMock mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(&mock_connection_handler_observer);
+
+ protocol_handler_test::ProtocolHandlerMock mock_protocol_handler;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler);
+
+ EXPECT_CALL(mock_protocol_handler, SendEndSession(uid_,start_session_id_));
+
+ InSequence seq;
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kMobileNav, kCommon)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kAudio, kCommon)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kBulk, kCommon)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(connection_key_,kRpc, kCommon)).Times(1);
+ connection_handler_->CloseConnectionSessions(uid_, kCommon);
+}
+
+TEST_F(ConnectionHandlerTest, StartService_withServices) {
+ // Add virtual device and connection
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ // Start Audio service
+ const uint32_t start_audio = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, kAudio, PROTECTION_OFF, &out_hash_id_);
+ EXPECT_EQ(start_session_id_, start_audio);
+ CheckServiceExists(uid_, start_session_id_, kAudio, true);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
+
+ // Start Audio service
+ const uint32_t start_video = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, kMobileNav, PROTECTION_OFF, &out_hash_id_);
+ EXPECT_EQ(start_session_id_, start_video);
+ CheckServiceExists(uid_, start_session_id_, kMobileNav, true);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
+}
+
+TEST_F(ConnectionHandlerTest, ServiceStop_UnExistSession) {
+ AddTestDeviceConnection();
+
+ const uint32_t end_session_result = connection_handler_->OnSessionEndedCallback(
+ uid_, 0u, 0u, kAudio);
+ EXPECT_EQ(0u, end_session_result);
+ CheckSessionExists(uid_, 0);
+}
+
+TEST_F(ConnectionHandlerTest, ServiceStop_UnExistService) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ const uint32_t end_session_result = connection_handler_->OnSessionEndedCallback(
+ uid_, start_session_id_, 0u, kAudio);
+ EXPECT_EQ(0u, end_session_result);
+ CheckServiceExists(uid_, start_session_id_, kAudio, false);
+}
+
+TEST_F(ConnectionHandlerTest, ServiceStop) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ // Check ignoring hash_id on stop non-rpc service
+ for (uint32_t some_hash_id = 0; some_hash_id < 0xFF; ++some_hash_id) {
+ // Start audio service
+ const uint32_t start_audio = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, kAudio, PROTECTION_OFF, &out_hash_id_);
+ EXPECT_EQ(start_session_id_, start_audio);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
+
+ const uint32_t end_session_result = connection_handler_->OnSessionEndedCallback(
+ uid_, start_session_id_, some_hash_id, kAudio);
+ EXPECT_EQ(connection_key_, end_session_result);
+ CheckServiceExists(uid_, start_session_id_, kAudio, false);
+ }
+}
+
+TEST_F(ConnectionHandlerTest, SessionStop_CheckHash) {
+ AddTestDeviceConnection();
+ for (uint32_t session = 0; session < 0xFF; ++session) {
+ AddTestSession();
+
+ const uint32_t hash = connection_key_;
+ const uint32_t wrong_hash = hash + 1;
+
+ const uint32_t end_audio_wrong_hash = connection_handler_->OnSessionEndedCallback(
+ uid_, start_session_id_, wrong_hash, kRpc);
+ EXPECT_EQ(0u, end_audio_wrong_hash);
+ CheckSessionExists(uid_, start_session_id_);
+
+ const uint32_t end_audio = connection_handler_->OnSessionEndedCallback(
+ uid_, start_session_id_, hash, kRpc);
+ EXPECT_EQ(connection_key_, end_audio);
+ CheckSessionExists(uid_, 0);
+ }
+}
+
+TEST_F(ConnectionHandlerTest, SessionStop_CheckSpecificHash) {
+ AddTestDeviceConnection();
+ for (uint32_t session = 0; session < 0xFF; ++session) {
+ AddTestSession();
+
+ const uint32_t wrong_hash = protocol_handler::HASH_ID_WRONG;
+ const uint32_t hash = protocol_handler::HASH_ID_NOT_SUPPORTED;
+
+ const uint32_t end_audio_wrong_hash = connection_handler_->OnSessionEndedCallback(
+ uid_, start_session_id_, wrong_hash, kRpc);
+ EXPECT_EQ(0u, end_audio_wrong_hash);
+ CheckSessionExists(uid_, start_session_id_);
+
+ const uint32_t end_audio = connection_handler_->OnSessionEndedCallback(
+ uid_, start_session_id_, hash, kRpc);
+ EXPECT_EQ(connection_key_, end_audio);
+ CheckSessionExists(uid_, 0);
+ }
+}
+
+TEST_F(ConnectionHandlerTest, SessionStarted_StartSession_SecureSpecific_Unprotect) {
+ // Add virtual device and connection
+ AddTestDeviceConnection();
+ // Forbid start kRPC without encryption
+ SetSpecificServices("0x07", "");
+ // Start new session with RPC service
+ const uint32_t session_id_fail = connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, &out_hash_id_);
+#ifdef ENABLE_SECURITY
+ EXPECT_EQ(0u, session_id_fail);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
+#else
+ EXPECT_EQ(1u, session_id_fail);
+ EXPECT_EQ(SessionHash(uid_, session_id_fail), out_hash_id_);
+#endif // ENABLE_SECURITY
+
+ // Allow start kRPC without encryption
+ SetSpecificServices("0x00, Non", "");
+ // Start new session with RPC service
+ const uint32_t session_id = connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, &out_hash_id_);
+ EXPECT_NE(0u, session_id);
+ CheckService(uid_, session_id, kRpc, NULL, PROTECTION_OFF);
+ EXPECT_EQ(SessionHash(uid_, session_id), out_hash_id_);
+}
+
+TEST_F(ConnectionHandlerTest, SessionStarted_StartSession_SecureSpecific_Protect) {
+ // Add virtual device and connection
+ AddTestDeviceConnection();
+ // Forbid start kRPC with encryption
+ SetSpecificServices("", "0x06, 0x07, 0x08, Non");
+ // Start new session with RPC service
+ const uint32_t session_id_fail = connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_ON, NULL);
+#ifdef ENABLE_SECURITY
+ EXPECT_EQ(0u, session_id_fail);
+#else
+ EXPECT_EQ(1u, session_id_fail);
+#endif // ENABLE_SECURITY
+
+ // Allow start kRPC with encryption
+ SetSpecificServices("", "0x00, 0x05, Non");
+ // Start new session with RPC service
+ const uint32_t session_id = connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_ON, &out_hash_id_);
+ EXPECT_NE(0u, session_id);
+ EXPECT_EQ(SessionHash(uid_, session_id), out_hash_id_);
+
+ // Protection steal FALSE because of APPlink Protocol implementation
+ CheckService(uid_, session_id, kRpc, NULL, PROTECTION_OFF);
+}
+
+TEST_F(ConnectionHandlerTest, SessionStarted_StartService_SecureSpecific_Unprotect) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ // Audio is 0x0A
+ ASSERT_EQ(0x0A, kAudio);
+
+ // Forbid start kAudio without encryption
+ SetSpecificServices("0x06, 0x0A, 0x08, Non", "");
+ // Start new session with Audio service
+ const uint32_t session_id2 = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, kAudio, PROTECTION_OFF, NULL);
+#ifdef ENABLE_SECURITY
+ EXPECT_EQ(0u, session_id2);
+#else
+ EXPECT_EQ(1u, session_id2);
+#endif // ENABLE_SECURITY
+ // Allow start kAudio without encryption
+ SetSpecificServices("0x06, 0x0B, 0x08, Non", "");
+ const uint32_t session_id3 = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, kAudio, PROTECTION_OFF, &out_hash_id_);
+ // Returned original session id
+#ifdef ENABLE_SECURITY
+ EXPECT_EQ(start_session_id_, session_id3);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
+ CheckService(uid_, session_id3, kRpc,
+ NULL,
+ PROTECTION_OFF);
+#else
+ EXPECT_EQ(0u, session_id3);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
+#endif // ENABLE_SECURITY
+}
+
+TEST_F(ConnectionHandlerTest, SessionStarted_StartService_SecureSpecific_Protect) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ // Audio is 0x0A
+ ASSERT_EQ(0x0A, kAudio);
+ // Forbid start kAudio with encryption
+ SetSpecificServices("", "0x06, 0x0A, 0x08, Non");
+ // Start new session with Audio service
+ const uint32_t session_id_reject = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, kAudio, PROTECTION_ON, NULL);
+#ifdef ENABLE_SECURITY
+ EXPECT_EQ(0u, session_id_reject);
+#else
+ EXPECT_EQ(1u, session_id_reject);
+#endif // ENABLE_SECURITY
+ // Allow start kAudio with encryption
+ SetSpecificServices("", "Non");
+ const uint32_t session_id3 = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, kAudio, PROTECTION_ON, &out_hash_id_);
+ // Returned original session id
+#ifdef ENABLE_SECURITY
+ EXPECT_EQ(start_session_id_, session_id3);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
+ CheckService(uid_, session_id3, kAudio,
+ NULL,
+ PROTECTION_ON);
+#else
+ EXPECT_EQ(0u, session_id3);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
+ CheckService(uid_, start_session_id_, kAudio, NULL, PROTECTION_OFF);
+#endif // ENABLE_SECURITY
+}
+
+TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtect) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ // Start RPC protection
+ const uint32_t session_id_new = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, kRpc, PROTECTION_ON, &out_hash_id_);
+#ifdef ENABLE_SECURITY
+ EXPECT_EQ(start_session_id_, session_id_new);
+ // Post protection nedd no hash
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
+ CheckService(uid_, start_session_id_, kRpc,
+ NULL,
+ PROTECTION_ON);
+#else
+ EXPECT_EQ(0u, session_id_new);
+ // Post protection nedd no hash
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
+ CheckService(uid_, start_session_id_, kRpc, NULL, PROTECTION_OFF);
+#endif // ENABLE_SECURITY
+
+ // Start Audio session without protection
+ const uint32_t session_id2 = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, kAudio, PROTECTION_OFF, &out_hash_id_);
+ EXPECT_EQ(start_session_id_, session_id2);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
+ CheckService(uid_, start_session_id_, kAudio, NULL, PROTECTION_OFF);
+
+ // Start Audio protection
+ const uint32_t session_id3 = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, kAudio, PROTECTION_ON, &out_hash_id_);
+#ifdef ENABLE_SECURITY
+ EXPECT_EQ(start_session_id_, session_id3);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
+ CheckService(uid_, start_session_id_, kAudio,
+ NULL,
+ PROTECTION_ON);
+#else
+ EXPECT_EQ(0u, session_id3);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
+ CheckService(uid_, start_session_id_, kAudio, NULL, PROTECTION_OFF);
+#endif // ENABLE_SECURITY
+}
+
+TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtectBulk) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ const uint32_t session_id_new = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, kBulk, PROTECTION_ON, NULL);
+#ifdef ENABLE_SECURITY
+ EXPECT_EQ(start_session_id_, session_id_new);
+ CheckService(uid_, start_session_id_, kRpc,
+ NULL,
+ PROTECTION_ON);
+#else
+ EXPECT_EQ(0u, session_id_new);
+ CheckService(uid_, start_session_id_, kRpc, NULL, PROTECTION_OFF);
+#endif // ENABLE_SECURITY
+}
+
+#ifdef ENABLE_SECURITY
+TEST_F(ConnectionHandlerTest, SetSSLContext_Null) {
+ // No SSLContext on start up
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kControl),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+ EXPECT_EQ(::security_manager::SecurityManager::ERROR_INTERNAL,
+ connection_handler_->SetSSLContext(connection_key_, NULL));
+ // No SSLContext after error
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kControl),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+
+ AddTestDeviceConnection();
+ EXPECT_EQ(::security_manager::SecurityManager::ERROR_INTERNAL,
+ connection_handler_->SetSSLContext(connection_key_, NULL));
+ // No SSLContext after error
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kControl),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+
+ AddTestSession();
+ EXPECT_EQ(::security_manager::SecurityManager::ERROR_SUCCESS,
+ connection_handler_->SetSSLContext(connection_key_, NULL));
+ // NULL SSLContext after success
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kControl),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+}
+TEST_F(ConnectionHandlerTest, SetSSLContext) {
+ // No SSLContext on start up
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kControl),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+
+ testing::StrictMock<security_manager_test::SSLContextMock> mock_ssl_context;
+ // Error on no connection
+ EXPECT_EQ(
+ connection_handler_->SetSSLContext(connection_key_, &mock_ssl_context),
+ ::security_manager::SecurityManager::ERROR_INTERNAL);
+ // No SSLContext after error
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kControl),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+
+ AddTestDeviceConnection();
+ // Error on no session
+ EXPECT_EQ(
+ connection_handler_->SetSSLContext(connection_key_, &mock_ssl_context),
+ ::security_manager::SecurityManager::ERROR_INTERNAL);
+ // No SSLContext after error
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kControl),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+ AddTestSession();
+ // Success
+ EXPECT_EQ(
+ connection_handler_->SetSSLContext(connection_key_, &mock_ssl_context),
+ ::security_manager::SecurityManager::ERROR_SUCCESS);
+ // SSLContext set on Success
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kControl),
+ &mock_ssl_context);
+ // Null SSLContext for unprotected services
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kBulk),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kAudio),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kMobileNav),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+}
+
+TEST_F(ConnectionHandlerTest, GetSSLContext_ByProtectedService) {
+ // No SSLContext on start up
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kControl),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+
+ testing::StrictMock<security_manager_test::SSLContextMock> mock_ssl_context;
+ AddTestDeviceConnection();
+ AddTestSession();
+ EXPECT_EQ(
+ connection_handler_->SetSSLContext(connection_key_, &mock_ssl_context),
+ ::security_manager::SecurityManager::ERROR_SUCCESS);
+ // kControl service mean - return for all connection
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kControl),
+ &mock_ssl_context);
+
+ // kAudio is not exists yet
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kAudio),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+ // Open kAudio service
+ const uint32_t session_id = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, kAudio, PROTECTION_ON, NULL);
+ EXPECT_EQ(session_id, start_session_id_);
+ CheckService(uid_, session_id, kAudio, &mock_ssl_context, PROTECTION_ON);
+
+ // kAudio is not exists yet
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kAudio),
+ &mock_ssl_context);
+}
+TEST_F(ConnectionHandlerTest, GetSSLContext_ByDealyProtectedRPC) {
+ testing::StrictMock<security_manager_test::SSLContextMock> mock_ssl_context;
+ AddTestDeviceConnection();
+ AddTestSession();
+ EXPECT_EQ(
+ connection_handler_->SetSSLContext(connection_key_, &mock_ssl_context),
+ ::security_manager::SecurityManager::ERROR_SUCCESS);
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kControl),
+ &mock_ssl_context);
+
+ // kRpc is not protected
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+
+ // Protect kRpc (Bulk will be protect also)
+ const uint32_t session_id = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, kRpc, PROTECTION_ON, NULL);
+ EXPECT_EQ(start_session_id_, session_id);
+ CheckService(uid_, session_id, kRpc, &mock_ssl_context, PROTECTION_ON);
+
+ // kRpc is protected
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc),
+ &mock_ssl_context);
+ // kBulk is protected
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kBulk),
+ &mock_ssl_context);
+}
+TEST_F(ConnectionHandlerTest, GetSSLContext_ByDealyProtectedBulk) {
+ testing::StrictMock<security_manager_test::SSLContextMock> mock_ssl_context;
+ AddTestDeviceConnection();
+ AddTestSession();
+ EXPECT_EQ(
+ connection_handler_->SetSSLContext(connection_key_, &mock_ssl_context),
+ ::security_manager::SecurityManager::ERROR_SUCCESS);
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kControl),
+ &mock_ssl_context);
+
+ // kRpc is not protected
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc),
+ reinterpret_cast<security_manager::SSLContext *>(NULL));
+
+ // Protect Bulk (kRpc will be protected also)
+ const uint32_t session_id = connection_handler_->OnSessionStartedCallback(
+ uid_, start_session_id_, kBulk, PROTECTION_ON, NULL);
+ EXPECT_EQ(start_session_id_, session_id);
+ CheckService(uid_, session_id, kRpc, &mock_ssl_context, PROTECTION_ON);
+
+ // kRpc is protected
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc),
+ &mock_ssl_context);
+ // kBulk is protected
+ EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kBulk),
+ &mock_ssl_context);
+}
+#endif // ENABLE_SECURITY
+
+} // namespace connection_handle_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
new file mode 100644
index 000000000..a1e9307ce
--- /dev/null
+++ b/src/components/connection_handler/test/connection_test.cc
@@ -0,0 +1,451 @@
+/*
+ * 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 <algorithm>
+#include "protocol/common.h"
+#include "connection_handler/connection.h"
+#include "connection_handler/connection_handler_impl.h"
+#include "protocol/service_type.h"
+#include "utils/shared_ptr.h"
+#include "security_manager_mock.h"
+
+#define EXPECT_RETURN_TRUE true
+#define EXPECT_RETURN_FALSE false
+#define EXPECT_SERVICE_EXISTS true
+#define EXPECT_SERVICE_NOT_EXISTS false
+
+namespace test {
+namespace components {
+namespace connection_handle {
+using namespace ::connection_handler;
+using namespace ::protocol_handler;
+
+class ConnectionTest : public ::testing::Test {
+ protected:
+ void SetUp() OVERRIDE {
+ connection_handler_ = ConnectionHandlerImpl::instance();
+ const ConnectionHandle connectionHandle = 0;
+ const DeviceHandle device_handle = 0;
+ connection_.reset(
+ new Connection(connectionHandle, device_handle, connection_handler_,
+ 10000));
+ }
+
+ void TearDown() OVERRIDE {
+ connection_.reset();
+ ConnectionHandlerImpl::destroy();
+ }
+ void StartSession() {
+ session_id = connection_->AddNewSession();
+ EXPECT_NE(session_id, 0u);
+ const SessionMap sessionMap = connection_->session_map();
+ EXPECT_FALSE(sessionMap.empty());
+ const ServiceList serviceList = sessionMap.begin()->second.service_list;
+ EXPECT_FALSE(serviceList.empty());
+ const ServiceList::const_iterator it = std::find(serviceList.begin(),
+ serviceList.end(),
+ protocol_handler::kRpc);
+ EXPECT_NE(it, serviceList.end());
+ }
+ void AddNewService(const protocol_handler::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);
+ EXPECT_EQ(result, expect_add_new_service_call_result);
+
+#ifdef ENABLE_SECURITY
+ if (protection) {
+ connection_->SetProtectionFlag(session_id, service_type);
+ }
+#endif // ENABLE_SECURITY
+ 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_EQ(expect_exist_service, found_result);
+#ifdef ENABLE_SECURITY
+ if (found_result) {
+ const Service& service = *it;
+ EXPECT_EQ(service.is_protected_, protection);
+ }
+#endif // ENABLE_SECURITY
+ }
+
+ void RemoveService(const protocol_handler::ServiceType service_type,
+ const bool expect_remove_service_result,
+ const bool expect_exist_service) {
+ const bool result = connection_->RemoveService(session_id, service_type);
+ EXPECT_EQ(result, expect_remove_service_result);
+
+ const SessionMap newSessionMap = connection_->session_map();
+ EXPECT_FALSE(newSessionMap.empty());
+ const ServiceList newServiceList = newSessionMap.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_EQ(expect_exist_service, found_result);
+ }
+
+ ::utils::SharedPtr<Connection> connection_;
+ ConnectionHandlerImpl* connection_handler_;
+ uint32_t session_id;
+};
+
+
+TEST_F(ConnectionTest, Session_TryGetProtocolVersionWithoutSession) {
+ uint8_t protocol_version;
+ EXPECT_FALSE(connection_->ProtocolVersion(session_id, protocol_version));
+}
+
+TEST_F(ConnectionTest, Session_GetDefaultProtocolVersion) {
+ StartSession();
+ uint8_t protocol_version;
+ EXPECT_TRUE(connection_->ProtocolVersion(session_id, protocol_version));
+ EXPECT_EQ(protocol_version, ::protocol_handler::PROTOCOL_VERSION_2);
+}
+TEST_F(ConnectionTest, Session_UpdateProtocolVersion) {
+ StartSession();
+ uint8_t protocol_version = ::protocol_handler::PROTOCOL_VERSION_3;
+ connection_->UpdateProtocolVersionSession(session_id, protocol_version);
+ EXPECT_TRUE(connection_->ProtocolVersion(session_id, protocol_version));
+ EXPECT_EQ(protocol_version, ::protocol_handler::PROTOCOL_VERSION_3);
+}
+
+TEST_F(ConnectionTest, HeartBeat_NotSupported) {
+ // Arrange
+ StartSession();
+ uint8_t protocol_version;
+ EXPECT_TRUE(connection_->ProtocolVersion(session_id, protocol_version));
+ EXPECT_EQ(protocol_version, ::protocol_handler::PROTOCOL_VERSION_2);
+
+ // Assert
+ EXPECT_FALSE(connection_->SupportHeartBeat(session_id));
+}
+
+TEST_F(ConnectionTest, DISABLED_HeartBeat_Supported) {
+ // Arrange
+ StartSession();
+
+ // Check if protocol version is 3
+ uint8_t protocol_version = ::protocol_handler::PROTOCOL_VERSION_3;
+ connection_->UpdateProtocolVersionSession(session_id, protocol_version);
+ EXPECT_EQ(protocol_version, ::protocol_handler::PROTOCOL_VERSION_3);
+
+ // Assert
+ EXPECT_TRUE(connection_->SupportHeartBeat(session_id));
+}
+
+// Try to add service without session
+TEST_F(ConnectionTest, Session_AddNewServiceWithoutSession) {
+ EXPECT_EQ(
+ connection_->AddNewService(session_id, protocol_handler::kAudio, true),
+ EXPECT_RETURN_FALSE);
+ EXPECT_EQ(
+ connection_->AddNewService(session_id, protocol_handler::kAudio, false),
+ EXPECT_RETURN_FALSE);
+ EXPECT_EQ(
+ connection_->AddNewService(session_id, protocol_handler::kMobileNav, true),
+ EXPECT_RETURN_FALSE);
+ EXPECT_EQ(
+ connection_->AddNewService(session_id, protocol_handler::kMobileNav, false),
+ EXPECT_RETURN_FALSE);
+}
+
+// Try to remove service without session
+TEST_F(ConnectionTest, Session_RemoveServiceWithoutSession) {
+ EXPECT_EQ(connection_->RemoveService(session_id, protocol_handler::kAudio),
+ EXPECT_RETURN_FALSE);
+ EXPECT_EQ(
+ connection_->RemoveService(session_id, protocol_handler::kMobileNav),
+ EXPECT_RETURN_FALSE);
+}
+// Try to remove RPC
+TEST_F(ConnectionTest, Session_RemoveRPCBulk) {
+ StartSession();
+ EXPECT_EQ(connection_->RemoveService(session_id, protocol_handler::kRpc),
+ EXPECT_RETURN_FALSE);
+ EXPECT_EQ(connection_->RemoveService(session_id, protocol_handler::kBulk),
+ EXPECT_RETURN_FALSE);
+}
+// Control Service could not be started anyway
+TEST_F(ConnectionTest, Session_AddControlService) {
+ StartSession();
+
+ AddNewService(protocol_handler::kControl, PROTECTION_OFF, EXPECT_RETURN_FALSE,
+ EXPECT_SERVICE_NOT_EXISTS);
+ AddNewService(protocol_handler::kControl, PROTECTION_ON, EXPECT_RETURN_FALSE,
+ EXPECT_SERVICE_NOT_EXISTS);
+}
+
+// Invalid Services couldnot be started anyway
+TEST_F(ConnectionTest, Session_AddInvalidService) {
+ StartSession();
+
+ AddNewService(protocol_handler::kInvalidServiceType, PROTECTION_OFF,
+ EXPECT_RETURN_FALSE, EXPECT_SERVICE_NOT_EXISTS);
+ AddNewService(protocol_handler::kInvalidServiceType, PROTECTION_ON,
+ EXPECT_RETURN_FALSE, EXPECT_SERVICE_NOT_EXISTS);
+}
+
+// RPC and Bulk Services could be only delay protected
+TEST_F(ConnectionTest, Session_AddRPCBulkServices) {
+ StartSession();
+ AddNewService(protocol_handler::kRpc, PROTECTION_OFF,
+ EXPECT_RETURN_FALSE, EXPECT_SERVICE_EXISTS);
+
+ // Bulk shall not be added and shall be PROTECTION_OFF
+ AddNewService(protocol_handler::kBulk, PROTECTION_OFF,
+ EXPECT_RETURN_FALSE, EXPECT_SERVICE_EXISTS);
+#ifdef ENABLE_SECURITY
+ AddNewService(protocol_handler::kRpc, PROTECTION_ON,
+ EXPECT_RETURN_TRUE,
+ EXPECT_SERVICE_EXISTS);
+#else
+ AddNewService(protocol_handler::kRpc, PROTECTION_ON,
+ EXPECT_RETURN_FALSE, EXPECT_SERVICE_EXISTS);
+#endif // ENABLE_SECURITY
+
+ // Bulk shall not be added and shall be PROTECTION_ON
+ AddNewService(protocol_handler::kBulk, PROTECTION_ON,
+ EXPECT_RETURN_FALSE, EXPECT_SERVICE_EXISTS);
+}
+
+TEST_F(ConnectionTest, Session_AddAllOtherService_Unprotected) {
+ StartSession();
+
+ AddNewService(protocol_handler::kAudio, PROTECTION_OFF,
+ EXPECT_RETURN_TRUE, EXPECT_SERVICE_EXISTS);
+ AddNewService(protocol_handler::kMobileNav, PROTECTION_OFF,
+ EXPECT_RETURN_TRUE, EXPECT_SERVICE_EXISTS);
+}
+
+TEST_F(ConnectionTest, Session_AddAllOtherService_Protected) {
+ StartSession();
+
+ AddNewService(protocol_handler::kAudio, PROTECTION_ON,
+ EXPECT_RETURN_TRUE, EXPECT_SERVICE_EXISTS);
+ AddNewService(protocol_handler::kMobileNav, PROTECTION_ON,
+ EXPECT_RETURN_TRUE, EXPECT_SERVICE_EXISTS);
+}
+
+TEST_F(ConnectionTest, FindAddedService) {
+ StartSession();
+
+ // Arrange
+ SessionMap currentSessionMap = connection_->session_map();
+ Service * sessionWithService = currentSessionMap.find(session_id)->second
+ .FindService(protocol_handler::kAudio);
+ EXPECT_EQ(NULL, sessionWithService);
+
+ // Act
+ AddNewService(protocol_handler::kAudio, PROTECTION_OFF,
+ EXPECT_RETURN_TRUE, EXPECT_SERVICE_EXISTS);
+
+ currentSessionMap = connection_->session_map();
+
+ // Expect that service is existing
+ sessionWithService = currentSessionMap.find(session_id)->second.FindService(
+ protocol_handler::kAudio);
+ EXPECT_TRUE(sessionWithService != NULL);
+}
+
+TEST_F(ConnectionTest, Session_RemoveAddedService) {
+ StartSession();
+ AddNewService(protocol_handler::kAudio, PROTECTION_OFF,
+ EXPECT_RETURN_TRUE, EXPECT_SERVICE_EXISTS);
+
+ EXPECT_EQ(connection_->RemoveService(session_id, protocol_handler::kAudio),
+ EXPECT_RETURN_TRUE);
+
+ // Try delete nonexisting service
+ EXPECT_EQ(connection_->RemoveService(session_id, protocol_handler::kAudio),
+ EXPECT_RETURN_FALSE);
+}
+
+TEST_F(ConnectionTest, Session_AddAllOtherService_DelayProtected1) {
+ StartSession();
+
+ AddNewService(protocol_handler::kAudio, PROTECTION_OFF,
+ EXPECT_RETURN_TRUE, EXPECT_SERVICE_EXISTS);
+
+ AddNewService(protocol_handler::kMobileNav, PROTECTION_OFF,
+ EXPECT_RETURN_TRUE, EXPECT_SERVICE_EXISTS);
+
+#ifdef ENABLE_SECURITY
+ AddNewService(protocol_handler::kAudio, PROTECTION_ON,
+ EXPECT_RETURN_TRUE, EXPECT_SERVICE_EXISTS);
+
+ AddNewService(protocol_handler::kMobileNav, PROTECTION_ON,
+ EXPECT_RETURN_TRUE, EXPECT_SERVICE_EXISTS);
+#else
+ AddNewService(protocol_handler::kAudio, PROTECTION_ON,
+ EXPECT_RETURN_FALSE, EXPECT_SERVICE_EXISTS);
+
+ AddNewService(protocol_handler::kMobileNav, PROTECTION_ON,
+ EXPECT_RETURN_FALSE, EXPECT_SERVICE_EXISTS);
+#endif // ENABLE_SECURITY
+}
+
+// Use other order
+TEST_F(ConnectionTest, Session_AddAllOtherService_DelayProtected2) {
+ StartSession();
+
+ AddNewService(protocol_handler::kAudio, PROTECTION_OFF,
+ EXPECT_RETURN_TRUE, EXPECT_SERVICE_EXISTS);
+#ifdef ENABLE_SECURITY
+ AddNewService(protocol_handler::kAudio, PROTECTION_ON,
+ EXPECT_RETURN_TRUE,
+ EXPECT_SERVICE_EXISTS);
+#else
+ AddNewService(protocol_handler::kAudio, PROTECTION_ON,
+ EXPECT_RETURN_FALSE, EXPECT_SERVICE_EXISTS);
+#endif // ENABLE_SECURITY
+
+ AddNewService(protocol_handler::kMobileNav, PROTECTION_OFF,
+ EXPECT_RETURN_TRUE, EXPECT_SERVICE_EXISTS);
+#ifdef ENABLE_SECURITY
+ AddNewService(protocol_handler::kMobileNav, PROTECTION_ON,
+ EXPECT_RETURN_TRUE, EXPECT_SERVICE_EXISTS);
+#else
+ AddNewService(protocol_handler::kMobileNav, PROTECTION_ON,
+ EXPECT_RETURN_FALSE, EXPECT_SERVICE_EXISTS);
+#endif // ENABLE_SECURITY
+}
+
+TEST_F(ConnectionTest, RemoveSession) {
+ StartSession();
+ EXPECT_EQ(session_id, connection_->RemoveSession(session_id));
+ EXPECT_EQ(0u, connection_->RemoveSession(session_id));
+}
+
+#ifdef ENABLE_SECURITY
+
+TEST_F(ConnectionTest, SetSSLContextWithoutSession) {
+ //random value. Session was not started
+ uint8_t session_id = 10;
+ security_manager_test::SSLContextMock mock_ssl_context;
+ int setResult = connection_->SetSSLContext(session_id, &mock_ssl_context);
+ EXPECT_EQ(security_manager::SecurityManager::ERROR_INTERNAL,setResult);
+}
+
+TEST_F(ConnectionTest, GetSSLContextWithoutSession) {
+ //random value. Session was not started
+ uint8_t session_id = 10;
+
+ EXPECT_EQ(NULL,connection_->GetSSLContext(session_id,protocol_handler::kMobileNav));
+}
+
+TEST_F(ConnectionTest, SetGetSSLContext) {
+ StartSession();
+
+ EXPECT_EQ(NULL,connection_->GetSSLContext(session_id,protocol_handler::kMobileNav));
+ AddNewService(protocol_handler::kMobileNav, PROTECTION_ON,
+ EXPECT_RETURN_TRUE, EXPECT_SERVICE_EXISTS);
+
+ EXPECT_EQ(NULL,connection_->GetSSLContext(session_id,protocol_handler::kMobileNav));
+
+ security_manager_test::SSLContextMock mock_ssl_context;
+ //Set SSLContext
+ int setResult = connection_->SetSSLContext(session_id, &mock_ssl_context);
+ EXPECT_EQ(security_manager::SecurityManager::ERROR_SUCCESS,setResult);
+
+ security_manager::SSLContext *result = connection_->GetSSLContext(session_id,protocol_handler::kMobileNav);
+ EXPECT_EQ(result,&mock_ssl_context);
+}
+
+TEST_F(ConnectionTest, SetProtectionFlagForRPC) {
+ StartSession();
+ // Arrange
+ SessionMap currentSessionMap = connection_->session_map();
+ Service * service_rpc = currentSessionMap.find(session_id)->second
+ .FindService(protocol_handler::kRpc);
+
+ EXPECT_FALSE(service_rpc->is_protected_);
+
+ Service * service_bulk = currentSessionMap.find(session_id)->second
+ .FindService(protocol_handler::kBulk);
+ EXPECT_FALSE(service_bulk->is_protected_);
+
+ // Expect that service protection is enabled
+ connection_->SetProtectionFlag(session_id, protocol_handler::kRpc);
+
+ currentSessionMap = connection_->session_map();
+ service_bulk = currentSessionMap.find(session_id)->second
+ .FindService(protocol_handler::kBulk);
+ EXPECT_TRUE(service_bulk->is_protected_);
+
+ service_rpc = currentSessionMap.find(session_id)->second
+ .FindService(protocol_handler::kRpc);
+ EXPECT_TRUE(service_rpc->is_protected_);
+}
+
+
+TEST_F(ConnectionTest, SetProtectionFlagForBulk) {
+ StartSession();
+ // Arrange
+ SessionMap currentSessionMap = connection_->session_map();
+ Service * service_rpc = currentSessionMap.find(session_id)->second
+ .FindService(protocol_handler::kRpc);
+
+ EXPECT_FALSE(service_rpc->is_protected_);
+
+ Service * service_bulk = currentSessionMap.find(session_id)->second
+ .FindService(protocol_handler::kBulk);
+ EXPECT_FALSE(service_bulk->is_protected_);
+
+ // Expect that service protection is enabled
+ connection_->SetProtectionFlag(session_id, protocol_handler::kBulk);
+
+ currentSessionMap = connection_->session_map();
+ service_bulk = currentSessionMap.find(session_id)->second.FindService(protocol_handler::kBulk);
+ EXPECT_TRUE(service_bulk->is_protected_);
+
+ service_rpc = currentSessionMap.find(session_id)->second.FindService(protocol_handler::kRpc);
+ EXPECT_TRUE(service_rpc->is_protected_);
+}
+
+#endif // ENABLE_SECURITY
+
+} // namespace connection_handle
+} // namespace components
+} // namespace test
+
diff --git a/src/components/connection_handler/test/device_test.cc b/src/components/connection_handler/test/device_test.cc
new file mode 100644
index 000000000..dc1a51faf
--- /dev/null
+++ b/src/components/connection_handler/test/device_test.cc
@@ -0,0 +1,80 @@
+/*
+ * 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 "encryption/hashing.h"
+#include "connection_handler/device.h"
+
+namespace test {
+namespace components {
+namespace connection_handle {
+
+using namespace connection_handler;
+TEST(ConnectionDevice, CompareDevicesWithDifferentMacAddresses) {
+ DeviceHandle device_handle = 0;
+
+ std::string connection_type = "BTMAC";
+ std::string device_name = "test_name";
+ std::string mac_address = "test_address";
+
+ Device test_device(device_handle, device_name, mac_address, connection_type);
+
+ EXPECT_EQ(device_handle, test_device.device_handle());
+ EXPECT_EQ(device_name, test_device.user_friendly_name());
+ EXPECT_NE(mac_address, test_device.mac_address());
+ EXPECT_EQ(connection_type, test_device.connection_type());
+ std::string hash_mac_address = test_device.mac_address();
+
+ std::string test_next_mac_address = "test_address_";
+ Device next_test_device(device_handle, device_name, test_next_mac_address, connection_type);
+ EXPECT_NE(test_next_mac_address, next_test_device.mac_address());
+ std::string hash_next_mac_address = next_test_device.mac_address();
+
+ EXPECT_NE(hash_mac_address, hash_next_mac_address);
+}
+
+TEST(ConnectionDevice, MacAddressHash) {
+ DeviceHandle device_handle = 0;
+ std::string connection_type = "BTMAC";
+ std::string device_name = "test_name";
+ std::string mac_address = "test_address";
+
+ Device test_device(device_handle, device_name, mac_address, connection_type);
+
+ std::string hashed_mac_address = encryption::MakeHash(mac_address);
+ EXPECT_EQ(hashed_mac_address, test_device.mac_address());
+}
+
+} // namespace connection_handle
+} // namespace components
+} // namespace test
+
diff --git a/src/components/connection_handler/test/heart_beat_monitor_test.cc b/src/components/connection_handler/test/heart_beat_monitor_test.cc
new file mode 100644
index 000000000..710977c64
--- /dev/null
+++ b/src/components/connection_handler/test/heart_beat_monitor_test.cc
@@ -0,0 +1,245 @@
+/*
+ * 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 <string>
+#include <iostream>
+//#include <stdio.h>
+#include "gmock/gmock.h"
+#include "connection_handler/heartbeat_monitor.h"
+#include "connection_handler/connection.h"
+#include "connection_handler/connection_handler.h"
+#include "config_profile/profile.h"
+
+namespace {
+const int32_t MILLISECONDS_IN_SECOND = 1000;
+const int32_t MICROSECONDS_IN_MILLISECONDS = 1000;
+const int32_t MICROSECONDS_IN_SECOND = 1000 * 1000;
+}
+
+namespace test {
+namespace components {
+namespace connection_handler_test {
+using ::testing::_;
+
+class ConnectionHandlerMock : public connection_handler::ConnectionHandler {
+ public:
+ MOCK_METHOD1(set_connection_handler_observer,
+ void(connection_handler::ConnectionHandlerObserver*));
+ MOCK_METHOD1(set_transport_manager,
+ void(transport_manager::TransportManager*));
+ MOCK_METHOD0(StartTransportManager,
+ void());
+ MOCK_METHOD1(ConnectToDevice,
+ void(connection_handler::DeviceHandle device_handle));
+ MOCK_METHOD0(ConnectToAllDevices,
+ void());
+ MOCK_METHOD1(CloseRevokedConnection, void(uint32_t connection_key));
+ MOCK_METHOD1(CloseConnection,
+ void(connection_handler::ConnectionHandle connection_handle));
+ MOCK_METHOD1(GetConnectionSessionsCount, uint32_t(uint32_t connection_key));
+ MOCK_METHOD2(GetDeviceID,
+ bool(const std::string& mac_address,
+ connection_handler::DeviceHandle* device_handle));
+ MOCK_CONST_METHOD1(GetConnectedDevicesMAC, void(std::vector<std::string> &device_macs));
+ MOCK_METHOD2(CloseSession,
+ void(uint32_t key,
+ connection_handler::CloseSessionReason close_reason));
+ MOCK_METHOD3(CloseSession,
+ void(connection_handler::ConnectionHandle connection_handle,
+ uint8_t session_id,
+ connection_handler::CloseSessionReason close_reason));
+ MOCK_METHOD2(SendEndService,
+ void(uint32_t key, uint8_t service_type));
+
+ MOCK_METHOD1(StartSessionHeartBeat,
+ void(uint32_t key));
+ MOCK_METHOD2(SendHeartBeat,
+ void(connection_handler::ConnectionHandle connection_handle,
+ uint8_t session_id));
+ MOCK_METHOD2(SetHeartBeatTimeout, void(uint32_t connection_key,
+ uint32_t timeout));
+ MOCK_METHOD2(BindProtocolVersionWithSession,
+ void(uint32_t connection_key,
+ uint8_t protocol_version));
+ MOCK_METHOD4(GetDataOnSessionKey,
+ int32_t(uint32_t key, uint32_t* app_id,
+ std::list<int32_t>* sessions_list,
+ uint32_t* device_id));
+};
+
+class HeartBeatMonitorTest : public testing::Test {
+public:
+ HeartBeatMonitorTest():
+ conn(NULL) {
+ profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
+ kTimeout = profile::Profile::instance()->heart_beat_timeout();
+ }
+
+protected:
+ testing::NiceMock<ConnectionHandlerMock> connection_handler_mock;
+ connection_handler::Connection* conn;
+ uint32_t kTimeout;
+ static const connection_handler::ConnectionHandle kConnectionHandle = 0xABCDEF;
+
+ virtual void SetUp() {
+ conn = new connection_handler::Connection(kConnectionHandle, 0,
+ &connection_handler_mock,
+ kTimeout);
+ }
+
+ virtual void TearDown() {
+ delete conn;
+ }
+
+};
+
+ACTION_P2(RemoveSession, conn, session_id){
+ conn->RemoveSession(session_id);
+}
+
+TEST_F(HeartBeatMonitorTest, TimerNotStarted) {
+
+ // 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);
+
+ conn->AddNewSession();
+ usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND);
+}
+
+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);
+
+ const uint32_t session = conn->AddNewSession();
+ conn->StartHeartBeat(session);
+ usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
+}
+
+TEST_F(HeartBeatMonitorTest, TimerElapsed) {
+ const uint32_t session = conn->AddNewSession();
+
+ EXPECT_CALL(connection_handler_mock, CloseSession(_, session,_))
+ .WillOnce(RemoveSession(conn, session));
+ EXPECT_CALL(connection_handler_mock, CloseConnection(_));
+ EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, session));
+
+ conn->StartHeartBeat(session);
+ usleep(2 * kTimeout * 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);
+}
+
+TEST_F(HeartBeatMonitorTest, NotKeptAlive) {
+ const uint32_t session = conn->AddNewSession();
+
+ EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, session));
+ EXPECT_CALL(connection_handler_mock, CloseSession(_, session,_))
+ .WillOnce(RemoveSession(conn, session));
+ EXPECT_CALL(connection_handler_mock, CloseConnection(_));
+
+ 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);
+}
+
+TEST_F(HeartBeatMonitorTest, TwoSessionsElapsed) {
+ const uint32_t kSession1 = conn->AddNewSession();
+ const uint32_t kSession2 = conn->AddNewSession();
+
+ EXPECT_CALL(connection_handler_mock, CloseSession(_, kSession1,_))
+ .WillOnce(RemoveSession(conn, kSession1));
+ EXPECT_CALL(connection_handler_mock, CloseSession(_, kSession2,_))
+ .WillOnce(RemoveSession(conn, kSession2));
+ EXPECT_CALL(connection_handler_mock, CloseConnection(_));
+ EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession1));
+ EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession2));
+
+ conn->StartHeartBeat(kSession1);
+ conn->StartHeartBeat(kSession2);
+ usleep(2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND);
+}
+
+TEST_F(HeartBeatMonitorTest, IncreaseHeartBeatTimeout) {
+ const uint32_t kSession = conn->AddNewSession();
+
+ 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);
+ // new timeout greater by old timeout so mock object shouldn't be invoked
+ usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS);
+}
+
+TEST_F(HeartBeatMonitorTest, DecreaseHeartBeatTimeout) {
+ const uint32_t kSession = conn->AddNewSession();
+
+ EXPECT_CALL(connection_handler_mock, CloseSession(_, kSession,_))
+ .WillOnce(RemoveSession(conn, kSession));
+ EXPECT_CALL(connection_handler_mock, CloseConnection(_));
+ EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession));
+
+ const uint32_t kNewTimeout = kTimeout - MICROSECONDS_IN_MILLISECONDS;
+ conn->StartHeartBeat(kSession);
+ conn->SetHeartBeatTimeout(kNewTimeout, kSession);
+ // new timeout less than old timeout so mock object should be invoked
+ usleep(kTimeout * 2 * MICROSECONDS_IN_MILLISECONDS);
+}
+
+} // namespace connection_handler_test
+} // namespace components
+} // namespace test
diff --git a/src/components/connection_handler/test/include/connection_handler_observer_mock.h b/src/components/connection_handler/test/include/connection_handler_observer_mock.h
new file mode 100644
index 000000000..9a7437526
--- /dev/null
+++ b/src/components/connection_handler/test/include/connection_handler_observer_mock.h
@@ -0,0 +1,70 @@
+/*
+ * 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_CONNECTION_HANDLER_TEST_INCLUDE_CONNECTION_HANDLER_OBSERVER_MOCK_H_
+#define SRC_COMPONENTS_CONNECTION_HANDLER_TEST_INCLUDE_CONNECTION_HANDLER_OBSERVER_MOCK_H_
+
+#include <gmock/gmock.h>
+#include <string>
+#include "connection_handler/connection_handler_observer.h"
+
+namespace test {
+namespace components {
+namespace connection_handler_test {
+
+/*
+ * MOCK implementation of ::connection_handler::ConnectionHandlerObserver interface
+ */
+class ConnectionHandlerObserverMock : public ::connection_handler::ConnectionHandlerObserver {
+ public:
+ MOCK_METHOD1(OnDeviceListUpdated,
+ void(const connection_handler::DeviceMap &device_list));
+ MOCK_METHOD0(OnFindNewApplicationsRequest,void());
+ MOCK_METHOD1(RemoveDevice,
+ void(const connection_handler::DeviceHandle &device_handle));
+ MOCK_METHOD3(OnServiceStartedCallback,
+ bool(const connection_handler::DeviceHandle &device_handle,
+ const int32_t &session_key,
+ const protocol_handler::ServiceType &type));
+ MOCK_METHOD3(OnServiceEndedCallback,
+ void(const int32_t &session_key,
+ const protocol_handler::ServiceType &type,
+ const connection_handler::CloseSessionReason& close_reason));
+ MOCK_CONST_METHOD1(GetHandshakeContext,
+ security_manager::SSLContext::HandshakeContext(
+ uint32_t key));
+
+};
+} // namespace connection_handler_test
+} // namespace components
+} // namespace test
+#endif //SRC_COMPONENTS_CONNECTION_HANDLER_TEST_INCLUDE_CONNECTION_HANDLER_OBSERVER_MOCK_H_
diff --git a/src/components/connection_handler/test/smartDeviceLink.ini b/src/components/connection_handler/test/smartDeviceLink.ini
new file mode 100644
index 000000000..109003eb5
--- /dev/null
+++ b/src/components/connection_handler/test/smartDeviceLink.ini
@@ -0,0 +1,165 @@
+ ; The INI-file consists of different chapters.
+; Each chapter begins with the line containing
+; the name in square brackets. Syntax:
+; [chapter]
+; The chapters consists of a set of items with a
+; assinged value. The syntax is:
+; item=value
+; All white spaces an second encounters of chapters
+; or items will be ignored.
+; Remarks start with semicolon or star as first character.
+; It is alowed for names of chapters and items to
+; contain semicolon and star. Possible syntax is:
+; [ chapter ] ;Remark
+; item = value ;Remark
+
+[HMI]
+LaunchHMI = true
+ServerAddress = 127.0.0.1
+ServerPort = 8087
+VideoStreamingPort = 5050
+AudioStreamingPort = 5080
+
+[MAIN]
+; Contains .json/.ini files
+AppConfigFolder =
+; Contains output files, e.g. .wav
+AppStorageFolder =
+; Contains resourses, e.g. audio8bit.wav
+AppResourceFolder =
+; Standard min stack size
+; in Ubuntu : PTHREAD_STACK_MIN = 16384
+; in QNX : PTHREAD_STACK_MIN = 256
+;The value of a variable ThreadStackSize used only if its realy needed, other way stack size will be PTHREAD_STACK_MIN
+;
+AppConfigFolder =
+AppStorageFolder =
+ThreadStackSize = 16384
+MixingAudioSupported = true
+HMICapabilities = hmi_capabilities.json
+MaxCmdID = 2000000000
+; Default request timeout in milliseconds
+DefaultTimeout = 10000
+
+# Timeout in seconds for resumption Application HMILevel
+# and resolving conflicts in case if multiple applications initiate resumption
+ApplicationResumingTimeout = 3
+
+# Timeout in seconds for pereodical saving resumption persisten data
+AppSavePersistentDataTimeout = 10 #seconds
+AppDirectoryQuota = 104857600
+; Allowed requests amount in HMI level NONE during time scale.
+; If value is 0 check will be skipped
+AppHMILevelNoneTimeScaleMaxRequests = 100
+AppHMILevelNoneRequestsTimeScale = 10
+; Allowed requests amount during time scale.
+; If value is 0 check will be skipped
+AppTimeScaleMaxRequests = 1000
+AppRequestsTimeScale = 10
+; Allowed pending requests amount. If value is 0 check will be skipped
+PendingRequestsAmount = 5000
+HeartBeatTimeout = 7000
+SupportedDiagModes = 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x09, 0x0A, 0x18, 0x19, 0x22, 0x3E
+SystemFilesPath = /tmp/fs/mp/images/ivsu_cache
+UseLastState = true
+TimeTestingPort = 8090
+ReadDIDRequest = 5, 1
+GetVehicleDataRequest = 5, 1
+
+[MEDIA MANAGER]
+; where 3 is a number of retries and 1 is a timeout in seconds for request frequency
+StartStreamRetry = 3, 1
+EnableRedecoding = false
+VideoStreamConsumer = socket
+AudioStreamConsumer = socket
+;VideoStreamConsumer = file
+;AudioStreamConsumer = file
+;VideoStreamConsumer = pipe
+;AudioStreamConsumer = pipe
+;Temp solution: if you change NamedPipePath also change path to pipe in src/components/qt_hmi/qml_model_qtXX/views/SDLNavi.qml
+;Named pipe path will be constructed using AppStorageFolder + name
+NamedVideoPipePath = video_stream_pipe
+NamedAudioPipePath = audio_stream_pipe
+;File path will be constructed using AppStorageFolder + name
+VideoStreamFile = video_stream_file
+AudioStreamFile = audio_stream_file
+; Recording file source (used for audio pass thru emulation only)
+RecordingFileSource = audio.8bit.wav
+; Recording file for audio pass thru
+RecordingFileName = audio.wav
+
+; HelpPromt and TimeOutPrompt is a vector of strings separated by comma
+[GLOBAL PROPERTIES]
+
+; Delimiter, which will be appended to each TTS chunck, e.g. helpPrompt/timeoutPrompt
+TTSDelimiter = ,
+; Default prompt items, separated by comma
+HelpPromt = Please speak one of the following commands,Please say a command
+; Default prompt items, separated by comma
+TimeOutPromt = Please speak one of the following commands,Please say a command
+HelpTitle = Available Vr Commands List
+; In case mobile app didn't send global properties default global properties will be sent after this timeout
+; max value TTSGlobalPropertiesTimeout 64K
+TTSGlobalPropertiesTimeout = 20
+
+[FILESYSTEM RESTRICTIONS]
+; Max allowed number of PutFile requests for one application in NONE
+PutFileRequest = 5
+; Max allowed number of DeleteFile requests for one application in NONE
+DeleteFileRequest = 5
+; Max allowed number of ListFiles requests for one application in NONE
+ListFilesRequest = 5
+
+[VR COMMANDS]
+HelpCommand = Help
+
+[AppInfo]
+; The path for applications info storage.
+AppInfoStorage = app_info.dat
+
+[Security Manager]
+Protocol = TLSv1.2
+; Certificate and key path to pem file
+CertificatePath = mycert.pem
+KeyPath = mykey.pem
+; SSL mode could be SERVER or CLIENT
+SSLMode = CLIENT
+; Could be ALL ciphers or list of chosen
+;CipherList = AES256-GCM-SHA384
+CipherList = ALL
+; Verify Mobile app certificate (could be used in both SSLMode Server and Client)
+VerifyPeer = false
+; If VerifyPeer is enable - terminate handshake if mobile app did not return a certificate
+FialOnNoCert = false
+; If VerifyPeer is enable - do not ask for a mobile app certificate again in case of a renegotiation
+VerifyClientOnce = false
+; Force protected services (could be id's from 0x01 to 0xFF)
+;ForceProtectedService = 0x0A, 0x0B
+ForceProtectedService = Non
+; Force unprotected services
+;ForceUnprotectedService = 0x07
+ForceUnprotectedService = Non
+
+[Policy]
+EnablePolicy = true
+PreloadedPT = sdl_preloaded_pt.json
+PathToSnapshot = sdl_snapshot.json
+
+[TransportManager]
+TCPAdapterPort = 12345
+MMEDatabase = /dev/qdb/mediaservice_db
+EventMQ = /dev/mqueue/ToSDLCoreUSBAdapter
+AckMQ = /dev/mqueue/FromSDLCoreUSBAdapter
+
+[IAP]
+LegacyProtocol = com.ford.sync.prot[0-29]
+HubProtocol = com.smartdevicelink.prot0
+PoolProtocol = com.smartdevicelink.prot[1-29]
+IAPSystemConfig = /fs/mp/etc/mm/ipod.cfg
+IAP2SystemConfig = /fs/mp/etc/mm/iap2.cfg
+IAP2HubConnectAttempts = 3
+
+[ApplicationManager]
+ApplicationListUpdateTimeout = 2
+; Max allowed threads for handling mobile requests. Currently max allowed is 2
+ThreadPoolSize = 1
diff --git a/src/components/dbus/CMakeLists.txt b/src/components/dbus/CMakeLists.txt
index 0bea8025e..7e7f2af78 100644
--- a/src/components/dbus/CMakeLists.txt
+++ b/src/components/dbus/CMakeLists.txt
@@ -1,12 +1,43 @@
+# 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_directories (
${DBUS_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/include/
${CMAKE_SOURCE_DIR}/
- ${CMAKE_SOURCE_DIR}/src/components/
+ ${COMPONENTS_DIR}
+ ${COMPONENTS_DIR}/formatters/include/
+ ${COMPONENTS_DIR}/smart_objects/include/
+ ${COMPONENTS_DIR}/utils/include/
${CMAKE_BINARY_DIR}/src/components/
- ${CMAKE_SOURCE_DIR}/src/components/formatters/include/
- ${CMAKE_SOURCE_DIR}/src/components/smart_objects/include/
- ${CMAKE_SOURCE_DIR}/src/components/utils/include/
)
set (SOURCES
@@ -43,3 +74,7 @@ add_library("DBus" ${SOURCES})
ADD_DEPENDENCIES("DBus" Utils install-3rd_party_dbus)
target_link_libraries("DBus" "${LIBRARIES}")
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/dbus/include/dbus/message_descriptions.h b/src/components/dbus/include/dbus/message_descriptions.h
index 9f73b2573..18c27ce0d 100644
--- a/src/components/dbus/include/dbus/message_descriptions.h
+++ b/src/components/dbus/include/dbus/message_descriptions.h
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (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) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_
diff --git a/src/components/dbus/include/dbus/schema.h b/src/components/dbus/include/dbus/schema.h
index d1ba37f23..2a5f6f361 100644
--- a/src/components/dbus/include/dbus/schema.h
+++ b/src/components/dbus/include/dbus/schema.h
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (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) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_SCHEMA_INCLUDE_DBUS_SCHEMA_SCHEMA_H_
#define SRC_COMPONENTS_DBUS_SCHEMA_INCLUDE_DBUS_SCHEMA_SCHEMA_H_
diff --git a/src/components/dbus/src/schema.cc b/src/components/dbus/src/schema.cc
index dde1f6ab5..157479928 100644
--- a/src/components/dbus/src/schema.cc
+++ b/src/components/dbus/src/schema.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/dbus/test/CMakeLists.txt b/src/components/dbus/test/CMakeLists.txt
new file mode 100644
index 000000000..d96f2388f
--- /dev/null
+++ b/src/components/dbus/test/CMakeLists.txt
@@ -0,0 +1,53 @@
+# 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.
+
+if(BUILD_TESTS)
+
+include_directories (
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/dbus/include/
+)
+
+set (LIBRARIES
+ gmock
+ DBus
+ formatters
+ SmartObjects
+)
+
+set(testSources
+ ${COMPONENTS_DIR}/dbus/test/test_schema.cc
+ ${COMPONENTS_DIR}/dbus/test/test_dbus_adapter.cc
+)
+
+create_test("test_DBus_test" "${testSources}" "${LIBRARIES}")
+
+endif()
+
diff --git a/src/components/dbus/test/test_dbus_adapter.cc b/src/components/dbus/test/test_dbus_adapter.cc
new file mode 100644
index 000000000..c5922dfdc
--- /dev/null
+++ b/src/components/dbus/test/test_dbus_adapter.cc
@@ -0,0 +1,61 @@
+/*
+ * \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/test_dbus_message_controller.cc b/src/components/dbus/test/test_dbus_message_controller.cc
new file mode 100644
index 000000000..f0056db4c
--- /dev/null
+++ b/src/components/dbus/test/test_dbus_message_controller.cc
@@ -0,0 +1,121 @@
+/*
+ * \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 "hmi_message_handler/mock_dbus_message_controller.h"
+#include "hmi_message_handler/mock_subscriber.h"
+
+using ::testing::_;
+
+namespace test {
+namespace components {
+namespace hmi_message_handler {
+
+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());
+ }
+
+ virtual void TearDown() {
+ 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 hmi_message_handler
+} // namespace components
+} // namespace test
+
+
diff --git a/src/components/dbus/test/test_schema.cc b/src/components/dbus/test/test_schema.cc
new file mode 100644
index 000000000..ecbd4b1bf
--- /dev/null
+++ b/src/components/dbus/test/test_schema.cc
@@ -0,0 +1,119 @@
+/*
+ * \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/CMakeLists.txt b/src/components/formatters/CMakeLists.txt
index 3f53cf0b7..3dd7dc936 100644
--- a/src/components/formatters/CMakeLists.txt
+++ b/src/components/formatters/CMakeLists.txt
@@ -1,25 +1,62 @@
+# 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.
+
+
+set(FORMATTERS_SRC_DIR ${COMPONENTS_DIR}/formatters/src)
+
include_directories (
- ./include/
- ../protocol_handler/include/
- ../utils/include/
+ include/
+ ${COMPONENTS_DIR}/protocol_handler/include/
+ ${COMPONENTS_DIR}/utils/include/
${JSONCPP_INCLUDE_DIRECTORY}
${MESSAGE_BROKER_INCLUDE_DIRECTORY}
- ../../../src/components/smart_objects/include
+ ${COMPONENTS_DIR}/smart_objects/include
)
set (SOURCES
- ./src/CSmartFactory.cpp
+ ${FORMATTERS_SRC_DIR}/CSmartFactory.cpp
)
set (FORMATTER_SOURCES
- ./src/CFormatterJsonBase.cpp
- ./src/CFormatterJsonSDLRPCv1.cpp
- ./src/CFormatterJsonSDLRPCv2.cpp
- ./src/formatter_json_rpc.cc
- ./src/meta_formatter.cc
- ./src/generic_json_formatter.cc
+ ${FORMATTERS_SRC_DIR}/CFormatterJsonBase.cpp
+ ${FORMATTERS_SRC_DIR}/CFormatterJsonSDLRPCv1.cpp
+ ${FORMATTERS_SRC_DIR}/CFormatterJsonSDLRPCv2.cpp
+ ${FORMATTERS_SRC_DIR}/formatter_json_rpc.cc
+ ${FORMATTERS_SRC_DIR}/meta_formatter.cc
+ ${FORMATTERS_SRC_DIR}/generic_json_formatter.cc
)
add_library("formatters" ${SOURCES}
${FORMATTER_SOURCES}
)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/formatters/include/formatters/formatter_json_rpc.h b/src/components/formatters/include/formatters/formatter_json_rpc.h
index 26636f4a2..d4653ef56 100644
--- a/src/components/formatters/include/formatters/formatter_json_rpc.h
+++ b/src/components/formatters/include/formatters/formatter_json_rpc.h
@@ -1,4 +1,4 @@
-/**
+/*
* @file formatter_json_rpc.h
* @brief FormatterJsonRpc header file.
*/
diff --git a/src/components/formatters/include/formatters/generic_json_formatter.h b/src/components/formatters/include/formatters/generic_json_formatter.h
index 3eaee0b36..a4b3f3f71 100644
--- a/src/components/formatters/include/formatters/generic_json_formatter.h
+++ b/src/components/formatters/include/formatters/generic_json_formatter.h
@@ -1,4 +1,4 @@
-/**
+/*
* @file generic_json_formatter.h
* @brief Generic JSON formatter header file.
*/
diff --git a/src/components/formatters/include/formatters/meta_formatter.h b/src/components/formatters/include/formatters/meta_formatter.h
index c1b767d7c..f9fd6fad7 100644
--- a/src/components/formatters/include/formatters/meta_formatter.h
+++ b/src/components/formatters/include/formatters/meta_formatter.h
@@ -1,4 +1,4 @@
-/**
+/*
* @file meta_fromatter.h
* @brief file describes class CMetaFormatter which is designed to format
* the smart object against given schema for given formatter
diff --git a/src/components/formatters/src/formatter_json_rpc.cc b/src/components/formatters/src/formatter_json_rpc.cc
index 8722df46d..012962bbb 100644
--- a/src/components/formatters/src/formatter_json_rpc.cc
+++ b/src/components/formatters/src/formatter_json_rpc.cc
@@ -1,4 +1,4 @@
-/**
+/*
* @file formatter_json_rpc.cc
* @brief formatter_json_rpc source file.
*/
diff --git a/src/components/formatters/src/generic_json_formatter.cc b/src/components/formatters/src/generic_json_formatter.cc
index ce1aa0380..6cc226619 100644
--- a/src/components/formatters/src/generic_json_formatter.cc
+++ b/src/components/formatters/src/generic_json_formatter.cc
@@ -1,4 +1,4 @@
-/**
+/*
* @file generic_json_formatter.cc
* @brief Generic JSON formatter source file.
*/
diff --git a/src/components/formatters/src/meta_formatter.cc b/src/components/formatters/src/meta_formatter.cc
index 145020a5e..8b24fd4b0 100644
--- a/src/components/formatters/src/meta_formatter.cc
+++ b/src/components/formatters/src/meta_formatter.cc
@@ -1,4 +1,4 @@
-/**
+/*
* @file meta_fromatter.cc
* @brief implementation of class CMetaFormatter which is designed to format
* the smart object against given schema for given formatter
diff --git a/src/components/formatters/test/CFormatterJsonBase_test.cc b/src/components/formatters/test/CFormatterJsonBase_test.cc
new file mode 100644
index 000000000..9efbfdcf7
--- /dev/null
+++ b/src/components/formatters/test/CFormatterJsonBase_test.cc
@@ -0,0 +1,337 @@
+/*
+ * 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>
+#include <algorithm>
+#include "json/value.h"
+#include "gtest/gtest.h"
+#include "json/reader.h"
+#include "formatters/CFormatterJsonBase.hpp"
+#include "formatters/generic_json_formatter.h"
+
+namespace test {
+namespace components {
+namespace formatters {
+
+using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
+
+TEST(CFormatterJsonBaseTest, JSonStringValueToSmartObj_ExpectSuccessful) {
+ // Arrange value
+ std::string string_val("test_string");
+ Json::Value json_value(string_val); // Json value from string
+ SmartObject object;
+ // Convert json to smart object
+ CFormatterJsonBase::jsonValueToObj(json_value, object);
+ // Check conversion was successful
+ EXPECT_EQ(string_val, object.asString());
+}
+
+TEST(CFormatterJsonBaseTest, JSonDoubleValueToSmartObj_ExpectSuccessful) {
+ // Arrange value
+ double dval = 3.512;
+ Json::Value json_value(dval); // Json value from double
+ SmartObject object;
+ // Convert json to smart object
+ CFormatterJsonBase::jsonValueToObj(json_value, object);
+ // Check conversion was successful
+ EXPECT_DOUBLE_EQ(dval, object.asDouble());
+}
+
+TEST(CFormatterJsonBaseTest, JSonMinIntValueToSmartObj_ExpectSuccessful) {
+ // Arrange value
+ Json::Int ival = Json::Value::minInt;
+ Json::Value json_value(ival); // Json value from possible minimum signed int
+ SmartObject object;
+ // Convert json to smart object
+ CFormatterJsonBase::jsonValueToObj(json_value, object);
+ // Check conversion was successful
+ EXPECT_EQ(ival, object.asInt());
+}
+
+TEST(CFormatterJsonBaseTest, JSonNullIntValueToSmartObj_ExpectSuccessful) {
+ // Arrange value
+ Json::Int ival = Json::nullValue;
+ Json::Value json_value(ival); // Json value from null int value
+ SmartObject object;
+ // Convert json to smart object
+ CFormatterJsonBase::jsonValueToObj(json_value, object);
+ // Check conversion was successful
+ EXPECT_EQ(ival, object.asInt());
+}
+
+TEST(CFormatterJsonBaseTest, JSonSignedMaxIntValueToSmartObj_ExpectSuccessful) {
+ // Arrange value
+ Json::Int ival = Json::Value::maxInt;
+ Json::Value json_value(ival); // Json value from maximum possible signed int
+ SmartObject object;
+ // Convert json to smart object
+ CFormatterJsonBase::jsonValueToObj(json_value, object);
+ // Check conversion was successful
+ EXPECT_EQ(ival, object.asInt());
+}
+
+TEST(CFormatterJsonBaseTest, DISABLED_JSonUnsignedMaxIntValueToSmartObj_ExpectSuccessful) {
+ // Arrange value
+ Json::UInt ui_val = Json::Value::maxUInt;
+ Json::Value json_value(ui_val); // Json value from maximum possible unsigned int
+ SmartObject object;
+ // Convert json to smart object
+ CFormatterJsonBase::jsonValueToObj(json_value, object);
+ // Check conversion was successful
+ EXPECT_EQ(ui_val, object.asUInt());
+}
+
+TEST(CFormatterJsonBaseTest, JSonSignedMaxInt64ValueToSmartObj_ExpectFailed) {
+ // Arrange value
+ Json::Int64 ival = Json::Value::maxInt64;
+ Json::Value json_value(ival); // Json value from maximum possible signed int
+ SmartObject object;
+ // Convert json to smart object
+ CFormatterJsonBase::jsonValueToObj(json_value, object);
+ // Check conversion was not successful as there is no such conversion
+ EXPECT_EQ(invalid_int64_value, object.asInt64());
+}
+
+TEST(CFormatterJsonBaseTest, JSonBoolValueToSmartObj_ExpectSuccessful) {
+ // Arrange value
+ bool bval1 = true;
+ bool bval2 = false;
+ Json::Value json_value1(bval1); // Json value from bool
+ Json::Value json_value2(bval2); // Json value from bool
+ SmartObject object1;
+ SmartObject object2;
+ // Convert json to smart object
+ CFormatterJsonBase::jsonValueToObj(json_value1, object1);
+ CFormatterJsonBase::jsonValueToObj(json_value2, object2);
+ // Check conversion was successful
+ EXPECT_TRUE(object1.asBool());
+ EXPECT_FALSE(object2.asBool());
+}
+
+TEST(CFormatterJsonBaseTest, JSonCStringValueToSmartObj_ExpectSuccessful) {
+ // Arrange value
+ const char* cstr_val = "cstring_test";
+ Json::Value json_value(cstr_val); // Json value from const char*
+ SmartObject object;
+ // Convert json to smart object
+ CFormatterJsonBase::jsonValueToObj(json_value, object);
+ // Check conversion was successful
+ EXPECT_STREQ(cstr_val, object.asCharArray());
+}
+
+TEST(CFormatterJsonBaseTest, JSonArrayValueToSmartObj_ExpectSuccessful) {
+ // Arrange value
+ const char* json_array = "[\"test1\", \"test2\", \"test3\"]"; // Array in json format
+ Json::Value json_value; // Json value from array. Will be initialized later
+ SmartObject object;
+ Json::Reader reader; // Json reader - Needed for correct parsing
+ // Parse array to json value
+ ASSERT_TRUE(reader.parse(json_array, json_value));
+ // Convert json array to SmartObject
+ CFormatterJsonBase::jsonValueToObj(json_value, object);
+ // Check conversion was successful
+ EXPECT_TRUE(json_value.isArray());
+ EXPECT_EQ(3u, object.asArray()->size());
+ SmartArray *ptr = NULL; // Smart Array pointer;
+ EXPECT_NE(ptr, object.asArray());
+}
+
+TEST(CFormatterJsonBaseTest, JSonObjectValueToSmartObj_ExpectSuccessful) {
+ // Arrange value
+ const char* json_object =
+ "{ \"json_test_object\": [\"test1\", \"test2\", \"test3\"], \"json_test_object2\": [\"test11\", \"test12\", \"test13\" ]}"; // Json object
+ Json::Value json_value; // Json value from object. Will be initialized later
+ SmartObject object;
+ Json::Reader reader; // Json reader - Needed for correct parsing
+ ASSERT_TRUE(reader.parse(json_object, json_value)); // If parsing not successful - no sense to continue
+ CFormatterJsonBase::jsonValueToObj(json_value, object);
+ // Check conversion was successful
+ EXPECT_TRUE(json_value.isObject());
+ EXPECT_TRUE(json_value.type() == Json::objectValue);
+ // Get keys collection from Smart Object
+ std::set<std::string> keys = object.enumerate();
+ std::set<std::string>::iterator it1 = keys.begin();
+ // Get members names(keys) from Json object
+ Json::Value::Members mems = json_value.getMemberNames();
+ std::vector<std::string>::iterator it;
+ // Compare sizes
+ EXPECT_EQ(mems.size(), keys.size());
+ // Sort mems
+ std::sort(mems.begin(), mems.end());
+ // Full data compare
+ for (it = mems.begin(); it != mems.end(); ++it) {
+ EXPECT_EQ(*it, *it1);
+ ++it1;
+ }
+ ASSERT(it == mems.end() && it1 == keys.end());
+}
+
+TEST(CFormatterJsonBaseTest, StringSmartObjectToJSon_ExpectSuccessful) {
+ // Arrange value
+ std::string string_val("test_string");
+ SmartObject object(string_val);
+ Json::Value json_value; // Json value from string
+ // Convert smart object to json
+ CFormatterJsonBase::objToJsonValue(object, json_value);
+ // Check conversion was successful
+ EXPECT_EQ(string_val, json_value.asString());
+}
+
+TEST(CFormatterJsonBaseTest, DoubleSmartObjectToJSon_ExpectSuccessful) {
+ // Arrange value
+ double dval = 3.512;
+ Json::Value json_value; // Json value from double
+ SmartObject object(dval);
+ // Convert json to smart object
+ CFormatterJsonBase::objToJsonValue(object, json_value);
+ // Check conversion was successful
+ EXPECT_DOUBLE_EQ(dval, json_value.asDouble());
+}
+
+TEST(CFormatterJsonBaseTest, ZeroIntSmartObjectToJSon_ExpectSuccessful) {
+ // Arrange value
+ Json::Int ival = Json::nullValue;
+ Json::Value json_value; // Json value from zero int
+ SmartObject object(ival);
+ // Convert json to smart object
+ CFormatterJsonBase::objToJsonValue(object, json_value);
+ // Check conversion was successful
+ EXPECT_EQ(ival, json_value.asInt());
+}
+
+TEST(CFormatterJsonBaseTest, MinIntSmartObjectToJSon_ExpectSuccessful) {
+ // Arrange value
+ Json::Int ival = Json::Value::minInt;
+ Json::Value json_value; // Json value from mimimum possible signed int
+ SmartObject object(ival);
+ // Convert json to smart object
+ CFormatterJsonBase::objToJsonValue(object, json_value);
+ // Check conversion was successful
+ EXPECT_EQ(ival, json_value.asInt());
+}
+
+TEST(CFormatterJsonBaseTest, DISABLED_UnsignedMaxIntSmartObjectToJSon_ExpectSuccessful) {
+ // Arrange value
+ Json::UInt ui_val = Json::Value::maxUInt;
+ Json::Value json_value; // Json value from maximum unsigned int
+ SmartObject object(ui_val);
+ // Convert json to smart object
+ CFormatterJsonBase::objToJsonValue(object, json_value);
+ // Check conversion was successful
+ EXPECT_EQ(ui_val, json_value.asUInt());
+}
+
+TEST(CFormatterJsonBaseTest, BoolSmartObjectToJSon_ExpectSuccessful) {
+ // Arrange value
+ bool bval1 = true;
+ bool bval2 = false;
+ Json::Value json_value1; // Json value from bool
+ Json::Value json_value2; // Json value from bool
+ SmartObject object1(bval1);
+ SmartObject object2(bval2);
+ // Convert json to smart object
+ CFormatterJsonBase::objToJsonValue(object1, json_value1);
+ CFormatterJsonBase::objToJsonValue(object2, json_value2);
+ // Check conversion was successful
+ EXPECT_TRUE(json_value1.asBool());
+ EXPECT_FALSE(json_value2.asBool());
+}
+
+TEST(CFormatterJsonBaseTest, CStringSmartObjectToJSon_ExpectSuccessful) {
+ // Arrange value
+ const char* cstr_val = "cstring_test";
+ Json::Value json_value; // Json value from const char*
+ SmartObject object(cstr_val);
+ // Convert json to smart object
+ CFormatterJsonBase::objToJsonValue(object, json_value);
+ // Check conversion was successful
+ EXPECT_STREQ(cstr_val, json_value.asCString());
+}
+
+TEST(CFormatterJsonBaseTest, ArraySmartObjectToJSon_ExpectSuccessful) {
+ // Arrange value
+ const char* json_array = "[\"test1\", \"test2\", \"test3\"]"; // Array in json format
+ Json::Value json_value; // Json value from array. Will be initialized later
+ Json::Value result; // Json value from array. Will be initialized later
+ SmartObject object;
+ Json::Reader reader; // Json reader - Needed for correct parsing
+ // Parse array to json value
+ ASSERT_TRUE(reader.parse(json_array, json_value)); // Convert json array to SmartObject
+ // Convert json array to SmartObject
+ CFormatterJsonBase::jsonValueToObj(json_value, object);
+ // Convert SmartObject to JSon
+ CFormatterJsonBase::objToJsonValue(object, result);
+ // Check conversion was successful
+ EXPECT_TRUE(result.isArray());
+ EXPECT_EQ(3u, result.size());
+}
+
+TEST(CFormatterJsonBaseTest, JSonObjectValueToObj_ExpectSuccessful) {
+ // Arrange value
+ const char* json_object =
+ "{ \"json_test_object\": [\"test1\", \"test2\", \"test3\"], \"json_test_object2\": [\"test11\", \"test12\", \"test13\" ]}"; // Json object
+ Json::Value json_value; // Json value from json object. Will be initialized later
+ Json::Value result; // Json value from Smart object. Will keep conversion result
+ SmartObject object;
+ Json::Reader reader; // Json reader - Needed for correct parsing
+ // Parse json object to correct json value
+ ASSERT_TRUE(reader.parse(json_object, json_value)); // If parsing not successful - no sense to continue
+ // Convert json array to SmartObject
+ CFormatterJsonBase::jsonValueToObj(json_value, object);
+ // Convert SmartObject to JSon
+ CFormatterJsonBase::objToJsonValue(object, result);
+ // Check conversion was successful
+ EXPECT_TRUE(result.isObject());
+ EXPECT_TRUE(result.type() == Json::objectValue);
+ EXPECT_TRUE(result == json_value);
+ // Get keys collection from Smart Object
+ std::set<std::string> keys = object.enumerate();
+ std::set<std::string>::iterator it1 = keys.begin();
+ // Get members names(keys) from Json object
+ Json::Value::Members mems = result.getMemberNames();
+ std::vector<std::string>::iterator it;
+ // Compare sizes
+ EXPECT_EQ(mems.size(), keys.size());
+ // Sort mems
+ std::sort(mems.begin(), mems.end());
+ // Full data compare
+ for (it = mems.begin(); it != mems.end(); ++it) {
+ EXPECT_EQ(*it, *it1);
+ ++it1;
+ }
+ ASSERT(it == mems.end() && it1 == keys.end());
+}
+
+} // namespace formatters
+} // namespace components
+} // namespace test
diff --git a/src/components/formatters/test/CMakeLists.txt b/src/components/formatters/test/CMakeLists.txt
new file mode 100644
index 000000000..b9966c867
--- /dev/null
+++ b/src/components/formatters/test/CMakeLists.txt
@@ -0,0 +1,67 @@
+# 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.
+
+
+if(BUILD_TESTS)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/smart_objects/include
+ ${COMPONENTS_DIR}/formatters/include
+ ${COMPONENTS_DIR}/formatters/test/include
+ ${CMAKE_BINARY_DIR}/src/components/interfaces
+ ${CMAKE_SOURCE_DIR}/src/3rd_party-static/jsoncpp/include
+)
+
+set(LIBRARIES
+ gmock
+ HMI_API
+ MOBILE_API
+ SmartObjects
+ formatters
+ jsoncpp
+)
+
+set(SOURCES
+ ${COMPONENTS_DIR}/formatters/test/src/SmartFactoryTestHelper.cc
+ ${COMPONENTS_DIR}/formatters/test/CSmartFactory_test.cc
+ ${COMPONENTS_DIR}/formatters/test/CFormatterJsonBase_test.cc
+ ${COMPONENTS_DIR}/formatters/test/generic_json_formatter_test.cc
+ ${COMPONENTS_DIR}/formatters/test/formatter_json_rpc_test.cc
+ ${COMPONENTS_DIR}/formatters/test/src/create_smartSchema.cc
+ ${COMPONENTS_DIR}/formatters/test/cFormatterJsonSDLRPCv1_test.cc
+ ${COMPONENTS_DIR}/formatters/test/cFormatterJsonSDLRPCv2_test.cc
+ ${COMPONENTS_DIR}/formatters/test/src/meta_formatter_test_helper.cc
+ ${COMPONENTS_DIR}/formatters/test/meta_formatter_test.cc
+)
+
+create_test("formatters_test" "${SOURCES}" "${LIBRARIES}")
+
+endif()
diff --git a/src/components/formatters/test/CSmartFactory_test.cc b/src/components/formatters/test/CSmartFactory_test.cc
new file mode 100644
index 000000000..39cf67b3f
--- /dev/null
+++ b/src/components/formatters/test/CSmartFactory_test.cc
@@ -0,0 +1,397 @@
+/*
+ * 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 "SmartFactoryTestHelper.h"
+#include "formatters/CSmartFactory.hpp"
+#include "gtest/gtest.h"
+
+namespace test {
+namespace components {
+namespace formatters {
+
+TEST(CSmartFactoryTest, CreateSmartSchemaKey_ExpectCreated) {
+ SmartSchemaKey<FunctionIdTest::eType, MessageTypeTest::eType> test_key(
+ FunctionIdTest::Function1, MessageTypeTest::notification);
+ EXPECT_EQ(test_key.functionId, FunctionIdTest::Function1);
+ EXPECT_EQ(test_key.messageType, MessageTypeTest::notification);
+}
+
+TEST(CSmartFactoryTest, CreateSmartFactory_ExpectCreated) {
+ CSmartFactoryTest test_factory;
+ EXPECT_EQ(9u, test_factory.function_schemes().size());
+ EXPECT_EQ(2u, test_factory.structs_schemes().size());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObjWithSchema1_ExpectCreatedObjectToCorrespondSmSchema1) {
+ CSmartFactoryTest test_factory;
+ // Create SmartObject with attached SmartChmema
+ SmartObject obj = test_factory.CreateSmartObject(FunctionIdTest::Function1,
+ MessageTypeTest::request);
+ EXPECT_TRUE(SmartType::SmartType_Map == obj.getType());
+ // Adding necessary fields
+ obj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::Function1;
+ obj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ obj[S_PARAMS][S_CORRELATION_ID] = 444;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(2u, keys.size());
+ EXPECT_EQ(Errors::eType::OK, obj.validate());
+ EXPECT_TRUE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObjWithNotExistedSchema_ExpectCreatedObjectNotValid) {
+ CSmartFactoryTest test_factory;
+ // Create SmartObject with attached SmartChmema
+ SmartObject obj = test_factory.CreateSmartObject(
+ FunctionIdTest::Function1, MessageTypeTest::INVALID_ENUM);
+ EXPECT_FALSE(SmartType::SmartType_Map == obj.getType());
+ EXPECT_TRUE(SmartType::SmartType_Null == obj.getType());
+ EXPECT_EQ(Errors::eType::OK, obj.validate());
+ EXPECT_TRUE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObjectWithSchema1_MissedOneField_ExpectCreatedNotCorrespondSmartSchema) {
+ CSmartFactoryTest test_factory;
+ // Create SmartObject with attached SmartChmema
+ SmartObject obj = test_factory.CreateSmartObject(FunctionIdTest::Function1,
+ MessageTypeTest::request);
+ EXPECT_TRUE(SmartType::SmartType_Map == obj.getType());
+ // Adding necessary fields but one field is missed
+ obj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::Function1;
+ obj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(2u, keys.size());
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ EXPECT_FALSE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObjectWithSchema1_AddOutOfRangeValue_ExpectCreatedNotCorrespondSmartSchema) {
+ CSmartFactoryTest test_factory;
+ // Create SmartObject with attached SmartChmema
+ SmartObject obj = test_factory.CreateSmartObject(FunctionIdTest::Function1,
+ MessageTypeTest::request);
+ EXPECT_TRUE(SmartType::SmartType_Map == obj.getType());
+ // Adding necessary fields but one field is missed
+ obj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::Function1;
+ obj[S_PARAMS][S_MESSAGE_TYPE] = 5;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ obj[S_PARAMS][S_CORRELATION_ID] = 444;
+ obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(2u, keys.size());
+ EXPECT_EQ(Errors::eType::OUT_OF_RANGE, obj.validate());
+ EXPECT_FALSE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObjectWithSchema1_AddInvalidValue_ExpectCreatedNotCorrespondSmartSchema) {
+ CSmartFactoryTest test_factory;
+ // Create SmartObject with attached SmartChmema
+ SmartObject obj = test_factory.CreateSmartObject(FunctionIdTest::Function1,
+ MessageTypeTest::request);
+ EXPECT_TRUE(SmartType::SmartType_Map == obj.getType());
+ // Adding necessary fields but one field is missed
+ obj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::Function1;
+ obj[S_PARAMS][S_MESSAGE_TYPE] = "return";
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ obj[S_PARAMS][S_CORRELATION_ID] = 444;
+ obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(2u, keys.size());
+ EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate());
+ EXPECT_FALSE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObj_AttachSchema1_ExpectCreatedObjectCorrespondsSmSchema1) {
+ CSmartFactoryTest test_factory;
+ // Create empty SmartObject without any schema
+ SmartObject obj;
+ // Adding fields necessary for schema to attach
+ obj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::Function1;
+ obj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ // Attach schema to object
+ EXPECT_TRUE(test_factory.attachSchema(obj));
+ EXPECT_TRUE(SmartType::SmartType_Map == obj.getType());
+ // Adding necessary fileds to correspond schema
+ obj[S_PARAMS][S_CORRELATION_ID] = 444;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(2u, keys.size());
+ EXPECT_EQ(Errors::eType::OK, obj.validate());
+ EXPECT_TRUE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObj_AttachSchema1_MissOneField_ExpectCreatedObjectNotCorrespondsSmSchema1) {
+ CSmartFactoryTest test_factory;
+ // Create empty SmartObject without any schema
+ SmartObject obj;
+ // Adding fields necessary for schema to attach
+ obj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::Function1;
+ obj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ // Attach schema to object
+ EXPECT_TRUE(test_factory.attachSchema(obj));
+ EXPECT_TRUE(SmartType::SmartType_Map == obj.getType());
+ // Adding necessary fileds to correspond schema but 1 field is missing
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(2u, keys.size());
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ EXPECT_FALSE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObj_AttachNotExistedSchema_ExpectSmSchemaNotAttached) {
+ CSmartFactoryTest test_factory;
+ // Create empty SmartObject without any schema
+ SmartObject obj;
+ // Adding fields necessary for schema to attach but one value is invalid
+ obj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::Function1;
+ obj[S_PARAMS][S_MESSAGE_TYPE] = 10;
+ // Attach schema to object
+ EXPECT_FALSE(test_factory.attachSchema(obj));
+ EXPECT_TRUE(SmartType::SmartType_Map == obj.getType());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObj_AttachSchema1_AddInvalidValue_ExpectCreatedObjectNotCorrespondsSmSchema1) {
+ CSmartFactoryTest test_factory;
+ // Create empty SmartObject without any schema
+ SmartObject obj;
+ // Adding fields necessary for schema to attach
+ obj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::Function1;
+ obj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ // Attach schema to object
+ EXPECT_TRUE(test_factory.attachSchema(obj));
+ EXPECT_TRUE(SmartType::SmartType_Map == obj.getType());
+ // Adding necessary fileds to correspond schema but 1 field is missing
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = "string";
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ obj[S_PARAMS][S_CORRELATION_ID] = 444;
+ obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(2u, keys.size());
+ EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate());
+ EXPECT_FALSE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObj_AttachSchema1_ExpectCreatedObjectCorrespondsSmSchema) {
+ CSmartFactoryTest test_factory;
+ // Create empty SmartObject without any schema
+ SmartObject obj;
+ // Attach schema to object
+ EXPECT_TRUE(test_factory.AttachSchema(StructIdentifiersTest::Common_1, obj));
+ obj["text"] = "test";
+ obj["position"] = 200;
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(2u, keys.size());
+ EXPECT_EQ(Errors::eType::OK, obj.validate());
+ EXPECT_TRUE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObj_AttachSchema1_OneMandatoryFieldMissed_ExpectCreatedObjectNotCorrespondsSmSchema) {
+ CSmartFactoryTest test_factory;
+ // Create empty SmartObject without any schema
+ SmartObject obj;
+ // Attach schema to object
+ EXPECT_TRUE(test_factory.AttachSchema(StructIdentifiersTest::Common_1, obj));
+ obj["text"] = "test";
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(1u, keys.size());
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ EXPECT_FALSE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObj_AttachSchema2_ExpectCreatedObjectCorrespondsSmSchema) {
+ CSmartFactoryTest test_factory;
+ // Create empty SmartObject without any schema
+ SmartObject obj;
+ // Attach schema to object
+ EXPECT_TRUE(test_factory.AttachSchema(StructIdentifiersTest::Common_2, obj));
+ obj["text"] = "test1";
+ obj["position"] = 200;
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(2u, keys.size());
+ EXPECT_EQ(Errors::eType::OK, obj.validate());
+ EXPECT_TRUE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObj_AttachSchema_ExpectCreatedObjectCorrespondsSmSchema) {
+ CSmartFactoryTest test_factory;
+ // Create empty SmartObject without any schema
+ SmartObject obj;
+ // Attach schema to object
+ EXPECT_TRUE(test_factory.AttachSchema(StructIdentifiersTest::Common_1, obj));
+ obj["text"] = "test";
+ obj["position"] = 200;
+ obj["image"]["text"] = "test2";
+ obj["image"]["position"] = 100;
+ EXPECT_EQ(Errors::eType::OK, obj["image"].validate());
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(3u, keys.size());
+ EXPECT_EQ(Errors::eType::OK, obj.validate());
+ EXPECT_TRUE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObj_WithSchemaFromStructId_ExpectCreatedObjectCorrespondsSmSchema) {
+ CSmartFactoryTest test_factory;
+ // Create empty SmartObject with schema correspopnding StructId
+ SmartObject obj = test_factory.CreateSmartObject(
+ StructIdentifiersTest::Common_1);
+ // Add fields
+ obj["text"] = "test";
+ obj["position"] = 200;
+ obj["image"]["text"] = "test2";
+ obj["image"]["position"] = 100;
+ // Check object "image"
+ EXPECT_EQ(Errors::eType::OK, obj["image"].validate());
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(3u, keys.size());
+ // Check global object
+ EXPECT_EQ(Errors::eType::OK, obj.validate());
+ EXPECT_TRUE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObj_WithSchemaFromStructId_MissedOneField_ExpectCreatedObjectNotCorrespondsSmSchema) {
+ CSmartFactoryTest test_factory;
+ // Create empty SmartObject with schema correspopnding StructId
+ SmartObject obj = test_factory.CreateSmartObject(
+ StructIdentifiersTest::Common_1);
+ // Add fields. One missed.
+ obj["text"] = "test";
+ obj["image"]["text"] = "test2";
+ obj["image"]["position"] = 100;
+ // Check object "image"
+ EXPECT_EQ(Errors::eType::OK, obj["image"].validate());
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(2u, keys.size());
+ // Check global object
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ EXPECT_FALSE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObj_WithSchemaFromStructId2_ExpectCreatedObjectCorrespondsSmSchema) {
+ CSmartFactoryTest test_factory;
+ // Create empty SmartObject with schema correspopnding StructId
+ SmartObject obj = test_factory.CreateSmartObject(
+ StructIdentifiersTest::Common_2);
+ // Add fields
+ obj["text"] = "test";
+ obj["position"] = 200;
+ obj["image"]["text"] = "test2";
+ obj["image"]["position"] = 100;
+ // Check object "image"
+ EXPECT_EQ(Errors::eType::OK, obj["image"].validate());
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(3u, keys.size());
+ // Check global object
+ EXPECT_EQ(Errors::eType::OK, obj.validate());
+ EXPECT_TRUE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObj_WithSchemaFromStructId2_MissedOneField_ExpectCreatedObjectNotCorrespondsSmSchema) {
+ CSmartFactoryTest test_factory;
+ // Create empty SmartObject with schema correspopnding StructId
+ SmartObject obj = test_factory.CreateSmartObject(
+ StructIdentifiersTest::Common_2);
+ // Add fields. One missed.
+ obj["text"] = "test";
+ obj["image"]["text"] = "test2";
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(2u, keys.size());
+ // Check global object
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ EXPECT_FALSE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, CreateSmartObj_WithSchemaFromStructId2_InvalidValueAdded_ExpectCreatedObjectNotCorrespondsSmSchema) {
+ CSmartFactoryTest test_factory;
+ // Create empty SmartObject with schema correspopnding StructId
+ SmartObject obj = test_factory.CreateSmartObject(
+ StructIdentifiersTest::Common_2);
+ // Add fields. One missed.
+ obj["text"] = 111;
+ obj["position"] = 200;
+ obj["image"]["text"] = "test2";
+ std::set<std::string> keys = obj.enumerate();
+ EXPECT_EQ(3u, keys.size());
+ // Check global object
+ EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate());
+ EXPECT_FALSE(obj.isValid());
+}
+
+TEST(CSmartFactoryTest, GetSchemaWithSmartFactory_ExpectReceivedSchema) {
+ CSmartFactoryTest test_factory;
+ CSmartSchema schema;
+ EXPECT_TRUE(
+ test_factory.GetSchema(FunctionIdTest::Function1,
+ MessageTypeTest::request, schema));
+}
+
+TEST(CSmartFactoryTest, GetNotExistedSchemaWithSmartFactory_ExpectNotReceivedSchema) {
+ CSmartFactoryTest test_factory;
+ CSmartSchema schema;
+ EXPECT_FALSE(
+ test_factory.GetSchema(FunctionIdTest::Function1,
+ MessageTypeTest::INVALID_ENUM, schema));
+}
+
+TEST(CSmartFactoryTest, GetSchemaWithSmartFactoryWithStructId1_ExpectReceivedSchema) {
+ CSmartFactoryTest test_factory;
+ CSmartSchema schema;
+ EXPECT_TRUE(test_factory.GetSchema(StructIdentifiersTest::Common_1, schema));
+}
+
+TEST(CSmartFactoryTest, GetSchemaWithSmartFactoryWithStructId2_ExpectReceivedSchema) {
+ CSmartFactoryTest test_factory;
+ CSmartSchema schema;
+ EXPECT_TRUE(test_factory.GetSchema(StructIdentifiersTest::Common_2, schema));
+}
+
+TEST(CSmartFactoryTest, GetNotExistedSchemaWithSmartFactoryWithStructId_ExpectNotReceivedSchema) {
+ CSmartFactoryTest test_factory;
+ CSmartSchema schema;
+ EXPECT_FALSE(
+ test_factory.GetSchema(StructIdentifiersTest::INVALID_ENUM, schema));
+}
+
+} // namespace formatters
+} // namespace components
+} // namespace test
+
diff --git a/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc b/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc
new file mode 100644
index 000000000..55b7f886f
--- /dev/null
+++ b/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc
@@ -0,0 +1,502 @@
+/*
+ * 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 "formatters/CFormatterJsonSDLRPCv1.hpp"
+#include "create_smartSchema.h"
+
+namespace test {
+namespace components {
+namespace formatters {
+
+TEST(CFormatterJsonSDLRPCv1Test, EmptySmartObjectToString) {
+ SmartObject srcObj;
+
+ EXPECT_EQ(Errors::eType::OK, srcObj.validate());
+
+ std::string jsonString;
+ bool result = CFormatterJsonSDLRPCv1::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString =
+ "{\n \
+ \"\" : {\n\
+ \"name\" : \"\",\n\
+ \"parameters\" : \"\"\n\
+ }\n\
+}\n";
+
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv1Test, SmObjWithRequestWithoutMsgNotValid_ToString) {
+ SmartObject srcObj;
+ CSmartSchema schema = initObjectSchema();
+ srcObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, srcObj.validate());
+
+ std::string jsonString;
+ bool result = CFormatterJsonSDLRPCv1::toString(srcObj, jsonString);
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString =
+ "{\n \
+ \"request\" : {\n\
+ \"correlationID\" : 13,\n\
+ \"name\" : \"RegisterAppInterface\",\n\
+ \"parameters\" : \"\"\n\
+ }\n\
+}\n";
+
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv1Test, SmObjWithRequestWithEmptyMsgWithTestSchemaToString) {
+ SmartObject srcObj;
+ CSmartSchema schema = initObjectSchema();
+ srcObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ srcObj[S_MSG_PARAMS][""] = "";
+
+ EXPECT_EQ(Errors::eType::OK, srcObj.validate());
+
+ std::string jsonString;
+
+ bool result = CFormatterJsonSDLRPCv1::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString =
+ "{\n \
+ \"request\" : {\n\
+ \"correlationID\" : 13,\n\
+ \"name\" : \"RegisterAppInterface\",\n\
+ \"parameters\" : {}\n\
+ }\n\
+}\n";
+
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv1Test, SmObjWithRequestWithNonemptyMsgWithTestSchemaToString) {
+ SmartObject srcObj;
+ CSmartSchema schema = initObjectSchema();
+ srcObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ srcObj[S_MSG_PARAMS]["info"] = "value";
+
+ std::string jsonString;
+
+ bool result = CFormatterJsonSDLRPCv1::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString =
+ "{\n \
+ \"request\" : {\n\
+ \"correlationID\" : 13,\n\
+ \"name\" : \"RegisterAppInterface\",\n\
+ \"parameters\" : {\n\
+ \"info\" : \"value\"\n\
+ }\n\
+ }\n\
+}\n";
+
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv1Test, SmObjWithRequestWithNonemptyMsgToString) {
+ SmartObject srcObj;
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = 5;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ srcObj[S_MSG_PARAMS]["vrSynonyms"][0] = "Synonym 1";
+
+ std::string jsonString;
+
+ bool result = CFormatterJsonSDLRPCv1::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString =
+ "{\n \
+ \"0\" : {\n\
+ \"correlationID\" : 13,\n\
+ \"name\" : \"5\",\n\
+ \"parameters\" : {\n\
+ \"vrSynonyms\" : [ \"Synonym 1\" ]\n\
+ }\n\
+ }\n\
+}\n";
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv1Test, SmObjWithResponseWithoutSchemaToString) {
+ SmartObject srcObj;
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::response;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = 5;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ srcObj[S_MSG_PARAMS]["success"] = true;
+ srcObj[S_MSG_PARAMS]["resultCode"] = 0;
+
+ std::string jsonString;
+
+ bool result = CFormatterJsonSDLRPCv1::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString =
+ "{\n \
+ \"1\" : {\n\
+ \"correlationID\" : 13,\n\
+ \"name\" : \"5\",\n\
+ \"parameters\" : {\n\
+ \"resultCode\" : 0,\n\
+ \"success\" : true\n\
+ }\n\
+ }\n\
+}\n";
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv1Test, SmObjWithNotificationToString) {
+ SmartObject srcObj;
+ CSmartSchema schema = initObjectSchema();
+ srcObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::notification;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::SetGlobalProperties;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ srcObj[S_MSG_PARAMS][""] = "";
+ std::string jsonString;
+
+ bool result = CFormatterJsonSDLRPCv1::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString =
+ "{\n \
+ \"notification\" : {\n\
+ \"correlationID\" : 13,\n\
+ \"name\" : \"SetGlobalProperties\",\n\
+ \"parameters\" : {}\n\
+ }\n\
+}\n";
+
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv1Test, SmObjWithResponseToString) {
+ SmartObject srcObj;
+
+ CSmartSchema schema = initObjectSchema();
+ srcObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::response;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+
+ srcObj[S_MSG_PARAMS]["success"] = true;
+ srcObj[S_MSG_PARAMS]["resultCode"] = TestType::SUCCESS;
+
+ std::string jsonString;
+
+ bool result = CFormatterJsonSDLRPCv1::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString =
+ "{\n \
+ \"response\" : {\n\
+ \"correlationID\" : 13,\n\
+ \"name\" : \"RegisterAppInterface\",\n\
+ \"parameters\" : {\n\
+ \"resultCode\" : \"SUCCESS\",\n\
+ \"success\" : true\n\
+ }\n\
+ }\n\
+}\n";
+
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv1Test, SmObjWithResponseWithoutSchemaWithoutParamsToString) {
+ SmartObject srcObj;
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::response;
+ std::string jsonString;
+
+ bool result = CFormatterJsonSDLRPCv1::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString =
+ "{\n \
+ \"1\" : {\n\
+ \"name\" : \"\",\n\
+ \"parameters\" : \"\"\n\
+ }\n\
+}\n";
+
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv1Test, StringRequestToSmObj) {
+ std::string inputJsonString =
+ "\
+ {\
+ \"request\": {\
+ \"correlationID\": 5,\
+ \"name\" : \"RegisterAppInterface\",\n\
+ \"parameters\": {\
+ \"syncMsgVersion\" : {\
+ \"majorVersion\" : 2,\
+ \"minorVersion\" : 10\
+ },\
+ \"appName\": \"some app name\",\
+ \"ttsName\": [{\
+ \"text\": \"ABC\",\
+ \"type\": \"TEXT\"\
+ }],\
+ \"vrSynonyms\": [\"Synonym 1\", \"Synonym 2\"]\
+ }\
+ }\
+ }";
+
+ SmartObject obj;
+
+ CSmartSchema schema = initObjectSchema();
+ obj.setSchema(schema);
+
+ bool result = CFormatterJsonSDLRPCv1::fromString<FunctionIDTest::eType,
+ MessageTypeTest::eType>(inputJsonString, obj);
+
+ EXPECT_EQ(CFormatterJsonSDLRPCv1::kSuccess, result);
+ EXPECT_EQ(Errors::eType::OK, obj.validate());
+ EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
+ EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
+ EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], 5);
+ EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_TYPE], 0);
+ EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_VERSION], 1);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["appName"], "some app name");
+
+ EXPECT_EQ(obj[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"], 2);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"], 10);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["ttsName"][0]["text"], "ABC");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["ttsName"][0]["type"], "TEXT");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["vrSynonyms"][0], "Synonym 1");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["vrSynonyms"][1], "Synonym 2");
+}
+
+TEST(CFormatterJsonSDLRPCv1Test, StringRequestWithoutNameToSmartObject) {
+ std::string inputJsonString =
+ "\
+ {\
+ \"request\": {\
+ \"correlationID\": 5,\
+ \"parameters\": {\
+ \"syncMsgVersion\" : {\
+ \"majorVersion\" : 2,\
+ \"minorVersion\" : 10\
+ },\
+ \"appName\": \"some app name\",\
+ \"ttsName\": [{\
+ \"text\": \"ABC\",\
+ \"type\": \"TEXT\"\
+ }],\
+ \"vrSynonyms\": [\"Synonym 1\", \"Synonym 2\"]\
+ }\
+ }\
+ }";
+
+ SmartObject obj;
+
+ bool result = CFormatterJsonSDLRPCv1::fromString<FunctionIDTest::eType,
+ MessageTypeTest::eType>(inputJsonString, obj);
+
+ EXPECT_EQ(CFormatterJsonSDLRPCv1::kParsingError, result);
+
+ EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
+ EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], "-1");
+ EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], 5);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["appName"], "some app name");
+
+ EXPECT_EQ(obj[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"], 2);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"], 10);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["ttsName"][0]["text"], "ABC");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["ttsName"][0]["type"], "TEXT");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["vrSynonyms"][0], "Synonym 1");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["vrSynonyms"][1], "Synonym 2");
+}
+
+TEST(CFormatterJsonSDLRPCv1Test, StringRequestWithIncorrectCorIDToSmartObject) {
+ std::string inputJsonString =
+ "\
+ {\
+ \"request\": {\
+ \"correlationID\": \"5\",\
+ \"parameters\": {\
+ \"syncMsgVersion\" : {\
+ \"majorVersion\" : 2,\
+ \"minorVersion\" : 10\
+ },\
+ \"appName\": \"some app name\",\
+ \"ttsName\": [{\
+ \"text\": \"ABC\",\
+ \"type\": \"TEXT\"\
+ }],\
+ \"vrSynonyms\": [\"Synonym 1\", \"Synonym 2\"]\
+ }\
+ }\
+ }";
+
+ SmartObject obj;
+
+ bool result = CFormatterJsonSDLRPCv1::fromString<FunctionIDTest::eType,
+ MessageTypeTest::eType>(inputJsonString, obj);
+ EXPECT_EQ(CFormatterJsonSDLRPCv1::kParsingError, result);
+
+ EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
+ EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], "-1");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["appName"], "some app name");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"], 2);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["ttsName"][0]["text"], "ABC");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["vrSynonyms"][0], "Synonym 1");
+}
+
+TEST(CFormatterJsonSDLRPCv1Test, StringResponceToSmartObject) {
+ std::string inputJsonString =
+ "{\n \
+ \"response\" : {\n\
+ \"correlationID\" : 13,\n\
+ \"name\" : \"RegisterAppInterface\",\n\
+ \"parameters\" : {\n\
+ \"resultCode\" : \"SUCCESS\",\n\
+ \"success\" : true\n\
+ }\n\
+ }\n\
+}\n";
+
+ SmartObject obj;
+
+ CSmartSchema schema = initObjectSchema();
+ obj.setSchema(schema);
+
+ bool result = CFormatterJsonSDLRPCv1::fromString<FunctionIDTest::eType,
+ MessageTypeTest::eType>(inputJsonString, obj);
+ EXPECT_EQ(CFormatterJsonSDLRPCv1::kSuccess, result);
+ EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::response);
+ EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], 0);
+ EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], 13);
+ EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_TYPE], 0);
+ EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_VERSION], 1);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["resultCode"], "SUCCESS");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["success"], true);
+}
+
+TEST(CFormatterJsonSDLRPCv1Test, StringNotificationToSmartObject) {
+ std::string inputJsonString =
+ "{\n \
+ \"notification\" : {\n\
+ \"correlationID\" : 13,\n\
+ \"name\" : \"SetGlobalProperties\",\n\
+ \"parameters\" : {}\n\
+ }\n\
+}\n";
+
+ SmartObject obj;
+
+ CSmartSchema schema = initObjectSchema();
+ obj.setSchema(schema);
+
+ bool result = CFormatterJsonSDLRPCv1::fromString<FunctionIDTest::eType,
+ MessageTypeTest::eType>(inputJsonString, obj);
+ EXPECT_EQ(CFormatterJsonSDLRPCv1::kSuccess, result);
+ EXPECT_EQ(Errors::eType::OK, obj.validate());
+ EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::notification);
+ EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::SetGlobalProperties);
+ EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], 13);
+ EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_TYPE], 0);
+ EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_VERSION], 1);
+}
+
+TEST(CFormatterJsonSDLRPCv1Test, MetaFormatToString) {
+ SmartObject srcObj;
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ srcObj[S_MSG_PARAMS]["info"] = "value";
+
+ std::string jsonString;
+
+ CSmartSchema schema = initObjectSchema();
+ srcObj.setSchema(schema);
+
+ meta_formatter_error_code::tMetaFormatterErrorCode result =
+ CFormatterJsonSDLRPCv1::MetaFormatToString(srcObj, schema, jsonString);
+ EXPECT_EQ(meta_formatter_error_code::kErrorOk, result);
+}
+
+} // namespace formatters
+} // namespace components
+} // namespace test
diff --git a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
new file mode 100644
index 000000000..814cff4ab
--- /dev/null
+++ b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
@@ -0,0 +1,392 @@
+/*
+ * 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 "create_smartSchema.h"
+#include "formatters/CFormatterJsonSDLRPCv2.hpp"
+
+namespace test {
+namespace components {
+namespace formatters {
+
+TEST(CFormatterJsonSDLRPCv2Test, EmptySmartObjectToString) {
+ SmartObject srcObj;
+
+ EXPECT_EQ(Errors::eType::OK, srcObj.validate());
+
+ std::string jsonString;
+ bool result = CFormatterJsonSDLRPCv2::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString = "\"\"\n";
+
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv2Test, SmObjWithRequestWithoutMsgNotValid_ToString) {
+ SmartObject srcObj;
+ CSmartSchema schema = initObjectSchema();
+ srcObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, srcObj.validate());
+
+ std::string jsonString;
+ bool result = CFormatterJsonSDLRPCv2::toString(srcObj, jsonString);
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString = "\"\"\n";
+
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv2Test, SmObjWithRequestWithEmptyMsgWithTestSchemaToString) {
+ SmartObject srcObj;
+ CSmartSchema schema = initObjectSchema();
+ srcObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS][""] = "";
+
+ EXPECT_EQ(Errors::eType::OK, srcObj.validate());
+
+ std::string jsonString;
+
+ bool result = CFormatterJsonSDLRPCv2::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString = "{}\n";
+
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv2Test, SmObjWithRequestWithNonemptyMsgWithTestSchemaToString) {
+ SmartObject srcObj;
+ CSmartSchema schema = initObjectSchema();
+ srcObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["info"] = "value";
+
+ std::string jsonString;
+
+ bool result = CFormatterJsonSDLRPCv2::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString = "{\n \"info\" : \"value\"\n}\n";
+
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv2Test, SmObjWithRequestWithNonemptyMsgToString) {
+ SmartObject srcObj;
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = 5;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["vrSynonyms"][0] = "Synonym 1";
+
+ std::string jsonString;
+
+ bool result = CFormatterJsonSDLRPCv2::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString =
+ "{\n \"vrSynonyms\" : [ \"Synonym 1\" ]\n}\n";
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv2Test, SmObjWithResponseWithoutSchemaToString) {
+ SmartObject srcObj;
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::response;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = 5;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["success"] = true;
+ srcObj[S_MSG_PARAMS]["resultCode"] = 0;
+
+ std::string jsonString;
+
+ bool result = CFormatterJsonSDLRPCv2::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString =
+ "{\n \"resultCode\" : 0,\n \"success\" : true\n}\n";
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv2Test, SmObjWithNotificationToString) {
+ SmartObject srcObj;
+ CSmartSchema schema = initObjectSchema();
+ srcObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::notification;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::SetGlobalProperties;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["info"] = "info_notification";
+ std::string jsonString;
+
+ bool result = CFormatterJsonSDLRPCv2::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString =
+ "{\n \"info\" : \"info_notification\"\n}\n";
+
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv2Test, SmObjWithResponseToString) {
+ SmartObject srcObj;
+
+ CSmartSchema schema = initObjectSchema();
+ srcObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::response;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+
+ srcObj[S_MSG_PARAMS]["success"] = true;
+ srcObj[S_MSG_PARAMS]["resultCode"] = TestType::SUCCESS;
+
+ std::string jsonString;
+
+ bool result = CFormatterJsonSDLRPCv2::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString =
+ "{\n \"resultCode\" : \"SUCCESS\",\n \"success\" : true\n}\n";
+
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv2Test, SmObjWithResponseWithoutSchemaWithoutParamsToString) {
+ SmartObject srcObj;
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::response;
+ std::string jsonString;
+
+ bool result = CFormatterJsonSDLRPCv2::toString(srcObj, jsonString);
+
+ EXPECT_TRUE(result);
+
+ std::string expectOutputJsonString = "\"\"\n";
+
+ EXPECT_EQ(expectOutputJsonString, jsonString);
+}
+
+TEST(CFormatterJsonSDLRPCv2Test, StringRequestWithoutCorIdToSmObj) {
+ std::string inputJsonString =
+ "\
+ {\
+ \"syncMsgVersion\" : {\
+ \"majorVersion\" : 2,\
+ \"minorVersion\" : 10\
+ },\
+ \"appName\": \"some app name\",\
+ \"ttsName\": [{\
+ \"text\": \"ABC\",\
+ \"type\": \"TEXT\"\
+ }],\
+ \"vrSynonyms\": [\"Synonym 1\", \"Synonym 2\"]\
+ }\n";
+
+ SmartObject obj;
+
+ CSmartSchema schema = initObjectSchema();
+ obj.setSchema(schema);
+
+ bool result = CFormatterJsonSDLRPCv2::fromString<FunctionIDTest::eType,
+ MessageTypeTest::eType>(inputJsonString, obj,
+ FunctionIDTest::RegisterAppInterface,
+ MessageTypeTest::request);
+
+ EXPECT_EQ(true, result);
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
+ EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
+ EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_TYPE], 0);
+ EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_VERSION], 2);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["appName"], "some app name");
+
+ EXPECT_EQ(obj[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"], 2);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"], 10);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["ttsName"][0]["text"], "ABC");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["ttsName"][0]["type"], "TEXT");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["vrSynonyms"][0], "Synonym 1");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["vrSynonyms"][1], "Synonym 2");
+}
+
+TEST(CFormatterJsonSDLRPCv2Test, StringRequestWithCorIdToSmObj) {
+ std::string inputJsonString =
+ "\
+ {\
+ \"syncMsgVersion\" : {\
+ \"majorVersion\" : 2,\
+ \"minorVersion\" : 10\
+ },\
+ \"appName\": \"some app name\",\
+ \"ttsName\": [{\
+ \"text\": \"ABC\",\
+ \"type\": \"TEXT\"\
+ }],\
+ \"vrSynonyms\": [\"Synonym 1\", \"Synonym 2\"]\
+ }\n";
+
+ SmartObject obj;
+
+ CSmartSchema schema = initObjectSchema();
+ obj.setSchema(schema);
+ int32_t corId = 10;
+ bool result = CFormatterJsonSDLRPCv2::fromString<FunctionIDTest::eType,
+ MessageTypeTest::eType>(inputJsonString, obj,
+ FunctionIDTest::RegisterAppInterface,
+ MessageTypeTest::request, corId);
+
+ EXPECT_EQ(true, result);
+ EXPECT_EQ(Errors::eType::OK, obj.validate());
+ EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
+ EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
+ EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], corId);
+ EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_TYPE], 0);
+ EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_VERSION], 2);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["appName"], "some app name");
+
+ EXPECT_EQ(obj[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"], 2);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"], 10);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["ttsName"][0]["text"], "ABC");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["ttsName"][0]["type"], "TEXT");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["vrSynonyms"][0], "Synonym 1");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["vrSynonyms"][1], "Synonym 2");
+}
+
+TEST(CFormatterJsonSDLRPCv2Test, StringResponceWithCorIdToSmartObject) {
+ std::string inputJsonString =
+ "{\n \
+ \"resultCode\" : \"SUCCESS\",\n\
+ \"success\" : true\n\
+ }\n";
+
+ SmartObject obj;
+
+ CSmartSchema schema = initObjectSchema();
+ obj.setSchema(schema);
+ int32_t corId = 10;
+ bool result = CFormatterJsonSDLRPCv2::fromString<FunctionIDTest::eType,
+ MessageTypeTest::eType>(inputJsonString, obj,
+ FunctionIDTest::RegisterAppInterface,
+ MessageTypeTest::response, corId);
+ EXPECT_EQ(true, result);
+
+ EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::response);
+ EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], 0);
+ EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], corId);
+ EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_TYPE], 0);
+ EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_VERSION], 2);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["resultCode"], "SUCCESS");
+ EXPECT_EQ(obj[S_MSG_PARAMS]["success"], true);
+}
+
+TEST(CFormatterJsonSDLRPCv2Test, StringNotificationToSmartObject) {
+ std::string inputJsonString =
+ "{\
+ \"info\" : \"info_notification\"\
+ }\n";
+
+ SmartObject obj;
+
+ CSmartSchema schema = initObjectSchema();
+ obj.setSchema(schema);
+ int32_t corId = 10;
+ bool result = CFormatterJsonSDLRPCv2::fromString<FunctionIDTest::eType,
+ MessageTypeTest::eType>(inputJsonString, obj,
+ FunctionIDTest::SetGlobalProperties,
+ MessageTypeTest::notification, corId);
+ EXPECT_EQ(true, result);
+ EXPECT_EQ(Errors::eType::OK, obj.validate());
+ EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::notification);
+ EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::SetGlobalProperties);
+ EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], corId);
+ EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_TYPE], 0);
+ EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_VERSION], 2);
+ EXPECT_EQ(obj[S_MSG_PARAMS]["info"], "info_notification");
+}
+
+TEST(CFormatterJsonSDLRPCv2Test, MetaFormatToString) {
+ SmartObject srcObj;
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["info"] = "value";
+
+ std::string jsonString;
+
+ CSmartSchema schema = initObjectSchema();
+ srcObj.setSchema(schema);
+
+ meta_formatter_error_code::tMetaFormatterErrorCode result =
+ CFormatterJsonSDLRPCv2::MetaFormatToString(srcObj, schema, jsonString);
+ EXPECT_EQ(meta_formatter_error_code::kErrorOk, result);
+}
+
+} // namespace formatters
+} // namespace components
+} // namespace test
diff --git a/src/components/formatters/test/formatter_json_rpc_test.cc b/src/components/formatters/test/formatter_json_rpc_test.cc
new file mode 100644
index 000000000..24bdc2fa3
--- /dev/null
+++ b/src/components/formatters/test/formatter_json_rpc_test.cc
@@ -0,0 +1,199 @@
+/*
+ * 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 "gtest/gtest.h"
+#include "formatters/formatter_json_rpc.h"
+#include "formatters/CSmartFactory.hpp"
+#include "HMI_API_schema.h"
+#include "MOBILE_API_schema.h"
+
+namespace test {
+namespace components {
+namespace formatters {
+
+using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
+using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+
+TEST(FormatterJsonRPCTest, CorrectRPCv1_request_SmartObjectToString_EXPECT_SUCCESS) {
+ // Create SmartObject
+ SmartObject obj;
+ obj[S_PARAMS][S_FUNCTION_ID] = hmi_apis::FunctionID::VR_IsReady;
+ obj[S_PARAMS][S_MESSAGE_TYPE] = hmi_apis::messageType::request;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 1;
+ obj[S_PARAMS][S_CORRELATION_ID] = 4444;
+ obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
+ // Attach Schema
+ hmi_apis::HMI_API factory;
+ EXPECT_TRUE(factory.attachSchema(obj));
+
+ std::string result;
+ // Convert SmrtObject to Json string
+ EXPECT_TRUE(FormatterJsonRpc::ToString(obj, result));
+ EXPECT_EQ(
+ std::string(
+ "{\n \"id\" : 4444,\n \"jsonrpc\" : \"2.0\",\n \"method\" : \"VR.IsReady\"\n}\n"),
+ result);
+}
+
+TEST(FormatterJsonRPCTest, CorrectRPCv2_request_SmartObjectToString_EXPECT_SUCCESS) {
+ // Create SmartObject
+ SmartObject obj;
+ obj[S_PARAMS][S_FUNCTION_ID] = mobile_apis::FunctionID::AddCommandID;
+ obj[S_PARAMS][S_MESSAGE_TYPE] = mobile_apis::messageType::request;
+ obj[S_PARAMS][S_CORRELATION_ID] = 4444;
+ obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
+ // Attach Schema
+ mobile_apis::MOBILE_API factory;
+ EXPECT_TRUE(factory.attachSchema(obj));
+
+ std::string result;
+ // Convert SmrtObject to Json string
+ EXPECT_TRUE(FormatterJsonRpc::ToString(obj, result));
+ EXPECT_EQ(
+ std::string(
+ "{\n \"id\" : 4444,\n \"jsonrpc\" : \"2.0\",\n \"method\" : \"AddCommandID\"\n}\n"),
+ result);
+}
+
+TEST(FormatterJsonRPCTest, CorrectRPCv1_notification_SmartObjectToString_EXPECT_SUCCESS) {
+ // Create SmartObject
+ SmartObject obj;
+ std::string result;
+ obj[S_PARAMS][S_FUNCTION_ID] = hmi_apis::FunctionID::Buttons_OnButtonPress;
+ obj[S_PARAMS][S_MESSAGE_TYPE] = hmi_apis::messageType::notification;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 1;
+ obj[S_PARAMS][S_CORRELATION_ID] = 4222;
+ obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
+ // Attach Schema
+ hmi_apis::HMI_API factory;
+ EXPECT_TRUE(factory.attachSchema(obj));
+ // Convert SmrtObject to Json string
+ EXPECT_TRUE(FormatterJsonRpc::ToString(obj, result));
+ EXPECT_EQ(
+ std::string(
+ "{\n \"jsonrpc\" : \"2.0\",\n \"method\" : \"Buttons.OnButtonPress\",\n \"params\" : {}\n}\n"),
+ result);
+}
+
+TEST(FormatterJsonRPCTest, InvalidRPC_SmartObjectToString_EXPECT_FALSE) {
+ // Create SmartObject
+ SmartObject obj;
+ std::string result;
+ obj[S_PARAMS][S_FUNCTION_ID] =
+ hmi_apis::FunctionID::BasicCommunication_OnReady;
+ obj[S_PARAMS][S_MESSAGE_TYPE] = hmi_apis::messageType::response;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 1;
+ obj[S_PARAMS][S_CORRELATION_ID] = 4222;
+ obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
+ // Attach Schema
+ hmi_apis::HMI_API factory;
+ EXPECT_FALSE(factory.attachSchema(obj));
+ // Convert SmrtObject to Json string
+ EXPECT_FALSE(FormatterJsonRpc::ToString(obj, result));
+ // Expect result with default value. No correct conversion was done
+ EXPECT_EQ(std::string("{\n \"jsonrpc\" : \"2.0\"\n}\n"), result);
+}
+
+TEST(FormatterJsonRPCTest, FromStringNotificationToSmartObj_ExpectSuccess) {
+ // Source Json string
+ const std::string json_string(
+ "{\n \"jsonrpc\" : \"2.0\",\n \"method\" : \"BasicCommunication.OnReady\",\n \"params\" : {}\n}\n");
+ // Smart Object to keep result
+ SmartObject obj;
+ // Convert json string to smart object
+ EXPECT_EQ(
+ 0,
+ (FormatterJsonRpc::FromString<hmi_apis::FunctionID::eType,
+ hmi_apis::messageType::eType>(json_string, obj)));
+ // Get keys collection from Smart Object
+ std::set<std::string> keys = obj["params"].enumerate();
+ EXPECT_EQ(4u, keys.size());
+}
+
+TEST(FormatterJsonRPCTest, FromStringToSmartObjInvalidFormat_ExpectFalse) {
+ // Source Json string
+ const std::string json_string(
+ "{\n \"method\" : \"BasicCommunication.OnReady\",\n \"params\" : {}\n}\n");
+ // Smart Object to keep result
+ SmartObject obj;
+ // Convert json string to smart object
+ EXPECT_EQ(
+ 2,
+ (FormatterJsonRpc::FromString<hmi_apis::FunctionID::eType,
+ hmi_apis::messageType::eType>(json_string, obj)));
+ // Get keys collection from Smart Object
+ std::set<std::string> keys = obj["params"].enumerate();
+ EXPECT_EQ(4u, keys.size());
+}
+
+TEST(FormatterJsonRPCTest, FromStringRequestToSmartObj_ExpectSuccess) {
+ // Source Json string
+ const std::string json_string(
+ "{\n \"id\" : 4444,\n \"jsonrpc\" : \"2.0\",\n \"method\" : \"VR.IsReady\"\n}\n");
+ // Smart Object to keep result
+ SmartObject obj;
+ // Convert json string to smart object
+ EXPECT_EQ(
+ 0,
+ (FormatterJsonRpc::FromString<hmi_apis::FunctionID::eType,
+ hmi_apis::messageType::eType>(json_string, obj)));
+ // Get keys collection from Smart Object
+ std::set<std::string> keys = obj["params"].enumerate();
+ std::set<std::string>::iterator it1 = keys.begin();
+ EXPECT_EQ(5u, keys.size());
+}
+
+TEST(FormatterJsonRPCTest, FromStringResponseToSmartObj_ExpectSuccess) {
+ // Source Json string
+ const std::string json_string(
+ "{\n \"id\" : 4444,\n \"jsonrpc\" : \"2.0\",\n \"method\" : \"VR.IsReady\"\n}\n");
+ // Smart Object to keep result
+ SmartObject obj;
+ // Convert json string to smart object
+ EXPECT_EQ(
+ 0,
+ (FormatterJsonRpc::FromString<hmi_apis::FunctionID::eType,
+ hmi_apis::messageType::eType>(json_string, obj)));
+ // Get keys collection from Smart Object
+ std::set<std::string> keys = obj["params"].enumerate();
+ std::set<std::string>::iterator it1 = keys.begin();
+ EXPECT_EQ(5u, keys.size());
+}
+
+} // namespace formatters
+} // namespace components
+} // namespace test
diff --git a/src/components/formatters/test/generic_json_formatter_test.cc b/src/components/formatters/test/generic_json_formatter_test.cc
new file mode 100644
index 000000000..51da8c91f
--- /dev/null
+++ b/src/components/formatters/test/generic_json_formatter_test.cc
@@ -0,0 +1,162 @@
+/*
+ * 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 "formatters/generic_json_formatter.h"
+
+namespace test {
+namespace components {
+namespace formatters {
+
+TEST(GenericJsonFormatter, ToString) {
+ namespace smartobj = NsSmartDeviceLink::NsSmartObjects;
+ namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+
+ smartobj::SmartObject obj;
+ std::string result;
+
+ formatters::GenericJsonFormatter::ToString(obj, result);
+ ASSERT_STREQ("null\n", result.c_str());
+
+ obj = true;
+ formatters::GenericJsonFormatter::ToString(obj, result);
+ ASSERT_STREQ("true\n", result.c_str());
+
+ obj = 10;
+ formatters::GenericJsonFormatter::ToString(obj, result);
+ ASSERT_STREQ("10\n", result.c_str());
+
+ obj = 15.2;
+ formatters::GenericJsonFormatter::ToString(obj, result);
+ ASSERT_STREQ("15.20\n", result.c_str());
+
+ obj = 'c';
+ formatters::GenericJsonFormatter::ToString(obj, result);
+ ASSERT_STREQ("\"c\"\n", result.c_str());
+
+ obj[0] = 1;
+ obj[1] = true;
+ obj[2] = "string";
+ formatters::GenericJsonFormatter::ToString(obj, result);
+ ASSERT_STREQ("[ 1, true, \"string\" ]\n", result.c_str());
+
+ obj["intField"] = 100500;
+ obj["stringField"] = "s";
+ obj["subobject"]["boolField"] = false;
+ obj["subobject"]["arrayField"][0] = 0;
+ obj["subobject"]["arrayField"][1] = 'c';
+ obj["subobject"]["arrayField"][2][0] = 10.0;
+ formatters::GenericJsonFormatter::ToString(obj, result);
+ ASSERT_STREQ("{\n"
+ " \"intField\" : 100500,\n"
+ " \"stringField\" : \"s\",\n"
+ " \"subobject\" : {\n"
+ " \"arrayField\" : [\n"
+ " 0,\n"
+ " \"c\",\n"
+ " [ 10.0 ]\n"
+ " ],\n"
+ " \"boolField\" : false\n"
+ " }\n"
+ "}\n", result.c_str());
+}
+
+TEST(GenericJsonFormatter, FromString) {
+ namespace smartobj = NsSmartDeviceLink::NsSmartObjects;
+ namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+
+ smartobj::SmartObject result;
+
+ ASSERT_FALSE(formatters::GenericJsonFormatter::FromString("", result));
+ ASSERT_FALSE(formatters::GenericJsonFormatter::FromString("\"str", result));
+ ASSERT_FALSE(formatters::GenericJsonFormatter::FromString("[10", result));
+ ASSERT_FALSE(formatters::GenericJsonFormatter::FromString("{10}", result));
+
+ ASSERT_TRUE(formatters::GenericJsonFormatter::FromString("null", result));
+ ASSERT_EQ(smartobj::SmartType_Null, result.getType());
+
+ ASSERT_TRUE(formatters::GenericJsonFormatter::FromString("true", result));
+ ASSERT_EQ(smartobj::SmartType_Boolean, result.getType());
+ ASSERT_EQ(true, result.asBool());
+
+ ASSERT_TRUE(formatters::GenericJsonFormatter::FromString("1", result));
+ ASSERT_EQ(smartobj::SmartType_Integer, result.getType());
+ ASSERT_EQ(1, result.asInt());
+
+ ASSERT_TRUE(formatters::GenericJsonFormatter::FromString("0.5", result));
+ ASSERT_EQ(smartobj::SmartType_Double, result.getType());
+ ASSERT_DOUBLE_EQ(0.5, result.asDouble());
+
+ ASSERT_TRUE(formatters::GenericJsonFormatter::FromString("\"str\"", result));
+ ASSERT_EQ(smartobj::SmartType_String, result.getType());
+ ASSERT_STREQ("str", result.asString().c_str());
+
+ ASSERT_TRUE(formatters::GenericJsonFormatter::FromString("[true, null, 10]",
+ result));
+ ASSERT_EQ(smartobj::SmartType_Array, result.getType());
+ ASSERT_EQ(smartobj::SmartType_Boolean, result.getElement(0U).getType());
+ ASSERT_EQ(true, result.getElement(0U).asBool());
+ ASSERT_EQ(smartobj::SmartType_Null, result.getElement(1U).getType());
+ ASSERT_EQ(smartobj::SmartType_Integer, result.getElement(2U).getType());
+ ASSERT_EQ(10, result.getElement(2U).asInt());
+
+ ASSERT_TRUE(
+ formatters::GenericJsonFormatter::FromString("{"
+ " \"intField\": 100500,"
+ " \"subobject\": {"
+ " \"arrayField\": [1, null],"
+ " \"strField\": \"str\""
+ " }"
+ "}",
+ result));
+ ASSERT_EQ(smartobj::SmartType_Map, result.getType());
+ ASSERT_EQ(smartobj::SmartType_Integer,
+ result.getElement("intField").getType());
+ ASSERT_EQ(100500, result.getElement("intField").asInt());
+ ASSERT_EQ(smartobj::SmartType_Map, result.getElement("subobject").getType());
+ ASSERT_EQ(smartobj::SmartType_Array,
+ result.getElement("subobject").getElement("arrayField").getType());
+ ASSERT_EQ(smartobj::SmartType_Integer,
+ result.getElement("subobject").getElement("arrayField").getElement(0U).getType());
+ ASSERT_EQ(1, result.getElement("subobject").getElement("arrayField").getElement(0U).asInt());
+ ASSERT_EQ(smartobj::SmartType_Null,
+ result.getElement("subobject").getElement("arrayField").getElement(1U).getType());
+ ASSERT_EQ(smartobj::SmartType_String,
+ result.getElement("subobject").getElement("strField").getType());
+ ASSERT_STREQ(
+ "str",
+ result.getElement("subobject").getElement("strField").asString().c_str());
+}
+
+} // formatters
+} // components
+} // test
diff --git a/src/components/formatters/test/include/SmartFactoryTestHelper.h b/src/components/formatters/test/include/SmartFactoryTestHelper.h
new file mode 100644
index 000000000..ca7021b84
--- /dev/null
+++ b/src/components/formatters/test/include/SmartFactoryTestHelper.h
@@ -0,0 +1,167 @@
+/*
+ * 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_FORMATTERS_TEST_INCLUDE_SMARTFACTORYTESTHELPER_H_
+#define SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_SMARTFACTORYTESTHELPER_H_
+
+#include <map>
+#include <set>
+
+#include "formatters/CSmartFactory.hpp"
+#include "HMI_API_schema.h"
+#include "smart_objects/always_true_schema_item.h"
+#include "smart_objects/always_false_schema_item.h"
+#include "smart_objects/array_schema_item.h"
+#include "smart_objects/bool_schema_item.h"
+#include "smart_objects/object_schema_item.h"
+#include "smart_objects/string_schema_item.h"
+#include "smart_objects/enum_schema_item.h"
+#include "smart_objects/number_schema_item.h"
+#include "smart_objects/schema_item_parameter.h"
+
+namespace test {
+namespace components {
+namespace formatters {
+
+using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace NsSmartDeviceLink::NsJSONHandler;
+using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace hmi_apis;
+
+namespace TestType {
+enum eType {
+ INVALID_ENUM = -1,
+ APPLICATION_NOT_REGISTERED = 0,
+ SUCCESS,
+ TOO_MANY_PENDING_REQUESTS,
+ REJECTED,
+ INVALID_DATA,
+ OUT_OF_MEMORY,
+ ABORTED,
+ USER_DISALLOWED,
+ GENERIC_ERROR,
+ DISALLOWED
+};
+} // namespace TestType
+
+namespace FunctionIdTest {
+enum eType {
+ INVALID_ENUM = -1,
+ Function1,
+ Function2,
+ Function3
+};
+} // namespace FunctionIdTest
+
+namespace MessageTypeTest {
+enum eType {
+ INVALID_ENUM = -1,
+ request,
+ response,
+ notification,
+ error_response
+};
+} // namespace MessageTypeTest
+
+namespace StructIdentifiersTest {
+enum eType {
+ INVALID_ENUM = -1,
+ Common_1,
+ Common_2,
+ Common_3
+};
+} // namespace StructIdentifiersTest
+
+class CSmartFactoryTest : public CSmartFactory<FunctionIdTest::eType,
+ MessageTypeTest::eType, StructIdentifiersTest::eType> {
+ public:
+ CSmartFactoryTest();
+ std::map<SmartSchemaKey<FunctionIdTest::eType, MessageTypeTest::eType>,
+ CSmartSchema> function_schemes() {
+ return functions_schemes_;
+ }
+ std::map<StructIdentifiersTest::eType, CSmartSchema> structs_schemes() {
+ return structs_schemes_;
+ }
+ protected:
+ typedef std::map<const StructIdentifiersTest::eType,
+ utils::SharedPtr<ISchemaItem> > TStructsSchemaItems;
+
+ static utils::SharedPtr<ISchemaItem> ProvideObjectSchemaItemForStruct(
+ TStructsSchemaItems &struct_schema_items,
+ const StructIdentifiersTest::eType struct_id);
+
+ void InitStructSchemes(TStructsSchemaItems &struct_schema_items);
+
+ void InitFunctionSchemes(
+ const TStructsSchemaItems &struct_schema_items,
+ const std::set<FunctionIdTest::eType> &function_id_items,
+ const std::set<MessageTypeTest::eType> &message_type_items);
+
+ static CSmartSchema InitFunction_Function1_request(
+ const std::set<FunctionIdTest::eType> &function_id_items,
+ const std::set<MessageTypeTest::eType> &message_type_items);
+
+ static CSmartSchema InitFunction_Function1_response(
+ const TStructsSchemaItems &struct_schema_items,
+ const std::set<FunctionIdTest::eType> &function_id_items,
+ const std::set<MessageTypeTest::eType> &message_type_items);
+
+ static CSmartSchema InitFunction_Function2_request(
+ const std::set<FunctionIdTest::eType> &function_id_items,
+ const std::set<MessageTypeTest::eType> &message_type_items);
+
+ static CSmartSchema InitFunction_Function2_response(
+ const TStructsSchemaItems &struct_schema_items,
+ const std::set<FunctionIdTest::eType> &function_id_items,
+ const std::set<MessageTypeTest::eType> &message_type_items);
+
+ static CSmartSchema InitFunction_Function3_request(
+ const std::set<FunctionIdTest::eType> &function_id_items,
+ const std::set<MessageTypeTest::eType> &message_type_items);
+
+ static CSmartSchema InitFunction_Function3_response(
+ const TStructsSchemaItems &struct_schema_items,
+ const std::set<FunctionIdTest::eType> &function_id_items,
+ const std::set<MessageTypeTest::eType> &message_type_items);
+
+ static utils::SharedPtr<ISchemaItem> InitStructSchemaItem_Common_1(
+ TStructsSchemaItems &struct_schema_items);
+
+ static utils::SharedPtr<ISchemaItem> InitStructSchemaItem_Common_2();
+};
+
+} // namespace formatters
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_SMARTFACTORYTESTHELPER_H_
diff --git a/src/components/formatters/test/include/create_smartSchema.h b/src/components/formatters/test/include/create_smartSchema.h
new file mode 100644
index 000000000..c3bc2651e
--- /dev/null
+++ b/src/components/formatters/test/include/create_smartSchema.h
@@ -0,0 +1,92 @@
+/*
+ * 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_FORMATTERS_TEST_INCLUDE_CREATESMARTSCHEMA_H_
+#define SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_CREATESMARTSCHEMA_H_
+
+#include "formatters/CFormatterJsonSDLRPCv1.hpp"
+#include "SmartFactoryTestHelper.h"
+
+namespace test {
+namespace components {
+namespace formatters {
+
+using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
+using namespace NsSmartDeviceLink::NsSmartObjects;
+
+namespace FunctionIDTest {
+enum eType {
+ INVALID_ENUM = -1,
+ RegisterAppInterface,
+ UnregisterAppInterface,
+ SetGlobalProperties,
+};
+}
+
+namespace Language {
+enum eType {
+ INVALID_ENUM = -1,
+ EN_EU,
+ RU_RU
+};
+}
+namespace AppTypeTest {
+enum eType {
+ INVALID_ENUM = -1,
+ SYSTEM,
+ MEDIA
+};
+}
+namespace SpeechCapabilities {
+enum eType {
+ INVALID_ENUM = -1,
+ SC_TEXT,
+};
+}
+
+namespace StructIdentifiers {
+enum eType {
+ INVALID_ENUM = -1,
+ Struct1,
+ Struct2
+};
+}
+
+CSmartSchema initObjectSchema();
+CSmartSchema initSchemaForMetaFormatter();
+
+} // namespace formatters
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_CREATESMARTSCHEMA_H_
diff --git a/src/components/formatters/test/include/meta_formatter_test_helper.h b/src/components/formatters/test/include/meta_formatter_test_helper.h
new file mode 100644
index 000000000..e2be3beb6
--- /dev/null
+++ b/src/components/formatters/test/include/meta_formatter_test_helper.h
@@ -0,0 +1,83 @@
+/*
+ * 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_FORMATTERS_TEST_INCLUDE_METAFORMATTERTESTHELPER_H_
+#define SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_METAFORMATTERTESTHELPER_H_
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "formatters/CFormatterJsonSDLRPCv1.hpp"
+#include "formatters/CSmartFactory.hpp"
+#include "create_smartSchema.h"
+
+namespace test {
+namespace components {
+namespace formatters {
+
+class CMetaFormatterTestHelper : public ::testing::Test {
+ protected:
+
+ virtual void SetUp();
+
+ virtual void TearDown();
+
+ void AnyObjectToJsonString(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
+ std::string& result_string);
+
+ void FillObjectIdenticalToSchema(
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+
+ void FillObjectIdenticalToSchemaWithoutNoMandatoriesParams(
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+
+ void CompareObjects(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& first,
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& second);
+
+ void FillObjectWithDefaultValues(
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+
+ void FillObjectWithoutSomeMandatoryFields(
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+
+ // Members
+ std::set<FunctionIDTest::eType> function_id_items_;
+ std::set<MessageTypeTest::eType> message_type_items_;
+};
+
+} // namespace formatters
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_METAFORMATTERTESTHELPER_H_
diff --git a/src/components/formatters/test/meta_formatter_test.cc b/src/components/formatters/test/meta_formatter_test.cc
new file mode 100644
index 000000000..17c2506ac
--- /dev/null
+++ b/src/components/formatters/test/meta_formatter_test.cc
@@ -0,0 +1,351 @@
+/*
+ * 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 "formatters/meta_formatter.h"
+#include "meta_formatter_test_helper.h"
+
+namespace test {
+namespace components {
+namespace formatters {
+
+TEST_F(CMetaFormatterTestHelper, inputObjectIdenticalToSchemaWithAndWithoutMandatoryParams) {
+ Json::Value value;
+ Json::Reader reader;
+ CSmartFactory<FunctionIDTest::eType, MessageTypeTest::eType,
+ StructIdentifiers::eType> factory_;
+
+ SmartObject object1 = factory_.CreateSmartObject(
+ FunctionIDTest::RegisterAppInterface, MessageTypeTest::request);
+
+ SmartObject object2 = factory_.CreateSmartObject(
+ FunctionIDTest::RegisterAppInterface, MessageTypeTest::request);
+
+ SmartObject result_object1;
+ SmartObject result_object2;
+ // Get schema
+ CSmartSchema schema;
+ schema = initSchemaForMetaFormatter();
+
+ FillObjectIdenticalToSchema(object1);
+ FillObjectIdenticalToSchemaWithoutNoMandatoriesParams(object2);
+ bool creationresult;
+ creationresult = CMetaFormatter::CreateObjectByPattern(object1, schema,
+ result_object1);
+ EXPECT_TRUE(creationresult);
+ creationresult = CMetaFormatter::CreateObjectByPattern(object2, schema,
+ result_object2);
+ EXPECT_TRUE(creationresult);
+
+ // Uncomment code to print objects in console
+// std::string formatted_string;
+// CFormatterJsonSDLRPCv1::toString(object1, formatted_string);
+// printf("object1 %s\n", formatted_string.c_str());
+//
+// CFormatterJsonSDLRPCv1::toString(result_object1, formatted_string);
+// printf("result_object1 %s\n", formatted_string.c_str());
+//
+// CFormatterJsonSDLRPCv1::toString(object2, formatted_string);
+// printf("object2 %s\n", formatted_string.c_str());
+//
+// CFormatterJsonSDLRPCv1::toString(result_object2, formatted_string);
+// printf("result_object2 %s\n", formatted_string.c_str());
+
+ CompareObjects(object1, result_object1);
+ CompareObjects(object2, result_object2);
+
+ // Enums must be unapplied (converted to string) in order to be compared against strings
+ result_object1.getSchema().unapplySchema(result_object1);
+ EXPECT_EQ("request", result_object1[S_PARAMS][S_MESSAGE_TYPE].asString());
+ EXPECT_EQ("RegisterAppInterface",
+ result_object1[S_PARAMS][S_FUNCTION_ID].asString());
+
+ result_object2.getSchema().unapplySchema(result_object2);
+ EXPECT_EQ("request", result_object2[S_PARAMS][S_MESSAGE_TYPE].asString());
+ EXPECT_EQ("RegisterAppInterface",
+ result_object2[S_PARAMS][S_FUNCTION_ID].asString());
+}
+
+TEST_F(CMetaFormatterTestHelper, NormalSchemaWithEmptyObject) {
+ SmartObject object;
+ SmartObject result_object;
+ SmartObject expected_object;
+
+ // Get schema
+ CSmartSchema schema = initSchemaForMetaFormatter();
+ bool create_object_result = CMetaFormatter::CreateObjectByPattern(
+ object, schema, result_object);
+ EXPECT_TRUE(create_object_result);
+
+ FillObjectWithDefaultValues(expected_object);
+
+ CompareObjects(expected_object, result_object);
+
+// Uncomment code to print objects in console
+// std::string str;
+// AnyObjectToJsonString(result_object, str);
+// printf("result_object(default) %s", str.c_str());
+// AnyObjectToJsonString(expected_object, str);
+// printf("expected_object %s", str.c_str());
+
+
+}
+
+TEST_F(CMetaFormatterTestHelper, NormalSchemaWithObjectWithoutSomeMandatoryFields) {
+ SmartObject object;
+ SmartObject result_object;
+
+ // Get schema
+ CSmartSchema schema = initSchemaForMetaFormatter();
+ FillObjectWithoutSomeMandatoryFields(object);
+
+ CMetaFormatter::CreateObjectByPattern(object, schema, result_object);
+
+ CompareObjects(object, result_object);
+ EXPECT_EQ(0, result_object[S_PARAMS][S_CORRELATION_ID].asInt());
+ EXPECT_EQ(
+ 0, result_object[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"].asInt());
+ EXPECT_EQ(
+ 0, result_object[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"].asInt());
+
+// Uncomment code to print object in console
+// std::string str;
+// AnyObjectToJsonString(result_object, str);
+// printf("result_object %s", str.c_str());
+
+}
+
+TEST_F(CMetaFormatterTestHelper, ObjectWithEmptyMap) {
+ std::map<std::string, CObjectSchemaItem::SMember> schemaMembersMap;
+ CSmartSchema map_schema = CSmartSchema(
+ CObjectSchemaItem::create(schemaMembersMap));
+
+ SmartObject object;
+ SmartObject result_object_empty_map;
+
+ SmartObject object_empty_map = SmartObject(SmartType_Map);
+ CMetaFormatter::CreateObjectByPattern(object_empty_map, map_schema,
+ result_object_empty_map);
+ EXPECT_EQ(SmartType_Map, result_object_empty_map.getType())<< "smartObject is not map type";
+ EXPECT_EQ(0u, result_object_empty_map.length())<< "non empty map";
+
+ CMetaFormatter::CreateObjectByPattern(object, map_schema,
+ result_object_empty_map);
+ EXPECT_EQ(SmartType_Map, result_object_empty_map.getType())<< "smartObject is not map type";
+ EXPECT_EQ(0u, result_object_empty_map.length())<< "non empty map";
+
+ object["field1"] = 0;
+ object["field2"] = SmartObject();
+ CMetaFormatter::CreateObjectByPattern(object, map_schema,
+ result_object_empty_map);
+ EXPECT_EQ(SmartType_Map, result_object_empty_map.getType())<< "smartObject is not map type";
+ EXPECT_EQ(0u, result_object_empty_map.length())<< "non empty map";
+
+ // Fill object with any values. Result must be the same
+ FillObjectIdenticalToSchema(object);
+ CMetaFormatter::CreateObjectByPattern(object, map_schema,
+ result_object_empty_map);
+ EXPECT_EQ(SmartType_Map, result_object_empty_map.getType())<< "smartObject is not map type";
+ EXPECT_EQ(0u, result_object_empty_map.length())<< "non empty map";
+
+ // Fill object with any values. Result must be the same
+ FillObjectIdenticalToSchemaWithoutNoMandatoriesParams(object);
+ CMetaFormatter::CreateObjectByPattern(object, map_schema,
+ result_object_empty_map);
+ EXPECT_EQ(SmartType_Map, result_object_empty_map.getType())<< "smartObject is not map type";
+ EXPECT_EQ(0u, result_object_empty_map.length())<< "non empty map";
+
+// Uncomment code to print object in console
+// std::string str;
+// AnyObjectToJsonString(result_object_empty_map, str);
+// printf("result_object(empty map) %s", str.c_str());
+
+}
+
+TEST_F(CMetaFormatterTestHelper, ObjectWithEmptyArray) {
+ SmartObject object;
+
+ SmartObject result_object_empty_array;
+ CSmartSchema array_schema = CSmartSchema(CArraySchemaItem::create());
+
+ SmartObject object_empty_aray = SmartObject(SmartType_Array);
+
+ CMetaFormatter::CreateObjectByPattern(object_empty_aray, array_schema,
+ result_object_empty_array);
+ EXPECT_EQ(SmartType_Array, result_object_empty_array.getType())<< "smartObject is not array type";
+ EXPECT_EQ(0u, result_object_empty_array.length())<< "non empty array";
+
+ CMetaFormatter::CreateObjectByPattern(object, array_schema,
+ result_object_empty_array);
+ EXPECT_EQ(SmartType_Array, result_object_empty_array.getType())<< "smartObject is not array type";
+ EXPECT_EQ(0u, result_object_empty_array.length())<< "non empty array";
+
+ // Fill object with any values. Result must be the same
+ FillObjectIdenticalToSchema(object);
+ CMetaFormatter::CreateObjectByPattern(object, array_schema,
+ result_object_empty_array);
+ EXPECT_EQ(SmartType_Array, result_object_empty_array.getType())<< "smartObject is not array type";
+ EXPECT_EQ(0u, result_object_empty_array.length())<< "non empty array";
+
+ // Fill object with any values. Result must be the same
+ FillObjectWithoutSomeMandatoryFields(object);
+ CMetaFormatter::CreateObjectByPattern(object, array_schema,
+ result_object_empty_array);
+ EXPECT_EQ(SmartType_Array, result_object_empty_array.getType())<< "smartObject is not array type";
+ EXPECT_EQ(0u, result_object_empty_array.length())<< "non empty array";
+
+// Uncomment code to print object in console
+// std::string str;
+// AnyObjectToJsonString(result_object_empty_array, str);
+// printf("result_object(empty array) %s", str.c_str());
+
+}
+
+TEST_F(CMetaFormatterTestHelper, ObjectWithEmptyArrayAndEmptyMapWithOtherParameters) {
+ // Arrange
+ SmartObject result_object;
+ SmartObject object;
+
+ std::map<std::string, CObjectSchemaItem::SMember> paramsMembersMap;
+
+ paramsMembersMap[S_FUNCTION_ID] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<FunctionIDTest::eType>::create(function_id_items_), true);
+
+ paramsMembersMap[S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<MessageTypeTest::eType>::create(message_type_items_),
+ true);
+
+ paramsMembersMap[S_CORRELATION_ID] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(TSchemaItemParameter<int>(0),
+ TSchemaItemParameter<int>(100),
+ TSchemaItemParameter<int>(55)),
+ true);
+
+ paramsMembersMap[S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(TSchemaItemParameter<int>(1),
+ TSchemaItemParameter<int>(2)),
+ false);
+ paramsMembersMap[S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), false);
+
+ std::map<std::string, CObjectSchemaItem::SMember> schemaMembersMap;
+
+ schemaMembersMap["mandatory_emptyMap1"] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(
+ std::map<std::string, CObjectSchemaItem::SMember>()),
+ true);
+
+ schemaMembersMap["mandatory_emptyMap2"] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(
+ std::map<std::string, CObjectSchemaItem::SMember>()),
+ true);
+
+ schemaMembersMap["mandatory_emptyAray"] = CObjectSchemaItem::SMember(
+ CArraySchemaItem::create(TNumberSchemaItem<int>::create()), true);
+
+ schemaMembersMap["non_mandatory_Array"] = CObjectSchemaItem::SMember(
+ CArraySchemaItem::create(TNumberSchemaItem<int>::create(),
+ TSchemaItemParameter<size_t>(1),
+ TSchemaItemParameter<size_t>(2)),
+ false);
+
+ schemaMembersMap["mandatory_string"] = CObjectSchemaItem::SMember(
+ CStringSchemaItem::create(TSchemaItemParameter<size_t>(0),
+ TSchemaItemParameter<size_t>(500),
+ TSchemaItemParameter<std::string>("defValue")),
+ true);
+
+ schemaMembersMap["non_mandatory_string"] = CObjectSchemaItem::SMember(
+ CStringSchemaItem::create(
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(500),
+ TSchemaItemParameter<std::string>("ignoredDefValue")),
+ false);
+
+ std::map<std::string, CObjectSchemaItem::SMember> rootMembersMap;
+ rootMembersMap[S_MSG_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(schemaMembersMap), true);
+ rootMembersMap[S_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(paramsMembersMap), true);
+
+ CSmartSchema schema = CSmartSchema(CObjectSchemaItem::create(rootMembersMap));
+
+ // Set object value
+ object[S_PARAMS][S_FUNCTION_ID] = 500;
+ object[S_PARAMS][S_PROTOCOL_VERSION] = 11;
+ object[S_PARAMS]["new_field"] = "100500 string";
+
+ object[S_MSG_PARAMS]["mandatory_emptyMap1"]["field1"] = 123;
+ object[S_MSG_PARAMS]["mandatory_emptyMap1"]["field2"][0] = 100;
+ object[S_MSG_PARAMS]["mandatory_emptyMap1"]["field2"][1] = 200;
+ object[S_MSG_PARAMS]["non_mandatory_Array"][0] = 100;
+ object[S_MSG_PARAMS]["non_mandatory_Array"][1] = 200;
+ object[S_MSG_PARAMS]["non_mandatory_Array"][2] = 300;
+ object[S_MSG_PARAMS]["non_mandatory_string"] = "some string";
+
+ CMetaFormatter::CreateObjectByPattern(object, schema, result_object);
+
+// Uncomment code to print object in console
+// std::string str;
+// AnyObjectToJsonString(object, str);
+// printf("object %s", str.c_str());
+// AnyObjectToJsonString(result_object, str);
+// printf("result_object %s", str.c_str());
+
+
+ // Assert
+ EXPECT_EQ(500, result_object[S_PARAMS][S_FUNCTION_ID].asInt());
+ EXPECT_EQ(-1, result_object[S_PARAMS][S_MESSAGE_TYPE].asInt());
+ EXPECT_EQ(55, result_object[S_PARAMS][S_CORRELATION_ID].asInt());
+ EXPECT_EQ(11u, result_object[S_PARAMS][S_PROTOCOL_VERSION].asUInt());
+
+ EXPECT_EQ(SmartType_Map,
+ result_object[S_MSG_PARAMS]["mandatory_emptyMap1"].getType());
+ EXPECT_EQ(0u, result_object[S_MSG_PARAMS]["mandatory_emptyMap1"].length());
+ EXPECT_EQ(SmartType_Map,
+ result_object[S_MSG_PARAMS]["mandatory_emptyMap2"].getType());
+ EXPECT_EQ(0u, result_object[S_MSG_PARAMS]["mandatory_emptyMap2"].length());
+ EXPECT_EQ(SmartType_Array,
+ result_object[S_MSG_PARAMS]["mandatory_emptyAray"].getType());
+ EXPECT_EQ(0u, result_object[S_MSG_PARAMS]["mandatory_emptyAray"].length());
+ EXPECT_EQ(100, result_object[S_MSG_PARAMS]["non_mandatory_Array"][0].asInt());
+ EXPECT_EQ(200, result_object[S_MSG_PARAMS]["non_mandatory_Array"][1].asInt());
+ EXPECT_EQ(300u,
+ result_object[S_MSG_PARAMS]["non_mandatory_Array"][2].asUInt());
+ EXPECT_EQ(std::string("defValue"),
+ result_object[S_MSG_PARAMS]["mandatory_string"].asString());
+ EXPECT_EQ(std::string("some string"),
+ result_object[S_MSG_PARAMS]["non_mandatory_string"].asString());
+}
+
+} // namespace formatters
+} // namespace components
+} // namespace test
diff --git a/src/components/formatters/test/src/SmartFactoryTestHelper.cc b/src/components/formatters/test/src/SmartFactoryTestHelper.cc
new file mode 100644
index 000000000..8f601afc2
--- /dev/null
+++ b/src/components/formatters/test/src/SmartFactoryTestHelper.cc
@@ -0,0 +1,501 @@
+/*
+ * 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 "SmartFactoryTestHelper.h"
+
+using namespace test::components::formatters;
+
+template<>
+const EnumConversionHelper<TestType::eType>::EnumToCStringMap EnumConversionHelper<
+ test::components::formatters::TestType::eType>::enum_to_cstring_map_ =
+ EnumConversionHelper<test::components::formatters::TestType::eType>::InitEnumToCStringMap();
+
+template<>
+const EnumConversionHelper<TestType::eType>::CStringToEnumMap EnumConversionHelper<
+ test::components::formatters::TestType::eType>::cstring_to_enum_map_ =
+ EnumConversionHelper<test::components::formatters::TestType::eType>::InitCStringToEnumMap();
+
+template<>
+const char* const EnumConversionHelper<TestType::eType>::cstring_values_[] = {
+ "APPLICATION_NOT_REGISTERED", "SUCCESS", "TOO_MANY_PENDING_REQUESTS",
+ "REJECTED", "INVALID_DATA", "OUT_OF_MEMORY", "ABORTED", "USER_DISALLOWED",
+ "GENERIC_ERROR", "DISALLOWED" };
+
+template<>
+const TestType::eType EnumConversionHelper<TestType::eType>::enum_values_[] = {
+ test::components::formatters::TestType::APPLICATION_NOT_REGISTERED,
+ test::components::formatters::TestType::SUCCESS,
+ test::components::formatters::TestType::TOO_MANY_PENDING_REQUESTS,
+ test::components::formatters::TestType::REJECTED,
+ test::components::formatters::TestType::INVALID_DATA,
+ test::components::formatters::TestType::OUT_OF_MEMORY,
+ test::components::formatters::TestType::ABORTED,
+ test::components::formatters::TestType::USER_DISALLOWED,
+ test::components::formatters::TestType::GENERIC_ERROR,
+ test::components::formatters::TestType::DISALLOWED };
+
+template<>
+const EnumConversionHelper<FunctionIdTest::eType>::EnumToCStringMap EnumConversionHelper<
+ test::components::formatters::FunctionIdTest::eType>::enum_to_cstring_map_ =
+ EnumConversionHelper<test::components::formatters::FunctionIdTest::eType>::InitEnumToCStringMap();
+
+template<>
+const EnumConversionHelper<FunctionIdTest::eType>::CStringToEnumMap EnumConversionHelper<
+ test::components::formatters::FunctionIdTest::eType>::cstring_to_enum_map_ =
+ EnumConversionHelper<test::components::formatters::FunctionIdTest::eType>::InitCStringToEnumMap();
+
+template<>
+const char* const EnumConversionHelper<FunctionIdTest::eType>::cstring_values_[] =
+ { "Function1", "Function2", "Function3" };
+
+template<>
+const FunctionIdTest::eType EnumConversionHelper<FunctionIdTest::eType>::enum_values_[] =
+ { test::components::formatters::FunctionIdTest::Function1,
+ test::components::formatters::FunctionIdTest::Function2,
+ test::components::formatters::FunctionIdTest::Function3 };
+
+template<>
+const EnumConversionHelper<MessageTypeTest::eType>::EnumToCStringMap EnumConversionHelper<
+ test::components::formatters::MessageTypeTest::eType>::enum_to_cstring_map_ =
+ EnumConversionHelper<test::components::formatters::MessageTypeTest::eType>::InitEnumToCStringMap();
+
+template<>
+const EnumConversionHelper<MessageTypeTest::eType>::CStringToEnumMap EnumConversionHelper<
+ test::components::formatters::MessageTypeTest::eType>::cstring_to_enum_map_ =
+ EnumConversionHelper<test::components::formatters::MessageTypeTest::eType>::InitCStringToEnumMap();
+
+template<>
+const char* const EnumConversionHelper<MessageTypeTest::eType>::cstring_values_[] =
+ { "request", "response", "notification" };
+
+template<>
+const MessageTypeTest::eType EnumConversionHelper<MessageTypeTest::eType>::enum_values_[] =
+ { test::components::formatters::MessageTypeTest::request,
+ test::components::formatters::MessageTypeTest::response,
+ test::components::formatters::MessageTypeTest::notification };
+
+CSmartFactoryTest::CSmartFactoryTest()
+ : CSmartFactory<FunctionIdTest::eType, MessageTypeTest::eType,
+ StructIdentifiersTest::eType>() {
+ TStructsSchemaItems struct_schema_items;
+ InitStructSchemes(struct_schema_items);
+ std::set<FunctionIdTest::eType> function_id_items;
+ function_id_items.insert(FunctionIdTest::Function1);
+ function_id_items.insert(FunctionIdTest::Function2);
+ function_id_items.insert(FunctionIdTest::Function3);
+
+ std::set<MessageTypeTest::eType> message_type_items;
+ message_type_items.insert(MessageTypeTest::request);
+ message_type_items.insert(MessageTypeTest::response);
+ message_type_items.insert(MessageTypeTest::notification);
+ message_type_items.insert(MessageTypeTest::error_response);
+ InitFunctionSchemes(struct_schema_items, function_id_items,
+ message_type_items);
+}
+
+void CSmartFactoryTest::InitStructSchemes(
+ TStructsSchemaItems &struct_schema_items) {
+ utils::SharedPtr<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));
+ structs_schemes_.insert(
+ std::make_pair(StructIdentifiersTest::Common_1,
+ CSmartSchema(struct_schema_item_Common_1)));
+
+ utils::SharedPtr<ISchemaItem> struct_schema_item_Common_2 =
+ InitStructSchemaItem_Common_2();
+ struct_schema_items.insert(
+ std::make_pair(StructIdentifiersTest::Common_2,
+ struct_schema_item_Common_2));
+ structs_schemes_.insert(
+ std::make_pair(StructIdentifiersTest::Common_2,
+ CSmartSchema(struct_schema_item_Common_2)));
+}
+
+void CSmartFactoryTest::InitFunctionSchemes(
+ const TStructsSchemaItems &struct_schema_items,
+ const std::set<FunctionIdTest::eType> &function_id_items,
+ const std::set<MessageTypeTest::eType> &message_type_items) {
+ CObjectSchemaItem::Members params_members;
+ params_members[S_FUNCTION_ID] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<FunctionIdTest::eType>::create(function_id_items), true);
+ params_members[S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<MessageTypeTest::eType>::create(message_type_items),
+ true);
+ params_members[S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[S_CORRELATION_ID] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[kCode] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[kMessage] = CObjectSchemaItem::SMember(
+ CStringSchemaItem::create(), true);
+
+ CObjectSchemaItem::Members root_members_map;
+ root_members_map[NsSmartDeviceLink::NsJSONHandler::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(
+ SmartSchemaKey<FunctionIdTest::eType, MessageTypeTest::eType>(
+ FunctionIdTest::Function1, MessageTypeTest::error_response),
+ error_response_schema));
+ functions_schemes_.insert(
+ std::make_pair(
+ SmartSchemaKey<FunctionIdTest::eType, MessageTypeTest::eType>(
+ FunctionIdTest::Function1, MessageTypeTest::request),
+ InitFunction_Function1_request(function_id_items,
+ message_type_items)));
+ functions_schemes_.insert(
+ std::make_pair(
+ SmartSchemaKey<FunctionIdTest::eType, MessageTypeTest::eType>(
+ FunctionIdTest::Function1, MessageTypeTest::response),
+ InitFunction_Function1_response(struct_schema_items,
+ function_id_items,
+ message_type_items)));
+
+ functions_schemes_.insert(
+ std::make_pair(
+ SmartSchemaKey<FunctionIdTest::eType, MessageTypeTest::eType>(
+ FunctionIdTest::Function2, MessageTypeTest::error_response),
+ error_response_schema));
+ functions_schemes_.insert(
+ std::make_pair(
+ SmartSchemaKey<FunctionIdTest::eType, MessageTypeTest::eType>(
+ FunctionIdTest::Function2, MessageTypeTest::request),
+ InitFunction_Function2_request(function_id_items,
+ message_type_items)));
+ functions_schemes_.insert(
+ std::make_pair(
+ SmartSchemaKey<FunctionIdTest::eType, MessageTypeTest::eType>(
+ FunctionIdTest::Function2, MessageTypeTest::response),
+ InitFunction_Function2_response(struct_schema_items,
+ function_id_items,
+ message_type_items)));
+
+ functions_schemes_.insert(
+ std::make_pair(
+ SmartSchemaKey<FunctionIdTest::eType, MessageTypeTest::eType>(
+ FunctionIdTest::Function3, MessageTypeTest::error_response),
+ error_response_schema));
+ functions_schemes_.insert(
+ std::make_pair(
+ SmartSchemaKey<FunctionIdTest::eType, MessageTypeTest::eType>(
+ FunctionIdTest::Function3, MessageTypeTest::request),
+ InitFunction_Function3_request(function_id_items,
+ message_type_items)));
+ functions_schemes_.insert(
+ std::make_pair(
+ SmartSchemaKey<FunctionIdTest::eType, MessageTypeTest::eType>(
+ FunctionIdTest::Function3, MessageTypeTest::response),
+ InitFunction_Function3_response(struct_schema_items,
+ function_id_items,
+ message_type_items)));
+}
+
+CSmartSchema CSmartFactoryTest::InitFunction_Function1_request(
+ const std::set<FunctionIdTest::eType> &function_id_items,
+ const std::set<MessageTypeTest::eType> &message_type_items) {
+
+ CObjectSchemaItem::Members schema_members;
+ CObjectSchemaItem::Members params_members;
+
+ params_members[S_FUNCTION_ID] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<FunctionIdTest::eType>::create(function_id_items), true);
+ params_members[S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<MessageTypeTest::eType>::create(message_type_items),
+ true);
+ params_members[S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[S_CORRELATION_ID] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+
+ CObjectSchemaItem::Members root_members_map;
+ root_members_map[S_MSG_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(schema_members), true);
+ root_members_map[S_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(params_members), true);
+
+ return CSmartSchema(CObjectSchemaItem::create(root_members_map));
+}
+
+CSmartSchema CSmartFactoryTest::InitFunction_Function1_response(
+ const TStructsSchemaItems &struct_schema_items,
+ const std::set<FunctionIdTest::eType> &function_id_items,
+ const std::set<MessageTypeTest::eType> &message_type_items) {
+ // Function parameter available.
+ utils::SharedPtr<ISchemaItem> available_SchemaItem = CBoolSchemaItem::create(
+ TSchemaItemParameter<bool>());
+
+ CObjectSchemaItem::Members schema_members;
+
+ schema_members["available"] = CObjectSchemaItem::SMember(available_SchemaItem,
+ true);
+
+ CObjectSchemaItem::Members params_members;
+ params_members[S_FUNCTION_ID] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<FunctionIdTest::eType>::create(function_id_items), true);
+ params_members[S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<MessageTypeTest::eType>::create(message_type_items),
+ true);
+ params_members[S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[S_CORRELATION_ID] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[kCode] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+
+ CObjectSchemaItem::Members root_members_map;
+ root_members_map[S_MSG_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(schema_members), true);
+ root_members_map[S_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(params_members), true);
+
+ return CSmartSchema(CObjectSchemaItem::create(root_members_map));
+}
+
+CSmartSchema CSmartFactoryTest::InitFunction_Function2_request(
+ const std::set<FunctionIdTest::eType> &function_id_items,
+ const std::set<MessageTypeTest::eType> &message_type_items) {
+ CObjectSchemaItem::Members schema_members;
+
+ CObjectSchemaItem::Members params_members;
+ params_members[S_FUNCTION_ID] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<FunctionIdTest::eType>::create(function_id_items), true);
+ params_members[S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<MessageTypeTest::eType>::create(message_type_items),
+ true);
+ params_members[S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[S_CORRELATION_ID] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+
+ CObjectSchemaItem::Members root_members_map;
+ root_members_map[S_MSG_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(schema_members), true);
+ root_members_map[S_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(params_members), true);
+
+ return CSmartSchema(CObjectSchemaItem::create(root_members_map));
+}
+
+CSmartSchema CSmartFactoryTest::InitFunction_Function2_response(
+ const TStructsSchemaItems &struct_schema_items,
+ const std::set<FunctionIdTest::eType> &function_id_items,
+ const std::set<MessageTypeTest::eType> &message_type_items) {
+ // Function parameter available.
+ utils::SharedPtr<ISchemaItem> available_SchemaItem = CBoolSchemaItem::create(
+ TSchemaItemParameter<bool>());
+
+ CObjectSchemaItem::Members schema_members;
+
+ schema_members["available"] = CObjectSchemaItem::SMember(available_SchemaItem,
+ true);
+
+ CObjectSchemaItem::Members params_members;
+ params_members[S_FUNCTION_ID] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<FunctionIdTest::eType>::create(function_id_items), true);
+ params_members[S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<MessageTypeTest::eType>::create(message_type_items),
+ true);
+ params_members[S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[S_CORRELATION_ID] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[kCode] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+
+ CObjectSchemaItem::Members root_members_map;
+ root_members_map[S_MSG_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(schema_members), true);
+ root_members_map[S_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(params_members), true);
+
+ return CSmartSchema(CObjectSchemaItem::create(root_members_map));
+}
+
+CSmartSchema CSmartFactoryTest::InitFunction_Function3_request(
+ const std::set<FunctionIdTest::eType> &function_id_items,
+ const std::set<MessageTypeTest::eType> &message_type_items) {
+ CObjectSchemaItem::Members schema_members;
+
+ CObjectSchemaItem::Members params_members;
+ params_members[S_FUNCTION_ID] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<FunctionIdTest::eType>::create(function_id_items), true);
+ params_members[S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<MessageTypeTest::eType>::create(message_type_items),
+ true);
+ params_members[S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[S_CORRELATION_ID] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+
+ CObjectSchemaItem::Members root_members_map;
+ root_members_map[S_MSG_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(schema_members), true);
+ root_members_map[S_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(params_members), true);
+
+ return CSmartSchema(CObjectSchemaItem::create(root_members_map));
+}
+
+CSmartSchema CSmartFactoryTest::InitFunction_Function3_response(
+ const TStructsSchemaItems &struct_schema_items,
+ const std::set<FunctionIdTest::eType> &function_id_items,
+ const std::set<MessageTypeTest::eType> &message_type_items) {
+ // Function parameter available.
+ //
+ // Must be true if VR is present and ready to communicate with SDL.
+ utils::SharedPtr<ISchemaItem> available_SchemaItem = CBoolSchemaItem::create(
+ TSchemaItemParameter<bool>());
+
+ CObjectSchemaItem::Members schema_members;
+
+ schema_members["available"] = CObjectSchemaItem::SMember(available_SchemaItem,
+ true);
+
+ CObjectSchemaItem::Members params_members;
+ params_members[S_FUNCTION_ID] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<FunctionIdTest::eType>::create(function_id_items), true);
+ params_members[S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<MessageTypeTest::eType>::create(message_type_items),
+ true);
+ params_members[S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[S_CORRELATION_ID] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ params_members[kCode] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+
+ CObjectSchemaItem::Members root_members_map;
+ root_members_map[S_MSG_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(schema_members), true);
+ root_members_map[S_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(params_members), true);
+
+ return CSmartSchema(CObjectSchemaItem::create(root_members_map));
+}
+
+utils::SharedPtr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_1(
+ TStructsSchemaItems &struct_schema_items) {
+ // Struct member text.
+ //
+ // Text to display
+ utils::SharedPtr<ISchemaItem> text_SchemaItem = CStringSchemaItem::create(
+ TSchemaItemParameter<size_t>(1), TSchemaItemParameter<size_t>(500),
+ TSchemaItemParameter<std::string>());
+
+ // Struct member image.
+ //
+ // Image struct
+ utils::SharedPtr<ISchemaItem> image_SchemaItem =
+ ProvideObjectSchemaItemForStruct(struct_schema_items,
+ StructIdentifiersTest::Common_2);
+
+ // Struct member position.
+ //
+ // Position to display item
+ utils::SharedPtr<ISchemaItem> position_SchemaItem =
+ TNumberSchemaItem<int32_t>::create(TSchemaItemParameter<int32_t>(1),
+ TSchemaItemParameter<int32_t>(500),
+ TSchemaItemParameter<int32_t>());
+ CObjectSchemaItem::Members struct_members;
+ struct_members["image"] = CObjectSchemaItem::SMember(image_SchemaItem, false);
+
+ CObjectSchemaItem::Members schema_members;
+
+ schema_members["text"] = CObjectSchemaItem::SMember(text_SchemaItem, true);
+ schema_members["position"] = CObjectSchemaItem::SMember(position_SchemaItem,
+ true);
+
+ CObjectSchemaItem::Members root_members_map;
+ root_members_map[""] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(struct_members), true);
+ root_members_map[""] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(schema_members), true);
+ return CObjectSchemaItem::create(schema_members);
+}
+
+utils::SharedPtr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_2() {
+ // Struct member text.
+ //
+ // Text to display
+ utils::SharedPtr<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 =
+ TNumberSchemaItem<int32_t>::create(TSchemaItemParameter<int32_t>(1),
+ TSchemaItemParameter<int32_t>(500),
+ TSchemaItemParameter<int32_t>());
+
+ CObjectSchemaItem::Members schema_members;
+ schema_members["text"] = CObjectSchemaItem::SMember(text_SchemaItem, true);
+ schema_members["position"] = CObjectSchemaItem::SMember(position_SchemaItem,
+ true);
+
+ return CObjectSchemaItem::create(schema_members);
+}
+
+utils::SharedPtr<ISchemaItem> CSmartFactoryTest::ProvideObjectSchemaItemForStruct(
+ TStructsSchemaItems &struct_schema_items,
+ const StructIdentifiersTest::eType struct_id) {
+ const TStructsSchemaItems::const_iterator it = struct_schema_items.find(
+ struct_id);
+ if (it != struct_schema_items.end()) {
+ return it->second;
+ }
+ return NsSmartDeviceLink::NsSmartObjects::CAlwaysFalseSchemaItem::create();
+}
+
diff --git a/src/components/formatters/test/src/create_smartSchema.cc b/src/components/formatters/test/src/create_smartSchema.cc
new file mode 100644
index 000000000..9d44567dc
--- /dev/null
+++ b/src/components/formatters/test/src/create_smartSchema.cc
@@ -0,0 +1,379 @@
+/*
+ * 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 "create_smartSchema.h"
+namespace test {
+namespace components {
+namespace formatters {
+
+using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
+using namespace NsSmartDeviceLink::NsSmartObjects;
+
+template<>
+const EnumConversionHelper<FunctionIDTest::eType>::EnumToCStringMap EnumConversionHelper<
+ test::components::formatters::FunctionIDTest::eType>::enum_to_cstring_map_ =
+ EnumConversionHelper<test::components::formatters::FunctionIDTest::eType>::InitEnumToCStringMap();
+
+template<>
+const EnumConversionHelper<FunctionIDTest::eType>::CStringToEnumMap EnumConversionHelper<
+ test::components::formatters::FunctionIDTest::eType>::cstring_to_enum_map_ =
+ EnumConversionHelper<test::components::formatters::FunctionIDTest::eType>::InitCStringToEnumMap();
+
+template<>
+const char* const EnumConversionHelper<FunctionIDTest::eType>::cstring_values_[] =
+ { "RegisterAppInterface", "UnregisterAppInterface", "SetGlobalProperties" };
+
+template<>
+const FunctionIDTest::eType EnumConversionHelper<FunctionIDTest::eType>::enum_values_[] =
+ { test::components::formatters::FunctionIDTest::RegisterAppInterface,
+ test::components::formatters::FunctionIDTest::UnregisterAppInterface,
+ test::components::formatters::FunctionIDTest::SetGlobalProperties };
+
+template<>
+const EnumConversionHelper<Language::eType>::EnumToCStringMap EnumConversionHelper<
+ test::components::formatters::Language::eType>::enum_to_cstring_map_ =
+ EnumConversionHelper<test::components::formatters::Language::eType>::InitEnumToCStringMap();
+
+template<>
+const EnumConversionHelper<Language::eType>::CStringToEnumMap EnumConversionHelper<
+ test::components::formatters::Language::eType>::cstring_to_enum_map_ =
+ EnumConversionHelper<test::components::formatters::Language::eType>::InitCStringToEnumMap();
+
+template<>
+const char* const EnumConversionHelper<Language::eType>::cstring_values_[] =
+ { "EN_EU", "RU_RU"};
+
+template<>
+const Language::eType EnumConversionHelper<Language::eType>::enum_values_[] =
+ { test::components::formatters::Language::EN_EU,
+ test::components::formatters::Language::RU_RU};
+
+template<>
+const EnumConversionHelper<SpeechCapabilities::eType>::EnumToCStringMap EnumConversionHelper<
+ test::components::formatters::SpeechCapabilities::eType>::enum_to_cstring_map_ =
+ EnumConversionHelper<test::components::formatters::SpeechCapabilities::eType>::InitEnumToCStringMap();
+
+template<>
+const EnumConversionHelper<SpeechCapabilities::eType>::CStringToEnumMap EnumConversionHelper<
+ test::components::formatters::SpeechCapabilities::eType>::cstring_to_enum_map_ =
+ EnumConversionHelper<test::components::formatters::SpeechCapabilities::eType>::InitCStringToEnumMap();
+
+template<>
+const char* const EnumConversionHelper<SpeechCapabilities::eType>::cstring_values_[] =
+ { "SC_TEXT"};
+
+template<>
+const SpeechCapabilities::eType EnumConversionHelper<SpeechCapabilities::eType>::enum_values_[] =
+ { test::components::formatters::SpeechCapabilities::SC_TEXT};
+
+template<>
+const EnumConversionHelper<AppTypeTest::eType>::EnumToCStringMap EnumConversionHelper<
+ test::components::formatters::AppTypeTest::eType>::enum_to_cstring_map_ =
+ EnumConversionHelper<test::components::formatters::AppTypeTest::eType>::InitEnumToCStringMap();
+
+template<>
+const EnumConversionHelper<AppTypeTest::eType>::CStringToEnumMap EnumConversionHelper<
+ test::components::formatters::AppTypeTest::eType>::cstring_to_enum_map_ =
+ EnumConversionHelper<test::components::formatters::AppTypeTest::eType>::InitCStringToEnumMap();
+
+template<>
+const char* const EnumConversionHelper<AppTypeTest::eType>::cstring_values_[] =
+ { "SYSTEM", "MEDIA"};
+
+template<>
+const AppTypeTest::eType EnumConversionHelper<AppTypeTest::eType>::enum_values_[] =
+ { test::components::formatters::AppTypeTest::SYSTEM,
+ test::components::formatters::AppTypeTest::MEDIA,
+ };
+
+CSmartSchema initObjectSchema() {
+ std::set<TestType::eType> resultCode_allowedEnumSubsetValues;
+ resultCode_allowedEnumSubsetValues.insert(
+ TestType::APPLICATION_NOT_REGISTERED);
+ resultCode_allowedEnumSubsetValues.insert(TestType::SUCCESS);
+ resultCode_allowedEnumSubsetValues.insert(
+ TestType::TOO_MANY_PENDING_REQUESTS);
+ resultCode_allowedEnumSubsetValues.insert(TestType::REJECTED);
+ resultCode_allowedEnumSubsetValues.insert(TestType::INVALID_DATA);
+ resultCode_allowedEnumSubsetValues.insert(TestType::OUT_OF_MEMORY);
+ resultCode_allowedEnumSubsetValues.insert(TestType::ABORTED);
+ resultCode_allowedEnumSubsetValues.insert(TestType::USER_DISALLOWED);
+ resultCode_allowedEnumSubsetValues.insert(TestType::GENERIC_ERROR);
+ resultCode_allowedEnumSubsetValues.insert(TestType::DISALLOWED);
+
+ // Possible functions in this test scheme
+ std::set<FunctionIDTest::eType> functionId_allowedEnumSubsetValues;
+ functionId_allowedEnumSubsetValues.insert(
+ FunctionIDTest::RegisterAppInterface);
+ functionId_allowedEnumSubsetValues.insert(
+ FunctionIDTest::UnregisterAppInterface);
+ functionId_allowedEnumSubsetValues.insert(
+ FunctionIDTest::SetGlobalProperties);
+
+ // Possible message types
+ std::set<MessageTypeTest::eType> messageType_allowedEnumSubsetValues;
+ messageType_allowedEnumSubsetValues.insert(MessageTypeTest::request);
+ messageType_allowedEnumSubsetValues.insert(MessageTypeTest::response);
+ messageType_allowedEnumSubsetValues.insert(MessageTypeTest::notification);
+
+ // Create result item
+ ISchemaItemPtr success_SchemaItem = CBoolSchemaItem::create(
+ TSchemaItemParameter<bool>());
+ ISchemaItemPtr resultCode_SchemaItem =
+ TEnumSchemaItem<TestType::eType>::create(
+ resultCode_allowedEnumSubsetValues,
+ TSchemaItemParameter<TestType::eType>());
+
+ // Create info value with min 0 length and max 1000
+ ISchemaItemPtr info_SchemaItem = CStringSchemaItem::create(
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(1000),
+ TSchemaItemParameter<std::string>());
+
+ ISchemaItemPtr tryAgainTime_SchemaItem = TNumberSchemaItem<int>::create(
+ TSchemaItemParameter<int>(0), TSchemaItemParameter<int>(2000000000),
+ TSchemaItemParameter<int>());
+
+ // Map of parameters
+ std::map<std::string, CObjectSchemaItem::SMember> schemaMembersMap;
+
+ schemaMembersMap["success"] = CObjectSchemaItem::SMember(success_SchemaItem,
+ false);
+ schemaMembersMap["resultCode"] = CObjectSchemaItem::SMember(
+ resultCode_SchemaItem, false);
+ schemaMembersMap["info"] = CObjectSchemaItem::SMember(info_SchemaItem, false);
+ schemaMembersMap["tryAgainTime"] = CObjectSchemaItem::SMember(
+ tryAgainTime_SchemaItem, false);
+
+ std::map<std::string, CObjectSchemaItem::SMember> paramsMembersMap;
+ paramsMembersMap[S_FUNCTION_ID] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<FunctionIDTest::eType>::create(
+ functionId_allowedEnumSubsetValues),
+ true);
+ paramsMembersMap[S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<MessageTypeTest::eType>::create(
+ messageType_allowedEnumSubsetValues),
+ true);
+ paramsMembersMap[S_CORRELATION_ID] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ paramsMembersMap[S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(TSchemaItemParameter<int>(1),
+ TSchemaItemParameter<int>(2)),
+ true);
+ paramsMembersMap[S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+
+ std::map<std::string, CObjectSchemaItem::SMember> rootMembersMap;
+ rootMembersMap[S_MSG_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(schemaMembersMap), true);
+ rootMembersMap[S_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(paramsMembersMap), true);
+ return CSmartSchema(CObjectSchemaItem::create(rootMembersMap));
+};
+
+
+CSmartSchema initSchemaForMetaFormatter() {
+ std::set<TestType::eType> resultCode_allowedEnumSubsetValues;
+ resultCode_allowedEnumSubsetValues.insert(
+ TestType::APPLICATION_NOT_REGISTERED);
+ resultCode_allowedEnumSubsetValues.insert(TestType::SUCCESS);
+ resultCode_allowedEnumSubsetValues.insert(
+ TestType::TOO_MANY_PENDING_REQUESTS);
+ resultCode_allowedEnumSubsetValues.insert(TestType::REJECTED);
+ resultCode_allowedEnumSubsetValues.insert(TestType::INVALID_DATA);
+ resultCode_allowedEnumSubsetValues.insert(TestType::OUT_OF_MEMORY);
+ resultCode_allowedEnumSubsetValues.insert(TestType::ABORTED);
+ resultCode_allowedEnumSubsetValues.insert(TestType::USER_DISALLOWED);
+ resultCode_allowedEnumSubsetValues.insert(TestType::GENERIC_ERROR);
+ resultCode_allowedEnumSubsetValues.insert(TestType::DISALLOWED);
+
+ // Possible functions in this test scheme
+ std::set<FunctionIDTest::eType> functionId_allowedEnumSubsetValues;
+ functionId_allowedEnumSubsetValues.insert(
+ FunctionIDTest::RegisterAppInterface);
+ functionId_allowedEnumSubsetValues.insert(
+ FunctionIDTest::UnregisterAppInterface);
+ functionId_allowedEnumSubsetValues.insert(
+ FunctionIDTest::SetGlobalProperties);
+
+ std::set<Language::eType> languageDesired_allowedEnumSubsetValues;
+ languageDesired_allowedEnumSubsetValues.insert(Language::RU_RU);
+ languageDesired_allowedEnumSubsetValues.insert(Language::EN_EU);
+
+
+ std::set<AppTypeTest::eType> appType_allowedEnumSubsetValues;
+ appType_allowedEnumSubsetValues.insert(AppTypeTest::SYSTEM);
+ appType_allowedEnumSubsetValues.insert(AppTypeTest::MEDIA);
+
+ std::set<SpeechCapabilities::eType> speechCapabilities_allowedEnumSubsetValues;
+ speechCapabilities_allowedEnumSubsetValues.insert(SpeechCapabilities::SC_TEXT);
+
+ // Possible message types
+ std::set<MessageTypeTest::eType> messageType_allowedEnumSubsetValues;
+ messageType_allowedEnumSubsetValues.insert(MessageTypeTest::request);
+ messageType_allowedEnumSubsetValues.insert(MessageTypeTest::response);
+ messageType_allowedEnumSubsetValues.insert(MessageTypeTest::notification);
+
+ // Create param items
+ ISchemaItemPtr appID_SchemaItem = CStringSchemaItem::create(
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(1000),
+ TSchemaItemParameter<std::string>());
+ ISchemaItemPtr appName_SchemaItem = CStringSchemaItem::create(
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(1000),
+ TSchemaItemParameter<std::string>());
+ ISchemaItemPtr isMediaApplication_SchemaItem = CBoolSchemaItem::create(
+ TSchemaItemParameter<bool>());
+ ISchemaItemPtr ngnMediaScreenAppName_SchemaItem = CStringSchemaItem::create(
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(1000),
+ TSchemaItemParameter<std::string>());
+
+ ISchemaItemPtr ttsNameItem_SchemaItem = CStringSchemaItem::create(
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(1000),
+ TSchemaItemParameter<std::string>());
+
+ ISchemaItemPtr ttstype_SchemaItem =
+ TEnumSchemaItem<SpeechCapabilities::eType>::create(
+ speechCapabilities_allowedEnumSubsetValues,
+ TSchemaItemParameter<SpeechCapabilities::eType>());
+
+ std::map<std::string, CObjectSchemaItem::SMember> ttsMap;
+ ttsMap["text"]=CObjectSchemaItem::SMember(ttsNameItem_SchemaItem,
+ false);
+ ttsMap["type"]=CObjectSchemaItem::SMember(ttstype_SchemaItem,
+ false);;
+
+ ISchemaItemPtr hmiDisplayLanguageDesired_SchemaItem =
+ TEnumSchemaItem<Language::eType>::create(
+ languageDesired_allowedEnumSubsetValues,
+ TSchemaItemParameter<Language::eType>());
+
+ ISchemaItemPtr languageDesired_SchemaItem =
+ TEnumSchemaItem<Language::eType>::create(
+ languageDesired_allowedEnumSubsetValues,
+ TSchemaItemParameter<Language::eType>());
+
+ ISchemaItemPtr vrElementSchemaItem = CStringSchemaItem::create(
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(1000),
+ TSchemaItemParameter<std::string>());
+
+ ISchemaItemPtr appTypeElementSchemaItem =
+ TEnumSchemaItem<AppTypeTest::eType>::create(
+ appType_allowedEnumSubsetValues,
+ TSchemaItemParameter<AppTypeTest::eType>());
+
+ ISchemaItemPtr ttsElementSchemaItem = CObjectSchemaItem::create(ttsMap);
+
+ ISchemaItemPtr ttsName_SchemaItem =
+ CArraySchemaItem::create(ttsElementSchemaItem,
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(1000));
+
+ ISchemaItemPtr vrSynonyms_SchemaItem =
+ CArraySchemaItem::create(vrElementSchemaItem,
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(1000));
+
+ ISchemaItemPtr appType_SchemaItem =
+ CArraySchemaItem::create(appTypeElementSchemaItem,
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(1000));
+
+
+ ISchemaItemPtr majorVersion_SchemaItem = TNumberSchemaItem<int>::create();
+ ISchemaItemPtr minorVersion_SchemaItem = TNumberSchemaItem<int>::create();
+
+ ISchemaItemPtr syncMsg_SchemaItem =CStringSchemaItem::create(
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(1000),
+ TSchemaItemParameter<std::string>());
+
+ ISchemaItemPtr syncMsgVersion_SchemaItem =
+ CArraySchemaItem::create(syncMsg_SchemaItem,
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(1000));
+
+ // Creation map for syncMsgVersion
+ std::map<std::string, CObjectSchemaItem::SMember> schemaSyncMsgVersionMap;
+ schemaSyncMsgVersionMap["majorVersion"]=CObjectSchemaItem::SMember(majorVersion_SchemaItem,
+ false);
+ schemaSyncMsgVersionMap["minorVersion"]=CObjectSchemaItem::SMember(minorVersion_SchemaItem,
+ false);;
+
+ // Map of parameters
+ std::map<std::string, CObjectSchemaItem::SMember> schemaMembersMap;
+
+ schemaMembersMap["appID"] = CObjectSchemaItem::SMember(appID_SchemaItem,
+ false);
+ schemaMembersMap["appName"] = CObjectSchemaItem::SMember(appName_SchemaItem,
+ false);
+ schemaMembersMap["appType"] = CObjectSchemaItem::SMember(appType_SchemaItem,
+ false);
+ schemaMembersMap["hmiDisplayLanguageDesired"] = CObjectSchemaItem::SMember(hmiDisplayLanguageDesired_SchemaItem,
+ false);
+ schemaMembersMap["isMediaApplication"] = CObjectSchemaItem::SMember(isMediaApplication_SchemaItem,
+ false);
+ schemaMembersMap["languageDesired"] = CObjectSchemaItem::SMember(languageDesired_SchemaItem,
+ false);
+ schemaMembersMap["ngnMediaScreenAppName"] = CObjectSchemaItem::SMember(ngnMediaScreenAppName_SchemaItem,
+ false);
+ schemaMembersMap["syncMsgVersion"] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schemaSyncMsgVersionMap),
+ false);
+ schemaMembersMap["ttsName"] = CObjectSchemaItem::SMember(ttsName_SchemaItem,
+ false);
+ schemaMembersMap["vrSynonyms"] = CObjectSchemaItem::SMember(vrSynonyms_SchemaItem, false);
+
+ std::map<std::string, CObjectSchemaItem::SMember> paramsMembersMap;
+ paramsMembersMap[S_FUNCTION_ID] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<FunctionIDTest::eType>::create(
+ functionId_allowedEnumSubsetValues),
+ true);
+ paramsMembersMap[S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<MessageTypeTest::eType>::create(
+ messageType_allowedEnumSubsetValues),
+ true);
+ paramsMembersMap[S_CORRELATION_ID] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ paramsMembersMap[S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(TSchemaItemParameter<int>(1),
+ TSchemaItemParameter<int>(2)),
+ true);
+ paramsMembersMap[S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+
+ std::map<std::string, CObjectSchemaItem::SMember> rootMembersMap;
+ rootMembersMap[S_MSG_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(schemaMembersMap), true);
+ rootMembersMap[S_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(paramsMembersMap), true);
+ return CSmartSchema(CObjectSchemaItem::create(rootMembersMap));
+};
+
+
+
+} // namespace formatters
+} // namespace components
+} // namespace test
diff --git a/src/components/formatters/test/src/meta_formatter_test_helper.cc b/src/components/formatters/test/src/meta_formatter_test_helper.cc
new file mode 100644
index 000000000..3445d948b
--- /dev/null
+++ b/src/components/formatters/test/src/meta_formatter_test_helper.cc
@@ -0,0 +1,222 @@
+/*
+ * 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 "meta_formatter_test_helper.h"
+
+namespace test {
+namespace components {
+namespace formatters {
+
+using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
+
+void CMetaFormatterTestHelper::SetUp() {
+ function_id_items_.insert(FunctionIDTest::RegisterAppInterface);
+ function_id_items_.insert(FunctionIDTest::UnregisterAppInterface);
+ function_id_items_.insert(FunctionIDTest::SetGlobalProperties);
+
+ message_type_items_.insert(MessageTypeTest::request);
+ message_type_items_.insert(MessageTypeTest::response);
+ message_type_items_.insert(MessageTypeTest::notification);
+}
+
+void CMetaFormatterTestHelper::TearDown() {
+ function_id_items_.clear();
+ message_type_items_.clear();
+}
+
+//-----------------------------------------------------------
+
+void CMetaFormatterTestHelper::AnyObjectToJsonString(
+ const SmartObject& obj, std::string& result_string) {
+
+ Json::Value params(Json::objectValue);
+
+ SmartObject formattedObj(obj);
+
+ CFormatterJsonBase::objToJsonValue(formattedObj, params);
+
+ result_string = params.toStyledString();
+}
+
+//-----------------------------------------------------------
+
+void CMetaFormatterTestHelper::FillObjectIdenticalToSchema(SmartObject& obj) {
+
+ obj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ obj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::RegisterAppInterface;
+ obj[S_PARAMS][S_CORRELATION_ID] = 12;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+
+ obj[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"] = 2;
+ obj[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"] = 10;
+ obj[S_MSG_PARAMS]["appName"] = "APP NAME";
+ obj[S_MSG_PARAMS]["ttsName"][0]["text"] = "ABC";
+ obj[S_MSG_PARAMS]["ttsName"][0]["type"] = SpeechCapabilities::SC_TEXT;
+ obj[S_MSG_PARAMS]["ngnMediaScreenAppName"] = "SCREEN NAME";
+ obj[S_MSG_PARAMS]["vrSynonyms"][0] = "Synonym1";
+ obj[S_MSG_PARAMS]["vrSynonyms"][1] = "Synonym2";
+ obj[S_MSG_PARAMS]["isMediaApplication"] = true;
+ obj[S_MSG_PARAMS]["languageDesired"] = Language::EN_EU;
+ obj[S_MSG_PARAMS]["hmiDisplayLanguageDesired"] = Language::RU_RU;
+ obj[S_MSG_PARAMS]["appType"][0] = AppTypeTest::SYSTEM;
+ obj[S_MSG_PARAMS]["appType"][1] = AppTypeTest::MEDIA;
+ obj[S_MSG_PARAMS]["appID"] = "APP ID";
+}
+
+//-----------------------------------------------------------
+void CMetaFormatterTestHelper::FillObjectIdenticalToSchemaWithoutNoMandatoriesParams(
+ SmartObject& obj) {
+ obj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ obj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::RegisterAppInterface;
+ obj[S_PARAMS][S_CORRELATION_ID] = 12;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+
+ obj[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"] = 2;
+ obj[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"] = 10;
+ obj[S_MSG_PARAMS]["appName"] = "APP NAME";
+ obj[S_MSG_PARAMS]["ngnMediaScreenAppName"] = "SCREEN NAME";
+ obj[S_MSG_PARAMS]["isMediaApplication"] = true;
+ obj[S_MSG_PARAMS]["languageDesired"] = Language::EN_EU;
+ obj[S_MSG_PARAMS]["hmiDisplayLanguageDesired"] = Language::RU_RU;
+ obj[S_MSG_PARAMS]["appID"] = "APP ID";
+
+ // Commented not mandatory params for check creation object without them
+// obj[S_MSG_PARAMS]["ttsName"][0]["text"] = "ABC";
+// obj[S_MSG_PARAMS]["ttsName"][0]["type"] =
+// SpeechCapabilities::SC_TEXT;
+
+// obj[S_MSG_PARAMS]["vrSynonyms"][0] = "Synonym1";
+// obj[S_MSG_PARAMS]["vrSynonyms"][1] = "Synonym2";
+
+// obj[S_MSG_PARAMS]["appType"][0] = AppTypeTest::SYSTEM; // not mandatory
+// obj[S_MSG_PARAMS]["appType"][1] = AppTypeTest::MEDIA;
+
+}
+
+void CMetaFormatterTestHelper::FillObjectWithoutSomeMandatoryFields(
+ SmartObject& obj) {
+ obj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ obj[S_PARAMS][S_FUNCTION_ID] = FunctionIDTest::RegisterAppInterface;
+
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+
+// Commented mandatory params for check creation object without them
+// obj[S_PARAMS][S_CORRELATION_ID] = 12;
+// obj[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"] = 2;
+// obj[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"] = 10;
+
+ obj[S_MSG_PARAMS]["appName"] = "APP NAME";
+ obj[S_MSG_PARAMS]["ttsName"][0]["text"] = "ABC";
+ obj[S_MSG_PARAMS]["ttsName"][0]["type"] = SpeechCapabilities::SC_TEXT;
+ obj[S_MSG_PARAMS]["ngnMediaScreenAppName"] = "SCREEN NAME";
+ obj[S_MSG_PARAMS]["vrSynonyms"][0] = "Synonym1";
+ obj[S_MSG_PARAMS]["vrSynonyms"][1] = "Synonym2";
+ obj[S_MSG_PARAMS]["isMediaApplication"] = true;
+ obj[S_MSG_PARAMS]["languageDesired"] = Language::EN_EU;
+ obj[S_MSG_PARAMS]["hmiDisplayLanguageDesired"] = Language::RU_RU;
+ obj[S_MSG_PARAMS]["appType"][0] = AppTypeTest::SYSTEM;
+ obj[S_MSG_PARAMS]["appType"][1] = AppTypeTest::MEDIA;
+ obj[S_MSG_PARAMS]["appID"] = "APP ID";
+}
+
+//-----------------------------------------------------------
+
+void CMetaFormatterTestHelper::CompareObjects(const SmartObject& first,
+ const SmartObject& second) {
+
+ if (SmartType_Array == first.getType()) {
+ ASSERT_EQ(SmartType_Array, second.getType());
+ for (size_t i = 0; i < first.length(); i++) {
+ CompareObjects(first.getElement(i), second.getElement(i));
+ }
+ } else if (SmartType_Map == first.getType()) {
+ ASSERT_EQ(SmartType_Map, second.getType());
+ std::set < std::string > keys = first.enumerate();
+
+ for (std::set<std::string>::const_iterator key = keys.begin();
+ key != keys.end(); key++) {
+ CompareObjects(first.getElement(*key), second.getElement(*key));
+ }
+ } else if (SmartType_Boolean == first.getType()) {
+ ASSERT_EQ(first.asBool(), second.asBool());
+ } else if (SmartType_Integer == first.getType()) {
+ ASSERT_EQ(first.asInt(), second.asInt());
+ } else if (SmartType_Double == first.getType()) {
+ ASSERT_EQ(first.asDouble(), second.asDouble());
+ } else if (SmartType_String == first.getType()) {
+ ASSERT_EQ(first.asString(), second.asString());
+ } else if (SmartType_Null == first.getType()) {
+ ASSERT_EQ(SmartType_Null, second.getType());
+ } else {
+ FAIL()<< "Unknown SmartObject type: " << first.getType();
+ }
+}
+
+//-----------------------------------------------------------
+
+void CMetaFormatterTestHelper::FillObjectWithDefaultValues(SmartObject& obj) {
+
+ obj[S_PARAMS][S_MESSAGE_TYPE] = -1;
+ obj[S_PARAMS][S_FUNCTION_ID] = -1;
+ obj[S_PARAMS][S_CORRELATION_ID] = 0;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 0;
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+
+ obj[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"] = 0;
+ obj[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"] = 0;
+ obj[S_MSG_PARAMS]["appName"] = "";
+ obj[S_MSG_PARAMS]["ngnMediaScreenAppName"] = "";
+ obj[S_MSG_PARAMS]["isMediaApplication"] = false;
+ obj[S_MSG_PARAMS]["languageDesired"] = -1;
+ obj[S_MSG_PARAMS]["hmiDisplayLanguageDesired"] = -1;
+ obj[S_MSG_PARAMS]["appID"] = "";
+
+// Commented params for check creation object with only default values
+// obj[S_MSG_PARAMS]["ttsName"][0]["text"] = "ABC";
+// obj[S_MSG_PARAMS]["ttsName"][0]["type"] =
+// SpeechCapabilities::SC_TEXT;
+
+// obj[S_MSG_PARAMS]["vrSynonyms"][0] = "Synonym1";
+// obj[S_MSG_PARAMS]["vrSynonyms"][1] = "Synonym2";
+
+// obj[S_MSG_PARAMS]["appType"][0] = AppTypeTest::SYSTEM;
+// obj[S_MSG_PARAMS]["appType"][1] = AppTypeTest::MEDIA;
+
+}
+
+} // namespace formatters
+} // namespace components
+} // namespace test
diff --git a/src/components/hmi_message_handler/CMakeLists.txt b/src/components/hmi_message_handler/CMakeLists.txt
index f280f9766..9559b6b00 100644
--- a/src/components/hmi_message_handler/CMakeLists.txt
+++ b/src/components/hmi_message_handler/CMakeLists.txt
@@ -1,20 +1,50 @@
+# 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_directories (
- ./include/
- ../application_manager/include/
- ../utils/include/
- ../smart_objects/include/
- ../formatters/include/
- ../config_profile/include/
- ../media_manager/include/
- ../protocol_handler/include
- ${JSONCPP_INCLUDE_DIRECTORY}
- ${MESSAGE_BROKER_INCLUDE_DIRECTORY}
- ../config_profile/include
- ${CMAKE_SOURCE_DIR}/src/components/
- ${CMAKE_BINARY_DIR}/src/components/
- ${CMAKE_SOURCE_DIR}/src/components/dbus/include/
- ${CMAKE_SOURCE_DIR}/
- ${LOG4CXX_INCLUDE_DIRECTORY}
+ include/
+ ${COMPONENTS_DIR}/application_manager/include/
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/smart_objects/include/
+ ${COMPONENTS_DIR}/formatters/include/
+ ${COMPONENTS_DIR}/config_profile/include/
+ ${COMPONENTS_DIR}/media_manager/include/
+ ${COMPONENTS_DIR}/protocol_handler/include
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${MESSAGE_BROKER_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}
+ ${CMAKE_BINARY_DIR}/src/components/
+ ${COMPONENTS_DIR}/dbus/include/
+ ${CMAKE_SOURCE_DIR}/
+ ${LOG4CXX_INCLUDE_DIRECTORY}
)
IF (HMIADAPTER STREQUAL "dbus")
@@ -23,22 +53,29 @@ IF (HMIADAPTER STREQUAL "dbus")
ENDIF ()
set (SOURCES
- ./src/hmi_message_handler_impl.cc
- ./src/messagebroker_adapter.cc
- ./src/hmi_message_adapter.cc
- ./src/mqueue_adapter.cc
+ ${COMPONENTS_DIR}/hmi_message_handler/src/hmi_message_handler_impl.cc
+ ${COMPONENTS_DIR}/hmi_message_handler/src/messagebroker_adapter.cc
+ ${COMPONENTS_DIR}/hmi_message_handler/src/hmi_message_adapter.cc
+ ${COMPONENTS_DIR}/hmi_message_handler/src/mqueue_adapter.cc
${DBUS_SOURCE}
)
-set (LIBRARIES
- Utils
- ${DBUS_ADAPTER}
- ${RTLIB}
+set(LIBRARIES
+ Utils
+ ${DBUS_ADAPTER}
+ ${RTLIB}
)
add_library("HMIMessageHandler" ${SOURCES})
target_link_libraries("HMIMessageHandler" ${LIBRARIES})
if(ENABLE_LOG)
- target_link_libraries("HMIMessageHandler" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+ target_link_libraries("HMIMessageHandler" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
+
+# Tests temporary are inactivated. For details please check
+# Readme.txt in test directory of hmi_message_handler
+
+#if(BUILD_TESTS)
+# add_subdirectory(test)
+#endif()
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter.h
index dc515318a..5ed37031e 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler.h
index 828ae9a00..3e06c6508 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
index 071ce2c54..d638f370d 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_observer.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_observer.h
index f77a1f6a5..f2f84b13e 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_observer.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_observer.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_sender.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_sender.h
index 271285730..d704a4df6 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_sender.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_sender.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
index df344c80f..4580b18ee 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/mqueue_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/mqueue_adapter.h
index 9d78fefc6..126ea3a66 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/mqueue_adapter.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/mqueue_adapter.h
@@ -1,34 +1,34 @@
/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MQUEUE_ADAPTER_H_
#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MQUEUE_ADAPTER_H_
@@ -40,6 +40,8 @@
namespace hmi_message_handler {
+class ReceiverThreadDelegate;
+
/**
* \brief HMI message adapter for mqueue
*/
@@ -55,9 +57,10 @@ class MqueueAdapter : public HMIMessageAdapter {
private:
mqd_t sdl_to_hmi_mqueue_;
mqd_t hmi_to_sdl_mqueue_;
+
+ ReceiverThreadDelegate* receiver_thread_delegate_;
threads::Thread* receiver_thread_;
};
} // namespace hmi_message_handler
-
#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MQUEUE_ADAPTER_H_
diff --git a/src/components/hmi_message_handler/src/dbus_message_adapter.cc b/src/components/hmi_message_handler/src/dbus_message_adapter.cc
index a79674df6..7c540ad0c 100644
--- a/src/components/hmi_message_handler/src/dbus_message_adapter.cc
+++ b/src/components/hmi_message_handler/src/dbus_message_adapter.cc
@@ -86,7 +86,7 @@ void DBusMessageAdapter::SendMessageToHMI(MessageSharedPointer message) {
break;
case hmi_apis::messageType::INVALID_ENUM:
default:
- LOG4CXX_INFO(logger_, "Message type is invalid");
+ LOG4CXX_WARN(logger_, "Message type is invalid");
}
}
@@ -119,6 +119,7 @@ void DBusMessageAdapter::SubscribeTo() {
DBusMessageController::SubscribeTo("BasicCommunication", "OnSystemRequest");
DBusMessageController::SubscribeTo("BasicCommunication", "OnSystemInfoChanged");
DBusMessageController::SubscribeTo("BasicCommunication", "OnPhoneCall");
+ DBusMessageController::SubscribeTo("BasicCommunication", "OnEmergencyEvent");
DBusMessageController::SubscribeTo("TTS", "Started");
DBusMessageController::SubscribeTo("TTS", "Stopped");
DBusMessageController::SubscribeTo("TTS", "OnLanguageChange");
@@ -156,7 +157,7 @@ void DBusMessageAdapter::SubscribeTo() {
}
void DBusMessageAdapter::SendMessageToCore(const smart_objects::SmartObject& obj) {
- LOG4CXX_INFO(logger_, "DBusMessageAdapter::SendMessageToCore");
+ LOG4CXX_AUTO_TRACE(logger_);
if (!handler()) {
LOG4CXX_WARN(logger_, "DBusMessageAdapter hasn't handler");
diff --git a/src/components/hmi_message_handler/src/hmi_message_adapter.cc b/src/components/hmi_message_handler/src/hmi_message_adapter.cc
index 343f13f00..d8c280bea 100644
--- a/src/components/hmi_message_handler/src/hmi_message_adapter.cc
+++ b/src/components/hmi_message_handler/src/hmi_message_adapter.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc b/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc
index ed37ee677..887d14561 100644
--- a/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc
+++ b/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
index 8779d2ea6..654fe747a 100644
--- a/src/components/hmi_message_handler/src/messagebroker_adapter.cc
+++ b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -74,17 +74,17 @@ void MessageBrokerAdapter::SendMessageToHMI(
void MessageBrokerAdapter::processResponse(std::string method,
Json::Value& root) {
- LOG4CXX_INFO(logger_, "MessageBrokerAdapter::processResponse");
+ LOG4CXX_AUTO_TRACE(logger_);
ProcessRecievedFromMB(root);
}
void MessageBrokerAdapter::processRequest(Json::Value& root) {
- LOG4CXX_INFO(logger_, "MessageBrokerAdapter::processRequest");
+ LOG4CXX_AUTO_TRACE(logger_);
ProcessRecievedFromMB(root);
}
void MessageBrokerAdapter::processNotification(Json::Value& root) {
- LOG4CXX_INFO(logger_, "MessageBrokerAdapter::processNotification");
+ LOG4CXX_AUTO_TRACE(logger_);
ProcessRecievedFromMB(root);
}
@@ -112,6 +112,7 @@ void MessageBrokerAdapter::SubscribeTo() {
MessageBrokerController::subscribeTo("BasicCommunication.OnExitAllApplications");
MessageBrokerController::subscribeTo("BasicCommunication.OnDeviceChosen");
MessageBrokerController::subscribeTo("BasicCommunication.OnPhoneCall");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnEmergencyEvent");
MessageBrokerController::subscribeTo("UI.OnLanguageChange");
MessageBrokerController::subscribeTo("VR.OnLanguageChange");
MessageBrokerController::subscribeTo("TTS.OnLanguageChange");
@@ -137,13 +138,15 @@ void MessageBrokerAdapter::SubscribeTo() {
void* MessageBrokerAdapter::SubscribeAndBeginReceiverThread(void* param) {
PassToThread(threads::Thread::CurrentId());
+ // For PASA we don't need to subscribe and register controller
+ // this will prevent from errors on start up
registerController();
SubscribeTo();
return MethodForReceiverThread(param);
}
void MessageBrokerAdapter::ProcessRecievedFromMB(Json::Value& root) {
- LOG4CXX_INFO(logger_, "MessageBrokerAdapter::ProcessRecievedFromMB");
+ LOG4CXX_AUTO_TRACE(logger_);
if (root.isNull()) {
// LOG
return;
@@ -166,7 +169,7 @@ void MessageBrokerAdapter::ProcessRecievedFromMB(Json::Value& root) {
message->set_protocol_version(application_manager::ProtocolVersion::kHMI);
if (!handler()) {
- // WARNING
+ LOG4CXX_WARN(logger_, "handler is NULL");
return;
}
diff --git a/src/components/hmi_message_handler/src/mqueue_adapter.cc b/src/components/hmi_message_handler/src/mqueue_adapter.cc
index b1524b5f0..825c27c04 100644
--- a/src/components/hmi_message_handler/src/mqueue_adapter.cc
+++ b/src/components/hmi_message_handler/src/mqueue_adapter.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 "hmi_message_handler/mqueue_adapter.h"
#include "hmi_message_handler/hmi_message_handler.h"
@@ -61,7 +61,7 @@ class ReceiverThreadDelegate : public threads::ThreadDelegate {
continue;
}
const std::string message_string(buffer, buffer + size);
- LOG4CXX_INFO(logger_, "Message: " << message_string);
+ LOG4CXX_DEBUG(logger_, "Message: " << message_string);
MessageSharedPointer message(new application_manager::Message(
protocol_handler::MessagePriority::kDefault));
message->set_json_message(message_string);
@@ -78,7 +78,7 @@ MqueueAdapter::MqueueAdapter(HMIMessageHandler* hmi_message_handler)
: HMIMessageAdapter(hmi_message_handler),
sdl_to_hmi_mqueue_(-1),
hmi_to_sdl_mqueue_(-1),
- receiver_thread_() {
+ receiver_thread_(NULL) {
mq_attr mq_attributes;
mq_attributes.mq_maxmsg = kMqueueSize;
mq_attributes.mq_msgsize = kMqueueMessageSize;
@@ -96,18 +96,17 @@ MqueueAdapter::MqueueAdapter(HMIMessageHandler* hmi_message_handler)
<< kHmiToSdlQueue << ", error " << errno);
return;
}
- ReceiverThreadDelegate* receiver_thread_delegate =
- new ReceiverThreadDelegate(hmi_to_sdl_mqueue_, hmi_message_handler);
- receiver_thread_ =
- threads::CreateThread("MqueueAdapter", receiver_thread_delegate);
+ receiver_thread_delegate_ = new ReceiverThreadDelegate(hmi_to_sdl_mqueue_,
+ hmi_message_handler);
+ receiver_thread_ = threads::CreateThread("MqueueAdapter",
+ receiver_thread_delegate_);
receiver_thread_->start();
}
MqueueAdapter::~MqueueAdapter() {
- if (receiver_thread_) {
- receiver_thread_->stop();
- threads::DeleteThread(receiver_thread_);
- }
+ receiver_thread_->join();
+ delete receiver_thread_delegate_;
+ threads::DeleteThread(receiver_thread_);
if (-1 != hmi_to_sdl_mqueue_) mq_close(hmi_to_sdl_mqueue_);
if (-1 != sdl_to_hmi_mqueue_) mq_close(sdl_to_hmi_mqueue_);
mq_unlink(kHmiToSdlQueue);
@@ -115,7 +114,7 @@ MqueueAdapter::~MqueueAdapter() {
}
void MqueueAdapter::SendMessageToHMI(const MessageSharedPointer message) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
if (-1 == sdl_to_hmi_mqueue_) {
LOG4CXX_ERROR(logger_, "Message queue is not opened");
@@ -131,8 +130,6 @@ void MqueueAdapter::SendMessageToHMI(const MessageSharedPointer message) {
LOG4CXX_ERROR(logger_, "Could not send message, error " << errno);
return;
}
-
- LOG4CXX_TRACE_EXIT(logger_);
}
void MqueueAdapter::SubscribeTo() {
diff --git a/src/components/hmi_message_handler/test/CMakeLists.txt b/src/components/hmi_message_handler/test/CMakeLists.txt
new file mode 100644
index 000000000..4a97e299f
--- /dev/null
+++ b/src/components/hmi_message_handler/test/CMakeLists.txt
@@ -0,0 +1,56 @@
+# 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.
+
+if(BUILD_TESTS)
+
+include_directories (
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/hmi_message_handler/include
+)
+
+set(LIBRARIES
+ gmock
+ ApplicationManager
+ HMIMessageHandler
+)
+
+set(SOURCES
+ ${COMPONENTS_DIR}/hmi_message_handler/test/mqueue_adapter_test.cc
+)
+
+if(${QT_HMI})
+ list (APPEND SOURCES
+ ${COMPONENTS_DIR}/hmi_message_handler/test/mock_subscriber.cc
+ ${COMPONENTS_DIR}/hmi_message_handler/test/dbus_message_adapter_test.cc
+ )
+endif()
+create_test("hmi_message_handler_test" "${SOURCES}" "${LIBRARIES}")
+
+endif()
diff --git a/src/components/hmi_message_handler/test/Readme.txt b/src/components/hmi_message_handler/test/Readme.txt
new file mode 100644
index 000000000..4dcd565d9
--- /dev/null
+++ b/src/components/hmi_message_handler/test/Readme.txt
@@ -0,0 +1,11 @@
+28.11.2014 Andriy Byzhynar
+
+1) Tests for mqueue_adapter failed as mqueue transport still not used.
+2) Tests are not actual at the moment until PASA moves to use mqueue transport.
+3) To activate tests - just uncomment following lines in CMakeLists.txt of hmi_message_handler :
+
+ - #if(BUILD_TESTS)
+ - # add_subdirectory(test)
+ - #endif()
+
+ They are located at the end of file.
diff --git a/src/components/hmi_message_handler/test/dbus_message_adapter_test.cc b/src/components/hmi_message_handler/test/dbus_message_adapter_test.cc
new file mode 100644
index 000000000..6699f788d
--- /dev/null
+++ b/src/components/hmi_message_handler/test/dbus_message_adapter_test.cc
@@ -0,0 +1,67 @@
+/**
+* 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 <pthread.h>
+#include "hmi_message_handler/dbus_message_adapter.h"
+#include "dbus/dbus_message_controller.h"
+
+namespace Json {
+class Value;
+}
+
+class MockDBusMessageController :
+ public ::dbus::DBusMessageController {
+ public:
+ MockDBusMessageController(const std::string& serviceName,
+ const std::string& path,
+ const std::string& hmiserviceName,
+ const std::string& hmipath)
+ : DBusMessageController(serviceName, path, hmiserviceName,hmipath),
+ 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 ::dbus::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;
+ }
+};
diff --git a/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_dbus_message_controller.h b/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_dbus_message_controller.h
new file mode 100644
index 000000000..7512f2ab1
--- /dev/null
+++ b/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_dbus_message_controller.h
@@ -0,0 +1,68 @@
+/*
+* 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 TEST_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_DBUS_MESSAGE_CONTROLLER_H_
+#define TEST_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_DBUS_MESSAGE_CONTROLLER_H_
+
+#include <pthread.h>
+#include "hmi_message_handler/dbus_message_controller.h"
+
+class MockDBusMessageController :
+ public ::hmi_message_handler::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;
+ }
+};
+
+
+#endif // TEST_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_DBUS_MESSAGE_CONTROLLER_H_
diff --git a/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_subscriber.h b/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_subscriber.h
new file mode 100644
index 000000000..62ccafb19
--- /dev/null
+++ b/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_subscriber.h
@@ -0,0 +1,62 @@
+/*
+* 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 TEST_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_SUBSCRIBER_H_
+#define TEST_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_SUBSCRIBER_H_
+
+#include <string>
+
+struct DBusConnection;
+
+namespace test {
+namespace components {
+namespace hmi_message_handler {
+
+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 hmi_message_handler
+} // namespace components
+} // namespace test
+
+#endif // TEST_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_SUBSCRIBER_H_
diff --git a/src/components/hmi_message_handler/test/include/mock_subscriber.h b/src/components/hmi_message_handler/test/include/mock_subscriber.h
new file mode 100644
index 000000000..27e7cad1b
--- /dev/null
+++ b/src/components/hmi_message_handler/test/include/mock_subscriber.h
@@ -0,0 +1,62 @@
+/*
+* 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_HMI_MESSAGE_HANDLER_TEST_INCLUDE_MOCK_SUBSCRIBER_H_
+#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_MOCK_SUBSCRIBER_H_
+
+#include <string>
+
+struct DBusConnection;
+
+namespace test {
+namespace components {
+namespace hmi_message_handler {
+
+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 hmi_message_handler
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_MOCK_SUBSCRIBER_H_
diff --git a/src/components/hmi_message_handler/test/mock_subscriber.cc b/src/components/hmi_message_handler/test/mock_subscriber.cc
new file mode 100644
index 000000000..3f1235bea
--- /dev/null
+++ b/src/components/hmi_message_handler/test/mock_subscriber.cc
@@ -0,0 +1,81 @@
+/**
+* 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 "include/mock_subscriber.h"
+
+
+namespace test {
+namespace components {
+namespace hmi_message_handler {
+
+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;
+ //int ret;
+ 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) {
+ // int a = message.length();
+}
+
+} // namespace hmi_message_handler
+} // namespace components
+} // namespace test
diff --git a/src/components/hmi_message_handler/test/mqueue_adapter_test.cc b/src/components/hmi_message_handler/test/mqueue_adapter_test.cc
new file mode 100644
index 000000000..87fb3a353
--- /dev/null
+++ b/src/components/hmi_message_handler/test/mqueue_adapter_test.cc
@@ -0,0 +1,94 @@
+/*
+ * 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 <gmock/gmock.h>
+
+#include "hmi_message_handler/hmi_message_handler.h"
+#include "hmi_message_handler/mqueue_adapter.h"
+
+using hmi_message_handler::MessageSharedPointer;
+using hmi_message_handler::HMIMessageHandler;
+using hmi_message_handler::HMIMessageAdapter;
+using hmi_message_handler::MqueueAdapter;
+using application_manager::Message;
+
+class MockHandler : public HMIMessageHandler {
+ public:
+ MOCK_METHOD1(OnMessageReceived, void(MessageSharedPointer message));
+ MOCK_METHOD1(AddHMIMessageAdapter, void(HMIMessageAdapter* adapter));
+ MOCK_METHOD1(RemoveHMIMessageAdapter, void(HMIMessageAdapter* adapter));
+ MOCK_METHOD1(OnErrorSending, void(MessageSharedPointer message));
+ MOCK_METHOD1(SendMessageToHMI, void(MessageSharedPointer message));
+};
+
+//TODO{ALeshin}: APPLINK-10846
+//TEST(MqueueAdapter, Send) {
+// MockHandler handler;
+// HMIMessageAdapter* adapter = new MqueueAdapter(&handler);
+
+// MessageSharedPointer message(
+// new Message(protocol_handler::MessagePriority::kDefault));
+// message->set_json_message("{}");
+// adapter->SendMessageToHMI(message);
+
+// mqd_t mqd = mq_open("/sdl_to_hmi", O_RDONLY);
+// ASSERT_NE(-1, mqd);
+// static char buf[65536];
+// ssize_t sz = mq_receive(mqd, buf, 65536, NULL);
+// ASSERT_EQ(2, sz);
+// EXPECT_STREQ("{}", buf);
+
+// delete adapter;
+//}
+
+//TODO{ALeshin}: APPLINK-10846
+//TEST(MqueueAdapter, Receive) {
+// MockHandler handler;
+// HMIMessageAdapter* adapter = new MqueueAdapter(&handler);
+
+// using ::testing::Property;
+// using ::testing::Pointee;
+// EXPECT_CALL(
+// handler,
+// OnMessageReceived(Property(
+// &MessageSharedPointer::get,
+// Pointee(Property(&Message::json_message, std::string("()"))))));
+
+// mqd_t mqd = mq_open("/hmi_to_sdl", O_WRONLY);
+// ASSERT_NE(-1, mqd);
+// const char buf[] = "()";
+// int rc = mq_send(mqd, buf, sizeof(buf) - 1, 0);
+// ASSERT_EQ(0, rc);
+
+// delete adapter;
+//}
diff --git a/src/components/include/protocol/common.h b/src/components/include/protocol/common.h
index f9fdd08fa..91bc53652 100644
--- a/src/components/include/protocol/common.h
+++ b/src/components/include/protocol/common.h
@@ -57,6 +57,7 @@ const uint8_t PROTOCOL_HEADER_V2_SIZE = 12;
* First 4-bit field of AppLink protocol packet
*/
enum {
+
/**
*\brief Constant: number of protocol version (1).
*/
@@ -71,10 +72,18 @@ enum {
*\brief Constant: number of protocol version (3).
* Has no difference with v.2 in Mobile_API.xml and frame Header difference
* Support SSL with Encryption, Video and Audio services
- * Suuport ControlFrame, End Service to/from mobile support, HeartBeat future
+ * Support ControlFrame, End Service to/from mobile support, HeartBeat feature
*/
PROTOCOL_VERSION_3 = 0x03,
/**
+ *@brief Constant: number of protocol version (4).
+ * This protocol is compatibility with version 3
+ * Support SSL with Encryption, Video and Audio services
+ * Support ControlFrame, End Service to/from mobile support, HeartBeat feature,
+ * SDL4.0 feature.
+ */
+ PROTOCOL_VERSION_4 = 0x04,
+ /**
*\brief Maximum value of packet version field (size 4-bit) specified AppLink Protocol v.7
*/
PROTOCOL_VERSION_MAX = 0x0F
@@ -186,10 +195,11 @@ enum {
};
/**
- *\brief If FRAME_TYPE_CONTROL: Constant: Maximum size of one frame excluding
- *\brief frame header (used Ethernet MTU as default target transport)
+ *\brief If FRAME_TYPE_CONTROL: Constant: Default maximum size of one frame
+ *\brief excluding frame header for protocol version 2
+ *\brief (used Ethernet MTU as default target transport)
*/
-const uint32_t MAXIMUM_FRAME_DATA_SIZE = 1500;
+const size_t MAXIMUM_FRAME_DATA_V2_SIZE = 1488;
/**
*\brief If FRAME_TYPE_CONSECUTIVE: Constant: Size of first frame in
@@ -216,9 +226,10 @@ enum RESULT_CODE {
RESULT_REASSIGN = 12,
RESULT_XML_PARSING = 13,
RESULT_RESEND_ACK = 14,
- RESULT_DEFRERRED = 15,
+ RESULT_DEFERRED = 15,
RESULT_ENCRYPTION_FAILED = 16,
RESULT_HEARTBEAT_IS_NOT_SUPPORTED = 17,
+ RESULT_MALFORMED_OCCURS = 18,
RESULT_UNKNOWN = 255
};
} // namespace protocol_handler
diff --git a/src/components/include/protocol/raw_message.h b/src/components/include/protocol/raw_message.h
index 09b5eafb7..f9a035e17 100644
--- a/src/components/include/protocol/raw_message.h
+++ b/src/components/include/protocol/raw_message.h
@@ -78,7 +78,7 @@ class RawMessage {
/**
* \brief Getter for message size
*/
- size_t data_size() const;
+ size_t data_size() const;
/**
* \brief Getter for actual data size
*/
diff --git a/src/components/include/protocol/service_type.h b/src/components/include/protocol/service_type.h
index ab049be9b..b5870e0af 100644
--- a/src/components/include/protocol/service_type.h
+++ b/src/components/include/protocol/service_type.h
@@ -61,7 +61,6 @@ const uint8_t SERVICE_TYPE_NAVI = 0x0B;
*/
const uint8_t SERVICE_TYPE_BULK = 0x0F;
-
/**
* \brief Enum describing possible types of sessions: RPC for API messages,
Navi for video streaming, bulk for PutFile.
@@ -83,5 +82,4 @@ ServiceType ServiceTypeFromByte(uint8_t type);
uint8_t ServiceTypeToByte(ServiceType type);
} // namespace protocol_handler
-
#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_SERVICE_TYPE_H_
diff --git a/src/components/include/protocol_handler/protocol_handler.h b/src/components/include/protocol_handler/protocol_handler.h
index e0d4fde8c..9bb77ae48 100644
--- a/src/components/include/protocol_handler/protocol_handler.h
+++ b/src/components/include/protocol_handler/protocol_handler.h
@@ -97,6 +97,10 @@ class ProtocolHandler {
*/
virtual void SendEndSession(int32_t connection_id, uint8_t session_id) = 0;
+ virtual void SendEndService(int32_t connection_id,
+ uint8_t session_id,
+ uint8_t service_type) = 0;
+
protected:
/**
* \brief Destructor
diff --git a/src/components/include/protocol_handler/session_observer.h b/src/components/include/protocol_handler/session_observer.h
index 9a958f6fa..355c62e64 100644
--- a/src/components/include/protocol_handler/session_observer.h
+++ b/src/components/include/protocol_handler/session_observer.h
@@ -96,6 +96,20 @@ class SessionObserver {
const protocol_handler::ServiceType &service_type) = 0;
/**
+ * \brief Callback function used by ProtocolHandler
+ * when Mobile Application start message flood
+ * \param connection_key used by other components as application identifier
+ */
+ virtual void OnApplicationFloodCallBack(const uint32_t &connection_key) = 0;
+
+ /**
+ * \brief Callback function used by ProtocolHandler
+ * when Mobile Application sends malformed message
+ * \param connection_key used by other components as application identifier
+ */
+ virtual void OnMalformedMessageCallback(const uint32_t &connection_key) = 0;
+
+ /**
* \brief Creates unique identifier of session (can be used as hash)
* from given connection identifier
* within which session exists and session number.
@@ -157,6 +171,17 @@ class SessionObserver {
transport_manager::ConnectionUID connection_handle,
uint8_t session_id) = 0;
+ /**
+ * @brief returns protocol version which application supports
+ * @param connection_id id of connection
+ * @param session_id id of session
+ * @param method writes value protocol version to protocol_version
+ * @return TRUE if session and connection exist otherwise returns FALSE
+ */
+ virtual bool ProtocolVersionUsed(uint32_t connection_id,
+ uint8_t session_id, uint8_t& protocol_version) = 0;
+
+
#ifdef ENABLE_SECURITY
/**
* \brief Sets crypto context of connection
diff --git a/src/components/include/security_manager/crypto_manager.h b/src/components/include/security_manager/crypto_manager.h
index 87cfc1397..00c3833e6 100644
--- a/src/components/include/security_manager/crypto_manager.h
+++ b/src/components/include/security_manager/crypto_manager.h
@@ -50,7 +50,7 @@ namespace security_manager {
class SSLContext;
enum Mode { CLIENT, SERVER };
-enum Protocol { SSLv3, TLSv1, TLSv1_1, TLSv1_2 };
+enum Protocol { SSLv3, TLSv1, TLSv1_1, TLSv1_2};
class CryptoManager {
public:
diff --git a/src/components/include/transport_manager/transport_adapter/device.h b/src/components/include/transport_manager/transport_adapter/device.h
index 78d3b4495..e7bca5a46 100644
--- a/src/components/include/transport_manager/transport_adapter/device.h
+++ b/src/components/include/transport_manager/transport_adapter/device.h
@@ -76,6 +76,8 @@ class Device {
virtual ApplicationList GetApplicationList() const = 0;
+ virtual void Stop() { }
+
inline const DeviceUID& unique_device_id() const {
return unique_device_id_;
}
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 2edf17311..9a820f4cf 100644
--- a/src/components/include/transport_manager/transport_adapter/transport_adapter.h
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file transport_adapter.h
* \brief TransportAdapter class header file.
*
@@ -57,7 +57,20 @@ namespace transport_adapter {
class TransportAdapterListener;
// TODO(EZamakhov): cahnge to DeviceUID
-typedef std::string DeviceType;
+//typedef std::string DeviceType;
+
+enum DeviceType {
+ AOA,
+ PASA_AOA,
+ BLUETOOTH,
+ PASA_BLUETOOTH,
+ MME,
+ TCP,
+ UNKNOWN
+};
+
+typedef std::map<DeviceType, std::string> DeviceTypes;
+
/**
* @brief Type definition of container(map) that holds device unique
*identifier(key value) and smart pointer to the device(mapped value).
@@ -123,6 +136,12 @@ class TransportAdapter {
virtual Error Init() = 0;
/**
+ * @brief Stops device adapter
+ * Called from transport manager to stop device adapter
+ */
+ virtual void Terminate() = 0;
+
+ /**
* @brief Add listener to the container(list) of device adapter listeners.
*
* @param listener Pointer to the device adapter listener.
diff --git a/src/components/include/transport_manager/transport_manager.h b/src/components/include/transport_manager/transport_manager.h
index 40790ac0a..25745e748 100644
--- a/src/components/include/transport_manager/transport_manager.h
+++ b/src/components/include/transport_manager/transport_manager.h
@@ -59,6 +59,12 @@ class TransportManager {
virtual int Init() = 0;
/**
+ * @brief Reinitializes transport manager
+ * @return Error code
+ */
+ virtual int Reinit() = 0;
+
+ /**
* @brief Start scanning for new devices.
*
* @return Code error.
diff --git a/src/components/include/transport_manager/transport_manager_listener.h b/src/components/include/transport_manager/transport_manager_listener.h
index 5033a95d1..0684e8f22 100644
--- a/src/components/include/transport_manager/transport_manager_listener.h
+++ b/src/components/include/transport_manager/transport_manager_listener.h
@@ -143,7 +143,7 @@ class TransportManagerListener {
/**
* @brief Notifies about recieving message from TM.
*
- * @param message Recieved message
+ * @param message Received message
**/
virtual void OnTMMessageReceived(const ::protocol_handler::RawMessagePtr message) = 0;
diff --git a/src/components/include/utils/atomic.h b/src/components/include/utils/atomic.h
index bfbcff9dc..f80455b74 100644
--- a/src/components/include/utils/atomic.h
+++ b/src/components/include/utils/atomic.h
@@ -28,15 +28,15 @@
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
-*/
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_H_
#ifdef __QNXNTO__
#include <atomic.h>
#endif
-#ifndef SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_H_
-#define SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_H_
-
#if defined(__QNXNTO__)
#define atomic_post_inc(ptr) atomic_add_value((ptr), 1)
#elif defined(__GNUG__)
diff --git a/src/components/include/utils/conditional_variable.h b/src/components/include/utils/conditional_variable.h
index 58119a0cf..1f0a7e62d 100644
--- a/src/components/include/utils/conditional_variable.h
+++ b/src/components/include/utils/conditional_variable.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -43,6 +43,7 @@
namespace sync_primitives {
class AutoLock;
+class Lock;
namespace impl {
#if defined(OS_POSIX)
@@ -80,7 +81,8 @@ class ConditionalVariable {
void Broadcast();
// Wait forever or up to milliseconds time limit
- void Wait(AutoLock& auto_lock);
+ bool Wait(AutoLock& auto_lock);
+ bool Wait(Lock& lock);
WaitStatus WaitFor(AutoLock& auto_lock, int32_t milliseconds);
private:
impl::PlatformConditionalVariable cond_var_;
diff --git a/src/components/include/utils/data_accessor.h b/src/components/include/utils/data_accessor.h
index f5e99797b..344d6e34a 100644
--- a/src/components/include/utils/data_accessor.h
+++ b/src/components/include/utils/data_accessor.h
@@ -33,40 +33,42 @@
#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
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_(0) {
- lock_.Acquire();
+ : data_(data),
+ lock_(const_cast<sync_primitives::Lock&>(lock)),
+ counter_( new uint32_t(0)) {
+ lock_.Acquire();
}
- template<class O> DataAccessor(const DataAccessor<O>& other)
- : data_(other.data_)
- , lock_(other.lock_)
- , counter_(other.counter_) {
- ++counter_;
+
+ DataAccessor(const DataAccessor<T>& other)
+ : data_(other.data_),
+ lock_(other.lock_),
+ counter_(other.counter_) {
+ ++(*counter_);
}
+
~DataAccessor() {
- if (counter_ > 0) {
- --counter_;
- }
- if (0 == counter_) {
- lock_.Release();
+ if (0 == *counter_) {
+ lock_.Release();
+ } else {
+ --(*counter_);
}
}
const T& GetData() const {
return data_;
}
private:
- template <class O> const DataAccessor<T>& operator=(const DataAccessor<O>& other);
- const T& data_;
- sync_primitives::Lock& lock_;
- uint32_t counter_;
+ void *operator new(size_t size);
+ const T& data_;
+ sync_primitives::Lock& lock_;
+ utils::SharedPtr<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 766932652..c8cef32ef 100644
--- a/src/components/include/utils/date_time.h
+++ b/src/components/include/utils/date_time.h
@@ -1,34 +1,34 @@
/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
@@ -50,6 +50,7 @@ class DateTime {
public:
static const int32_t MILLISECONDS_IN_SECOND = 1000;
static const int32_t MICROSECONDS_IN_MILLISECONDS = 1000;
+ static const int32_t MICROSECONDS_IN_SECOND = 1000 * 1000;
static TimevalStruct getCurrentTime();
@@ -80,5 +81,6 @@ class DateTime {
};
} // namespace date_time
-
+bool operator<(const TimevalStruct& time1, const TimevalStruct& time2);
+bool 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 910a88052..29bd46714 100644
--- a/src/components/include/utils/lock.h
+++ b/src/components/include/utils/lock.h
@@ -34,11 +34,14 @@
#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 "utils/atomic.h"
+#include "utils/memory_barrier.h"
namespace sync_primitives {
@@ -48,6 +51,31 @@ typedef pthread_mutex_t PlatformMutex;
#endif
} // namespace impl
+
+class SpinMutex {
+ public:
+ SpinMutex()
+ : state_(0) { }
+ void Lock() {
+ if (atomic_post_set(&state_) == 0) {
+ return;
+ }
+ for(;;) {
+ sched_yield();
+ if (state_ == 0 && atomic_post_set(&state_) == 0) {
+ return;
+ }
+ }
+ }
+ void Unlock() {
+ state_ = 0;
+ }
+ ~SpinMutex() {
+ }
+ private:
+ 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
diff --git a/src/components/include/utils/logger.h b/src/components/include/utils/logger.h
index 7c00c5d3a..50d194245 100644
--- a/src/components/include/utils/logger.h
+++ b/src/components/include/utils/logger.h
@@ -30,6 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+
+
#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_LOGGER_H_
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_LOGGER_H_
@@ -37,11 +39,11 @@
#include <errno.h>
#include <string.h>
#include <sstream>
- #include <apr_time.h>
#include <log4cxx/propertyconfigurator.h>
#include <log4cxx/spi/loggingevent.h>
#include "utils/push_log.h"
#include "utils/logger_status.h"
+ #include "utils/auto_trace.h"
#endif // ENABLE_LOG
#ifdef ENABLE_LOG
@@ -57,19 +59,23 @@
#define INIT_LOGGER(file_name) \
log4cxx::PropertyConfigurator::configure(file_name);
- // without this line log4cxx threads continue using some instances destroyed by exit()
- #define DEINIT_LOGGER() \
- log4cxx::Logger::getRootLogger()->closeNestedAppenders();
+ // Logger deinitilization function and macro, need to stop log4cxx writing
+ // without this deinitilization log4cxx threads continue using some instances destroyed by exit()
+ void deinit_logger ();
+ #define DEINIT_LOGGER() deinit_logger()
#define LOG4CXX_IS_TRACE_ENABLED(logger) logger->isTraceEnabled()
+ log4cxx_time_t time_now();
+
#define LOG_WITH_LEVEL(loggerPtr, logLevel, logEvent) \
do { \
if (logger::logger_status != logger::DeletingLoggerThread) { \
if (loggerPtr->isEnabledFor(logLevel)) { \
std::stringstream accumulator; \
accumulator << logEvent; \
- logger::push_log(loggerPtr, logLevel, accumulator.str(), apr_time_now(), LOG4CXX_LOCATION, ::log4cxx::spi::LoggingEvent::getCurrentThreadName()); \
+ logger::push_log(loggerPtr, logLevel, accumulator.str(), time_now(), \
+ LOG4CXX_LOCATION, ::log4cxx::spi::LoggingEvent::getCurrentThreadName()); \
} \
} \
} while (false)
@@ -110,8 +116,8 @@
#undef LOG4CXX_TRACE
#define LOG4CXX_TRACE(loggerPtr, logEvent) LOG_WITH_LEVEL(loggerPtr, ::log4cxx::Level::getTrace(), logEvent)
- #define LOG4CXX_TRACE_ENTER(logger) LOG4CXX_TRACE(logger, "ENTER: " << __PRETTY_FUNCTION__ )
- #define LOG4CXX_TRACE_EXIT(logger) LOG4CXX_TRACE(logger, "EXIT: " << __PRETTY_FUNCTION__ )
+ #define LOG4CXX_AUTO_TRACE_WITH_NAME_SPECIFIED(loggerPtr, auto_trace) logger::AutoTrace auto_trace(loggerPtr, LOG4CXX_LOCATION)
+ #define LOG4CXX_AUTO_TRACE(loggerPtr) LOG4CXX_AUTO_TRACE_WITH_NAME_SPECIFIED(loggerPtr, SDL_local_auto_trace_object)
#define LOG4CXX_ERROR_WITH_ERRNO(logger, message) \
LOG4CXX_ERROR(logger, message << ", error code " << errno << " (" << strerror(errno) << ")")
@@ -173,8 +179,8 @@
#define LOG4CXX_FATAL_EXT(logger, logEvent)
#define LOG4CXX_FATAL_STR_EXT(logger, logEvent)
- #define LOG4CXX_TRACE_ENTER(logger)
- #define LOG4CXX_TRACE_EXIT(logger)
+ #define LOG4CXX_AUTO_TRACE_WITH_NAME_SPECIFIED(loggerPtr, auto_trace)
+ #define LOG4CXX_AUTO_TRACE(loggerPtr)
#endif // ENABLE_LOG
#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_LOGGER_H_
diff --git a/src/components/include/utils/logger_status.h b/src/components/include/utils/logger_status.h
index e28fa6f83..17fa0562c 100644
--- a/src/components/include/utils/logger_status.h
+++ b/src/components/include/utils/logger_status.h
@@ -45,7 +45,7 @@ typedef enum {
// this variable is only changed when creating and deleting logger thread
// its reads and writes are believed to be atomic
// thus it shall be considered thread safe
-extern LoggerStatus logger_status;
+extern volatile LoggerStatus logger_status;
} // namespace logger
diff --git a/src/components/include/utils/macro.h b/src/components/include/utils/macro.h
index bf34b199b..bfd13411f 100644
--- a/src/components/include/utils/macro.h
+++ b/src/components/include/utils/macro.h
@@ -32,8 +32,12 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_MACRO_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_MACRO_H_
+#ifdef DEBUG
#include <assert.h>
+#else // RELEASE
#include <stdio.h>
+#endif
+#include "logger.h"
@@ -54,14 +58,53 @@
#define FRIEND_DELETER_DESTRUCTOR(TypeName) \
friend utils::deleters::Deleter<TypeName>::~Deleter()
+#ifdef DEBUG
+ #define ASSERT(condition) \
+ do { \
+ DEINIT_LOGGER(); \
+ assert(condition); \
+ } while (false)
+#else // RELEASE
+ #define ASSERT(condition) \
+ fprintf(stderr, "Failed condition \"" #condition "\" [%s:%d][%s]\n\n", \
+ __FILE__, __LINE__, __FUNCTION__)
+#endif
+
#define DCHECK(condition) \
if (!(condition)) { \
- printf("\nDCHECK [%s:%d][%s]", __FILE__, __LINE__, __FUNCTION__); \
- printf("[Check failed: " #condition "]\n\n"); \
- assert(false); \
+ CREATE_LOGGERPTR_LOCAL(logger_, "assert"); \
+ LOG4CXX_FATAL(logger_, "DCHECK failed with \"" << #condition \
+ << "\" [" << __FUNCTION__ << "][" << __FILE__ << ':' << __LINE__ << ']'); \
+ ASSERT((condition)); \
+ }
+
+/*
+ * Will cauch assert on debug version,
+ * Will return return_value in release build
+ */
+#define DCHECK_OR_RETURN(condition, return_value) \
+ if (!(condition)) { \
+ CREATE_LOGGERPTR_LOCAL(logger_, "assert"); \
+ LOG4CXX_FATAL(logger_, "DCHECK failed with \"" << #condition \
+ << "\" [" << __FUNCTION__ << "][" << __FILE__ << ':' << __LINE__ << ']' ); \
+ ASSERT((condition)); \
+ return (return_value); \
+ }
+/*
+ * Will cauch assert on debug version,
+ * Will return return_value in release build
+ */
+#define DCHECK_OR_RETURN_VOID(condition) \
+ if (!(condition)) { \
+ CREATE_LOGGERPTR_LOCAL(logger_, "assert"); \
+ LOG4CXX_FATAL(logger_, "DCHECK failed with \"" << #condition \
+ << "\" [" << __FUNCTION__ << "][" << __FILE__ << ':' << __LINE__ << ']' ); \
+ ASSERT((condition)); \
+ return ; \
}
-#define NOTREACHED() DCHECK(false)
+
+#define NOTREACHED() DCHECK(!"Unreachable code")
// Allows to perform static check that virtual function from base class is
// actually being overriden if compiler support is available
@@ -79,4 +122,9 @@
*/
#define ARRAYSIZE(arr) sizeof (arr) / sizeof(*arr)
+#ifdef BUILD_TESTS
+#define FRIEND_TEST(test_case_name, test_name)\
+friend class test_case_name##_##test_name##_Test
+#endif
+
#endif // SRC_COMPONENTS_INCLUDE_UTILS_MACRO_H_
diff --git a/src/components/include/utils/make_shared.h b/src/components/include/utils/make_shared.h
new file mode 100644
index 000000000..dc817e362
--- /dev/null
+++ b/src/components/include/utils/make_shared.h
@@ -0,0 +1,108 @@
+/*
+ * 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(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/memory_barrier.h b/src/components/include/utils/memory_barrier.h
index 312894e03..43c7c9df1 100644
--- a/src/components/include/utils/memory_barrier.h
+++ b/src/components/include/utils/memory_barrier.h
@@ -28,7 +28,7 @@
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
-*/
+ */
#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_MEMORY_BARRIER_H_
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_MEMORY_BARRIER_H_
diff --git a/src/components/include/utils/message_queue.h b/src/components/include/utils/message_queue.h
index 9d998cc69..e0b333672 100644
--- a/src/components/include/utils/message_queue.h
+++ b/src/components/include/utils/message_queue.h
@@ -28,10 +28,10 @@
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
-*/
+ */
-#ifndef MESSAGE_QUEUE_CLASS
-#define MESSAGE_QUEUE_CLASS
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_MESSAGE_QUEUE_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_MESSAGE_QUEUE_H_
#include <queue>
@@ -44,7 +44,9 @@
* \class MessageQueue
* \brief Wrapper for multithreading queue.
*/
- //TODO(Ezamakhov): move to utils namespace
+
+namespace utils {
+
template<typename T, class Q = std::queue<T> > class MessageQueue {
public:
typedef Q Queue;
@@ -107,7 +109,6 @@ template<typename T, class Q = std::queue<T> > class MessageQueue {
void Reset();
private:
-
/**
*\brief Queue
*/
@@ -157,11 +158,12 @@ template<typename T, class Q> void MessageQueue<T, Q>::push(const T& element) {
{
sync_primitives::AutoLock auto_lock(queue_lock_);
if (shutting_down_) {
- CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
- LOG4CXX_ERROR(logger_, "Runtime error, pushing into queue"
+ CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
+ LOG4CXX_ERROR(logger_, "Runtime error, pushing into queue"
" that is being shut down");
+ return;
}
- queue_.push(element);
+ queue_.push(element);
}
queue_new_items_.Broadcast();
}
@@ -193,4 +195,6 @@ template<typename T, class Q> void MessageQueue<T, Q>::Reset() {
}
}
-#endif // MESSAGE_QUEUE_CLASS
+} // namespace utils
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_MESSAGE_QUEUE_H_
diff --git a/src/components/include/utils/prioritized_queue.h b/src/components/include/utils/prioritized_queue.h
index 4bec901f5..2a8ebf0a7 100644
--- a/src/components/include/utils/prioritized_queue.h
+++ b/src/components/include/utils/prioritized_queue.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/include/utils/rwlock.h b/src/components/include/utils/rwlock.h
index b5042acbf..1083dbd63 100644
--- a/src/components/include/utils/rwlock.h
+++ b/src/components/include/utils/rwlock.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_RWLOCK_H_
-#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_RWLOCK_H_
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_RWLOCK_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_RWLOCK_H_
#if defined(OS_POSIX)
#include <pthread.h>
@@ -49,21 +49,91 @@ typedef pthread_rwlock_t PlatformRWLock;
#endif
} // namespace impl
+/**
+ * RW locks wrapper
+ * Read-write locks permit concurrent reads and exclusive writes to a protected shared resource.
+ * The read-write lock is a single entity that can be locked in read or write mode.
+ * To modify a resource, a thread must first acquire the exclusive write lock.
+ * An exclusive write lock is not permitted until all read locks have been released.
+ */
+
class RWLock {
public:
RWLock();
~RWLock();
- void AcquireForReading();
- void AcquireForWriting();
- void Release();
+
+ /**
+ * @brief Acqure read-write lock for reading.
+ * The calling thread acquires the read lock if a writer does not
+ * hold the lock and there are no writers blocked on the lock.
+ * It is unspecified whether the calling thread acquires the lock
+ * when a writer does not hold the lock and there are writers waiting for the lock.
+ * If a writer holds the lock, the calling thread will not acquire the read lock.
+ * If the read lock is not acquired, the calling thread blocks
+ * (that is, it does not return from the AcquireForReading()) until it can acquire the lock.
+ * Results are undefined if the calling thread holds a write lock on rwlock at the time the call is made.
+ * A thread can hold multiple concurrent read locks on rwlock
+ * (that is, successfully call AcquireForReading() n times)
+ * If so, the thread must perform matching unlocks (that is, it must call Release() n times).
+ * @returns true if lock was acquired and false if was not
+ */
+ bool AcquireForReading();
+
+ /**
+ * @brief try to Acqure read-write lock for reading.
+ * Applies a read lock as in AcquireForReading()
+ * with the exception that the function fails if any thread
+ * holds a write lock on rwlock or there are writers blocked on rwlock.
+ * But not blocks calling thread.
+ * @returns true if lock was acquired and false if was not
+ */
+ bool TryAcquireForReading();
+
+ /**
+ * @brief Try to Acqure read-write lock for writing.
+ * Applies a write lock like AcquireForWriting(), with the exception that the
+ * function fails if any thread currently holds rwlock (for reading or writing)
+ * Invoke of TryAcquireForWriting will not block calling thread and returns "false"
+ * @returns true if lock was acquired and false if was not
+ */
+ bool TryAcquireForWriting();
+
+ /**
+ * @brief Acqure read-write lock for writing.
+ * Applies a write lock to the read-write lock.
+ * The calling thread acquires the write lock if no other thread (reader or writer)
+ * holds the read-write lock rwlock. Otherwise, the thread blocks
+ * (that is, does not return from the AcquireForWriting() call)
+ * until it can acquire the lock.
+ * Results are undefined if the calling thread holds the read-write lock (whether a read or write lock)
+ * at the time the call is made.
+ * The thread must perform matching unlock (that is, it must call Release()).
+ * @returns true if lock was acquired and false if was not
+ */
+ bool AcquireForWriting();
+
+ /**
+ * @brief Release read-write lock.
+ * Releases a lock held on the read-write lock object.
+ * Results are undefined if the read-write lock rwlock
+ * is not held by the calling thread.
+ * @returns true if lock was released and false if was not
+ */
+ bool Release();
private:
impl::PlatformRWLock rwlock_;
};
+/**
+ * @brief Makes auto lock read-write locks for reading
+ * Please use AutoReadLock to acquire for reading and (automatically) release it
+ */
+
class AutoReadLock {
public:
- explicit AutoReadLock(RWLock& rwlock) : rwlock_(rwlock) {
+ explicit AutoReadLock(RWLock& rwlock)
+ : rwlock_(rwlock) {
rwlock_.AcquireForReading();
}
~AutoReadLock() {
@@ -72,13 +142,17 @@ class AutoReadLock {
private:
RWLock& rwlock_;
-
DISALLOW_COPY_AND_ASSIGN(AutoReadLock);
};
+/**
+ * @brief Makes auto lock read-write locks for writing
+ * Please use AutoWriteLock to acquire for writing and (automatically) release it
+ */
class AutoWriteLock {
public:
- explicit AutoWriteLock(RWLock& rwlock) : rwlock_(rwlock) {
+ explicit AutoWriteLock(RWLock& rwlock)
+ : rwlock_(rwlock) {
rwlock_.AcquireForWriting();
}
~AutoWriteLock() {
@@ -87,10 +161,9 @@ class AutoWriteLock {
private:
RWLock& rwlock_;
-
DISALLOW_COPY_AND_ASSIGN(AutoWriteLock);
};
} // namespace sync_primitives
-#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_RWLOCK_H_
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_RWLOCK_H_
diff --git a/src/components/include/utils/shared_ptr.h b/src/components/include/utils/shared_ptr.h
index 604bee998..f506c6018 100644
--- a/src/components/include/utils/shared_ptr.h
+++ b/src/components/include/utils/shared_ptr.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -164,7 +164,6 @@ class SharedPtr {
operator bool() const;
void reset();
void reset(ObjectType* other);
- void release();
ObjectType* get() const;
/**
@@ -197,6 +196,8 @@ class SharedPtr {
* @brief Pointer to reference counter.
**/
uint32_t* mReferenceCounter;
+
+ void release();
};
template<typename ObjectType>
diff --git a/src/components/include/utils/threads/CMakeLists.txt b/src/components/include/utils/threads/CMakeLists.txt
new file mode 100644
index 000000000..f97039c21
--- /dev/null
+++ b/src/components/include/utils/threads/CMakeLists.txt
@@ -0,0 +1,5 @@
+set(UtilsIncludeDir ${COMPONENTS_DIR/utils/include)
+
+include_directories (
+ ${UtilsIncludeDir}
+) \ No newline at end of file
diff --git a/src/components/include/utils/threads/message_loop_thread.h b/src/components/include/utils/threads/message_loop_thread.h
index e051c4890..6f90df209 100644
--- a/src/components/include/utils/threads/message_loop_thread.h
+++ b/src/components/include/utils/threads/message_loop_thread.h
@@ -39,13 +39,16 @@
#include "utils/logger.h"
#include "utils/macro.h"
#include "utils/message_queue.h"
-#include "utils/threads/thread_manager.h"
-#include "utils/lock.h"
+#include "utils/threads/thread.h"
+#include "utils/shared_ptr.h"
namespace threads {
-/*
- * Class that handles a thread which sole purpose is to pump messages pushed
+using ::utils::MessageQueue;
+
+/**
+ * \class MessageLoopThread
+ * \brief Handles a thread which sole purpose is to pump messages pushed
* to it's queue. To handle messages someone, Handler must be implemented and
* passed to MessageLoopThread constructor.
*/
@@ -79,6 +82,10 @@ class MessageLoopThread {
// Places a message to the therad's queue. Thread-safe.
void PostMessage(const Message& message);
+
+ // Process already posted messages and stop thread processing. Thread-safe.
+ void Shutdown();
+
private:
/*
* Implementation of ThreadDelegate that actually pumps the queue and is
@@ -90,19 +97,20 @@ class MessageLoopThread {
// threads::ThreadDelegate overrides
virtual void threadMain() OVERRIDE;
- virtual bool exitThreadMain() OVERRIDE;
+ virtual void exitThreadMain() OVERRIDE;
+
private:
// Handle all messages that are in the queue until it is empty
void DrainQue();
- private:
// Handler that processes messages
Handler& handler_;
// Message queue that is actually owned by MessageLoopThread
MessageQueue<Message, Queue>& message_queue_;
- sync_primitives::Lock active_lock;
};
+
private:
MessageQueue<Message, Queue> message_queue_;
+ LoopThreadDelegate* thread_delegate_;
threads::Thread* thread_;
};
@@ -112,8 +120,10 @@ template<class Q>
MessageLoopThread<Q>::MessageLoopThread(const std::string& name,
Handler* handler,
const ThreadOptions& thread_opts)
- : thread_(threads::CreateThread(name.c_str(), new LoopThreadDelegate(&message_queue_, handler))) {
- bool started = thread_->startWithOptions(thread_opts);
+ : thread_delegate_(new LoopThreadDelegate(&message_queue_, handler)),
+ thread_(threads::CreateThread(name.c_str(),
+ thread_delegate_)) {
+ const bool started = thread_->start(thread_opts);
if (!started) {
CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
LOG4CXX_ERROR(logger_, "Failed to start thread " << name);
@@ -122,7 +132,10 @@ MessageLoopThread<Q>::MessageLoopThread(const std::string& name,
template<class Q>
MessageLoopThread<Q>::~MessageLoopThread() {
- thread_->stop();
+ Shutdown();
+ thread_->join();
+ delete thread_delegate_;
+ threads::DeleteThread(thread_);
}
template <class Q>
@@ -130,6 +143,11 @@ void MessageLoopThread<Q>::PostMessage(const Message& message) {
message_queue_.push(message);
}
+template <class Q>
+void MessageLoopThread<Q>::Shutdown() {
+ thread_->stop();
+}
+
//////////
template<class Q>
MessageLoopThread<Q>::LoopThreadDelegate::LoopThreadDelegate(
@@ -142,8 +160,9 @@ MessageLoopThread<Q>::LoopThreadDelegate::LoopThreadDelegate(
template<class Q>
void MessageLoopThread<Q>::LoopThreadDelegate::threadMain() {
- sync_primitives::AutoLock auto_lock(active_lock);
- while(!message_queue_.IsShuttingDown()){
+ CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
+ LOG4CXX_AUTO_TRACE(logger_);
+ while (!message_queue_.IsShuttingDown()) {
DrainQue();
message_queue_.wait();
}
@@ -152,18 +171,15 @@ void MessageLoopThread<Q>::LoopThreadDelegate::threadMain() {
}
template<class Q>
-bool MessageLoopThread<Q>::LoopThreadDelegate::exitThreadMain() {
+void MessageLoopThread<Q>::LoopThreadDelegate::exitThreadMain() {
+ CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
+ LOG4CXX_AUTO_TRACE(logger_);
message_queue_.Shutdown();
- {
- sync_primitives::AutoLock auto_lock(active_lock);
- // Prevent canceling thread until queue is drained
- }
- return true;
}
template<class Q>
void MessageLoopThread<Q>::LoopThreadDelegate::DrainQue() {
- while(!message_queue_.empty()) {
+ while (!message_queue_.empty()) {
handler_.Handle(message_queue_.pop());
}
}
diff --git a/src/components/include/utils/threads/thread.h b/src/components/include/utils/threads/thread.h
index 3b81cf345..fd2b5e9fd 100644
--- a/src/components/include/utils/threads/thread.h
+++ b/src/components/include/utils/threads/thread.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,19 +43,19 @@
#include "utils/macro.h"
#include "utils/threads/thread_delegate.h"
#include "utils/threads/thread_options.h"
+#include "utils/conditional_variable.h"
+#include "utils/lock.h"
namespace threads {
-namespace impl {
#if defined(OS_POSIX)
typedef pthread_t PlatformThreadHandle;
#else
#error Please implement thread for your OS
#endif
-}
/**
- * Non platform specific thread abstraction that establishes a
+ * @brief Non platform specific thread abstraction that establishes a
* threads::ThreadDelegate on a new thread.
*
* ThreadDelegate example:
@@ -75,60 +75,72 @@ typedef pthread_t PlatformThreadHandle;
* thread.join();
* printf("ok!\n");
*/
+
class Thread;
+void enqueue_to_join(Thread* thread);
+
Thread* CreateThread(const char* name, ThreadDelegate* delegate);
-void DeleteThread(Thread*);
+void DeleteThread(Thread* thread);
class Thread {
- friend Thread* CreateThread(const char*, ThreadDelegate*);
- friend void DeleteThread(Thread*);
- public:
- /**
- * Class that represents unique in-process thread identifier
- * due to restriction of pthread API it only allows checks
- * for equality to different thread id and no ordering.
- *
- * ostream<< operator is provided for this class which
- * outputs thread name associated to an identifier.
- */
- class Id {
- public:
- explicit Id(const impl::PlatformThreadHandle& id): id_(id) {}
- bool operator==(const Id& that) const;
- impl::PlatformThreadHandle Handle() const { return id_; }
- private:
- impl::PlatformThreadHandle id_;
- friend class Thread;
- };
-
- // Get unique ID of currently executing thread
- static Id CurrentId();
-
- // Get name associated with thread identified by thread_id
- static std::string NameFromId(const Id& thread_id);
-
- // Give thread thread_id a name, helpful for debugging
- static void SetNameForId(const Id& thread_id, const std::string& name);
+ private:
+ const std::string name_;
+ // Should be locked to protect delegate_ value
+ sync_primitives::Lock delegate_lock_;
+ ThreadDelegate* delegate_;
+ PlatformThreadHandle handle_;
+ ThreadOptions thread_options_;
+ // Should be locked to protect isThreadRunning_ and thread_created_ values
+ sync_primitives::Lock state_lock_;
+ volatile unsigned int isThreadRunning_;
+ volatile bool stopped_;
+ volatile bool finalized_;
+ bool thread_created_;
+ // Signalled when Thread::start() is called
+ sync_primitives::ConditionalVariable run_cond_;
+ public:
/**
- * Starts the thread.
+ * @brief Starts the thread.
* @return true if the thread was successfully started.
*/
bool start();
- ThreadDelegate* delegate() const;
-
/**
- * Starts the thread. Behaves exactly like Start in addition to
+ * @brief Starts the thread. Behaves exactly like \ref start() in addition to
* allow to override the default options.
- * @param options - thread options. Look for 'threads/thread_options.h'
+ * @param options Thread options. Look for 'threads/thread_options.h'
* for details.
* @return true if the thread was successfully started.
*/
- bool startWithOptions(const ThreadOptions& options);
+ bool start(const ThreadOptions& options);
+
+ sync_primitives::Lock& delegate_lock() {
+ return delegate_lock_;
+ }
+
+ ThreadDelegate *delegate() const {
+ return delegate_;
+ }
+
+ void set_delegate(ThreadDelegate *delegate) {
+ DCHECK(!isThreadRunning_);
+ delegate_ = delegate;
+ }
+
+ friend Thread* CreateThread(const char* name, ThreadDelegate* delegate);
+ friend void DeleteThread(Thread* thread);
+
+ public:
+ // Get unique ID of currently executing thread
+ static PlatformThreadHandle CurrentId();
+
+ // Give thread thread_id a name, helpful for debugging
+ static void SetNameForId(const PlatformThreadHandle& thread_id,
+ std::string name);
/**
- * Signals the thread to exit and returns once the thread has exited.
+ * @brief Signals the thread to exit and returns once the thread has exited.
* After this method returns, the Thread object is completely reset and may
* be used as if it were newly constructed (i.e., Start may be called again).
*
@@ -137,16 +149,18 @@ class Thread {
*/
void stop();
+ void join();
+
/**
- * Get thread name.
+ * @brief Get thread name.
* @return thread name
*/
- const std::string& thread_name() {
+ const std::string& name() {
return name_;
}
/**
- * Returns true if the thread has been started, and not yet stopped.
+ * @brief Returns true if the thread has been started, and not yet stopped.
* When a thread is running, the thread_id_ is non-zero.
* @return true if the thread has been started, and not yet stopped.
*/
@@ -154,12 +168,10 @@ class Thread {
return isThreadRunning_;
}
- void set_running(bool running) {
- isThreadRunning_ = running;
- }
+ void set_running(bool running);
/**
- * Is thread joinable?
+ * @brief Is thread joinable?
* @return - Returns true if the thread is joinable.
*/
bool is_joinable() const {
@@ -167,7 +179,7 @@ class Thread {
}
/**
- * Thread stack size
+ * @brief Thread stack size
* @return thread stack size
*/
size_t stack_size() const {
@@ -175,23 +187,15 @@ class Thread {
}
/**
- * The native thread handle.
+ * @brief The native thread handle.
* @return thread handle.
*/
- impl::PlatformThreadHandle thread_handle() const {
- return thread_handle_;
- }
-
- /**
- * Thread id.
- * @return return thread id.
- */
- Id thread_id() const {
- return Id(thread_handle());
+ PlatformThreadHandle thread_handle() const {
+ return handle_;
}
/**
- * Thread options.
+ * @brief Thread options.
* @return thread options.
*/
const ThreadOptions& thread_options() const {
@@ -199,16 +203,12 @@ class Thread {
}
/**
- * Minimum size of thread stack for specific platform.
+ * @brief Minimum size of thread stack for specific platform.
*/
static size_t kMinStackSize;
protected:
- const std::string name_;
- ThreadDelegate* delegate_;
- impl::PlatformThreadHandle thread_handle_;
- ThreadOptions thread_options_;
- volatile unsigned int isThreadRunning_;
+ sync_primitives::ConditionalVariable state_cond_;
private:
/**
@@ -216,19 +216,17 @@ class Thread {
* @param name - display string to identify the thread.
* @param delegate - thread procedure delegate. Look for
* 'threads/thread_delegate.h' for details.
- * NOTE: delegate will be deleted by destructor.
+ * LifeCycle thread , otherwise it will be joined in stop method
+ * NOTE: delegate will be deleted after thread will be joined
* This constructor made private to prevent
* Thread object to be created on stack
*/
Thread(const char* name, ThreadDelegate* delegate);
-
+ virtual ~Thread();
+ static void* threadFunc(void* arg);
+ static void cleanup(void* arg);
DISALLOW_COPY_AND_ASSIGN(Thread);
- virtual ~Thread() { }
};
-inline bool operator!= (const Thread::Id& left, const Thread::Id& right) {
- return !(left == right);
-}
-std::ostream& operator<<(std::ostream& os, const Thread::Id& thread_id);
} // namespace threads
#endif // SRC_COMPONENTS_INCLUDE_UTILS_THREADS_THREAD_H_
diff --git a/src/components/include/utils/threads/thread_delegate.h b/src/components/include/utils/threads/thread_delegate.h
index 47e68f1e8..66ad30241 100644
--- a/src/components/include/utils/threads/thread_delegate.h
+++ b/src/components/include/utils/threads/thread_delegate.h
@@ -35,30 +35,66 @@
#include <pthread.h>
+#include "utils/lock.h"
+
namespace threads {
+enum ThreadState {
+ kInit = 0,
+ kStarted = 1,
+ kStopReq = 2
+};
+
+class Thread;
+
/**
* Thread procedure interface.
* Look for "threads/thread.h" for example
*/
class ThreadDelegate {
- public:
+ public:
+ ThreadDelegate()
+ : state_(kInit),
+ thread_(NULL) {
+ }
+ /**
+ * \brief Thread procedure.
+ */
+ virtual void threadMain() = 0;
+
+ /**
+ * Should be called to free all resources allocated in threadMain
+ * and exiting threadMain
+ * This function should be blocking and return only when threadMain() will be
+ * finished in other case segmantation failes are possible
+ */
+ virtual void exitThreadMain();
- /**
- * Thread procedure.
- */
- virtual void threadMain() = 0;
+ virtual ~ThreadDelegate();
- /**
- * Should be called to free all resources allocated in threadMain
- * and exiting threadMain
- * This function should be blocking and return only when threadMain() will be
- * finished in other case segmantation failes are possible
- */
- virtual bool exitThreadMain() {
- return false;
+ Thread* thread() const {
+ return thread_;
+ }
+
+ void set_thread(Thread *thread);
+
+ bool ImproveState(unsigned int to) {
+ state_lock_.Lock();
+ if ((state_ + 1 == to) || (to == kInit && state_ == kStopReq)) {
+ state_ = to;
}
- virtual ~ThreadDelegate() { }
+ state_lock_.Unlock();
+ return state_ == to;
+ }
+
+ unsigned int state() const {
+ return state_;
+ }
+
+ private:
+ volatile unsigned int state_;
+ sync_primitives::SpinMutex state_lock_;
+ Thread* thread_;
};
} // namespace threads
diff --git a/src/components/include/utils/threads/thread_options.h b/src/components/include/utils/threads/thread_options.h
index 217f0815a..797ee0693 100644
--- a/src/components/include/utils/threads/thread_options.h
+++ b/src/components/include/utils/threads/thread_options.h
@@ -38,7 +38,7 @@
namespace threads {
/**
- * @breif Startup options for thread.
+ * @brief Startup options for thread.
* Look for "threads/thread.h" for example
*/
class ThreadOptions {
@@ -74,7 +74,7 @@ class ThreadOptions {
* @param options - new options.
* @return new options.
*/
- ThreadOptions& operator=(const ThreadOptions& options ) {
+ ThreadOptions& operator=(const ThreadOptions& options) {
stack_size_ = options.stack_size();
is_joinable_ = options.is_joinable();
return *this;
diff --git a/src/components/include/utils/timer_thread.h b/src/components/include/utils/timer_thread.h
index a3481e4b4..4236c4e46 100644
--- a/src/components/include/utils/timer_thread.h
+++ b/src/components/include/utils/timer_thread.h
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -28,15 +28,16 @@
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
-*/
+ */
-#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_TIMER_THREAD
-#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_TIMER_THREAD
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_TIMER_THREAD_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_TIMER_THREAD_H_
#include <time.h>
#include <inttypes.h>
#include <cstdint>
#include <limits>
+#include <string>
#include "utils/conditional_variable.h"
#include "utils/lock.h"
@@ -52,8 +53,9 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
class TimerDelegate;
-/*
- * The TimerThread class provide possibility to run timer in a separate thread.
+/**
+ * \class TimerThread
+ * \brief TimerThread class provide possibility to run timer in a separate thread.
* The client should specify callee and const callback function.
* Example usage:
*
@@ -67,315 +69,381 @@ class TimerDelegate;
* To stop timer call timer.stop();
*
*/
-template <class T>
+template<class T>
class TimerThread {
- public:
-
- friend class TimerDelegate;
- friend class TimerLooperDelegate;
-
+ public:
+ friend class TimerDelegate;
+ friend class TimerLooperDelegate;
+
+ /**
+ * @brief Default constructor
+ *
+ * @param name - display string to identify the thread.
+ * @param callee A class that use timer
+ * @param f CallBackFunction which will be called on timeout
+ * Attention! "f()" will be called not in main thread but in timer thread
+ * Never use stop() and start() methods inside f
+ * @param is_looper Define this timer as looper,
+ * if true, TimerThread will call "f()" function every time out
+ * until stop()
+ */
+ TimerThread(const char* name, T* callee, void (T::*f)(), bool is_looper =
+ false);
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~TimerThread();
+
+ /**
+ * @brief Starts timer for specified timeout.
+ * Previously started timeout will be set to new value.
+ * On timeout TimerThread::onTimeOut interface will be called.
+ * Must not be used in callback function!
+ *
+ * @param timeout_seconds Timeout in seconds to be set
+ */
+ virtual void start(uint32_t timeout_seconds);
+
+ /**
+ * @brief Starts timer for specified timeout.
+ * Previously started timeout will be set to new value.
+ * On timeout TimerThread::onTimeOut interface will be called.
+ * Must not be used in callback function!
+ *
+ * @param timeout_seconds Timeout in seconds to be set
+ *
+ * @param callee A class that use timer
+ *
+ * @param allBackFunction which will be called on timeout
+ * Attention! "f()" will be called not in main thread but in timer thread
+ * Never use stop() and start() methods inside f
+ */
+ virtual void start(uint32_t timeout_seconds, T* callee, void (T::*f)());
+
+ /**
+ * @brief Stops timer execution
+ * Must not be used in callback function!
+ */
+ virtual void stop();
+
+ /**
+ * @brief Tell timer status
+ * @return true if timer is currently running, otherwise return false
+ */
+ virtual bool isRunning();
+
+ /**
+ * @brief Suspends timer execution after next loop.
+ */
+ virtual void suspend();
+
+ /**
+ * @brief Stop timer update timeout and start timer again
+ * Note that it cancel thread of timer, If you use it from callback,
+ * it probably will stop execution of callback function
+ * @param timeout_seconds new timeout value
+ *
+ */
+ virtual void updateTimeOut(const uint32_t timeout_seconds);
+
+ protected:
+ /**
+ * @brief Interface called by delegator on timeout
+ */
+ void onTimeOut() const;
+
+ private:
+ /**
+ * @brief Delegate release timer, will call callback function one time
+ */
+ class TimerDelegate : public threads::ThreadDelegate {
+ public:
/**
* @brief Default constructor
*
- * @param name - display string to identify the thread.
- * @param callee A class that use timer
- * @param f CallBackFunction which will be called on timeout
- * Attention! "f()" will be called not in main thread but in timer thread
- * Never use stop() and start() methods inside f
- * @param is_looper Define this timer as looper,
- * if true, TimerThread will call "f()" function every time out
- * until stop()
+ * @param timer_thread The Timer_thread pointer
*/
- TimerThread(const char* name, T* callee , void (T::*f)(), bool is_looper = false);
+ explicit TimerDelegate(TimerThread* timer_thread);
/**
* @brief Destructor
*/
- virtual ~TimerThread();
+ virtual ~TimerDelegate();
/**
- * @brief Starts timer for specified timeout.
- * Previously started timeout will be set to new value.
- * On timeout TimerThread::onTimeOut interface will be called.
- * Must not be used in callback function!
- *
- * @param timeout_seconds Timeout in seconds to be set
+ * @brief Thread main function.
*/
- virtual void start(uint32_t timeout_seconds);
+ virtual void threadMain();
/**
- * @brief Stops timer execution
- * Must not be used in callback function!
+ * @brief Called by thread::thread to free all allocated resources.
*/
- virtual void stop();
+ virtual void exitThreadMain();
/**
- * @brief Tell tmer status
- * @return true if timer is currently running, otherwise return false
+ * @brief Set new Timeout
+ * @param timeout_seconds New timeout to be set
*/
- virtual bool isRunning();
+ virtual void setTimeOut(const uint32_t timeout_seconds);
- /*
- * @brief Stop timer update timeout and start timer again
- * Note that it cancel thread of timer, If you use it from callback,
- * it probably will stop execution of callback function
- * @param timeout_seconds new timeout value
- *
+ /**
+ * @brief Quits threadMain function after next loop.
*/
- virtual void updateTimeOut(const uint32_t timeout_seconds);
- threads::Thread* thread_;
- protected:
+ virtual void shouldBeStoped();
/**
- * @brief Interface called by delegator on timeout
+ * @brief Restarts non-loop timer after current iteration.
*/
- void onTimeOut() const;
-
- private:
-
+ virtual void shouldBeRestarted();
+
+ protected:
+ TimerThread* timer_thread_;
+ uint32_t timeout_seconds_;
+ sync_primitives::Lock state_lock_;
+ sync_primitives::ConditionalVariable termination_condition_;
+ volatile bool stop_flag_;
+ sync_primitives::Lock restart_flag_lock_;
+ volatile bool restart_flag_;
+ int32_t calculateMillisecondsLeft();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TimerDelegate);
+ };
+
+ /**
+ * @brief Delegate release looper timer.
+ * Will call delegate every timeout function while stop()
+ * won't be called
+ */
+ class TimerLooperDelegate : public TimerDelegate {
+ public:
/**
- * @brief Delegate release timer, will call callback function one time
+ * @brief Default constructor
+ *
+ * @param timer_thread The Timer_thread pointer
+ * @param timeout Timeout to be set
*/
- class TimerDelegate : public threads::ThreadDelegate {
- public:
-
- /**
- * @brief Default constructor
- *
- * @param timer_thread The Timer_thread pointer
- */
- TimerDelegate(TimerThread* timer_thread);
-
- /**
- * @brief Destructor
- */
- virtual ~TimerDelegate();
-
- /**
- * @brief Thread main function.
- */
- virtual void threadMain();
-
- /**
- * @brief Called by thread::thread to free all allocated resources.
- */
- virtual bool exitThreadMain();
-
- /**
- * @brief Set new Timeout
- * @param timeout_seconds New timeout to be set
- */
- virtual void setTimeOut(const uint32_t timeout_seconds);
-
- protected:
- TimerThread* timer_thread_;
- uint32_t timeout_seconds_;
- sync_primitives::Lock state_lock_;
- sync_primitives::ConditionalVariable termination_condition_;
- volatile bool stop_flag_;
- int32_t calculateMillisecondsLeft();
- private:
- DISALLOW_COPY_AND_ASSIGN(TimerDelegate);
- };
-
+ explicit TimerLooperDelegate(TimerThread* timer_thread);
/**
- * @brief Delegate release looper timer.
- * Will call delegate every timeout function while stop()
- * won't be called
+ * @brief Thread main function.
*/
- class TimerLooperDelegate : public TimerDelegate {
- public:
-
- /**
- * @brief Default constructor
- *
- * @param timer_thread The Timer_thread pointer
- * @param timeout Timeout to be set
- */
- TimerLooperDelegate(TimerThread* timer_thread);
-
- /**
- * @brief Thread main function.
- */
- virtual void threadMain();
- private:
- DISALLOW_COPY_AND_ASSIGN(TimerLooperDelegate);
- };
- void (T::*callback_)();
- T* callee_;
- TimerDelegate* delegate_;
- //threads::Thread* thread_;
- std::string name_;
- mutable bool is_running_;
- bool is_looper_;
-
- DISALLOW_COPY_AND_ASSIGN(TimerThread);
+ virtual void threadMain();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TimerLooperDelegate);
+ };
+ threads::Thread* thread_;
+ void (T::*callback_)();
+ T* callee_;
+ TimerDelegate* delegate_;
+ std::string name_;
+ volatile bool is_looper_;
+
+ DISALLOW_COPY_AND_ASSIGN(TimerThread);
};
-template <class T>
-TimerThread<T>::TimerThread(const char* name, T* callee, void (T::*f)(), bool is_looper)
- : thread_(NULL),
- callback_(f),
- callee_(callee),
- delegate_(NULL),
- is_running_(false),
- is_looper_(is_looper) {
+template<class T>
+TimerThread<T>::TimerThread(const char* name, T* callee, void (T::*f)(),
+ bool is_looper)
+ : thread_(NULL),
+ callback_(f),
+ callee_(callee),
+ delegate_(NULL),
+ name_(name),
+ is_looper_(is_looper) {
+ delegate_ =
+ is_looper_ ? new TimerLooperDelegate(this) : new TimerDelegate(this);
+
+ thread_ = threads::CreateThread(name_.c_str(), delegate_);
}
-template <class T>
+template<class T>
TimerThread<T>::~TimerThread() {
- LOG4CXX_INFO(logger_, "TimerThread is to destroy " << name_);
- stop();
+ LOG4CXX_DEBUG(logger_, "TimerThread is to be destroyed " << name_);
+ thread_->join();
+ delete delegate_;
+ threads::DeleteThread(thread_);
callback_ = NULL;
callee_ = NULL;
}
-template <class T>
+template<class T>
void TimerThread<T>::start(uint32_t timeout_seconds) {
- LOG4CXX_TRACE(logger_, "Starting timer " << this);
- if (is_running_) {
- LOG4CXX_INFO(logger_, "TimerThread start needs stop " << name_);
- stop();
- }
-
- delegate_ = is_looper_ ?
- new TimerLooperDelegate(this) :
- new TimerDelegate(this);
- delegate_->setTimeOut(timeout_seconds);
-
- thread_ = threads::CreateThread("TimerThread", delegate_);
- if (delegate_ && thread_) {
- is_running_ = true;
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (isRunning()) {
+ LOG4CXX_INFO(logger_, "Restart timer in thread " << name_);
+ delegate_->shouldBeRestarted();
+ updateTimeOut(timeout_seconds);
+ } else {
+ updateTimeOut(timeout_seconds);
thread_->start();
}
}
-template <class T>
+template<class T>
+void TimerThread<T>::start(uint32_t timeout_seconds, T* callee,
+ void (T::*f)()) {
+ callee_ = callee;
+ callback_ = f;
+ start(timeout_seconds);
+}
+
+template<class T>
void TimerThread<T>::stop() {
- LOG4CXX_TRACE(logger_, "Stopping timer " << this);
- if (is_running_ && delegate_ && thread_) {
- LOG4CXX_INFO(logger_, "TimerThread thread_ stop " << name_);
- thread_->stop();
- is_running_ = false;
- } else {
- LOG4CXX_INFO(logger_, "TimerThread thread_ not stop " << name_);
- }
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(thread_);
+ LOG4CXX_DEBUG(logger_, "Stopping timer " << name_);
+ thread_->join();
}
-template <class T>
+template<class T>
bool TimerThread<T>::isRunning() {
- return is_running_;
+ DCHECK(thread_);
+ return thread_->is_running();
}
-template <class T>
+template<class T>
+void TimerThread<T>::suspend() {
+ LOG4CXX_DEBUG(logger_, "Suspend timer " << name_ << " after next loop");
+ delegate_->shouldBeStoped();
+}
+
+template<class T>
void TimerThread<T>::updateTimeOut(const uint32_t timeout_seconds) {
delegate_->setTimeOut(timeout_seconds);
}
-template <class T>
-void TimerThread<T>::onTimeOut() const {
+template<class T> void TimerThread<T>::onTimeOut() const {
if (callee_ && callback_) {
(callee_->*callback_)();
- /*
- if (!is_looper_) {
- stop();
- }
- */
}
}
-template <class T>
+template<class T>
TimerThread<T>::TimerDelegate::TimerDelegate(TimerThread* timer_thread)
- : timer_thread_(timer_thread),
- timeout_seconds_(0),
- state_lock_(true),
- stop_flag_(false) {
+ : timer_thread_(timer_thread),
+ timeout_seconds_(0),
+ state_lock_(true),
+ stop_flag_(false),
+ restart_flag_(false) {
DCHECK(timer_thread_);
}
-template <class T>
-TimerThread<T>::TimerLooperDelegate::TimerLooperDelegate(TimerThread* timer_thread)
- : TimerDelegate(timer_thread) {
+template<class T>
+TimerThread<T>::TimerLooperDelegate::TimerLooperDelegate(
+ TimerThread* timer_thread)
+ : TimerDelegate(timer_thread) {
}
-template <class T>
+template<class T>
TimerThread<T>::TimerDelegate::~TimerDelegate() {
timer_thread_ = NULL;
}
-template <class T>
+template<class T>
void TimerThread<T>::TimerDelegate::threadMain() {
using sync_primitives::ConditionalVariable;
sync_primitives::AutoLock auto_lock(state_lock_);
+ stop_flag_ = false;
while (!stop_flag_) {
// Sleep
- int32_t wait_milliseconds_left = TimerDelegate::calculateMillisecondsLeft();
+ int32_t wait_milliseconds_left = TimerDelegate::calculateMillisecondsLeft();
ConditionalVariable::WaitStatus wait_status =
termination_condition_.WaitFor(auto_lock, wait_milliseconds_left);
// Quit sleeping or continue sleeping in case of spurious wake up
- if (ConditionalVariable::kTimeout == wait_status ||
- wait_milliseconds_left <= 0) {
- break;
+ if (ConditionalVariable::kTimeout == wait_status
+ || wait_milliseconds_left <= 0) {
+ LOG4CXX_TRACE(logger_,
+ "Timer timeout " << wait_milliseconds_left << " ms");
+ timer_thread_->onTimeOut();
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Timeout reset force: " << TimerDelegate::timeout_seconds_);
+ }
+ {
+ sync_primitives::AutoLock auto_lock(restart_flag_lock_);
+ if (!restart_flag_) {
+ return;
+ }
+ restart_flag_ = false;
}
- }
- if (!stop_flag_) {
- timer_thread_->onTimeOut();
- timer_thread_->stop();
}
}
-template <class T>
+template<class T>
void TimerThread<T>::TimerLooperDelegate::threadMain() {
using sync_primitives::ConditionalVariable;
sync_primitives::AutoLock auto_lock(TimerDelegate::state_lock_);
+ TimerDelegate::stop_flag_ = false;
while (!TimerDelegate::stop_flag_) {
- int32_t wait_milliseconds_left = TimerDelegate::calculateMillisecondsLeft();
+ int32_t wait_milliseconds_left = TimerDelegate::calculateMillisecondsLeft();
ConditionalVariable::WaitStatus wait_status =
- TimerDelegate::termination_condition_.WaitFor(auto_lock, wait_milliseconds_left);
+ TimerDelegate::termination_condition_.WaitFor(auto_lock,
+ wait_milliseconds_left);
// Quit sleeping or continue sleeping in case of spurious wake up
- if (ConditionalVariable::kTimeout == wait_status ||
- wait_milliseconds_left <= 0) {
- LOG4CXX_TRACE(logger_, "Timer timeout " << wait_milliseconds_left);
+ if (ConditionalVariable::kTimeout == wait_status
+ || wait_milliseconds_left <= 0) {
+ LOG4CXX_TRACE(logger_,
+ "Timer timeout " << wait_milliseconds_left << " ms");
TimerDelegate::timer_thread_->onTimeOut();
} else {
- LOG4CXX_DEBUG(logger_, "Timeout reset force: " << TimerDelegate::timeout_seconds_);
+ LOG4CXX_DEBUG(logger_,
+ "Timeout reset force: " << TimerDelegate::timeout_seconds_);
}
}
}
-
-template <class T>
-bool TimerThread<T>::TimerDelegate::exitThreadMain() {
- sync_primitives::AutoLock auto_lock(state_lock_);
- stop_flag_ = true;
+template<class T>
+void TimerThread<T>::TimerDelegate::exitThreadMain() {
+ shouldBeStoped();
termination_condition_.NotifyOne();
- return true;
}
-template <class T>
+template<class T>
void TimerThread<T>::TimerDelegate::setTimeOut(const uint32_t timeout_seconds) {
timeout_seconds_ = timeout_seconds;
termination_condition_.NotifyOne();
}
-template <class T>
+template<class T>
+void TimerThread<T>::TimerDelegate::shouldBeStoped() {
+ {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ stop_flag_ = true;
+ }
+ {
+ sync_primitives::AutoLock auto_lock(restart_flag_lock_);
+ restart_flag_ = false;
+ }
+}
+
+template<class T>
+void TimerThread<T>::TimerDelegate::shouldBeRestarted() {
+ sync_primitives::AutoLock auto_lock(restart_flag_lock_);
+ restart_flag_ = true;
+}
+
+template<class T>
int32_t TimerThread<T>::TimerThread::TimerDelegate::calculateMillisecondsLeft() {
time_t cur_time = time(NULL);
time_t end_time = std::numeric_limits<time_t>::max();
- if (TimerDelegate::timeout_seconds_ + cur_time > TimerDelegate::timeout_seconds_) { // no overflow occurred
+ if (TimerDelegate::timeout_seconds_ + cur_time
+ > TimerDelegate::timeout_seconds_) { // no overflow occurred
end_time = cur_time + TimerDelegate::timeout_seconds_;
}
- int64_t wait_seconds_left = static_cast<int64_t>(difftime(end_time, cur_time));
- int32_t wait_milliseconds_left = std::numeric_limits<int32_t>::max();
- const int32_t millisecconds_in_second = 1000;
- if (wait_seconds_left < std::numeric_limits<int32_t>::max() / millisecconds_in_second) {
- wait_milliseconds_left = millisecconds_in_second * wait_seconds_left;
+ int64_t wait_seconds_left = static_cast<int64_t>(difftime(end_time, cur_time));
+ int32_t wait_milliseconds_left = std::numeric_limits<int32_t>::max();
+ const int32_t milliseconds_in_second = 1000;
+ if (wait_seconds_left
+ < std::numeric_limits<int32_t>::max() / milliseconds_in_second) {
+ wait_milliseconds_left = milliseconds_in_second * wait_seconds_left;
}
return wait_milliseconds_left;
}
} // namespace timer
-#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_TIMER_THREAD
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_TIMER_THREAD_H_
diff --git a/src/components/interfaces/CMakeLists.txt b/src/components/interfaces/CMakeLists.txt
index ac065fafb..bcb47976e 100644
--- a/src/components/interfaces/CMakeLists.txt
+++ b/src/components/interfaces/CMakeLists.txt
@@ -1,8 +1,39 @@
+# 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_directories (
- ../utils/include/
- ../formatters/include
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/formatters/include
)
-
+
GenerateInterface("v4_protocol_v1_2_no_extra.xml" "NsSmartDeviceLinkRPC::V1" "sdlrpcv1")
GenerateInterface("MOBILE_API.xml" "mobile_apis" "sdlrpcv2")
@@ -27,9 +58,8 @@ IF (${HMI_DBUS_API})
)
include_directories (
- ../../../src/components/smart_objects/include
- ../../../src/components/formatters/include/
- ${CMAKE_SOURCE_DIR}/src/components/formatters/include/
+ ${COMPONENTS_DIR}/smart_objects/include
+ ${COMPONENTS_DIR}/formatters/include/
${CMAKE_BINARY_DIR}
)
@@ -48,3 +78,4 @@ IF (${HMI_DBUS_API})
add_library(HMI_API "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc")
ENDIF (${HMI_DBUS_API})
+add_dependencies(HMI_API Utils)
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index f9e98cbc7..0f00117b1 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -61,6 +61,16 @@
<element name="WARNINGS" value="21"/>
<element name="GENERIC_ERROR" value="22"/>
<element name="USER_DISALLOWED" value="23"/>
+ <element name="TRUNCATED_DATA" value="24"/>
+</enum>
+
+<enum name="TransportType">
+ <description>
+ Lists of the transport types used for device connection to HU.
+ </description>
+ <element name="BLUETOOTH"/>
+ <element name="USB"/>
+ <element name="WIFI"/>
</enum>
<enum name="ButtonName">
@@ -81,7 +91,7 @@
<element name="PRESET_8"/>
<element name="PRESET_9"/>
<element name="CUSTOM_BUTTON"/>
- <element name="SEARCH"/>
+ <element name="SEARCH"/>
</enum>
<enum name="ButtonEventMode">
@@ -451,15 +461,27 @@
<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>
+ <element name="timeToDestination"/>
<!-- TO DO to be removed -->
- <element name="turnText"/>
+ <element name="turnText"/>
</enum>
<enum name="ImageFieldName">
@@ -514,6 +536,12 @@
<element name="DD_OFF" />
</enum>
+<enum name="EmergencyState">
+ <description>Enumeration that describes possible states of emergency event.</description>
+ <element name="EMERGENCY_ON" />
+ <element name="EMERGENCY_OFF" />
+</enum>
+
<enum name="MediaClockFormat">
<element name="CLOCK1">
<description>
@@ -550,7 +578,7 @@
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
+ Is used for CID and NGN head unit
</description>
</element>
<element name="CLOCKTEXT3">
@@ -916,6 +944,7 @@
<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>
@@ -965,6 +994,20 @@
<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">
@@ -1098,10 +1141,12 @@
<element name="NONE"/>
</enum>
-<enum name="SpeakType">
+<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">
@@ -1253,6 +1298,21 @@
</param>
</struct>
+<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. ’true’ – if device is allowed for PolicyTable Exchange; ‘false’ – if device is NOT allowed for PolicyTable Exchange </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>
@@ -1297,22 +1357,51 @@
<param name="icon" type="String" mandatory="false">
<description>Path to application icon stored on HU.</description>
</param>
- <param name="deviceName" type="String" mandatory="true">
- <description>The name of device which the provided application is running on.</description>
+ <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">
+ <param name="hmiDisplayLanguageDesired" type="Common.Language" mandatory="false">
<description>The language the application intends to use on HU </description>
</param>
- <param name="isMediaApplication" type="Boolean" mandatory="true">
+ <param name="isMediaApplication" type="Boolean" mandatory="false">
<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">
@@ -1465,6 +1554,15 @@
</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.
@@ -1494,8 +1592,8 @@
</param>
<param name="keypressMode" type="Common.KeypressMode" mandatory="false" >
<description>
- Desired keypress mode.
- If omitted, this value will be set to RESEND_CURRENT_ENTRY.
+ 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">
@@ -1535,18 +1633,6 @@
</param>
</struct>
-<struct name="DeviceInfo">
- <param name="name" type="String" mandatory="true">
- <description>The name of the device connected.</description>
- </param>
- <param name="id" type="Integer" mandatory="true">
- <description>The ID of the device connected</description>
- </param>
- <param name="isSDLAllowed" type="Boolean" mandatory="false">
- <description>Sent by SDL in UpdateDeviceList. ’true’ – if device is allowed for PolicyTable Exchange; ‘false’ – if device is NOT allowed for PolicyTable Exchange </description>
- </param>
-</struct>
-
<!--IVI part-->
<struct name="GPSData">
<description>Struct with the GPS data.</description>
@@ -1895,6 +1981,24 @@
</description>
</param>
</function>
+ <function name="OnButtonSubscription" messagetype="notification">
+ <description>
+ Sender: SDL->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">
@@ -1913,6 +2017,15 @@
<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->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">
<description>This method must be invoked by SDL to update audio state.</description>
<param name="appID" type="Integer" mandatory="true">
@@ -1923,7 +2036,7 @@
</function>
<function name="UpdateAppList" messagetype="request">
<description>Issued by SDL to notify HMI about new applications registered.</description>
- <param name="applications" type="Common.HMIApplication" mandatory="true" array="true" minsize="1" maxsize="100"/>
+ <param name="applications" type="Common.HMIApplication" mandatory="true" array="true" minsize="0" maxsize="100"/>
</function>
<function name="UpdateAppList" messagetype="response">
</function>
@@ -2052,6 +2165,11 @@
<description>Specifies reason for exiting all apllications.</description>
</param>
</function>
+ <function name="OnAwakeSDL" messagetype="notification">
+ <description>
+ Sender: HMI->SDL. Must be sent to return SDL to normal operation after 'Suspend' or 'LowVoltage' events
+ </description>
+ </function>
<function name="MixingAudioSupported" messagetype="request">
<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>
@@ -2063,6 +2181,12 @@
</function>
<function name="PlayTone" messagetype="notification">
<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>
<!-- Policies -->
@@ -2154,8 +2278,8 @@
<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>
+ into many PutFiles
+ </description>
</param>
<param name="FileName" type="String" maxlength="255" mandatory="true">
@@ -2387,7 +2511,7 @@
<param name="appID" type="Integer" mandatory="true">
<description>ID of application that requested this RPC.</description>
</param>
- <param name="speakType" type="Common.SpeakType" mandatory="false">
+ <param name="speakType" type="Common.MethodName" mandatory="false">
<description>Defines the type of the request which causes text-to-speech</description>
</param>
</function>
@@ -2626,8 +2750,8 @@
</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
+ Manually entered text selection, e.g. through keyboard
+ Can be returned in lieu of choiceID, depending on trigger source
</description>
</param>
</function>
@@ -2639,9 +2763,9 @@
<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"
+ 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">
@@ -2711,6 +2835,9 @@
<param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" 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’s capabilities. See HMICapabilities.</description>
+ </param>
</function>
<function name="ChangeRegistration" messagetype="request">
<description>Request from SmartDeviceLink to HMI to change language for app.</description>
@@ -2729,6 +2856,11 @@
<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>
@@ -2775,8 +2907,8 @@
<function name="SetDisplayLayout" messagetype="request">
<param name="displayLayout" type="String" maxlength="500" mandatory="true">
<description>
- Predefined or dynamically created screen layout.
- Currently only predefined screen layouts are defined.
+ Predefined or dynamically created screen layout.
+ Currently only predefined screen layouts are defined.
</description>
</param>
<param name="appID" type="Integer" mandatory="true">
@@ -2801,27 +2933,27 @@
<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).
+ 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.
+ 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>
@@ -2971,6 +3103,9 @@
</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">
@@ -3035,6 +3170,9 @@
<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>
@@ -3095,6 +3233,18 @@
</function>
<function name="StopAudioStream" messagetype="response">
</function>
+ <function name="OnAudioDataStreaming" messagetype="notification">
+ <description>Sender: SDL->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->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>
</interface>
@@ -3164,7 +3314,7 @@
</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.
+ Array of bytes comprising CAN message.
</description>
</param>
<param name="appID" type="Integer" mandatory="true">
@@ -3174,16 +3324,16 @@
<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.
+ 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.
+ 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="appID" type="Integer" mandatory="true">
<description>ID of application that requested this RPC.</description>
@@ -3843,6 +3993,12 @@
<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">
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index 7a652bb23..2c0dc0667 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -1,4897 +1,5108 @@
-<?xml version="1.0" standalone="no"?>
-<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
-
-<interface name="Ford Sync RAPI" version="2.1B" date="2013-05-30">
-
- <enum name="Result" internal_scope="base">
- <element name="SUCCESS">
- <description>The request succeeded</description>
- </element>
- <element name="UNSUPPORTED_REQUEST">
- <description>The request is not supported by Sync</description>
- </element>
- <element name="UNSUPPORTED_RESOURCE">
- <description>
- A button that was requested for subscription is not supported under the current system.
- NOTE: could become a more generic UNSUPPORTED_RESOURCE by merging with VEHIVLE_DATA_NOT_AVAILABLE.
- </description>
- </element>
- <element name="DISALLOWED">
- <description>RPC is not authorized in local policy table.</description>
- </element>
- <element name="REJECTED">
- <description>
- The requested command was rejected, e.g. because mobile app is in background and cannot perform any HMI commands.
- Or an HMI command (e.g. Speak) is rejected because a higher priority HMI command (e.g. Alert) is playing.
- </description>
- </element>
- <element name="ABORTED">
- <description>
- A command was aborted, for example due to user interaction (e.g. user pressed button).
- Or an HMI command (e.g. Speak) is aborted because a higher priority HMI command (e.g. Alert) was requested.
- </description>
- </element>
- <element name="IGNORED">
- <description>
- A command was ignored, because the intended result is already in effect.
- For example, SetMediaClockTimer was used to pause the media clock although the clock is paused already.
- NOTE: potentially replaces SUBSCRIBED_ALREADY
- </description>
- </element>
- <element name="RETRY">
- <description>The user interrupted the RPC (e.g. PerformAudioPassThru) and indicated to start over. Note, the app must issue the new RPC.</description>
- </element>
- <element name="IN_USE">
- <description>
- The data may not be changed, because it is currently in use.
- For example when trying to delete a command set that is currently involved in an interaction.
- </description>
- </element>
- <element name="VEHICLE_DATA_NOT_AVAILABLE">
- <description>The requested vehicle data is not available on this vehicle or is not published.</description>
- </element>
- <element name="TIMED_OUT">
- <description>Overlay reached the maximum timeout and closed.</description>
- </element>
- <element name="INVALID_DATA">
- <description>
- The data sent is invalid. For example:
- Invalid Json syntax
- Parameters out of bounds (number or enum range)
- Mandatory parameters not provided
- Parameter provided with wrong type
- Invalid characters
- Empty string
- </description>
- </element>
- <element name="CHAR_LIMIT_EXCEEDED"/>
- <element name="INVALID_ID">
- <description>
- One of the provided IDs is not valid. For example
- This applies to CorrelationID, SubscriptionID [@TODO if SubscriptionID is used], CommandID, MenuID, [@TODO: missed one?]
- </description>
- </element>
- <element name="DUPLICATE_NAME">
- <description>There was a conflict with an registered name (application or menu item) or vr command</description>
- </element>
- <element name="APPLICATION_NOT_REGISTERED">
- <description>An command can not be executed because no application has been registered with RegisterApplication.</description>
- </element>
- <element name="WRONG_LANGUAGE">
- <description>
- The requested language is currently not supported.
- Might be because of a mismatch of the currently active language on Sync and the requested language
- </description>
- </element>
- <element name="OUT_OF_MEMORY">
- <description>The system could not process the request because the necessary memory couldn't be allocated</description>
- </element>
- <element name="TOO_MANY_PENDING_REQUESTS">
- <description>There are too many requests pending (means, that the response has not been delivered, yet).</description>
- <designdescription>There may be a maximum of 1000 pending requests at a time.</designdescription>
- </element>
- <element name="TOO_MANY_APPLICATIONS">
- <description>There are already too many registered applications</description>
- </element>
- <element name="APPLICATION_REGISTERED_ALREADY">
- <description>RegisterApplication has been called again, after a RegisterApplication was successful before.</description>
- </element>
- <element name="WARNINGS">
- <description>The RPC (e.g. SubscribeVehicleData) executed successfully but one or more items have a warning or failure.</description>
- </element>
- <element name="GENERIC_ERROR">
- <description>Provided data is valid but something went wrong in the lower layers.</description>
- </element>
- <element name="USER_DISALLOWED">
- <description>RPC is included in a functional group explicitly blocked by the user.</description>
- </element>
- <element name="UNSUPPORTED_VERSION">
- <description>Sync doesn't support the protocol that is requested by the mobile application</description>
- </element>
- <element name="VEHICLE_DATA_NOT_ALLOWED">
- <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">
- <description>A specified file could not be found on Sync.</description>
- </element>
- <element name="CANCEL_ROUTE">
- <description>User selected to Cancel Route.</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="SAVED">
- <description>The RPC (e.g. Slider) executed successfully and the user elected to save the current position / value.</description>
- </element>
- <element name="INVALID_CERT">
- <description>The certificate provided during authentication is invalid.</description>
- </element>
- <element name="EXPIRED_CERT">
- <description>The certificate provided during authentication is expired.</description>
- </element>
- <element name="RESUME_FAILED">
- <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>
- </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 Sync 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 Sync and may vary
- </description>
- </element>
- </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="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>
-</enum>
-
- <enum name="UpdateMode">
- <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->mediaClock)</description>
- </enum>
-
- <enum name="TimerMode">
- <element name="UP" />
- <description>Causes the media clock timer to update from 0:00 to a specified time</description>
- <element name="DOWN" />
- <description>Causes the media clock timer to update from a specified time to 0:00</description>
- <element name="NONE" />
- <description>Indicates to not use the media clock timer</description>
- </enum>
-
- <enum name="InteractionMode">
- <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.
- Selections are made with the OK and Seek Right and Left, Tune Up and Down buttons.
- </description>
- <element name="VR_ONLY" />
- <description>
- This mode causes the interaction to only occur using V4.
- Selections are made by saying the command.
- </description>
- <element name="BOTH" />
- <description>
- This mode causes both a VR and display selection option for an interaction.
- Selections can be made either from the menu display or by speaking the command.
- </description>
- </enum>
-
- <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="HMILevel">
- <description>Enumeraction that describes current levels of HMI.</description>
- <element name="FULL" internal_name="HMI_FULL" />
- <element name="LIMITED" internal_name="HMI_LIMITED" />
- <element name="BACKGROUND" internal_name="HMI_BACKGROUND" />
- <element name="NONE" internal_name="HMI_NONE" />
- </enum>
-
- <enum name="AudioStreamingState">
- <description>Enumeraction that describes possible states of audio streaming.</description>
- <element name="AUDIBLE" />
- <element name="ATTENUATED" />
- <element name="NOT_AUDIBLE" />
- </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>App is 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="SystemContext">
- <description>Enumeration that describes possible contexts an app's HMI might be in.</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>
- </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 an in-App menu onscreen.</description>
- </element>
- <element name="HMI_OBSCURED" internal_name="SYSCTXT_HMI_OBSCURED">
- <description>The app's display HMI is currently being obscured by either a system or other app's overlay.</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="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="AppInterfaceUnregisteredReason">
- <description>Error code, which comes from sync side.</description>
- <element name="USER_EXIT" />
- <element name="IGNITION_OFF" />
- <element name="BLUETOOTH_OFF" />
- <element name="USB_DISCONNECTED" />
- <element name="REQUEST_WHILE_IN_NONE_HMI_LEVEL" />
- <element name="TOO_MANY_REQUESTS" />
- <element name="DRIVER_DISTRACTION_VIOLATION" />
- <element name="LANGUAGE_CHANGE" />
- <element name="MASTER_RESET" />
- <element name="FACTORY_DEFAULTS" />
- <element name="APP_UNAUTHORIZED" />
- <element name="PROTOCOL_VIOLATION" />
- </enum>
-
- <enum name="TriggerSource">
- <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" />
- </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="SamplingRate">
- <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"/>
- </enum>
-
- <enum name="BitsPerSample">
- <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"/>
- </enum>
-
- <enum name="AudioType">
- <description>Describes different audio type options for PerformAudioPassThru.</description>
- <element name="PCM" />
- </enum>
-
- <struct name="AudioPassThruCapabilities">
- <description>Describes different audio type configurations for PerformAudioPassThru.</description>
- <description>e.g. {8kHz,8-bit,PCM}</description>
- <param name="samplingRate" type="SamplingRate"/>
- <param name="bitsPerSample" type="BitsPerSample"/>
- <param name="audioType" type="AudioType"/>
- </struct>
-
- <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="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="MediaClockFormat">
- <element name="CLOCK1">
- <description>
- minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;
- used for Type II and CID headunits
- </description>
- </element>
- <element name="CLOCK2">
- <description>
- minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59;
- used for Type V headunit
- </description>
- </element>
- <element name="CLOCK3">
- <description>
- minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
- used for GEN1.1 MFD3/4/5 headunits
- </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, see TypeII column in XLS. See [@TODO: create file ref]]
- :|sp : colon or space
- used for Type II headunit
- </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, see CID column in XLS. See [@TODO: create file ref]]
- :|sp : colon or space
- used for CID headunit
- NOTE: difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character set
- </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, see Type 5 column in XLS]. See [@TODO: create file ref]
- :|sp : colon or space
- used for Type V headunit
- </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].
- used for GEN1.1 MFD3/4/5 headunits
- </description>
- </element>
- </enum>
-
- <enum name="DisplayType">
- <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" />
- </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">
- <description> Time to destination</description>
- </element>
-
- <element name="navigationText">
- <description>Navigation text for UpdateTurnList.</description>
- </element>
-
- <element name="notificationText">
- <description> Footer text for slider</description>
- </element>
-
- <element name="turnText">
- <description> Turn text</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="PredefinedLayout" platform="documentation">
- <description>Predefined screen layout.</description>
-
- <element name="DEFAULT" rootscreen="true">
- <description>
- Default media / non-media screen.
- Can be set as a root screen.
- </description>
- </element>
- <element name="MEDIA" rootscreen="true">
- <description>
- Default Media screen.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NON-MEDIA" internal_name="NON_MEDIA" rootscreen="true">
- <description>
- Default Non-media screen.
- Can be set as a root screen.
- </description>
- </element>
- <element name="ONSCREEN_PRESETS" rootscreen="true">
- <description>
- Custom root media screen containing app-defined onscreen presets.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NAV_FULLSCREEN_MAP" rootscreen="true">
- <description>
- Custom root template screen containing full screen map with navigation controls.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NAV_LIST" rootscreen="true">
- <description>
- Custom root template screen containing video represented list.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NAV_KEYBOARD" rootscreen="true">
- <description>
- Custom root template screen containing video represented keyboard.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TEXT" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with lines of text.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXT_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing lines of text with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TILES_ONLY" rootscreen="true">
- <description>
- Custom root template screen containing only tiled SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXTBUTTONS_ONLY" rootscreen="true">
- <description>
- Custom root template screen containing only text SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TILES" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with tiled SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TILES_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing tiled SoftButtons with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with text and SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing text and SoftButtons with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TEXTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with text only SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXTBUTTONS_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing text only SoftButtons with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="LARGE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing a large graphic and SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="DOUBLE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing two graphics and SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="LARGE_GRAPHIC_ONLY" rootscreen="true">
- <description>
- Custom root template screen containing only a large graphic.
- Can be set as a root screen.
- </description>
- </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>
-
- <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="TBTState">
- <description>Enumeration that describes possible states of turn-by-turn client or AppLink 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="DriverDistractionState">
- <description>Enumeration that describes possible states of driver distraction.</description>
- <element name="DD_ON" />
- <element name="DD_OFF" />
- </enum>
-
- <enum name="ImageType">
- <description>Contains information about the type of image.</description>
- <element name="STATIC" />
- <element name="DYNAMIC" />
- </enum>
-
- <struct name="Image">
- <param name="value" minlength="0" maxlength="65535" type="String">
- <description>Either the static hex icon value or the binary image file name identifier (sent by PutFile).</description>
- </param>
- <param name="imageType" type="ImageType">
- <description>Describes, whether it is a static or dynamic image.</description>
- </param>
- </struct>
-
- <struct name="SoftButton">
- <param name="type" type="SoftButtonType">
- <description>Describes, whether it is text, highlighted text, icon, or dynamic image. See softButtonType</description>
- </param>
- <param name="text" minlength="0" maxlength="500" type="String" mandatory="false">
- <description>Optional text to display (if defined as TEXT or BOTH)</description>
- </param>
- <param name="image" type="Image" mandatory="false">
- <description>Optional image struct for SoftButton (if defined as IMAGE or BOTH)</description>
- </param>
- <param name="isHighlighted" type="Boolean" defvalue="false" mandatory="false">
- <description>
- True, if highlighted
- False, if not highlighted
- </description>
- </param>
- <param name="softButtonID" type="Integer" minvalue="0" maxvalue="65535">
- <description>Value which is returned via OnButtonPress / OnButtonEvent</description>
- </param>
- <param name="systemAction" type="SystemAction" defvalue="DEFAULT_ACTION" mandatory="false">
- <description>Parameter indicating whether selecting a SoftButton shall call a specific system action. This is intended to allow Notifications to bring the callee into full / focus; or in the case of persistent overlays, the overlay can persist when a SoftButton is pressed.</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" />
- <param name="menuName" type="String" maxlength="500" />
- <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" />
- <param name="image" type="Image" mandatory="false"/>
- <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">
- <description>Text to display for VR Help item</description>
- </param>
- <param name="image" type="Image" mandatory="false">
- <description>Image struct for VR Help item</description>
- </param>
- <param name="position" type="Integer" minvalue="1" maxvalue="100">
- <description>Position to display item in VR Help list</description>
- </param>
- </struct>
-
- <struct name="SyncMsgVersion">
- <description>Specifies the version number of the SYNC V4 protocol, that is supported by the mobile application</description>
-
- <param name="majorVersion" type="Integer" minvalue="1" maxvalue="10">
- <description>The major version indicates versions that is not-compatible to previous versions.</description>
- </param>
- <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000">
- <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>
- </struct>
-
- <enum name="GlobalProperty">
- <description>The different global properties.</description>
- <element name="HELPPROMPT">
- <description>The property helpPrompt of setGlobalProperties</description>
- </element>
- <element name="TIMEOUTPROMPT">
- <description>The property timeoutPrompt of setGlobalProperties</description>
- </element>
- <element name="VRHELPTITLE">
- <description>The property vrHelpTitle of setGlobalProperties</description>
- </element>
- <element name="VRHELPITEMS">
- <description>The property array of vrHelp of setGlobalProperties</description>
- </element>
- <element name="MENUNAME">
- <description>The property in-app menu name of setGlobalProperties</description>
- </element>
- <element name="MENUICON">
- <description>The property in-app menu icon of setGlobalProperties</description>
- </element>
- <element name="KEYBOARDPROPERTIES">
- <description>The on-screen keyboard configuration of setGlobalProperties</description>
- </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="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="UNKNOWN">
- </element>
- <element name="FAULT">
- </element>
- </enum>
-
- <enum name="ComponentVolumeStatus">
- <description>The volume status of a vehicle component.</description>
- <element name="UNKNOWN" internal_name="CVS_UNKNOWN">
- </element>
- <element name="NORMAL" internal_name="CVS_NORMAL">
- </element>
- <element name="LOW" internal_name="CVS_LOW">
- </element>
- <element name="FAULT" internal_name="CVS_FAULT">
- </element>
- <element name="ALERT" internal_name="CVS_ALERT">
- </element>
- <element name="NOT_SUPPORTED" internal_name="CVS_NOT_SUPPORTED">
- </element>
- </enum>
-
- <struct name="SingleTireStatus">
- <param name="status" type="ComponentVolumeStatus">
- <description>See ComponentVolumeStatus.</description>
- </param>
- </struct>
-
- <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="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="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">
- </element>
- </enum>
-
- <enum name="IgnitionStatus">
- <description>Reflects the status of ignition.</description>
- <element name="UNKNOWN" internal_name="IS_UNKNOWN">
- </element>
- <element name="OFF" internal_name="IS_OFF">
- </element>
- <element name="ACCESSORY" internal_name="IS_ACCESSORY">
- </element>
- <element name="RUN" internal_name="IS_RUN">
- </element>
- <element name="START" internal_name="IS_START">
- </element>
- <element name="INVALID" internal_name="IS_INVALID">
- </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">
- </element>
- <element name="NO" internal_name="VDES_NO">
- </element>
- <element name="YES" internal_name="VDES_YES">
- </element>
- <element name="NOT_SUPPORTED" internal_name="VDES_NOT_SUPPORTED">
- </element>
- <element name="FAULT" internal_name="VDES_FAULT">
- </element>
- </enum>
-
- <enum name="DeviceLevelStatus">
- <description>Reflects the reported battery 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="WiperStatus">
- <description>Reflects the status of the wipers.</description>
- <element name="OFF" />
- <element name="AUTO_OFF" />
- <element name="OFF_MOVING" />
- <element name="MAN_INT_OFF" />
- <element name="MAN_INT_ON" />
- <element name="MAN_LOW" />
- <element name="MAN_HIGH" />
- <element name="MAN_FLICK" />
- <element name="WASH" />
- <element name="AUTO_LOW" />
- <element name="AUTO_HIGH" />
- <element name="COURTESYWIPE" />
- <element name="AUTO_ADJUST" />
- <element name="STALLED" />
- <element name="NO_DATA_EXISTS" />
- </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="MaintenanceModeStatus">
- <description>Reflects the status of a vehicle maintenance mode.</description>
- <element name="NORMAL" internal_name="MMS_NORMAL">
- </element>
- <element name="NEAR" internal_name="MMS_NEAR">
- </element>
- <element name="ACTIVE" internal_name="MMS_ACTIVE">
- </element>
- <element name="FEATURE_NOT_PRESENT" internal_name="MMS_FEATURE_NOT_PRESENT">
- </element>
- </enum>
-
- <enum name="VehicleDataActiveStatus">
- <description>Reflects the status of given vehicle component.</description>
- <element name="INACTIVE_NOT_CONFIRMED" internal_name="VDAS_INACTIVE_NOT_CONFIRMED">
- </element>
- <element name="INACTIVE_CONFIRMED" internal_name="VDAS_INACTIVE_CONFIRMED">
- </element>
- <element name="ACTIVE_NOT_CONFIRMED" internal_name="VDAS_ACTIVE_NOT_CONFIRMED">
- </element>
- <element name="ACTIVE_CONFIRMED" internal_name="VDAS_ACTIVE_CONFIRMED">
- </element>
- <element name="FAULT" internal_name="VDAS_FAULT">
- </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>
-
- <struct name="BeltStatus">
- <param name="driverBeltDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerBeltDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsPasBelt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerBuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1PasBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverBuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1DrvBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRow2BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerChildDetected" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1PasChld_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRow2BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow2BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow3BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw3mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRow3BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw3lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRow3BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw3rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRearInflatableBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2lRib_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRearInflatableBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2rRib_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow1BeltDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1mBelt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow1BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
-
- <struct name="BodyInformation">
- <param name="parkBrakeActive" type="Boolean">
- <description>References signal "PrkBrkActv_B_Actl".</description>
- </param>
- <param name="ignitionStableStatus" type="IgnitionStableStatus">
- <description>References signal "Ignition_Switch_Stable". See IgnitionStableStatus.</description>
- </param>
- <param name="ignitionStatus" type="IgnitionStatus">
- <description>References signal "Ignition_status". 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">
- <description>References signal "CPM_VoiceRec_STAT".</description>
- </param>
- <param name="btIconOn" type="Boolean">
- <description>References signal "BT_ICON".</description>
- </param>
- <param name="callActive" type="Boolean">
- <description>References signal "CPM_Call_Active_STAT".</description>
- </param>
- <param name="phoneRoaming" type="Boolean">
- <description>References signal "CPM_Phone_Roaming_STAT".</description>
- </param>
- <param name="textMsgAvailable" type="Boolean">
- <description>References signal "CPM_TextMsg_AVAL".</description>
- </param>
- <param name="battLevelStatus" type="DeviceLevelStatus">
- <description>Device battery level status. References signal "CPM_Batt_Level_STAT". See DeviceLevelStatus.</description>
- </param>
- <param name="stereoAudioOutputMuted" type="Boolean">
- <description>References signal "CPM_Stereo_Audio_Output".</description>
- </param>
- <param name="monoAudioOutputMuted" type="Boolean">
- <description>References signal "CPM_Mono_Audio_Output".</description>
- </param>
- <param name="signalLevelStatus" type="DeviceLevelStatus">
- <description>Device signal level status. References signal "CPM_Signal_Strength_STAT". See DeviceLevelStatus.</description>
- </param>
- <param name="primaryAudioSource" type="PrimaryAudioSource">
- <description>References signal "CPM_Stereo_PAS_Source". See PrimaryAudioSource.</description>
- </param>
- <param name="eCallEventActive" type="Boolean">
- <description>References signal "eCall_Event".</description>
- </param>
- </struct>
-
- <struct name="HeadLampStatus">
- <param name="lowBeamsOn" type="Boolean">
- <description>Status of the low beam lamps. References signal "HeadLampLoActv_B_Stat".</description>
- </param>
- <param name="highBeamsOn" type="Boolean">
- <description>Status of the high beam lamps. References signal "HeadLghtHiOn_B_Stat".</description>
- </param>
- <param name="ambientLightSensorStatus" type="AmbientLightStatus">
- <description>Status of the ambient light sensor.</description>
- </param>
- </struct>
-
- <struct name="engineInfo">
- <param name="electricFuelConsumption" type="Float" minvalue="0" maxvalue="30000">
- <description>
- Indicates the electric fuel consumption in terms of gasoline equivalent volume to support fuel economy equivalent calculations.
- Note:Plug-in vehicle use only!
- References signal "ElFuelFlw_Vl_Dsply".
- </description>
- </param>
- <param name="stateOfCharge" type="Float" minvalue="0" maxvalue="100">
- <description>Percent state of charge for the high voltage battery. References signal "BattTracSoc_Pc_Dsply".</description>
- </param>
- <param name="fuelMaintenanceMode" type="MaintenanceModeStatus">
- <description>Current status of fuel maintenance mode (if present on hybrid vehicles). References signal "FuelMaintMde_D_Dsply".</description>
- </param>
- <param name="distanceToEmpty" type="Float" minvalue="0" maxvalue="1000">
- <description>
- Electric range (DTE) in km. References signal "VehElRnge_L_Dsply".
- 0xFFE = No Data Exists
- 0xFFF = Fault
- </description>
- </param>
- </struct>
-
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- Ford Specific Data Items -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
-
- <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="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="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>
-
- <struct name="DeviceInfo">
- <description>Various information abount connecting device.</description>
-
- <param name="hardware" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device model</description>
- </param>
- <param name="firmwareRev" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device firmware revision</description>
- </param>
- <param name="os" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device OS</description>
- </param>
- <param name="osVersion" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device OS version</description>
- </param>
- <param name="carrier" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device mobile carrier (if applicable)</description>
- </param>
- <param name="maxNumberRFCOMMPorts" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
- <description>Omitted if connected not via BT.</description>
- </param>
-
- </struct>
-
- <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="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="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="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>
-
- <struct name="ECallInfo">
- <param name="eCallNotificationStatus" type="VehicleDataNotificationStatus">
- <description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
- </param>
- <param name="auxECallNotificationStatus" type="VehicleDataNotificationStatus">
- <description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
- </param>
- <param name="eCallConfirmationStatus" type="ECallConfirmationStatus">
- <description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
- </param>
- </struct>
-
- <struct name="AirbagStatus">
- <param name="driverAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverSideAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverCurtainAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerCurtainAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverKneeAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerSideAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerKneeAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
-
- <struct name="EmergencyEvent">
- <param name="emergencyEventType" type="EmergencyEventType">
- <description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
- </param>
- <param name="fuelCutoffStatus" type="FuelCutoffStatus">
- <description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
- </param>
- <param name="rolloverEvent" type="VehicleDataEventStatus">
- <description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
-
- <param name="maximumChangeVelocity" type="Integer" minvalue="0" maxvalue="255">
- <description>References signal "VedsMaxDeltaV_D_Ltchd". Change in velocity in KPH. Additional reserved values:
- 0x00 No event
- 0xFE Not supported
- 0xFF Fault
- </description>
- </param>
- <param name="multipleEvents" type="VehicleDataEventStatus">
- <description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
-
- <struct name="ClusterModeStatus">
- <param name="powerModeActive" type="Boolean">
- <description>References signal "PowerMode_UB".</description>
- </param>
- <param name="powerModeQualificationStatus" type="PowerModeQualificationStatus">
- <description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
- </param>
- <param name="carModeStatus" type="CarModeStatus">
- <description>References signal "CarMode". See CarMode.</description>
- </param>
- <param name="powerModeStatus" type="PowerModeStatus">
- <description>References signal "PowerMode". See PowerMode.</description>
- </param>
- </struct>
-
- <struct name="MyKey">
- <param name="e911Override" type="VehicleDataStatus">
- <description>Indicates whether e911 override is on. References signal "MyKey_e911Override_St". See VehicleDataStatus.</description>
- </param>
- </struct>
-
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- / Ford Specific Data Items -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-
- <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>
-
- <struct name="TireStatus">
- <description>The status and pressure of the tires.</description>
-
- <param name="pressureTelltale" type="WarningLightStatus">
- <description>Status of the Tire Pressure Telltale. See WarningLightStatus.</description>
- </param>
- <param name="leftFront" type="SingleTireStatus">
- <description>The status of the left front tire.</description>
- </param>
- <param name="rightFront" type="SingleTireStatus">
- <description>The status of the right front tire.</description>
- </param>
- <param name="leftRear" type="SingleTireStatus">
- <description>The status of the left rear tire.</description>
- </param>
- <param name="rightRear" type="SingleTireStatus">
- <description>The status of the right rear tire.</description>
- </param>
- <param name="innerLeftRear" type="SingleTireStatus">
- <description>The status of the inner left rear.</description>
- </param>
- <param name="innerRightRear" type="SingleTireStatus">
- <description>The status of the inner right rear.</description>
- </param>
- </struct>
-
- <struct name="GPSData">
- <description>Struct with the GPS data.</description>
- <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90">
- </param>
- <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100">
- <description>The current UTC year.</description>
- </param>
- <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12">
- <description>The current UTC month.</description>
- </param>
- <param name="utcDay" type="Integer" minvalue="1" maxvalue="31">
- <description>The current UTC day.</description>
- </param>
- <param name="utcHours" type="Integer" minvalue="0" maxvalue="23">
- <description>The current UTC hour.</description>
- </param>
- <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59">
- <description>The current UTC minute.</description>
- </param>
- <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59">
- <description>The current UTC second.</description>
- </param>
- <param name="compassDirection" type="CompassDirection">
- <description>See CompassDirection.</description>
- </param>
- <param name="pdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
- <description>PDOP. If undefined or unavailable, then value shall be set to 0.</description>
- </param>
- <param name="hdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
- <description>HDOP. If value is unknown, value shall be set to 0.</description>
- </param>
- <param name="vdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
- <description>VDOP. If value is unknown, value shall be set to 0.</description>
- </param>
- <param name="actual" type="Boolean">
- <description>
- True, if actual.
- False, if infered.
- </description>
- </param>
- <param name="satellites" type="Integer" minvalue="0" maxvalue="31">
- <description>Number of satellites in view</description>
- </param>
- <param name="dimension" type="Dimension">
- <description>See Dimension</description>
- </param>
- <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000">
- <description>Altitude in meters</description>
- </param>
- <param name="heading" type="Float" minvalue="0" maxvalue="359.99">
- <description>The heading. North is 0. Resolution is 0.01</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="500">
- <description>The speed in KPH</description>
- </param>
- </struct>
-
- <struct name="VehicleDataResult">
- <description>Individual published data request result</description>
- <param name="dataType" type="VehicleDataType">
- <description>Defined published data element type.</description>
- </param>
- <param name="resultCode" type="VehicleDataResultCode">
- <description>Published data result code.</description>
- </param>
- </struct>
-
- <struct name="DIDResult">
- <description>Individual requested DID result and data</description>
- <param name="resultCode" type="VehicleDataResultCode">
- <description>Individual DID result code.</description>
- </param>
- <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Location of raw data from vehicle data DID</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="StartTime">
- <param name="hours" type="Integer" minvalue="0" maxvalue="59">
- <description>
- The hour of the media clock.
- Some radios only support a max of 19 hours. If out of range, it will be rejected.
- </description>
- </param>
- <param name="minutes" type="Integer" minvalue="0" maxvalue="59" />
- <param name="seconds" type="Integer" minvalue="0" maxvalue="59" />
- </struct>
-
- <struct name="TextField">
- <param name="name" type="TextFieldName">
- <description>The name that identifies the field. See TextFieldName.</description>
- </param>
- <param name="characterSet" type="CharacterSet">
- <description>The character set that is supported in this field. See CharacterSet.</description>
- </param>
- <param name="width" type="Integer" minvalue="1" maxvalue="500">
- <description>The number of characters in one row of this field.</description>
- </param>
- <param name="rows" type="Integer" minvalue="1" maxvalue="8">
- <description>The number of rows of this field.</description>
- </param>
- </struct>
-
- <struct name="ImageResolution">
- <param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000">
- <description>The image resolution width.</description>
- </param>
- <param name="resolutionHeight" type="Integer" minvalue="1" maxvalue="10000">
- <description>The image resolution height.</description>
- </param>
- </struct>
-
- <struct name="ImageField">
- <param name="name" type="ImageFieldName">
- <description>The name that identifies the field. See ImageFieldName.</description>
- </param>
- <param name="imageTypeSupported" type="FileType" array="true">
- <description>The image types that are supported in this field. See FileType.</description>
- </param>
- <param name="imageResolution" type="ImageResolution">
- <description>The image resolution of this field.</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>
-
- <enum name="TouchType">
- <element name="BEGIN"/>
- <element name="MOVE"/>
- <element name="END"/>
- </enum>
-
- <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="TouchCoord" mandatory="true" array="true" minsize="1" maxsize="1000">
- </param>
- </struct>
-
- <struct name="Coordinate">
- <param name="xCoord" type="Integer" mandatory="true">
- </param>
- <param name="yCoord" type="Integer" mandatory="true">
- </param>
- </struct>
-
- <struct name="TouchArea">
- <param name="rotationAngle" type="Float" mandatory="false" minvalue="0" maxvalue="360">
- </param>
- <param name="radiusCoord" type="Coordinate" mandatory="true">
- </param>
- </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="ScreenParams">
- <param name="resolution" type="ImageResolution" mandatory="true">
- <description>The resolution of the prescribed screen area.</description>
- </param>
- <param name="touchEventAvailable" type="TouchEventCapabilities" mandatory="false">
- <description>Types of screen touch events available in screen area.</description>
- </param>
- </struct>
-
- <enum name="PermissionStatus">
- <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"/>
- <element name="USER_DISALLOWED" internal_name="PS_USER_DISALLOWED"/>
- <element name="USER_CONSENT_PENDING" internal_name="PS_USER_CONSENT_PENDING"/>
- </enum>
-
- <struct name="HMIPermissions">
- <param name="allowed" type="HMILevel" minsize="0" maxsize="100" array="true">
- <description>A set of all HMI levels that are permitted for this given RPC.</description>
- </param>
- <param name="userDisallowed" type="HMILevel" minsize="0" maxsize="100" array="true">
- <description>A set of all HMI levels that are prohibited for this given RPC.</description>
- </param>
- </struct>
-
- <struct name="ParameterPermissions">
- <param name="allowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true">
- <description>A set of all parameters that are permitted for this given RPC.</description>
- </param>
- <param name="userDisallowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true">
- <description>A set of all parameters that are prohibited for this given RPC.</description>
- </param>
- </struct>
-
- <struct name="PermissionItem">
- <param name="rpcName" type="String" maxlength="100">
- <description>Name of the individual RPC in the policy table.</description>
- </param>
- <param name="hmiPermissions" type="HMIPermissions" />
- <param name="parameterPermissions" type="ParameterPermissions" />
- </struct>
-
- <struct name="DisplayCapabilities">
- <description>Contains information about the display capabilities.</description>
- <param name="displayType" type="DisplayType">
- <description>The type of the display. See DisplayType</description>
- </param>
- <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true">
- <description>A set of all fields that support text data. See TextField</description>
- </param>
- <param name="imageFields" type="ImageField" minsize="1" maxsize="100" array="true">
- <description>A set of all fields that support images. See ImageField</description>
- </param>
- <param name="mediaClockFormats" type="MediaClockFormat" minsize="0" maxsize="100" array="true">
- <description>A set of all supported formats of the media clock. See MediaClockFormat</description>
- </param>
- <param name="graphicSupported" type="Boolean">
- <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">
- <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">
- <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="ButtonCapabilities">
- <description>Contains information about a button's capabilities.</description>
- <param name="name" type="ButtonName">
- <description>The name of the button. See ButtonName.</description>
- </param>
- <param name="shortPressAvailable" type="Boolean">
- <description>
- The button supports a short press.
- Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
- </description>
- </param>
- <param name="longPressAvailable" type="Boolean">
- <description>
- The button supports a LONG press.
- Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
- </description>
- </param>
- <param name="upDownAvailable" type="Boolean">
- <description>
- The button supports "button down" and "button up".
- Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
- Whenever the button is released, onButtonEvent( UP) will be invoked.
- </description>
- </param>
- </struct>
-
- <struct name="SoftButtonCapabilities">
- <description>Contains information about a SoftButton's capabilities.</description>
- <param name="shortPressAvailable" type="Boolean">
- <description>
- The button supports a short press.
- Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
- </description>
- </param>
- <param name="longPressAvailable" type="Boolean">
- <description>
- The button supports a LONG press.
- Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
- </description>
- </param>
- <param name="upDownAvailable" type="Boolean">
- <description>
- The button supports "button down" and "button up".
- Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
- Whenever the button is released, onButtonEvent( UP) will be invoked.
- </description>
- </param>
- <param name="imageSupported" type="Boolean">
- <description>The button supports referencing a static or dynamic image.</description>
- </param>
- </struct>
-
- <struct name="PresetBankCapabilities">
- <description>Contains information about on-screen preset capabilities.</description>
- <param name="onScreenPresetsAvailable" type="Boolean">
- <description>Onscreen custom presets are available.</description>
- </param>
- </struct>
-
- <struct name="MenuParams">
- <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.
- If not provided, it will be provided 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 are at top level of the in application menu.
- 0 will insert at the front.
- 1 will insert at the second position.
- if position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
- If this param was omitted the entry will be added at the end.
- </description>
- </param>
-
- <param name="menuName" type="String" maxlength="500">
- <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>
- <param name="text" minlength="0" maxlength="500" type="String">
- <description>
- The text or phonemes to speak.
- May not be empty.
- </description>
- </param>
- <param name="type" type="SpeechCapabilities">
- <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities</description>
- </param>
- </struct>
-
- <struct name="Turn">
- <param name="navigationText" type="String" maxlength="500" mandatory="false">
- </param>
- <param name="turnIcon" type="Image" mandatory="false">
- </param>
- </struct>
-
- <struct name="VehicleType">
- <param name="make" type="String" maxlength="500" mandatory="false">
- <description>Make of the vehicle, e.g. Ford</description>
- </param>
- <param name="model" type="String" maxlength="500" mandatory="false">
- <description>Model of the vehicle, e.g. Fiesta</description>
- </param>
- <param name="modelYear" type="String" maxlength="500" mandatory="false">
- <description>Model Year of the vehicle, e.g. 2013</description>
- </param>
- <param name="trim" type="String" maxlength="500" mandatory="false">
- <description>Trim of the vehicle, e.g. SE</description>
- </param>
- </struct>
-
- <enum name="KeyboardLayout">
- <description>Enumeration listing possible keyboard layouts.</description>
- <element name="QWERTY" />
- <element name="QWERTZ" />
- <element name="AZERTY" />
- </enum>
-
- <enum name="KeyboardEvent" platform="MobileNav">
- <description>Enumeration listing possible keyboard events.</description>
- <element name="KEYPRESS" />
- <element name="ENTRY_SUBMITTED" />
- <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>
-
- <struct name="KeyboardProperties">
- <description>Configuration of on-screen keyboard (if available).</description>
-
- <param name="language" type="Language" mandatory="false">
- <description>The keyboard language.</description>
- </param>
-
- <param name="keyboardLayout" type="KeyboardLayout" mandatory="false" >
- <description>Desired keyboard layout.</description>
- </param>
-
- <param name="keypressMode" type="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>
-
- <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" />
- </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="FunctionID" internal_scope="base">
- <description>Enumeration linking function names with function IDs in AppLink protocol.</description>
- <description>Assumes enumeration starts at value 0.</description>
- <element name="RESERVED" value="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" />
-
-
-
-<!--
- 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" />
-<!--
- Ford Specific Request / Response RPCs
- Range = 0x 0001 0000 - 0x 0001 7FFF
--->
-
-
-<!--
- Ford Specific Notifications
- Range = 0x 0001 8000 - 0x 0001 FFFF
--->
-
- </enum>
-
- <enum name="messageType">
- <description>
- Enumeration linking message types with function types in WiPro protocol.
- Assumes enumeration starts at value 0.
- </description>
- <element name="request" value="0" />
- <element name="response" value="1" />
- <element name="notification" value="2" />
- </enum>
-
- <!-- Requests/Responses -->
-
- <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="request">
- <description>
- Establishes an interface with a mobile application.
- Before registerAppInterface no other commands will be accepted/executed.
- </description>
-
- <param name="syncMsgVersion" type="SyncMsgVersion">
- <description>See SyncMsgVersion</description>
- </param>
-
- <param name="appName" type="String" maxlength="100">
- <description>
- The mobile application name, e.g. "Ford Drive Green".
- 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 previously registered applications and any predefined blacklist of words (global commands)
- Needs to be unique over all applications. Applications with the same name will be rejected.
- Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
- </description>
- </param>
-
- <param name="ttsName" type="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.
- Needs to be unique over all applications.
- May not be empty.
- May not start with a new line character.
- </description>
- </param>
-
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
- <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)
- Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
- </description>
- </param>
-
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <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)
- Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
- </description>
- </param>
-
- <param name="isMediaApplication" type="Boolean">
- <description>
- Indicates if the application is a media or a non-media application.
- Only media applications will be able to stream audio to Sync that is audible outside of the BT media source.
- </description>
- </param>
- <param name="languageDesired" type="Language" mandatory="true">
- <description>
- See Language
- Current app’s expected VR+TTS language
- If there is a mismatch with SYNC, 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">
- <description>
- See Language
- Current app’s expected display language
- If there is a mismatch with SYNC, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
- </description>
- </param>
- <param name="appHMIType" type="AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- See AppHMIType
- List of all applicable app HMI types stating which HMI classifications to be given to the app.
- e.g. for platforms like GEN2, this will determine which "corner(s)" the app can populate.
- </description>
- </param>
- <param name="hashID" type="String" maxlength="100" mandatory="false">
- <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.
- If omitted, then the previous state of an app's commands, etc. will not be restored.
- </description>
- </param>
- <param name="deviceInfo" type="DeviceInfo" mandatory="false">
- <description>
- See DeviceInfo.
- </description>
- </param>
- <param name="appID" type="String" maxlength="100" mandatory="true">
- <description>ID used to validate app with policy table entries</description>
- </param>
- </function>
-
- <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="response">
- <description>The response to registerAppInterface</description>
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="GENERIC_ERROR"/>
- <element name="DUPLICATE_NAME"/>
- <element name="TOO_MANY_APPLICATIONS"/>
- <element name="APPLICATION_REGISTERED_ALREADY"/>
- <element name="UNSUPPORTED_VERSION"/>
- <element name="WRONG_LANGUAGE"/>
- <element name="DISALLOWED"/>
- <element name="WARNINGS"/>
- <element name="RESUME_FAILED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="false">
- <description>See SyncMsgVersion</description>
- </param>
-
- <param name="language" type="Language" mandatory="false">
- <description>The currently active VR+TTS language on Sync. See "Language" for options.</description>
- </param>
-
- <param name="hmiDisplayLanguage" type="Language" mandatory="false">
- <description>The currently active display language on Sync. See "Language" for options.</description>
- </param>
-
- <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
- <description>See DisplayCapabilities</description>
- </param>
-
- <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See ButtonCapabilities</description >
- </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 >
- </param>
-
- <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
- <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">
- <issue creator="rs">If not used yet => remove</issue>
- <description>See HmiZoneCapabilities</description>
- </param>
-
- <param name="speechCapabilities" type="SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See SpeechCapabilities</description>
- </param>
-
- <param name="vrCapabilities" type="VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See VrCapabilities</description>
- </param>
-
- <param name="audioPassThruCapabilities" type="AudioPassThruCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See AudioPassThruCapability</description>
- </param>
-
- <param name="vehicleType" type="VehicleType" mandatory="false">
- <description>Specifies the vehicle's type. See VehicleType.</description>
- </param>
-
- <param name="prerecordedSpeech" type="PrerecordedSpeech" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See PrerecordedSpeech</description>
- </param>
-
- <param name="supportedDiagModes" type="Integer" minvalue="0" maxvalue="255" array="true" minsize="1" maxsize="100" mandatory="false">
- <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>
-
- </function>
-
- <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="request">
- <description>
- Closes an interface from a mobile application.
- After unregisterAppInterface, no commands other than registerAppInterface will be accepted/executed.
- Will fail, if no registerAppInterface was completed successfully before.
- </description>
- </function>
-
- <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="request">
- <description>Allows setting global properties.</description>
-
- <param name="helpPrompt" type="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="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="vrHelpTitle" type="String" maxlength="500" mandatory="false">
- <description>
- VR Help Title text.
- If omitted on supported displays, the default SYNC help title shall be used.
- If omitted and one or more vrHelp items are provided, the request will be rejected.
- </description>
- </param>
-
- <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- VR Help Items.
- If omitted on supported displays, the default AppLink VR help / What Can I Say? screen shall be used.
- If the list of VR Help Items contains nonsequential positions (e.g. [1,2,4]), the RPC shall be rejected.
- If omitted and a vrHelpTitle is provided, the request will be rejected.
- </description>
- </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="Image" mandatory="false">
- <description>>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
- </param>
-
- <param name="keyboardProperties" type="KeyboardProperties" mandatory="false">
- <description>On-screen keybaord configuration (if available).</description>
- </param>
- </function>
-
- <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="request">
- <description>Allows resetting global properties.</description>
-
- <param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true" >
- <description>Contains the names of all global properties (like timeoutPrompt) that should be unset. Resetting means, that they have the same value as at start up (default)</description>
- </param>
- </function>
-
- <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="AddCommand" functionID="AddCommandID" messagetype="request">
- <description>
- Adds a command to the in application menu.
- Either menuParams or vrCommands must be provided.
- </description>
-
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>unique ID of the command to add.</description>
- </param>
-
- <param name="menuParams" type="MenuParams" mandatory="false">
- <description>Optional sub value containing menu parameters</description>
- </param>
-
- <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="false">
- <description>
- An array of strings to be used as VR synonyms for this command.
- If this array is provided, it may not be empty.
- </description>
- </param>
-
- <param name="cmdIcon" type="Image" mandatory="false">
- <description>
- Image struct determining whether static or dynamic icon.
- If omitted on supported displays, no (or the default if applicable) icon shall be displayed.
- </description>
- </param>
-
- </function>
-
- <function name="AddCommand" functionID="AddCommandID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="request">
- <description>Deletes all commands from the in-application menu with the specified command id.</description>
-
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>ID of the command(s) to delete.</description>
- </param>
-
- </function>
-
- <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="IN_USE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="request">
- <description>Adds a sub menu to the in-application menu.</description>
-
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000">
- <description>unique ID of the sub menu to add.</description>
- </param>
-
- <param name="position" type="Integer" minvalue="0" maxvalue="1000" defvalue="1000" mandatory="false">
- <description>
- Position within the items that are are at top level of the in application menu.
- 0 will insert at the front.
- 1 will insert at the second position.
- If position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
- Position of any submenu will always be located before the return and exit options
- If this param was omitted the entry will be added at the end.
- </description>
- </param>
-
- <param name="menuName" maxlength="500" type="String">
- <description>Text to show in the menu for this sub menu.</description>
- </param>
- </function>
-
- <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="request">
- <description>Deletes a submenu from the in-application menu.</description>
-
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000">
- <description>The "menuID" of the submenu to delete. (See addSubMenu.menuID)</description>
- </param>
-
- </function>
-
- <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="IN_USE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="request">
- <description>creates interaction choice set to be used later by performInteraction</description>
-
- <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>Unique ID used for this interaction choice set.</description>
- </param>
-
- <param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true" />
- </function>
-
- <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="request">
- <description>Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
-
- <param name="initialText" type="String" maxlength="500" >
- <description>Text to be displayed first.</description>
- </param>
-
- <param name="initialPrompt" type="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="interactionMode" type="InteractionMode">
- <description>See InteractionMode.</description>
- </param>
-
- <param name="interactionChoiceSetIDList" type="Integer" minsize="0" maxsize="100" minvalue="0" maxvalue="2000000000" array="true">
- <description>List of interaction choice set IDs to use with an interaction.</description>
- </param>
-
- <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Help text. This is the spoken string when a user speaks "help" when the interaction is occuring.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Timeout text. This text is spoken when a VR interaction times out.
- 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" minvalue="5000" maxvalue="100000" defvalue="10000" mandatory="false">
- <description>
- Timeout in milliseconds.
- If omitted a standard value of 10000 milliseconds is used.
- Applies only to the menu portion of the interaction. The VR timeout will be handled by the platform.
- </description>
- </param>
-
- <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Ability to send suggested VR Help Items to display on-screen during Perform Interaction.
- If omitted on supported displays, the default SYNC generated list of suggested choices shall be displayed.
- </description>
- </param>
-
- <param name="interactionLayout" type="LayoutMode" mandatory="false">
- <description>See LayoutMode.</description>
- </param>
-
- </function>
-
- <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- <element name="TIMED_OUT"/>
- <element name="ABORTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- ID of the choice that was selected in response to PerformInteraction.
- Only is valid if resultCode is SUCCESS.
- </description>
- </param>
-
- <param name="manualTextEntry" type="String" 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>
-
- <param name="triggerSource" type="TriggerSource" mandatory="false">
- <description>
- See TriggerSource
- Only is valid if resultCode is SUCCESS.
- </description>
- </param>
-
- </function>
-
- <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="request">
- <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>
-
- <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>ID of the interaction choice set to delete.</description>
- </param>
- </function>
-
- <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="IN_USE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="Alert" functionID="AlertID" messagetype="request">
- <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">
- <description>The first line of the alert text field</description>
- </param>
-
- <param name="alertText2" type="String" maxlength="500" mandatory="false">
- <description>The second line of the alert text field</description>
- </param>
-
- <param name="alertText3" type="String" maxlength="500" mandatory="false">
- <description>The optional third line of the alert text field</description>
- </param>
-
- <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="duration" type="Integer" minvalue="3000" maxvalue="10000" defvalue="5000" mandatory="false">
- <description>
- Timeout in milliseconds.
- Typical timeouts are 3-5 seconds.
- If omitted, timeout is set to 5s.
- </description>
- </param>
-
- <param name="playTone" type="Boolean" mandatory="false">
- <description>
- Defines if tone should be played. Tone is played before TTS.
- If omitted, no tone is played.
- </description>
- </param>
-
- <param name="progressIndicator" type="Boolean" mandatory="false" platform="MobileNav">
- <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">
- <description>
- App defined SoftButtons.
- If omitted on supported displays, the displayed alert shall not have any SoftButtons.
- </description>
- </param>
-
- </function>
-
- <function name="Alert" functionID="AlertID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="ABORTED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="tryAgainTime" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <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.
- An app must not send an alert without waiting at least the amount of time dictated.
- </description>
- </param>
-
- </function>
-
- <function name="Show" functionID="ShowID" messagetype="request">
- <description>Updates the persistent display. Supported fields depend on display capabilities.</description>
-
- <param name="mainField1" type="String" minlength="0" maxlength="500" mandatory="false">
- <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.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="mainField2" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- The text that should be displayed on the second display line.
- If this text is not set, the text of mainField2 stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="mainField3" type="String" minlength="0" maxlength="500" mandatory="false">
- <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.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="mainField4" type="String" minlength="0" maxlength="500" mandatory="false">
- <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.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="alignment" type="TextAlignment" mandatory="false">
- <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">
- <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">
- <description>
- Text value for MediaClock field. Has to be properly formatted by Mobile App according to Sync 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">
- <description>
- The text that should be displayed in the track field.
- This field is only valid for media applications on NGN type ACMs.
- If this text is not set, the text of mediaTrack stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="graphic" type="Image" mandatory="false">
- <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">
- <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">
- <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">
- <description>
- App labeled on-screen presets (i.e. GEN2).
- If omitted on supported displays, the presets will be shown as not defined.
- </description>
- </param>
-
- </function>
-
- <function name="Show" functionID="ShowID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="ABORTED"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="Speak" functionID="SpeakID" messagetype="request">
- <description>Speaks a text.</description>
-
- <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true">
- <description>
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- </function>
-
- <function name="Speak" functionID="SpeakID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="ABORTED"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="request">
- <description>Sets the initial media clock value and automatic update method.</description>
-
- <param name="startTime" type="StartTime" mandatory="false">
- <description>
- See StartTime.
- startTime must be provided for "COUNTUP" and "COUNTDOWN".
- startTime will be ignored for "PAUSE", "RESUME", and "CLEAR"
- </description>
- </param>
-
- <param name="endTime" type="StartTime" mandatory="false">
- <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)
- 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="UpdateMode" mandatory="true">
- <description>
- Enumeration to control the media clock.
- 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>
- </function>
-
- <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="IGNORED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="request">
- <description>Starts audio pass thru session </description>
- <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- SYNC will speak this prompt before opening the audio pass thru session.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- If omitted, then no initial prompt is spoken.
- </description>
- </param>
- <param name="audioPassThruDisplayText1" type="String" mandatory="false" maxlength="500">
- <description>First line of text displayed during audio capture.</description>
- </param>
- <param name="audioPassThruDisplayText2" type="String" mandatory="false" maxlength="500">
- <description>Second line of text displayed during audio capture.</description>
- </param>
- <param name="samplingRate" type="SamplingRate" mandatory="true">
- <description> This value shall be allowed at 8 khz or 16 or 22 or 44 khz.</description>
- </param>
- <param name="maxDuration" type="Integer" minvalue="1" maxvalue="1000000" mandatory="true">
- <description>The maximum duration of audio recording in milliseconds. </description>
- </param>
- <param name="bitsPerSample" type="BitsPerSample" mandatory="true">
- <description>Specifies the quality the audio is recorded. Currently 8 bit or 16 bit.</description>
- </param>
- <param name="audioType" type="AudioType" mandatory="true">
- <description>Specifies the type of audio data being requested.</description>
- </param>
- <param name="muteAudio" type="Boolean" mandatory="false">
- <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" functionID="PerformAudioPassThruID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="DISALLOWED"/>
- <element name="REJECTED"/>
- <element name="ABORTED"/>
- <element name="RETRY"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="request">
- <description>When this request is invoked, the audio capture stops.</description>
- </function>
-
- <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="request">
- <description>
- Subscribes to built-in HMI buttons.
- The application will be notified by the OnButtonEvent and OnButtonPress.
- To unsubscribe the notifications, use unsubscribeButton.
- </description>
-
- <param name="buttonName" type="ButtonName">
- <description>Name of the button to subscribe.</description>
- </param>
- </function>
-
- <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="UNSUPPORTED_RESOURCE" />
- <element name="IGNORED" />
- <element name="REJECTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="request">
- <description>Unsubscribes from built-in HMI buttons.</description>
-
- <param name="buttonName" type="ButtonName">
- <description>Name of the button to unsubscribe.</description>
- </param>
- </function>
-
- <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="UNSUPPORTED_RESOURCE" />
- <element name="IGNORED" />
- <element name="REJECTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" 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" functionID="SubscribeVehicleDataID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="WARNINGS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="IGNORED" />
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="gps" type="VehicleDataResult" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="VehicleDataResult" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="VehicleDataResult" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
- <description>The external temperature in degrees celsius.</description>
- </param>
- <param name="prndl" type="VehicleDataResult" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="VehicleDataResult" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="VehicleDataResult" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="VehicleDataResult" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="VehicleDataResult" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="VehicleDataResult" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="VehicleDataResult" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="VehicleDataResult" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="VehicleDataResult" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="VehicleDataResult" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModes" type="VehicleDataResult" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="VehicleDataResult" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="request">
- <description>This function is used to unsubscribe the notifications from the subscribeVehicleData function.</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="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="WARNINGS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="IGNORED" />
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="gps" type="VehicleDataResult" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="VehicleDataResult" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="VehicleDataResult" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="prndl" type="VehicleDataResult" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="VehicleDataResult" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="VehicleDataResult" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="VehicleDataResult" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="VehicleDataResult" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="VehicleDataResult" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="VehicleDataResult" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="VehicleDataResult" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="VehicleDataResult" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="VehicleDataResult" 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="VehicleDataResult" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModes" type="VehicleDataResult" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="VehicleDataResult" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="GetVehicleData" functionID="GetVehicleDataID" 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>
-
- <!-- 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="GetVehicleData" functionID="GetVehicleDataID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="VEHICLE_DATA_NOT_ALLOWED"/>
- <element name="VEHICLE_DATA_NOT_AVAILABLE"/>
- <element name="USER_DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="gps" type="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="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="PRNDL" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="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="BeltStatus" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="BodyInformation" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="DeviceStatus" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="VehicleDataEventStatus" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="WiperStatus" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="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>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="ECallInfo" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="AirbagStatus" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="EmergencyEvent" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="ClusterModeStatus" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="MyKey" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="ReadDID" functionID="ReadDIDID" messagetype="request">
- <description>Non periodic vehicle data read request</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>
- </function>
-
- <function name="ReadDID" functionID="ReadDIDID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="TRUNCATED_DATA"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="didResult" type="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" functionID="GetDTCsID" messagetype="request">
- <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>
-
- </function>
-
- <function name="GetDTCs" functionID="GetDTCsID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="TRUNCATED_DATA"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="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 (ecuHeader contains information if list is truncated).
- Each DTC is represented by 4 bytes (3 bytes of data and 1 byte status as defined in VHR_Layout_Specification_DTCs.pdf).
- </description>
- </param>
-
- </function>
-
- <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="request">
- <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>
- </function>
-
- <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="TRUNCATED_DATA"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="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="ScrollableMessage" functionID="ScrollableMessageID" messagetype="request">
- <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">
- <description>Body of text that can include newlines and tabs.</description>
- </param>
- <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" defvalue="30000" mandatory="false">
- <description>App defined timeout. Indicates how long of a timeout from the last action (i.e. scrolling message resets timeout).</description>
- </param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
- <description>
- App defined SoftButtons.
- If omitted on supported displays, only the system defined "Close" SoftButton will be displayed.
- </description>
- </param>
- </function>
-
- <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="CHAR_LIMIT_EXCEEDED"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="REJECTED"/>
- <element name="ABORTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="Slider" functionID="SliderID" messagetype="request">
- <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 display</description>
- </param>
- <param name="sliderFooter" type="String" maxlength="500" minsize="1" maxsize="26" array="true" mandatory="false">
- <description>
- Text footer to display (meant to display min/max threshold descriptors).
- For a static text footer, only one footer string shall be provided in the array.
- For a dynamic text footer, the number of footer text string in the array must match the numTicks value.
- For a dynamic text footer, text array string should correlate with potential slider position index.
- If omitted on supported displays, no footer text shall be displayed.
- </description>
- </param>
- <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" defvalue="10000" mandatory="false">
- <description>
- App defined timeout. Indicates how long of a timeout from the last action (i.e. sliding control resets timeout).
- If omitted, the value is set to 10000.
- </description>
- </param>
- </function>
-
- <function name="Slider" functionID="SliderID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="SAVED"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="REJECTED"/>
- <element name="ABORTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
- <description>
- Current slider value returned when saved or canceled (aborted)
- This value is only returned for resultCodes "SAVED" or "ABORTED"
- </description>
- </param>
- </function>
-
- <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="request">
- <param name="navigationText1" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="navigationText2" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="eta" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="timeToDestination" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="totalDistance" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="turnIcon" type="Image" mandatory="false">
- </param>
- <param name="nextTurnIcon" type="Image" mandatory="false">
- </param>
- <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false">
- <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">
- <description>
- Distance till next maneuver (starting from) from previous maneuver.
- 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, 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">
- <description>
- Three dynamic SoftButtons available (first SoftButton is fixed to "Turns").
- If omitted on supported displays, the currently displayed SoftButton values will not change.
- </description>
- </param>
- </function>
-
- <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="request">
- <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>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
- <description>If omitted on supported displays, only the system defined "Close" SoftButton shall be displayed.</description>
- </param>
- </function>
-
- <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="IGNORED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="ABORTED"/>
- <element name="WARNINGS"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="request">
- <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">
- <description>If omitted on supported displays, app-defined SoftButton will be left blank.</description>
- </param>
- </function>
-
- <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="request">
- <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">
- <description>Request new app name registration</description>
- </param>
- <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
- <description>Request new ttsName registration</description>
- </param>
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
- <description>Request new app short name registration</description>
- </param>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Request new VR synonyms registration</description>
- </param>
-
-</function>
-
-
-
- <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description>
- true, if successful
- false, if failed
- </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="DUPLICATE_NAME"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="GenericResponse" functionID="GenericResponseID" messagetype="response">
- <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.
- </description>
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="INVALID_DATA"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="PutFile" functionID="PutFileID" messagetype="request">
- <description>
- Used to push a binary data onto the SYNC module from a mobile device, such as icons and album art
- Not supported on first generation SYNC vehicles.
- Binary data is in binary part of hybrid msg.
- </description>
-
- <param name="syncFileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
-
- <param name="fileType" type="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>
-
- <param name="systemFile" type="Boolean" defvalue="false" mandatory="false">
- <description>Indicates if the file is meant to be passed thru core to elsewhere on the system.
- If set to TRUE, then the system will instead pass the data thru as it arrives to a predetermined area outside of core. If omitted, the value will be set to false.</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>
-
- </function>
-
- <function name="PutFile" functionID="PutFileID" messagetype="response">
- <description>Response is sent, when the file data was copied (success case). Or when an error occured.</description>
- <description>Not supported on First generation SYNC vehicles. </description>
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>
- Provides the total local space available on SYNC for the registered app.
- If the transfer has systemFile enabled, then the value will be set to 0 automatically.
- </description>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="DeleteFile" functionID="DeleteFileID" messagetype="request">
- <description>
- Used to delete a file resident on the SYNC module in the app's local cache.
- Not supported on first generation SYNC vehicles.
- </description>
-
- <param name="syncFileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
-
- </function>
-
- <function name="DeleteFile" functionID="DeleteFileID" messagetype="response">
- <description>
- Response is sent, when the file data was deleted (success case). Or when an error occured.
- Not supported on First generation SYNC vehicles.
- </description>
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>Provides the total local space available on SYNC for the registered app.</description>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="ListFiles" functionID="ListFilesID" messagetype="request">
- <description>
- Requests the current list of resident filenames for the registered app.
- Not supported on first generation SYNC vehicles.
- </description>
- </function>
-
- <function name="ListFiles" functionID="ListFilesID" messagetype="response">
- <description>
- Returns the current list of resident filenames for the registered app along with the current space available
- Not supported on First generation SYNC vehicles.
- </description>
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="filenames" type="String" maxlength="500" minsize="0" maxsize="1000" array="true" mandatory="false">
- <description>
- An array of all filenames resident on SYNC for the given registered app.
- If omitted, then no files currently reside on the system.
- </description>
- </param>
-
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>Provides the total local space available on SYNC for the registered app.</description>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="SetAppIcon" functionID="SetAppIconID" messagetype="request">
- <description>
- Used to set existing local file on SYNC as the app's icon
- Not supported on first generation SYNC vehicles.
- </description>
-
- <param name="syncFileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
-
- </function>
-
- <function name="SetAppIcon" functionID="SetAppIconID" messagetype="response">
- <description>
- Response is sent, when the file data was copied (success case). Or when an error occured.
- Not supported on First generation SYNC vehicles.
- </description>
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request">
- <description>
- Used to set an alternate display layout.
- If not sent, default screen for given platform will be shown
- </description>
-
- <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>
- </function>
-
- <function name="OnHashChange" functionID="OnHashChangeID" messagetype="notification">
- <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.
- </description>
-
- <param name="hashID" type="String" maxlength="100" mandatory="true">
- <description>Calculated hash ID to be referenced during RegisterAppInterface.</description>
- </param>
- </function>
-
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
- <description>See DisplayCapabilities</description>
- </param>
-
- <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See ButtonCapabilities</description >
- </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 >
- </param>
-
- <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
- <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">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SystemRequest" functionID="SystemRequestID" messagetype="request">
- <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="RequestType" mandatory="true">
- <description>The type of system request.</description>
- </param>
- <param name="fileName" type="String" maxlength="255" mandatory="false">
- <description>The name of file.</description>
- </param>
- </function>
-
- <function name="SystemRequest" functionID="SystemRequestID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_CERT"/>
- <element name="EXPIRED_CERT"/>
- </param>
- </function>
-
- <function name="SendLocation" functionID="SendLocationID" messagetype="request">
- <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="Image" mandatory="false">
- <description>
- Image / icon of intended location (if applicable and supported)
- </description>
- </param>
- </function>
-
- <function name="SendLocation" functionID="SendLocationID" messagetype="response" >
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="DISALLOWED"/>
- </param>
- </function>
-
-
- <!-- Notifications -->
-
- <function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification">
- <param name="hmiLevel" type="HMILevel">
- <description>See HMILevel</description>
- </param>
-
- <param name="audioStreamingState" type="AudioStreamingState">
- <description>See AudioStreamingState</description>
- </param>
-
- <param name="systemContext" type="SystemContext">
- <description>See SystemContext</description>
- </param>
- </function>
-
- <function name="OnAppInterfaceUnregistered" functionID="OnAppInterfaceUnregisteredID" messagetype="notification">
- <param name="reason" type="AppInterfaceUnregisteredReason">
- <description>See AppInterfaceUnregisteredReason</description>
- </param>
- </function>
-
- <function name="OnButtonEvent" functionID="OnButtonEventID" messagetype="notification">
- <description>Notifies application of UP/DOWN events for buttons to which the application is subscribed.</description>
- <param name="buttonName" type="ButtonName"/>
- <param name="buttonEventMode" type="ButtonEventMode">
- <description>Indicates whether this is an UP or DOWN event.</description>
- </param>
- <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false">
- <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">
- <description>Notifies application of LONG/SHORT press events for buttons to which the application is subscribed.</description>
- <param name="buttonName" type="ButtonName"/>
- <param name="buttonPressMode" type="ButtonPressMode">
- <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">
- <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">
- <description>Callback for the periodic and non periodic vehicle data read function.</description>
- <param name="gps" type="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="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="PRNDL" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="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="BeltStatus" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="BodyInformation" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="DeviceStatus" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="VehicleDataEventStatus" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="WiperStatus" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="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>
-
- <!-- Ford Specific Vehicle Data -->
- <param name="eCallInfo" type="ECallInfo" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="AirbagStatus" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="EmergencyEvent" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="ClusterModeStatus" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="MyKey" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Vehicle Data -->
-
- </function>
-
- <function name="OnCommand" functionID="OnCommandID" messagetype="notification">
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>Command ID, which is related to a specific menu entry</description>
- </param>
-
- <param name="triggerSource" type="TriggerSource">
- <description>See TriggerSource</description>
- </param>
- </function>
-
- <function name="OnTBTClientState" functionID="OnTBTClientStateID" messagetype="notification" >
- <description>Provides applications with notifications specific to the current TBT client status on the module</description>
- <param name="state" type="TBTState">
- <description>Current State of TBT client</description>
- </param>
- </function>
-
- <function name="OnDriverDistraction" functionID="OnDriverDistractionID" messagetype="notification" >
- <description>Provides driver distraction state to mobile applications</description>
- <param name="state" type="DriverDistractionState">
- <description>Current State of Driver Distraction</description>
- </param>
- </function>
-
- <function name="OnPermissionsChange" functionID="OnPermissionsChangeID" messagetype="notification" >
- <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">
- <description>Change in permissions for a given set of RPCs</description>
- </param>
- </function>
-
- <function name="OnAudioPassThru" functionID="OnAudioPassThruID" messagetype="notification">
- <description>Binary data is in binary part of hybrid msg</description>
- </function>
-
- <function name="OnLanguageChange" functionID="OnLanguageChangeID" messagetype="notification">
- <param name="language" type="Language">
- <description>Current SYNC voice engine (VR+TTS) language</description>
- </param>
- <param name="hmiDisplayLanguage" type="Language">
- <description>Current display language</description>
- </param>
- </function>
-
- <function name="OnKeyboardInput" functionID="OnKeyboardInputID" messagetype="notification" platform="MobileNav">
-
- <description>On-screen keyboard event.</description>
- <description>Can be full string or individual keypresses depending on keyboard mode.</description>
-
- <param name="event" type="KeyboardEvent" mandatory="true">
- <description>On-screen keyboard input data.</description>
- </param>
-
- <param name="data" type="String" 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" functionID="OnTouchEventID" messagetype="notification" platform="MobileNav">
- <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>
- </param>
- <param name="event" type="TouchEvent" mandatory="true" minsize="1" maxsize="10" array="true">
- <description>List of all individual touches involved in this event.</description>
- </param>
- </function>
-
- <function name="OnSystemRequest" functionID="OnSystemRequestID" messagetype="notification">
- <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="RequestType" mandatory="true">
- <description>The type of system request.</description>
- </param>
- <param name="url" type="String" maxlength="1000" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Optional array of URL(s) for HTTP requests.
- If blank, the binary data shall be forwarded to the app.
- If not blank, the binary data shall be forwarded to the url(s) with a provided timeout in seconds.
- </description>
- </param>
- <param name="timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- Optional timeout for HTTP requests
- Required if a URL is provided
- </description>
- </param>
- <param name="fileType" type="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>
- </function>
-
-<!-- ~~~~~~~~~~~~~~~~~~ -->
-<!-- Ford Specific APIs -->
-<!-- ~~~~~~~~~~~~~~~~~~ -->
-</interface>
+<?xml version="1.0" standalone="no"?>
+<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
+
+<interface name="Ford Sync RAPI" version="4.0" date="2015-03-30">
+
+ <enum name="Result" internal_scope="base">
+ <element name="SUCCESS">
+ <description>The request succeeded</description>
+ </element>
+ <element name="INVALID_DATA">
+ <description>
+ The data sent is invalid. For example:
+ Invalid Json syntax
+ Parameters out of bounds (number or enum range)
+ Mandatory parameters not provided
+ Parameter provided with wrong type
+ Invalid characters
+ Empty string
+ </description>
+ </element>
+ <element name="UNSUPPORTED_REQUEST">
+ <description>The request is not supported by Sync</description>
+ </element>
+ <element name="OUT_OF_MEMORY">
+ <description>The system could not process the request because the necessary memory couldn't be allocated</description>
+ </element>
+ <element name="TOO_MANY_PENDING_REQUESTS">
+ <description>There are too many requests pending (means, that the response has not been delivered, yet).</description>
+ <designdescription>There may be a maximum of 1000 pending requests at a time.</designdescription>
+ </element>
+ <element name="INVALID_ID">
+ <description>
+ One of the provided IDs is not valid. For example
+ This applies to CorrelationID, SubscriptionID, CommandID, MenuID, etc.
+ </description>
+ </element>
+ <element name="DUPLICATE_NAME">
+ <description>There was a conflict with an registered name (application or menu item) or vr command</description>
+ </element>
+ <element name="TOO_MANY_APPLICATIONS">
+ <description>There are already too many registered applications</description>
+ </element>
+ <element name="APPLICATION_REGISTERED_ALREADY">
+ <description>RegisterApplication has been called again, after a RegisterApplication was successful before.</description>
+ </element>
+ <element name="UNSUPPORTED_VERSION">
+ <description>Sync doesn't support the protocol that is requested by the mobile application</description>
+ </element>
+ <element name="WRONG_LANGUAGE">
+ <description>
+ The requested language is currently not supported.
+ Might be because of a mismatch of the currently active language on Sync and the requested language
+ </description>
+ </element>
+ <element name="APPLICATION_NOT_REGISTERED">
+ <description>An command can not be executed because no application has been registered with RegisterApplication.</description>
+ </element>
+ <element name="IN_USE">
+ <description>
+ The data may not be changed, because it is currently in use.
+ For example when trying to delete a command set that is currently involved in an interaction.
+ </description>
+ </element>
+ <element name="VEHICLE_DATA_NOT_ALLOWED">
+ <description>The user has turned off access to vehicle data, and it is globally unavailable to mobile applications.</description>
+ </element>
+ <element name="VEHICLE_DATA_NOT_AVAILABLE">
+ <description>The requested vehicle data is not available on this vehicle or is not published.</description>
+ </element>
+ <element name="REJECTED">
+ <description>
+ The requested command was rejected, e.g. because mobile app is in background and cannot perform any HMI commands.
+ Or an HMI command (e.g. Speak) is rejected because a higher priority HMI command (e.g. Alert) is playing.
+ </description>
+ </element>
+ <element name="ABORTED">
+ <description>
+ A command was aborted, for example due to user interaction (e.g. user pressed button).
+ Or an HMI command (e.g. Speak) is aborted because a higher priority HMI command (e.g. Alert) was requested.
+ </description>
+ </element>
+ <element name="IGNORED">
+ <description>
+ A command was ignored, because the intended result is already in effect.
+ For example, SetMediaClockTimer was used to pause the media clock although the clock is paused already.
+ NOTE: potentially replaces SUBSCRIBED_ALREADY
+ </description>
+ </element>
+ <element name="UNSUPPORTED_RESOURCE">
+ <description>
+ A button that was requested for subscription is not supported under the current system.
+ NOTE: could become a more generic UNSUPPORTED_RESOURCE by merging with VEHICLE_DATA_NOT_AVAILABLE.
+ </description>
+ </element>
+ <element name="FILE_NOT_FOUND">
+ <description>A specified file could not be found on Sync.</description>
+ </element>
+ <element name="GENERIC_ERROR">
+ <description>Provided data is valid but something went wrong in the lower layers.</description>
+ </element>
+ <element name="DISALLOWED">
+ <description>RPC is not authorized in local policy table.</description>
+ </element>
+ <element name="USER_DISALLOWED">
+ <description>RPC is included in a functional group explicitly blocked by the user.</description>
+ </element>
+ <element name="TIMED_OUT">
+ <description>Overlay reached the maximum timeout and closed.</description>
+ </element>
+ <element name="CANCEL_ROUTE">
+ <description>User selected to Cancel Route.</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="RETRY">
+ <description>The user interrupted the RPC (e.g. PerformAudioPassThru) and indicated to start over. Note, the app must issue the new RPC.</description>
+ </element>
+ <element name="WARNINGS">
+ <description>The RPC (e.g. SubscribeVehicleData) executed successfully but one or more items have a warning or failure.</description>
+ </element>
+ <element name="SAVED">
+ <description>The RPC (e.g. Slider) executed successfully and the user elected to save the current position / value.</description>
+ </element>
+ <element name="INVALID_CERT">
+ <description>The certificate provided during authentication is invalid.</description>
+ </element>
+ <element name="EXPIRED_CERT">
+ <description>The certificate provided during authentication is expired.</description>
+ </element>
+ <element name="RESUME_FAILED">
+ <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="CHAR_LIMIT_EXCEEDED"></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 Sync 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 Sync and may vary
+ </description>
+ </element>
+ </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="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>
+</enum>
+
+ <enum name="UpdateMode">
+ <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->mediaClock)</description>
+ </enum>
+
+ <enum name="TimerMode">
+ <element name="UP" />
+ <description>Causes the media clock timer to update from 0:00 to a specified time</description>
+ <element name="DOWN" />
+ <description>Causes the media clock timer to update from a specified time to 0:00</description>
+ <element name="NONE" />
+ <description>Indicates to not use the media clock timer</description>
+ </enum>
+
+ <enum name="InteractionMode">
+ <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.
+ Selections are made with the OK and Seek Right and Left, Tune Up and Down buttons.
+ </description>
+ <element name="VR_ONLY" />
+ <description>
+ This mode causes the interaction to only occur using V4.
+ Selections are made by saying the command.
+ </description>
+ <element name="BOTH" />
+ <description>
+ This mode causes both a VR and display selection option for an interaction.
+ Selections can be made either from the menu display or by speaking the command.
+ </description>
+ </enum>
+
+ <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="HMILevel">
+ <description>Enumeraction that describes current levels of HMI.</description>
+ <element name="FULL" internal_name="HMI_FULL" />
+ <element name="LIMITED" internal_name="HMI_LIMITED" />
+ <element name="BACKGROUND" internal_name="HMI_BACKGROUND" />
+ <element name="NONE" internal_name="HMI_NONE" />
+ </enum>
+
+ <enum name="AudioStreamingState">
+ <description>Enumeraction that describes possible states of audio streaming.</description>
+ <element name="AUDIBLE" />
+ <element name="ATTENUATED" />
+ <element name="NOT_AUDIBLE" />
+ </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>App is 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="SystemContext">
+ <description>Enumeration that describes possible contexts an app's HMI might be in.</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>
+ </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 an in-App menu onscreen.</description>
+ </element>
+ <element name="HMI_OBSCURED" internal_name="SYSCTXT_HMI_OBSCURED">
+ <description>The app's display HMI is currently being obscured by either a system or other app's overlay.</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="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="AppInterfaceUnregisteredReason">
+ <description>Error code, which comes from sync side.</description>
+<!-- Deprecate
+ <element name="USER_EXIT" />
+-->
+ <element name="IGNITION_OFF" />
+ <element name="BLUETOOTH_OFF" />
+ <element name="USB_DISCONNECTED" />
+ <element name="REQUEST_WHILE_IN_NONE_HMI_LEVEL" />
+ <element name="TOO_MANY_REQUESTS" />
+ <element name="DRIVER_DISTRACTION_VIOLATION" />
+ <element name="LANGUAGE_CHANGE" />
+ <element name="MASTER_RESET" />
+ <element name="FACTORY_DEFAULTS" />
+ <element name="APP_UNAUTHORIZED" />
+ <element name="PROTOCOL_VIOLATION" />
+ </enum>
+
+ <enum name="TriggerSource">
+ <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" />
+ </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="SamplingRate">
+ <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"/>
+ </enum>
+
+ <enum name="BitsPerSample">
+ <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"/>
+ </enum>
+
+ <enum name="AudioType">
+ <description>Describes different audio type options for PerformAudioPassThru.</description>
+ <element name="PCM" />
+ </enum>
+
+ <struct name="AudioPassThruCapabilities">
+ <description>
+ Describes different audio type configurations for PerformAudioPassThru.
+ e.g. {8kHz,8-bit,PCM}
+ </description>
+ <param name="samplingRate" type="SamplingRate"/>
+ <param name="bitsPerSample" type="BitsPerSample"/>
+ <param name="audioType" type="AudioType"/>
+ </struct>
+
+ <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="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="MediaClockFormat">
+ <element name="CLOCK1">
+ <description>
+ minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;
+ used for Type II and CID headunits
+ </description>
+ </element>
+ <element name="CLOCK2">
+ <description>
+ minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59;
+ used for Type V headunit
+ </description>
+ </element>
+ <element name="CLOCK3">
+ <description>
+ minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
+ used for GEN1.1 MFD3/4/5 headunits
+ </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, see TypeII column in XLS. See [@TODO: create file ref]]
+ :|sp : colon or space
+ used for Type II headunit
+ </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, see CID column in XLS. See [@TODO: create file ref]]
+ :|sp : colon or space
+ used for CID headunit
+ NOTE: difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character set
+ </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, see Type 5 column in XLS]. See [@TODO: create file ref]
+ :|sp : colon or space
+ used for Type V headunit
+ </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].
+ used for GEN1.1 MFD3/4/5 headunits
+ </description>
+ </element>
+ </enum>
+
+ <enum name="DisplayType">
+ <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" />
+ </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="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>
+
+ </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="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>
+
+ <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="TBTState">
+ <description>Enumeration that describes possible states of turn-by-turn client or AppLink 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="DriverDistractionState">
+ <description>Enumeration that describes possible states of driver distraction.</description>
+ <element name="DD_ON" />
+ <element name="DD_OFF" />
+ </enum>
+
+ <enum name="ImageType">
+ <description>Contains information about the type of image.</description>
+ <element name="STATIC" />
+ <element name="DYNAMIC" />
+ </enum>
+
+ <struct name="Image">
+ <param name="value" minlength="0" maxlength="65535" type="String">
+ <description>Either the static hex icon value or the binary image file name identifier (sent by PutFile).</description>
+ </param>
+ <param name="imageType" type="ImageType">
+ <description>Describes, whether it is a static or dynamic image.</description>
+ </param>
+ </struct>
+
+ <struct name="SoftButton">
+ <param name="type" type="SoftButtonType">
+ <description>Describes, whether it is text, highlighted text, icon, or dynamic image. See softButtonType</description>
+ </param>
+ <param name="text" minlength="0" maxlength="500" type="String" mandatory="false">
+ <description>Optional text to display (if defined as TEXT or BOTH)</description>
+ </param>
+ <param name="image" type="Image" mandatory="false">
+ <description>Optional image struct for SoftButton (if defined as IMAGE or BOTH)</description>
+ </param>
+ <param name="isHighlighted" type="Boolean" defvalue="false" mandatory="false">
+ <description>
+ True, if highlighted
+ False, if not highlighted
+ </description>
+ </param>
+ <param name="softButtonID" type="Integer" minvalue="0" maxvalue="65535">
+ <description>Value which is returned via OnButtonPress / OnButtonEvent</description>
+ </param>
+ <param name="systemAction" type="SystemAction" defvalue="DEFAULT_ACTION" mandatory="false">
+ <description>Parameter indicating whether selecting a SoftButton shall call a specific system action. This is intended to allow Notifications to bring the callee into full / focus; or in the case of persistent overlays, the overlay can persist when a SoftButton is pressed.</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" />
+ <param name="menuName" type="String" maxlength="500" />
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" />
+ <param name="image" type="Image" mandatory="false"/>
+ <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">
+ <description>Text to display for VR Help item</description>
+ </param>
+ <param name="image" type="Image" mandatory="false">
+ <description>Image struct for VR Help item</description>
+ </param>
+ <param name="position" type="Integer" minvalue="1" maxvalue="100">
+ <description>Position to display item in VR Help list</description>
+ </param>
+ </struct>
+
+ <struct name="SyncMsgVersion">
+ <description>Specifies the version number of the SYNC V4 protocol, that is supported by the mobile application</description>
+
+ <param name="majorVersion" type="Integer" minvalue="1" maxvalue="10">
+ <description>The major version indicates versions that is not-compatible to previous versions.</description>
+ </param>
+ <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000">
+ <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>
+ </struct>
+
+ <enum name="GlobalProperty">
+ <description>The different global properties.</description>
+ <element name="HELPPROMPT">
+ <description>The property helpPrompt of setGlobalProperties</description>
+ </element>
+ <element name="TIMEOUTPROMPT">
+ <description>The property timeoutPrompt of setGlobalProperties</description>
+ </element>
+ <element name="VRHELPTITLE">
+ <description>The property vrHelpTitle of setGlobalProperties</description>
+ </element>
+ <element name="VRHELPITEMS">
+ <description>The property array of vrHelp of setGlobalProperties</description>
+ </element>
+ <element name="MENUNAME">
+ <description>The property in-app menu name of setGlobalProperties</description>
+ </element>
+ <element name="MENUICON">
+ <description>The property in-app menu icon of setGlobalProperties</description>
+ </element>
+ <element name="KEYBOARDPROPERTIES">
+ <description>The on-screen keyboard configuration of setGlobalProperties</description>
+ </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="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="UNKNOWN">
+ </element>
+ <element name="FAULT">
+ </element>
+ </enum>
+
+ <enum name="ComponentVolumeStatus">
+ <description>The volume status of a vehicle component.</description>
+ <element name="UNKNOWN" internal_name="CVS_UNKNOWN">
+ </element>
+ <element name="NORMAL" internal_name="CVS_NORMAL">
+ </element>
+ <element name="LOW" internal_name="CVS_LOW">
+ </element>
+ <element name="FAULT" internal_name="CVS_FAULT">
+ </element>
+ <element name="ALERT" internal_name="CVS_ALERT">
+ </element>
+ <element name="NOT_SUPPORTED" internal_name="CVS_NOT_SUPPORTED">
+ </element>
+ </enum>
+
+ <struct name="SingleTireStatus">
+ <param name="status" type="ComponentVolumeStatus">
+ <description>See ComponentVolumeStatus.</description>
+ </param>
+ </struct>
+
+ <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="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="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">
+ </element>
+ </enum>
+
+ <enum name="IgnitionStatus">
+ <description>Reflects the status of ignition.</description>
+ <element name="UNKNOWN" internal_name="IS_UNKNOWN">
+ </element>
+ <element name="OFF" internal_name="IS_OFF">
+ </element>
+ <element name="ACCESSORY" internal_name="IS_ACCESSORY">
+ </element>
+ <element name="RUN" internal_name="IS_RUN">
+ </element>
+ <element name="START" internal_name="IS_START">
+ </element>
+ <element name="INVALID" internal_name="IS_INVALID">
+ </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">
+ </element>
+ <element name="NO" internal_name="VDES_NO">
+ </element>
+ <element name="YES" internal_name="VDES_YES">
+ </element>
+ <element name="NOT_SUPPORTED" internal_name="VDES_NOT_SUPPORTED">
+ </element>
+ <element name="FAULT" internal_name="VDES_FAULT">
+ </element>
+ </enum>
+
+ <enum name="DeviceLevelStatus">
+ <description>Reflects the reported battery 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="WiperStatus">
+ <description>Reflects the status of the wipers.</description>
+ <element name="OFF" />
+ <element name="AUTO_OFF" />
+ <element name="OFF_MOVING" />
+ <element name="MAN_INT_OFF" />
+ <element name="MAN_INT_ON" />
+ <element name="MAN_LOW" />
+ <element name="MAN_HIGH" />
+ <element name="MAN_FLICK" />
+ <element name="WASH" />
+ <element name="AUTO_LOW" />
+ <element name="AUTO_HIGH" />
+ <element name="COURTESYWIPE" />
+ <element name="AUTO_ADJUST" />
+ <element name="STALLED" />
+ <element name="NO_DATA_EXISTS" />
+ </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="MaintenanceModeStatus">
+ <description>Reflects the status of a vehicle maintenance mode.</description>
+ <element name="NORMAL" internal_name="MMS_NORMAL">
+ </element>
+ <element name="NEAR" internal_name="MMS_NEAR">
+ </element>
+ <element name="ACTIVE" internal_name="MMS_ACTIVE">
+ </element>
+ <element name="FEATURE_NOT_PRESENT" internal_name="MMS_FEATURE_NOT_PRESENT">
+ </element>
+ </enum>
+
+ <enum name="VehicleDataActiveStatus">
+ <description>Reflects the status of given vehicle component.</description>
+ <element name="INACTIVE_NOT_CONFIRMED" internal_name="VDAS_INACTIVE_NOT_CONFIRMED">
+ </element>
+ <element name="INACTIVE_CONFIRMED" internal_name="VDAS_INACTIVE_CONFIRMED">
+ </element>
+ <element name="ACTIVE_NOT_CONFIRMED" internal_name="VDAS_ACTIVE_NOT_CONFIRMED">
+ </element>
+ <element name="ACTIVE_CONFIRMED" internal_name="VDAS_ACTIVE_CONFIRMED">
+ </element>
+ <element name="FAULT" internal_name="VDAS_FAULT">
+ </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" internal_name="ALS_UNKNOWN" />
+ <element name="INVALID" />
+ </enum>
+
+ <struct name="BeltStatus">
+ <param name="driverBeltDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerBeltDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsPasBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerBuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw1PasBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverBuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw1DrvBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRow2BuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw2lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerChildDetected" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw1PasChld_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRow2BuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw2rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow2BuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw2mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow3BuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw3mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRow3BuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw3lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRow3BuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw3rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRearInflatableBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw2lRib_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRearInflatableBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw2rRib_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow1BeltDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw1mBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow1BuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw1mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="BodyInformation">
+ <param name="parkBrakeActive" type="Boolean">
+ <description>References signal "PrkBrkActv_B_Actl".</description>
+ </param>
+ <param name="ignitionStableStatus" type="IgnitionStableStatus">
+ <description>References signal "Ignition_Switch_Stable". See IgnitionStableStatus.</description>
+ </param>
+ <param name="ignitionStatus" type="IgnitionStatus">
+ <description>References signal "Ignition_status". 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">
+ <description>References signal "CPM_VoiceRec_STAT".</description>
+ </param>
+ <param name="btIconOn" type="Boolean">
+ <description>References signal "BT_ICON".</description>
+ </param>
+ <param name="callActive" type="Boolean">
+ <description>References signal "CPM_Call_Active_STAT".</description>
+ </param>
+ <param name="phoneRoaming" type="Boolean">
+ <description>References signal "CPM_Phone_Roaming_STAT".</description>
+ </param>
+ <param name="textMsgAvailable" type="Boolean">
+ <description>References signal "CPM_TextMsg_AVAL".</description>
+ </param>
+ <param name="battLevelStatus" type="DeviceLevelStatus">
+ <description>Device battery level status. References signal "CPM_Batt_Level_STAT". See DeviceLevelStatus.</description>
+ </param>
+ <param name="stereoAudioOutputMuted" type="Boolean">
+ <description>References signal "CPM_Stereo_Audio_Output".</description>
+ </param>
+ <param name="monoAudioOutputMuted" type="Boolean">
+ <description>References signal "CPM_Mono_Audio_Output".</description>
+ </param>
+ <param name="signalLevelStatus" type="DeviceLevelStatus">
+ <description>Device signal level status. References signal "CPM_Signal_Strength_STAT". See DeviceLevelStatus.</description>
+ </param>
+ <param name="primaryAudioSource" type="PrimaryAudioSource">
+ <description>References signal "CPM_Stereo_PAS_Source". See PrimaryAudioSource.</description>
+ </param>
+ <param name="eCallEventActive" type="Boolean">
+ <description>References signal "eCall_Event".</description>
+ </param>
+ </struct>
+
+ <struct name="HeadLampStatus">
+ <param name="lowBeamsOn" type="Boolean">
+ <description>Status of the low beam lamps. References signal "HeadLampLoActv_B_Stat".</description>
+ </param>
+ <param name="highBeamsOn" type="Boolean">
+ <description>Status of the high beam lamps. References signal "HeadLghtHiOn_B_Stat".</description>
+ </param>
+ <param name="ambientLightSensorStatus" type="AmbientLightStatus" mandatory="false">
+ <description>Status of the ambient light sensor.</description>
+ </param>
+ </struct>
+
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
+<!-- Ford Specific Data Items -->
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <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="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="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="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="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="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="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>
+
+ <struct name="ECallInfo">
+ <param name="eCallNotificationStatus" type="VehicleDataNotificationStatus">
+ <description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
+ </param>
+ <param name="auxECallNotificationStatus" type="VehicleDataNotificationStatus">
+ <description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
+ </param>
+ <param name="eCallConfirmationStatus" type="ECallConfirmationStatus">
+ <description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="AirbagStatus">
+ <param name="driverAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverSideAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverCurtainAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerCurtainAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverKneeAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerSideAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerKneeAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="EmergencyEvent">
+ <param name="emergencyEventType" type="EmergencyEventType">
+ <description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
+ </param>
+ <param name="fuelCutoffStatus" type="FuelCutoffStatus">
+ <description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
+ </param>
+ <param name="rolloverEvent" type="VehicleDataEventStatus">
+ <description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+
+ <param name="maximumChangeVelocity" type="Integer" minvalue="0" maxvalue="255">
+ <description>References signal "VedsMaxDeltaV_D_Ltchd". Change in velocity in KPH. Additional reserved values:
+ 0x00 No event
+ 0xFE Not supported
+ 0xFF Fault
+ </description>
+ </param>
+ <param name="multipleEvents" type="VehicleDataEventStatus">
+ <description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="ClusterModeStatus">
+ <param name="powerModeActive" type="Boolean">
+ <description>References signal "PowerMode_UB".</description>
+ </param>
+ <param name="powerModeQualificationStatus" type="PowerModeQualificationStatus">
+ <description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
+ </param>
+ <param name="carModeStatus" type="CarModeStatus">
+ <description>References signal "CarMode". See CarMode.</description>
+ </param>
+ <param name="powerModeStatus" type="PowerModeStatus">
+ <description>References signal "PowerMode". See PowerMode.</description>
+ </param>
+ </struct>
+
+ <struct name="MyKey">
+ <param name="e911Override" type="VehicleDataStatus">
+ <description>Indicates whether e911 override is on. References signal "MyKey_e911Override_St". See VehicleDataStatus.</description>
+ </param>
+ </struct>
+
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+<!-- / Ford Specific Data Items -->
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <enum name="VehicleDataResultCode">
+ <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>
+ </element>
+ <element name="TRUNCATED_DATA" internal_name="VDRC_TRUNCATED_DATA">
+ <description>DTC / DID request successful, however, not all active DTCs or full contents of DID location available</description>
+ </element>
+ <element name="DISALLOWED" internal_name="VDRC_DISALLOWED">
+ <description>This vehicle data item is not allowed for this app by Ford.</description>
+ </element>
+ <element name="USER_DISALLOWED" internal_name="VDRC_USER_DISALLOWED">
+ <description>The user has not granted access to this type of vehicle data item at this time.</description>
+ </element>
+ <element name="INVALID_ID" internal_name="VDRC_INVALID_ID">
+ <description>The ECU ID referenced is not a valid ID on the bus / system.</description>
+ </element>
+ <element name="VEHICLE_DATA_NOT_AVAILABLE" internal_name="VDRC_DATA_NOT_AVAILABLE">
+ <description>The requested vehicle data item / DTC / DID is not currently available or responding on the bus / system.</description>
+ </element>
+ <element name="DATA_ALREADY_SUBSCRIBED" internal_name="VDRC_DATA_ALREADY_SUBSCRIBED">
+ <description>The vehicle data item is already subscribed.</description>
+ </element>
+ <element name="DATA_NOT_SUBSCRIBED" internal_name="VDRC_DATA_NOT_SUBSCRIBED">
+ <description>The vehicle data item cannot be unsubscribed because it is not currently subscribed.</description>
+ </element>
+ <element name="IGNORED" internal_name="VDRC_IGNORED">
+ <description>The request for this item is ignored because it is already in progress.</description>
+ </element>
+ </enum>
+
+ <struct name="TireStatus">
+ <description>The status and pressure of the tires.</description>
+
+ <param name="pressureTelltale" type="WarningLightStatus">
+ <description>Status of the Tire Pressure Telltale. See WarningLightStatus.</description>
+ </param>
+ <param name="leftFront" type="SingleTireStatus">
+ <description>The status of the left front tire.</description>
+ </param>
+ <param name="rightFront" type="SingleTireStatus">
+ <description>The status of the right front tire.</description>
+ </param>
+ <param name="leftRear" type="SingleTireStatus">
+ <description>The status of the left rear tire.</description>
+ </param>
+ <param name="rightRear" type="SingleTireStatus">
+ <description>The status of the right rear tire.</description>
+ </param>
+ <param name="innerLeftRear" type="SingleTireStatus">
+ <description>The status of the inner left rear.</description>
+ </param>
+ <param name="innerRightRear" type="SingleTireStatus">
+ <description>The status of the inner right rear.</description>
+ </param>
+ </struct>
+
+ <struct name="GPSData">
+ <description>Struct with the GPS data.</description>
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90">
+ </param>
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100">
+ <description>The current UTC year.</description>
+ </param>
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12">
+ <description>The current UTC month.</description>
+ </param>
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31">
+ <description>The current UTC day.</description>
+ </param>
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23">
+ <description>The current UTC hour.</description>
+ </param>
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59">
+ <description>The current UTC minute.</description>
+ </param>
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59">
+ <description>The current UTC second.</description>
+ </param>
+ <param name="compassDirection" type="CompassDirection">
+ <description>See CompassDirection.</description>
+ </param>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
+ <description>PDOP. If undefined or unavailable, then value shall be set to 0.</description>
+ </param>
+ <param name="hdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
+ <description>HDOP. If value is unknown, value shall be set to 0.</description>
+ </param>
+ <param name="vdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
+ <description>VDOP. If value is unknown, value shall be set to 0.</description>
+ </param>
+ <param name="actual" type="Boolean">
+ <description>
+ True, if actual.
+ False, if infered.
+ </description>
+ </param>
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31">
+ <description>Number of satellites in view</description>
+ </param>
+ <param name="dimension" type="Dimension">
+ <description>See Dimension</description>
+ </param>
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000">
+ <description>Altitude in meters</description>
+ </param>
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99">
+ <description>The heading. North is 0. Resolution is 0.01</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="500">
+ <description>The speed in KPH</description>
+ </param>
+ </struct>
+
+ <struct name="VehicleDataResult">
+ <description>Individual published data request result</description>
+ <param name="dataType" type="VehicleDataType">
+ <description>Defined published data element type.</description>
+ </param>
+ <param name="resultCode" type="VehicleDataResultCode">
+ <description>Published data result code.</description>
+ </param>
+ </struct>
+
+ <struct name="DIDResult">
+ <description>Individual requested DID result and data</description>
+ <param name="resultCode" type="VehicleDataResultCode">
+ <description>Individual DID result code.</description>
+ </param>
+ <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Location of raw data from vehicle data DID</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="StartTime">
+ <param name="hours" type="Integer" minvalue="0" maxvalue="59">
+ <description>
+ The hour of the media clock.
+ Some radios only support a max of 19 hours. If out of range, it will be rejected.
+ </description>
+ </param>
+ <param name="minutes" type="Integer" minvalue="0" maxvalue="59" />
+ <param name="seconds" type="Integer" minvalue="0" maxvalue="59" />
+ </struct>
+
+ <struct name="TextField">
+ <param name="name" type="TextFieldName">
+ <description>The name that identifies the field. See TextFieldName.</description>
+ </param>
+ <param name="characterSet" type="CharacterSet">
+ <description>The character set that is supported in this field. See CharacterSet.</description>
+ </param>
+ <param name="width" type="Integer" minvalue="1" maxvalue="500">
+ <description>The number of characters in one row of this field.</description>
+ </param>
+ <param name="rows" type="Integer" minvalue="1" maxvalue="8">
+ <description>The number of rows of this field.</description>
+ </param>
+ </struct>
+
+ <struct name="ImageResolution">
+ <param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000">
+ <description>The image resolution width.</description>
+ </param>
+ <param name="resolutionHeight" type="Integer" minvalue="1" maxvalue="10000">
+ <description>The image resolution height.</description>
+ </param>
+ </struct>
+
+ <struct name="ImageField">
+ <param name="name" type="ImageFieldName">
+ <description>The name that identifies the field. See ImageFieldName.</description>
+ </param>
+ <param name="imageTypeSupported" type="FileType" minsize="1" maxsize="100" array="true">
+ <description>The image types that are supported in this field. See FileType.</description>
+ </param>
+ <param name="imageResolution" type="ImageResolution" mandatory="false">
+ <description>The image resolution of this field.</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>
+
+ <enum name="TouchType">
+ <element name="BEGIN"/>
+ <element name="MOVE"/>
+ <element name="END"/>
+ </enum>
+
+ <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="2000000000" 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="TouchCoord" mandatory="true" array="true" minsize="1" maxsize="1000">
+ </param>
+ </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="ScreenParams">
+ <param name="resolution" type="ImageResolution" mandatory="true">
+ <description>The resolution of the prescribed screen area.</description>
+ </param>
+ <param name="touchEventAvailable" type="TouchEventCapabilities" mandatory="false">
+ <description>Types of screen touch events available in screen area.</description>
+ </param>
+ </struct>
+
+ <enum name="PermissionStatus">
+ <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"/>
+ <element name="USER_DISALLOWED" internal_name="PS_USER_DISALLOWED"/>
+ <element name="USER_CONSENT_PENDING" internal_name="PS_USER_CONSENT_PENDING"/>
+ </enum>
+
+ <struct name="HMIPermissions">
+ <param name="allowed" type="HMILevel" minsize="0" maxsize="100" array="true">
+ <description>A set of all HMI levels that are permitted for this given RPC.</description>
+ </param>
+ <param name="userDisallowed" type="HMILevel" minsize="0" maxsize="100" array="true">
+ <description>A set of all HMI levels that are prohibited for this given RPC.</description>
+ </param>
+ </struct>
+
+ <struct name="ParameterPermissions">
+ <param name="allowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true">
+ <description>A set of all parameters that are permitted for this given RPC.</description>
+ </param>
+ <param name="userDisallowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true">
+ <description>A set of all parameters that are prohibited for this given RPC.</description>
+ </param>
+ </struct>
+
+ <struct name="PermissionItem">
+ <param name="rpcName" type="String" maxlength="100">
+ <description>Name of the individual RPC in the policy table.</description>
+ </param>
+ <param name="hmiPermissions" type="HMIPermissions" />
+ <param name="parameterPermissions" type="ParameterPermissions" />
+ </struct>
+
+ <struct name="DisplayCapabilities">
+ <description>Contains information about the display capabilities.</description>
+ <param name="displayType" type="DisplayType">
+ <description>The type of the display. See DisplayType</description>
+ </param>
+ <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true">
+ <description>A set of all fields that support text data. See TextField</description>
+ </param>
+ <param name="imageFields" type="ImageField" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>A set of all fields that support images. See ImageField</description>
+ </param>
+ <param name="mediaClockFormats" type="MediaClockFormat" minsize="0" maxsize="100" array="true">
+ <description>A set of all supported formats of the media clock. See MediaClockFormat</description>
+ </param>
+ <param name="graphicSupported" type="Boolean">
+ <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">
+ <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">
+ <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>
+
+ <!-- TODO: Add pixel density? -->
+ </struct>
+
+ <struct name="ButtonCapabilities">
+ <description>Contains information about a button's capabilities.</description>
+ <param name="name" type="ButtonName">
+ <description>The name of the button. See ButtonName.</description>
+ </param>
+ <param name="shortPressAvailable" type="Boolean">
+ <description>
+ The button supports a short press.
+ Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
+ </description>
+ </param>
+ <param name="longPressAvailable" type="Boolean">
+ <description>
+ The button supports a LONG press.
+ Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
+ </description>
+ </param>
+ <param name="upDownAvailable" type="Boolean">
+ <description>
+ The button supports "button down" and "button up".
+ Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
+ Whenever the button is released, onButtonEvent( UP) will be invoked.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="SoftButtonCapabilities">
+ <description>Contains information about a SoftButton's capabilities.</description>
+ <param name="shortPressAvailable" type="Boolean">
+ <description>
+ The button supports a short press.
+ Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
+ </description>
+ </param>
+ <param name="longPressAvailable" type="Boolean">
+ <description>
+ The button supports a LONG press.
+ Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
+ </description>
+ </param>
+ <param name="upDownAvailable" type="Boolean">
+ <description>
+ The button supports "button down" and "button up".
+ Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
+ Whenever the button is released, onButtonEvent( UP) will be invoked.
+ </description>
+ </param>
+ <param name="imageSupported" type="Boolean">
+ <description>The button supports referencing a static or dynamic image.</description>
+ </param>
+ </struct>
+
+ <struct name="PresetBankCapabilities">
+ <description>Contains information about on-screen preset capabilities.</description>
+ <param name="onScreenPresetsAvailable" type="Boolean">
+ <description>Onscreen custom presets are available.</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="MenuParams">
+ <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.
+ If not provided, it will be provided 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 are at top level of the in application menu.
+ 0 will insert at the front.
+ 1 will insert at the second position.
+ if position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
+ If this param was omitted the entry will be added at the end.
+ </description>
+ </param>
+
+ <param name="menuName" type="String" maxlength="500">
+ <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>
+ <param name="text" minlength="0" maxlength="500" type="String">
+ <description>
+ The text or phonemes to speak.
+ May not be empty.
+ </description>
+ </param>
+ <param name="type" type="SpeechCapabilities">
+ <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities</description>
+ </param>
+ </struct>
+
+ <struct name="Turn">
+ <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>
+ <param name="turnIcon" type="Image" mandatory="false">
+ <description>Individual turn icon. Must provide at least text or icon for a given turn.</description>
+ </param>
+ </struct>
+
+ <struct name="VehicleType">
+ <param name="make" type="String" maxlength="500" mandatory="false">
+ <description>Make of the vehicle, e.g. Ford</description>
+ </param>
+ <param name="model" type="String" maxlength="500" mandatory="false">
+ <description>Model of the vehicle, e.g. Fiesta</description>
+ </param>
+ <param name="modelYear" type="String" maxlength="500" mandatory="false">
+ <description>Model Year of the vehicle, e.g. 2013</description>
+ </param>
+ <param name="trim" type="String" maxlength="500" mandatory="false">
+ <description>Trim of the vehicle, e.g. SE</description>
+ </param>
+ </struct>
+
+ <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>
+
+ <struct name="KeyboardProperties">
+ <description>Configuration of on-screen keyboard (if available).</description>
+
+ <param name="language" type="Language" mandatory="false">
+ <description>The keyboard language.</description>
+ </param>
+
+ <param name="keyboardLayout" type="KeyboardLayout" mandatory="false" >
+ <description>Desired keyboard layout.</description>
+ </param>
+
+ <param name="keypressMode" type="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="DeviceInfo">
+ <description>Various information abount connecting device.</description>
+
+ <param name="hardware" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device model</description>
+ </param>
+ <param name="firmwareRev" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device firmware revision</description>
+ </param>
+ <param name="os" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device OS</description>
+ </param>
+ <param name="osVersion" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device OS version</description>
+ </param>
+ <param name="carrier" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device mobile carrier (if applicable)</description>
+ </param>
+ <param name="maxNumberRFCOMMPorts" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Omitted if connected not via BT.</description>
+ </param>
+
+ </struct>
+
+ <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="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="PredefinedLayout" platform="documentation">
+ <description>Predefined screen layout.</description>
+
+ <element name="DEFAULT" rootscreen="true">
+ <description>
+ Default media / non-media screen.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="MEDIA" rootscreen="true">
+ <description>
+ Default Media screen.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NON-MEDIA" internal_name="NON_MEDIA" rootscreen="true">
+ <description>
+ Default Non-media screen.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="ONSCREEN_PRESETS" rootscreen="true">
+ <description>
+ Custom root media screen containing app-defined onscreen presets.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NAV_FULLSCREEN_MAP" rootscreen="true" >
+ <description>
+ Custom root template screen containing full screen map with navigation controls.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NAV_LIST" rootscreen="true" >
+ <description>
+ Custom root template screen containing video represented list.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NAV_KEYBOARD" rootscreen="true" >
+ <description>
+ Custom root template screen containing video represented keyboard.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TEXT" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with lines of text.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXT_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing lines of text with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TILES_ONLY" rootscreen="true">
+ <description>
+ Custom root template screen containing only tiled SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXTBUTTONS_ONLY" rootscreen="true">
+ <description>
+ Custom root template screen containing only text SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TILES" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with tiled SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TILES_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing tiled SoftButtons with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with text and SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing text and SoftButtons with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TEXTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with text only SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXTBUTTONS_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing text only SoftButtons with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="LARGE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing a large graphic and SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="DOUBLE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing two graphics and SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="LARGE_GRAPHIC_ONLY" rootscreen="true">
+ <description>
+ Custom root template screen containing only a large graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ </enum>
+
+ <enum name="FunctionID" internal_scope="base">
+ <description>Enumeration linking function names with function IDs in AppLink protocol.</description>
+ <description>Assumes enumeration starts at value 0.</description>
+ <element name="RESERVED" value="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" />
+
+<!--
+ 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" />
+
+<!--
+ 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" />
+
+<!--
+ Ford Specific Notifications
+ Range = 0x 0001 8000 - 0x 0001 FFFF
+-->
+
+ <element name="OnEncodedSyncPDataID" value="98304" hexvalue="18000" />
+ <element name="OnSyncPDataID" value="98305" hexvalue="18001" />
+
+ </enum>
+
+ <enum name="messageType">
+ <description>
+ Enumeration linking message types with function types in WiPro protocol.
+ Assumes enumeration starts at value 0.
+ </description>
+ <element name="request" value="0" />
+ <element name="response" value="1" />
+ <element name="notification" value="2" />
+ </enum>
+
+ <!-- Requests/Responses -->
+
+ <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="request">
+ <description>
+ Establishes an interface with a mobile application.
+ Before registerAppInterface no other commands will be accepted/executed.
+ </description>
+
+ <param name="syncMsgVersion" type="SyncMsgVersion">
+ <description>See SyncMsgVersion</description>
+ </param>
+
+ <param name="appName" type="String" maxlength="100">
+ <description>
+ The mobile application name, e.g. "Ford Drive Green".
+ 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 previously registered applications and any predefined blacklist of words (global commands)
+ Needs to be unique over all applications. Applications with the same name will be rejected.
+ Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
+ </description>
+ </param>
+
+ <param name="ttsName" type="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.
+ Needs to be unique over all applications.
+ May not be empty.
+ May not start with a new line character.
+ Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
+ </description>
+ </param>
+
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
+ <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)
+ Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
+ </description>
+ </param>
+
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
+ <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)
+ Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
+ </description>
+ </param>
+
+ <param name="isMediaApplication" type="Boolean">
+ <description>
+ Indicates if the application is a media or a non-media application.
+ Only media applications will be able to stream audio to Sync that is audible outside of the BT media source.
+ </description>
+ </param>
+ <param name="languageDesired" type="Language" mandatory="true">
+ <description>
+ See Language
+ Current app's expected VR+TTS language
+ If there is a mismatch with SYNC, 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">
+ <description>
+ See Language
+ Current app's expected display language
+ If there is a mismatch with SYNC, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
+ </description>
+ </param>
+
+ <param name="appHMIType" type="AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
+ <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">
+ <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.
+ If omitted, then the previous state of an app's commands, etc. will not be restored.
+ When sending hashID, all RegisterAppInterface parameters should still be provided (e.g. ttsName, etc.).
+ </description>
+ </param>
+ <param name="deviceInfo" type="DeviceInfo" mandatory="false">
+ <description>
+ See DeviceInfo.
+ </description>
+ </param>
+ <param name="appID" type="String" maxlength="100" mandatory="true">
+ <description>ID used to validate app with policy table entries</description>
+ </param>
+ </function>
+
+ <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="response">
+ <description>The response to registerAppInterface</description>
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="TOO_MANY_APPLICATIONS"/>
+ <element name="APPLICATION_REGISTERED_ALREADY"/>
+ <element name="UNSUPPORTED_VERSION"/>
+ <element name="WRONG_LANGUAGE"/>
+ <element name="DISALLOWED"/>
+ <element name="WARNINGS"/>
+ <element name="RESUME_FAILED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="false">
+ <description>See SyncMsgVersion</description>
+ </param>
+
+ <param name="language" type="Language" mandatory="false">
+ <description>The currently active VR+TTS language on Sync. See "Language" for options.</description>
+ </param>
+
+ <param name="hmiDisplayLanguage" type="Language" mandatory="false">
+ <description>The currently active display language on Sync. See "Language" for options.</description>
+ </param>
+
+ <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
+ <description>See DisplayCapabilities</description>
+ </param>
+
+ <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See ButtonCapabilities</description >
+ </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 >
+ </param>
+
+ <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
+ <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">
+ <issue creator="rs">If not used yet => remove</issue>
+ <description>See HmiZoneCapabilities</description>
+ </param>
+
+ <param name="speechCapabilities" type="SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See SpeechCapabilities</description>
+ </param>
+
+ <param name="prerecordedSpeech" type="PrerecordedSpeech" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See PrerecordedSpeech</description>
+ </param>
+
+ <param name="vrCapabilities" type="VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See VrCapabilities</description>
+ </param>
+
+ <param name="audioPassThruCapabilities" type="AudioPassThruCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See AudioPassThruCapability</description>
+ </param>
+
+ <param name="vehicleType" type="VehicleType" mandatory="false">
+ <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" >
+ <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">
+ <description>Specifies the HMI’s capabilities. See HMICapabilities.</description>
+ </param>
+
+ <param name="sdlVersion" type="String" maxlength="100" mandatory="false" platform="documentation">
+ <description>The SmartDeviceLink version.</description>
+ </param>
+
+ <param name="systemSoftwareVersion" type="String" maxlength="100" mandatory="false" platform="documentation">
+ <description>The software version of the system that implements the SmartDeviceLink core.</description>
+ </param>
+
+ </function>
+
+ <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="request">
+ <description>
+ Closes an interface from a mobile application.
+ After unregisterAppInterface, no commands other than registerAppInterface will be accepted/executed.
+ Will fail, if no registerAppInterface was completed successfully before.
+ </description>
+ </function>
+
+ <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="request">
+ <description>Allows setting global properties.</description>
+
+ <param name="helpPrompt" type="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="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="vrHelpTitle" type="String" maxlength="500" mandatory="false">
+ <description>
+ VR Help Title text.
+ If omitted on supported displays, the default SYNC help title shall be used.
+ If omitted and one or more vrHelp items are provided, the request will be rejected.
+ </description>
+ </param>
+
+ <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ VR Help Items.
+ If omitted on supported displays, the default AppLink VR help / What Can I Say? screen shall be used.
+ If the list of VR Help Items contains nonsequential positions (e.g. [1,2,4]), the RPC shall be rejected.
+ If omitted and a vrHelpTitle is provided, the request will be rejected.
+ </description>
+ </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="Image" mandatory="false">
+ <description>>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
+ </param>
+
+ <param name="keyboardProperties" type="KeyboardProperties" mandatory="false">
+ <description>On-screen keybaord configuration (if available).</description>
+ </param>
+ </function>
+
+ <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="WARNINGS"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="request">
+ <description>Allows resetting global properties.</description>
+
+ <param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true" >
+ <description>Contains the names of all global properties (like timeoutPrompt) that should be unset. Resetting means, that they have the same value as at start up (default)</description>
+ </param>
+ </function>
+
+ <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="AddCommand" functionID="AddCommandID" messagetype="request">
+ <description>
+ Adds a command to the in application menu.
+ Either menuParams or vrCommands must be provided.
+ </description>
+
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>unique ID of the command to add.</description>
+ </param>
+
+ <param name="menuParams" type="MenuParams" mandatory="false">
+ <description>Optional sub value containing menu parameters</description>
+ </param>
+
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="false">
+ <description>
+ An array of strings to be used as VR synonyms for this command.
+ If this array is provided, it may not be empty.
+ </description>
+ </param>
+
+ <param name="cmdIcon" type="Image" mandatory="false">
+ <description>
+ Image struct determining whether static or dynamic icon.
+ If omitted on supported displays, no (or the default if applicable) icon shall be displayed.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="AddCommand" functionID="AddCommandID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="DISALLOWED"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="request">
+ <description>Deletes all commands from the in-application menu with the specified command id.</description>
+
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>ID of the command(s) to delete.</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="request">
+ <description>Adds a sub menu to the in-application menu.</description>
+
+ <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000">
+ <description>unique ID of the sub menu to add.</description>
+ </param>
+
+ <param name="position" type="Integer" minvalue="0" maxvalue="1000" defvalue="1000" mandatory="false">
+ <description>
+ Position within the items that are are at top level of the in application menu.
+ 0 will insert at the front.
+ 1 will insert at the second position.
+ If position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
+ Position of any submenu will always be located before the return and exit options
+ If this param was omitted the entry will be added at the end.
+ </description>
+ </param>
+
+ <param name="menuName" maxlength="500" type="String">
+ <description>Text to show in the menu for this sub menu.</description>
+ </param>
+ </function>
+
+ <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="request">
+ <description>Deletes a submenu from the in-application menu.</description>
+
+ <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000">
+ <description>The "menuID" of the submenu to delete. (See addSubMenu.menuID)</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="request">
+ <description>creates interaction choice set to be used later by performInteraction</description>
+
+ <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>Unique ID used for this interaction choice set.</description>
+ </param>
+
+ <param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true" />
+ </function>
+
+ <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="request">
+ <description>Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
+
+ <param name="initialText" type="String" maxlength="500" >
+ <description>
+ Text to be displayed first.
+ </description>
+ </param>
+
+ <param name="initialPrompt" type="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="interactionMode" type="InteractionMode">
+ <description>See InteractionMode.</description>
+ </param>
+
+ <param name="interactionChoiceSetIDList" type="Integer" minsize="0" maxsize="100" minvalue="0" maxvalue="2000000000" array="true">
+ <description>List of interaction choice set IDs to use with an interaction.</description>
+ </param>
+
+ <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Help text. This is the spoken string when a user speaks "help" when the interaction is occuring.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Timeout text. This text is spoken when a VR interaction times out.
+ 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" minvalue="5000" maxvalue="100000" defvalue="10000" mandatory="false">
+ <description>
+ Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.
+ Applies only to the menu portion of the interaction. The VR timeout will be handled by the platform.
+ </description>
+ </param>
+
+ <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Ability to send suggested VR Help Items to display on-screen during Perform Interaction.
+ If omitted on supported displays, the default SYNC generated list of suggested choices shall be displayed.
+ </description>
+ </param>
+
+ <param name="interactionLayout" type="LayoutMode" mandatory="false">
+ <description>See LayoutMode.</description>
+ </param>
+
+ </function>
+
+ <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="TIMED_OUT"/>
+ <element name="ABORTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ ID of the choice that was selected in response to PerformInteraction.
+ Only is valid if general result is "success:true".
+ </description>
+ </param>
+
+ <param name="manualTextEntry" type="String" 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>
+
+ <param name="triggerSource" type="TriggerSource" mandatory="false">
+ <description>
+ See TriggerSource
+ Only is valid if resultCode is SUCCESS.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="request">
+ <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>
+
+ <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>ID of the interaction choice set to delete.</description>
+ </param>
+ </function>
+
+ <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="Alert" functionID="AlertID" messagetype="request">
+ <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">
+ <description>The first line of the alert text field</description>
+ </param>
+
+ <param name="alertText2" type="String" maxlength="500" mandatory="false">
+ <description>The second line of the alert text field</description>
+ </param>
+
+ <param name="alertText3" type="String" maxlength="500" mandatory="false">
+ <description>The optional third line of the alert text field</description>
+ </param>
+
+ <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="duration" type="Integer" minvalue="3000" maxvalue="10000" defvalue="5000" mandatory="false">
+ <description>
+ Timeout in milliseconds.
+ Typical timeouts are 3-5 seconds.
+ If omitted, timeout is set to 5s.
+ </description>
+ </param>
+
+ <param name="playTone" type="Boolean" mandatory="false">
+ <description>
+ Defines if tone should be played. Tone is played before TTS.
+ If omitted, no tone is played.
+ </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="softButtons" type="SoftButton" minsize="0" maxsize="4" array="true" mandatory="false">
+ <description>
+ App defined SoftButtons.
+ If omitted on supported displays, the displayed alert shall not have any SoftButtons.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="Alert" functionID="AlertID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="tryAgainTime" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <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.
+ An app must not send an alert without waiting at least the amount of time dictated.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="Show" functionID="ShowID" messagetype="request">
+ <description>Updates the persistent display. Supported fields depend on display capabilities.</description>
+
+ <param name="mainField1" type="String" minlength="0" maxlength="500" mandatory="false">
+ <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.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="mainField2" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>
+ The text that should be displayed on the second display line.
+ If this text is not set, the text of mainField2 stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="mainField3" type="String" minlength="0" maxlength="500" mandatory="false">
+ <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.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="mainField4" type="String" minlength="0" maxlength="500" mandatory="false">
+ <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.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="alignment" type="TextAlignment" mandatory="false">
+ <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">
+ <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">
+ <description>
+ Text value for MediaClock field. Has to be properly formatted by Mobile App according to Sync 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">
+ <description>
+ The text that should be displayed in the track field.
+ If this text is not set, the text of mediaTrack stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="graphic" type="Image" mandatory="false">
+ <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">
+ <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">
+ <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">
+ <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>
+
+ </function>
+
+ <function name="Show" functionID="ShowID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="WARNINGS"/>
+ <element name="ABORTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="Speak" functionID="SpeakID" messagetype="request">
+ <description>Speaks a text.</description>
+
+ <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true">
+ <description>
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="Speak" functionID="SpeakID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="ABORTED"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="request">
+ <description>Sets the initial media clock value and automatic update method.</description>
+
+ <param name="startTime" type="StartTime" mandatory="false">
+ <description>
+ See StartTime.
+ startTime must be provided for "COUNTUP" and "COUNTDOWN".
+ startTime will be ignored for "RESUME", and "CLEAR"
+ startTime can be sent for "PAUSE", in which case it will update the paused startTime
+ </description>
+ </param>
+
+ <param name="endTime" type="StartTime" mandatory="false">
+ <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)
+ 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 "RESUME", and "CLEAR"
+ endTime can be sent for "PAUSE", in which case it will update the paused endTime
+ </description>
+ </param>
+
+ <param name="updateMode" type="UpdateMode" mandatory="true">
+ <description>
+ Enumeration to control the media clock.
+ 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>
+ </function>
+
+ <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="request">
+ <description>Starts audio pass thru session </description>
+ <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ SYNC will speak this prompt before opening the audio pass thru session.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ If omitted, then no initial prompt is spoken.
+ </description>
+ </param>
+ <param name="audioPassThruDisplayText1" type="String" mandatory="false" maxlength="500">
+ <description>First line of text displayed during audio capture.</description>
+ </param>
+ <param name="audioPassThruDisplayText2" type="String" mandatory="false" maxlength="500">
+ <description>Second line of text displayed during audio capture.</description>
+ </param>
+ <param name="samplingRate" type="SamplingRate" mandatory="true">
+ <description> This value shall be allowed at 8 khz or 16 or 22 or 44 khz.</description>
+ </param>
+ <param name="maxDuration" type="Integer" minvalue="1" maxvalue="1000000" mandatory="true">
+ <description>The maximum duration of audio recording in milliseconds. </description>
+ </param>
+ <param name="bitsPerSample" type="BitsPerSample" mandatory="true">
+ <description>Specifies the quality the audio is recorded. Currently 8 bit or 16 bit.</description>
+ </param>
+ <param name="audioType" type="AudioType" mandatory="true">
+ <description>Specifies the type of audio data being requested.</description>
+ </param>
+ <param name="muteAudio" type="Boolean" mandatory="false">
+ <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" functionID="PerformAudioPassThruID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ <element name="RETRY"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="request">
+ <description>When this request is invoked, the audio capture stops.</description>
+ </function>
+
+ <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="request">
+ <description>
+ Subscribes to built-in HMI buttons.
+ The application will be notified by the OnButtonEvent and OnButtonPress.
+ To unsubscribe the notifications, use unsubscribeButton.
+ </description>
+
+ <param name="buttonName" type="ButtonName">
+ <description>Name of the button to subscribe.</description>
+ </param>
+ </function>
+
+ <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="UNSUPPORTED_RESOURCE" />
+ <element name="IGNORED" />
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="request">
+ <description>Unsubscribes from built-in HMI buttons.</description>
+
+ <param name="buttonName" type="ButtonName">
+ <description>Name of the button to unsubscribe.</description>
+ </param>
+ </function>
+
+ <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="UNSUPPORTED_RESOURCE" />
+ <element name="IGNORED" />
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" 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" functionID="SubscribeVehicleDataID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="WARNINGS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED" />
+ <element name="IGNORED" />
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="gps" type="VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
+ </param>
+ <param name="prndl" type="VehicleDataResult" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="VehicleDataResult" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="VehicleDataResult" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="VehicleDataResult" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="VehicleDataResult" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="VehicleDataResult" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="VehicleDataResult" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="VehicleDataResult" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="VehicleDataResult" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModes" type="VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="VehicleDataResult" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="request">
+ <description>This function is used to unsubscribe the notifications from the subscribeVehicleData function.</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="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="WARNINGS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED" />
+ <element name="IGNORED" />
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="gps" type="VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="prndl" type="VehicleDataResult" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="VehicleDataResult" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="VehicleDataResult" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="VehicleDataResult" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="VehicleDataResult" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="VehicleDataResult" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="VehicleDataResult" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="VehicleDataResult" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="VehicleDataResult" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="VehicleDataResult" mandatory="false" >
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModes" type="VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="VehicleDataResult" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="GetVehicleData" functionID="GetVehicleDataID" 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>
+
+ <!-- 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="GetVehicleData" functionID="GetVehicleDataID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="VEHICLE_DATA_NOT_ALLOWED"/>
+ <element name="VEHICLE_DATA_NOT_AVAILABLE"/>
+ <element name="USER_DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="gps" type="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="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="PRNDL" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="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="BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="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>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="ECallInfo" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="MyKey" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="ReadDID" functionID="ReadDIDID" messagetype="request">
+ <description>Non periodic vehicle data read request</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>
+ </function>
+
+ <function name="ReadDID" functionID="ReadDIDID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="TRUNCATED_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="didResult" type="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" functionID="GetDTCsID" messagetype="request">
+ <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>
+
+ </function>
+
+ <function name="GetDTCs" functionID="GetDTCsID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="TRUNCATED_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="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 (ecuHeader contains information if list is truncated).
+ Each DTC is represented by 4 bytes (3 bytes of data and 1 byte status as defined in VHR_Layout_Specification_DTCs.pdf).
+ </description>
+ </param>
+
+ </function>
+
+ <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="request">
+ <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>
+ </function>
+
+ <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="TRUNCATED_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="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="ScrollableMessage" functionID="ScrollableMessageID" messagetype="request">
+ <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">
+ <description>Body of text that can include newlines and tabs.</description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" defvalue="30000" mandatory="false">
+ <description>App defined timeout. Indicates how long of a timeout from the last action (i.e. scrolling message resets timeout).</description>
+ </param>
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
+ <description>
+ App defined SoftButtons.
+ If omitted on supported displays, only the system defined "Close" SoftButton will be displayed.
+ </description>
+ </param>
+ </function>
+
+ <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="CHAR_LIMIT_EXCEEDED"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="Slider" functionID="SliderID" messagetype="request">
+ <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 display</description>
+ </param>
+ <param name="sliderFooter" type="String" maxlength="500" minsize="1" maxsize="26" array="true" mandatory="false">
+ <description>
+ Text footer to display (meant to display min/max threshold descriptors).
+ For a static text footer, only one footer string shall be provided in the array.
+ For a dynamic text footer, the number of footer text string in the array must match the numTicks value.
+ For a dynamic text footer, text array string should correlate with potential slider position index.
+ If omitted on supported displays, no footer text shall be displayed.
+ </description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" defvalue="10000" mandatory="false">
+ <description>
+ App defined timeout. Indicates how long of a timeout from the last action (i.e. sliding control resets timeout).
+ If omitted, the value is set to 10000.
+ </description>
+ </param>
+ </function>
+
+ <function name="Slider" functionID="SliderID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="SAVED"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ <element name="TIMED_OUT"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
+ <description>
+ Current slider value returned when saved or canceled (aborted)
+ This value is only returned for resultCodes "SAVED" or "ABORTED"
+ </description>
+ </param>
+ </function>
+
+ <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="request">
+ <param name="navigationText1" type="String" minlength="0" maxlength="500" mandatory="false">
+ </param>
+ <param name="navigationText2" type="String" minlength="0" maxlength="500" mandatory="false">
+ </param>
+ <param name="eta" type="String" minlength="0" maxlength="500" mandatory="false">
+ </param>
+ <param name="timeToDestination" type="String" minlength="0" maxlength="500" mandatory="false">
+ </param>
+ <param name="totalDistance" type="String" minlength="0" maxlength="500" mandatory="false">
+ </param>
+ <param name="turnIcon" type="Image" mandatory="false">
+ </param>
+ <param name="nextTurnIcon" type="Image" mandatory="false">
+ </param>
+ <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false">
+ <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">
+ <description>
+ Distance till next maneuver (starting from) from previous maneuver.
+ 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, 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">
+ <description>
+ Three dynamic SoftButtons available (first SoftButton is fixed to "Turns").
+ If omitted on supported displays, the currently displayed SoftButton values will not change.
+ </description>
+ </param>
+ </function>
+
+ <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="request">
+ <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>
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
+ <description>If omitted on supported displays, only the system defined "Close" SoftButton shall be displayed.</description>
+ </param>
+ </function>
+
+ <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="ABORTED"/>
+ <element name="WARNINGS"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="request">
+ <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">
+ <description>If omitted on supported displays, app-defined SoftButton will be left blank.</description>
+ </param>
+ </function>
+
+ <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="request">
+ <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">
+ <description>Request new app name registration</description>
+ </param>
+ <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <description>Request new ttsName registration</description>
+ </param>
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
+ <description>Request new app short name registration</description>
+ </param>
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Request new VR synonyms registration</description>
+ </param>
+
+</function>
+
+
+
+ <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description>
+ true, if successful
+ false, if failed
+ </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="GenericResponse" functionID="GenericResponseID" messagetype="response">
+ <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.
+ </description>
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="INVALID_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="PutFile" functionID="PutFileID" messagetype="request">
+ <description>
+ Used to push a binary data onto the SYNC module from a mobile device, such as icons and album art
+ Not supported on first generation SYNC vehicles.
+ Binary data is in binary part of hybrid msg.
+ </description>
+
+ <param name="syncFileName" type="String" maxlength="255" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+
+ <param name="fileType" type="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>
+
+ <param name="systemFile" type="Boolean" defvalue="false" mandatory="false" >
+ <description>
+ Indicates if the file is meant to be passed thru core to elsewhere on the system.
+ If set to TRUE, then the system will instead pass the data thru as it arrives to a predetermined area outside of core.
+ If omitted, the value will be set to false.
+ </description>
+ </param>
+
+ <param name="offset" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ Optional length in bytes for resuming partial data chunks
+ If offset is set to 0, then length is the total length of the file to be downloaded
+ </description>
+ </param>
+
+ </function>
+
+ <function name="PutFile" functionID="PutFileID" messagetype="response">
+ <description>Response is sent, when the file data was copied (success case). Or when an error occured.</description>
+ <description>Not supported on First generation SYNC vehicles. </description>
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
+ <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>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="DeleteFile" functionID="DeleteFileID" messagetype="request">
+ <description>
+ Used to delete a file resident on the SYNC module in the app's local cache.
+ Not supported on first generation SYNC vehicles.
+ </description>
+
+ <param name="syncFileName" type="String" maxlength="500" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteFile" functionID="DeleteFileID" messagetype="response">
+ <description>
+ Response is sent, when the file data was deleted (success case). Or when an error occured.
+ Not supported on First generation SYNC vehicles.
+ </description>
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>Provides the total local space available on SYNC for the registered app.</description>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="ListFiles" functionID="ListFilesID" messagetype="request">
+ <description>
+ Requests the current list of resident filenames for the registered app.
+ Not supported on first generation SYNC vehicles.
+ </description>
+ </function>
+
+ <function name="ListFiles" functionID="ListFilesID" messagetype="response">
+ <description>
+ Returns the current list of resident filenames for the registered app along with the current space available
+ Not supported on First generation SYNC vehicles.
+ </description>
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="filenames" type="String" maxlength="500" minsize="0" maxsize="1000" array="true" mandatory="false">
+ <description>
+ An array of all filenames resident on SYNC for the given registered app.
+ If omitted, then no files currently reside on the system.
+ </description>
+ </param>
+
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>Provides the total local space available on SYNC for the registered app.</description>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="SetAppIcon" functionID="SetAppIconID" messagetype="request">
+ <description>
+ Used to set existing local file on SYNC as the app's icon
+ Not supported on first generation SYNC vehicles.
+ </description>
+
+ <param name="syncFileName" type="String" maxlength="500" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+
+ </function>
+
+ <function name="SetAppIcon" functionID="SetAppIconID" messagetype="response">
+ <description>
+ Response is sent, when the file data was copied (success case). Or when an error occured.
+ Not supported on First generation SYNC vehicles.
+ </description>
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request">
+ <description>
+ Used to set an alternate display layout.
+ If not sent, default screen for given platform will be shown
+ </description>
+
+ <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>
+
+ </function>
+
+ <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
+ <description>See DisplayCapabilities</description>
+ </param>
+
+ <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See ButtonCapabilities</description >
+ </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 >
+ </param>
+
+ <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
+ <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">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SystemRequest" functionID="SystemRequestID" messagetype="request" >
+ <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>
+ The type of system request.
+ Note that Proprietary requests should forward the binary data to the known proprietary module on the system.
+ </description>
+ </param>
+ <param name="fileName" type="String" maxlength="255" mandatory="false">
+ <description>
+ Filename of HTTP data to store in predefined system staging area.
+ Mandatory if requestType is HTTP.
+ PROPRIETARY requestType should ignore this parameter.
+ </description>
+ </param>
+ </function>
+
+ <function name="SystemRequest" functionID="SystemRequestID" messagetype="response" >
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_CERT"/>
+ <element name="EXPIRED_CERT"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="DISALLOWED"/>
+ <element name="ABORTED"/>
+ <element name="WARNINGS"/>
+ <element name="TIMED_OUT"/>
+ <element name="IGNORED"/>
+ </param>
+ </function>
+
+ <function name="SendLocation" functionID="SendLocationID" messagetype="request">
+ <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="Image" mandatory="false">
+ <description>
+ Image / icon of intended location (if applicable and supported)
+ </description>
+ </param>
+ </function>
+
+ <function name="SendLocation" functionID="SendLocationID" messagetype="response" >
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="DialNumber" functionID="DialNumberID" messagetype="request">
+ <description>Dials a phone number and switches to phone application.</description>
+
+ <param name="number" type="String" maxlength="40">
+ <description>
+ Phone number is a string, which can be up to 40 chars.
+ All characters shall be stripped from string except digits 0-9 and * # , ; +
+ </description>
+ </param>
+ </function>
+
+ <function name="DialNumber" functionID="DialNumberID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <!-- Notifications -->
+
+ <function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification">
+ <param name="hmiLevel" type="HMILevel">
+ <description>See HMILevel</description>
+ </param>
+
+ <param name="audioStreamingState" type="AudioStreamingState">
+ <description>See AudioStreamingState</description>
+ </param>
+
+ <param name="systemContext" type="SystemContext">
+ <description>See SystemContext</description>
+ </param>
+ </function>
+
+ <function name="OnAppInterfaceUnregistered" functionID="OnAppInterfaceUnregisteredID" messagetype="notification">
+ <param name="reason" type="AppInterfaceUnregisteredReason">
+ <description>See AppInterfaceUnregisteredReason</description>
+ </param>
+ </function>
+
+ <function name="OnButtonEvent" functionID="OnButtonEventID" messagetype="notification">
+ <description>Notifies application of UP/DOWN events for buttons to which the application is subscribed.</description>
+ <param name="buttonName" type="ButtonName"/>
+ <param name="buttonEventMode" type="ButtonEventMode">
+ <description>Indicates whether this is an UP or DOWN event.</description>
+ </param>
+ <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false">
+ <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">
+ <description>Notifies application of LONG/SHORT press events for buttons to which the application is subscribed.</description>
+ <param name="buttonName" type="ButtonName"/>
+ <param name="buttonPressMode" type="ButtonPressMode">
+ <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">
+ <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">
+ <description>Callback for the periodic and non periodic vehicle data read function.</description>
+ <param name="gps" type="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="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="PRNDL" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="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="BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="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>
+
+ <!-- Ford Specific Vehicle Data -->
+ <param name="eCallInfo" type="ECallInfo" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="MyKey" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Vehicle Data -->
+
+ </function>
+
+ <function name="OnCommand" functionID="OnCommandID" messagetype="notification">
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>Command ID, which is related to a specific menu entry</description>
+ </param>
+
+ <param name="triggerSource" type="TriggerSource">
+ <description>See TriggerSource</description>
+ </param>
+ </function>
+
+ <function name="OnTBTClientState" functionID="OnTBTClientStateID" messagetype="notification" >
+ <description>Provides applications with notifications specific to the current TBT client status on the module</description>
+ <param name="state" type="TBTState">
+ <description>Current State of TBT client</description>
+ </param>
+ </function>
+
+ <function name="OnDriverDistraction" functionID="OnDriverDistractionID" messagetype="notification" >
+ <description>Provides driver distraction state to mobile applications</description>
+ <param name="state" type="DriverDistractionState">
+ <description>Current State of Driver Distraction</description>
+ </param>
+ </function>
+
+ <function name="OnPermissionsChange" functionID="OnPermissionsChangeID" messagetype="notification" >
+ <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">
+ <description>Change in permissions for a given set of RPCs</description>
+ </param>
+ </function>
+
+ <function name="OnAudioPassThru" functionID="OnAudioPassThruID" messagetype="notification">
+ <description>Binary data is in binary part of hybrid msg</description>
+ </function>
+
+ <function name="OnLanguageChange" functionID="OnLanguageChangeID" messagetype="notification">
+ <param name="language" type="Language">
+ <description>Current SYNC voice engine (VR+TTS) language</description>
+ </param>
+ <param name="hmiDisplayLanguage" type="Language">
+ <description>Current display language</description>
+ </param>
+ </function>
+
+ <function name="OnKeyboardInput" functionID="OnKeyboardInputID" messagetype="notification" >
+
+ <description>On-screen keyboard event.</description>
+ <description>Can be full string or individual keypresses depending on keyboard mode.</description>
+
+ <param name="event" type="KeyboardEvent" mandatory="true">
+ <description>On-screen keyboard input data.</description>
+ </param>
+
+ <param name="data" type="String" 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" functionID="OnTouchEventID" messagetype="notification" >
+ <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>
+ </param>
+ <param name="event" type="TouchEvent" mandatory="true" minsize="1" maxsize="10" array="true">
+ <description>List of all individual touches involved in this event.</description>
+ </param>
+ </function>
+
+ <function name="OnSystemRequest" functionID="OnSystemRequestID" messagetype="notification" >
+ <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="RequestType" mandatory="true">
+ <description>The type of system request.</description>
+ </param>
+ <param name="url" type="String" maxlength="1000" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Optional URL for HTTP requests.
+ If blank, the binary data shall be forwarded to the app.
+ If not blank, the binary data shall be forwarded to the url with a provided timeout in seconds.
+ </description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ Optional timeout for HTTP requests
+ Required if a URL is provided
+ </description>
+ </param>
+ <param name="fileType" type="FileType" mandatory="false">
+ <description>Optional file type (meant for HTTP file requests).</description>
+ </param>
+ <param name="offset" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>Optional length in bytes for resuming partial data chunks</description>
+ </param>
+ </function>
+
+ <function name="OnHashChange" functionID="OnHashChangeID" messagetype="notification">
+ <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.
+ </description>
+ <param name="hashID" type="String" maxlength="100" mandatory="true">
+ <description>Calculated hash ID to be referenced during RegisterAppInterface.</description>
+ </param>
+ </function>
+
+<!-- ~~~~~~~~~~~~~~~~~~ -->
+<!-- Ford Specific APIs -->
+<!-- ~~~~~~~~~~~~~~~~~~ -->
+
+ <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="request" >
+ <description>
+ Allows encoded data in the form of SyncP packets to be sent to the SYNC module.
+ Legacy / v1 Protocol implementation; use SyncPData instead.
+ *** DEPRECATED ***
+ </description>
+
+ <param name="data" type="String" maxlength="1000000" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description>Contains base64 encoded string of SyncP packets.</description>
+ <todo>What is the maxlength?</todo>
+ </param>
+ </function>
+
+ <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="response" >
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+<!-- Deprecating - covered by SystemRequest
+ <function name="SyncPData" functionID="SyncPDataID" messagetype="request" >
+ <description>
+ Allows binary data in the form of SyncP packets to be sent to the SYNC module.
+ Binary data is in binary part of hybrid msg.
+ </description>
+ </function>
+
+ <function name="SyncPData" functionID="SyncPDataID" messagetype="response" >
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+-->
+
+ <function name="OnEncodedSyncPData" functionID="OnEncodedSyncPDataID" messagetype="notification" >
+ <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.
+ *** DEPRECATED ***
+ </description>
+ <param name="data" type="String" maxlength="1000000" minsize="1" maxsize="100" mandatory="true" array="true">
+ <description>Contains base64 encoded string of SyncP packets.</description>
+ </param>
+ <param name="URL" type="String" maxlength="1000" mandatory="false">
+ <description>
+ If blank, the SyncP data shall be forwarded to the app.
+ If not blank, the SyncP data shall be forwarded to the provided URL.
+ </description>
+ </param>
+ <param name="Timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ If blank, the SyncP data shall be forwarded to the app.
+ If not blank, the SyncP data shall be forwarded with the provided timeout in seconds.
+ </description>
+ </param>
+ </function>
+
+<!-- Deprecating - covered by OnSystemRequest
+ <function name="OnSyncPData" functionID="OnSyncPDataID" messagetype="notification" >
+ <description>
+ Callback including binary data of any SyncP packets that SYNC needs to send back to the mobile device.
+ Responds to SyncPData.
+ Binary data is in binary part of hybrid msg.
+ </description>
+
+ <param name="URL" type="String" maxlength="1000" mandatory="false">
+ <description>
+ If blank, the SyncP data shall be forwarded to the app.
+ If not blank, the SyncP data shall be forwarded to the provided URL.
+ </description>
+ </param>
+ <param name="Timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ If blank, the SyncP data shall be forwarded to the app.
+ If not blank, the SyncP data shall be forwarded with the provided timeout in seconds.
+ </description>
+ </param>
+
+ </function>
+-->
+</interface>
diff --git a/src/components/interfaces/QT_HMI_API.xml b/src/components/interfaces/QT_HMI_API.xml
index d6450b834..eab9edb86 100644
--- a/src/components/interfaces/QT_HMI_API.xml
+++ b/src/components/interfaces/QT_HMI_API.xml
@@ -56,6 +56,15 @@
<element name="WARNINGS" value="21"/>
<element name="GENERIC_ERROR" value="22"/>
<element name="USER_DISALLOWED" value="23"/>
+ <element name="TRUNCATED_DATA" value="24"/>
+ </enum>
+ <enum name="TransportType">
+ <description>
+ Lists of the transport types used for device connection to HU.
+ </description>
+ <element name="BLUETOOTH"/>
+ <element name="USB"/>
+ <element name="WIFI"/>
</enum>
<enum name="ButtonName">
<description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
@@ -432,6 +441,18 @@
<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>
@@ -495,13 +516,13 @@
<description>
minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59;
Is used for Type V head units.
- </description>
+ </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>
+ </description>
</element>
<element name="CLOCKTEXT1">
<description>
@@ -511,7 +532,7 @@
c : character out of following character set: sp|0-9|[letters
:|sp : colon or space
Is used for Type II head unit
- </description>
+ </description>
</element>
<element name="CLOCKTEXT2">
<description>
@@ -520,8 +541,8 @@
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>
+ Is used for CID and NGN head unit
+ </description>
</element>
<element name="CLOCKTEXT3">
<description>
@@ -865,6 +886,7 @@
<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>
@@ -910,6 +932,20 @@
<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>
@@ -1032,10 +1068,12 @@
<element name="NORMAL"/>
<element name="NONE"/>
</enum>
-<enum name="SpeakType">
+<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">
@@ -1072,6 +1110,20 @@
<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. ’true’ – if device is allowed for PolicyTable Exchange; ‘false’ – 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"/>
@@ -1221,8 +1273,26 @@
<param name="icon" type="String" mandatory="false">
<description>Path to application icon stored on HU.</description>
</param>
- <param name="deviceName" type="String" mandatory="true">
- <description>The name of device which the provided application is running on.</description>
+ <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>
@@ -1237,6 +1307,17 @@
<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">
@@ -1378,6 +1459,14 @@
<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.
@@ -1405,8 +1494,8 @@
</param>
<param name="keypressMode" type="Common.KeypressMode" mandatory="false">
<description>
- Desired keypress mode.
- If omitted, this value will be set to RESEND_CURRENT_ENTRY.
+ 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">
@@ -1443,17 +1532,6 @@
<description>e.g. SE</description>
</param>
</struct>
- <struct name="DeviceInfo">
- <param name="name" type="String" mandatory="true">
- <description>The name of the device connected.</description>
- </param>
- <param name="id" type="Integer" mandatory="true">
- <description>The ID of the device connected</description>
- </param>
- <param name="isSDLAllowed" type="Boolean" mandatory="false">
- <description>Sent by SDL in UpdateDeviceList. ’true’ – if device is allowed for PolicyTable Exchange; ‘false’ – if device is NOT allowed for PolicyTable Exchange </description>
- </param>
- </struct>
<!--IVI part-->
<struct name="GPSData">
<description>Struct with the GPS data.</description>
@@ -1788,6 +1866,24 @@
</description>
</param>
</function>
+ <function name="OnButtonSubscription" messagetype="notification">
+ <description>
+ Sender: SDL->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">
@@ -1805,6 +1901,15 @@
<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->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">
@@ -1815,7 +1920,7 @@
</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="1" maxsize="100"/>
+ <param name="applications" type="Common.HMIApplication" mandatory="true" array="true" minsize="0" maxsize="100"/>
</function>
<function name="UpdateAppList" messagetype="response">
</function>
@@ -1944,6 +2049,11 @@
<description>Specifies reason for exiting all apllications.</description>
</param>
</function>
+ <function name="OnAwakeSDL" messagetype="notification">
+ <description>
+ Sender: HMI->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>
@@ -1955,6 +2065,12 @@
</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>
<!-- Policies -->
<!-- SyncP RPC-->
@@ -2041,8 +2157,8 @@
</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>
+ into many PutFiles
+ </description>
</param>
<param name="FileName" type="String" maxlength="255" mandatory="true">
<description>File reference name.</description>
@@ -2267,7 +2383,7 @@
<param name="appID" type="Integer" mandatory="true">
<description>ID of application that requested this RPC.</description>
</param>
- <param name="speakType" type="Common.SpeakType" mandatory="false">
+ <param name="speakType" type="Common.MethodName" mandatory="false">
<description>Defines the type of the request which causes text-to-speech</description>
</param>
</function>
@@ -2506,8 +2622,8 @@
</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
+ Manually entered text selection, e.g. through keyboard
+ Can be returned in lieu of choiceID, depending on trigger source
</description>
</param>
</function>
@@ -2519,9 +2635,9 @@
<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"
+ 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">
@@ -2591,6 +2707,9 @@
<param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" 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’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>
@@ -2609,6 +2728,11 @@
<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>
@@ -2655,8 +2779,8 @@
<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.
+ Predefined or dynamically created screen layout.
+ Currently only predefined screen layouts are defined.
</description>
</param>
<param name="appID" type="Integer" mandatory="true">
@@ -2681,27 +2805,27 @@
<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).
+ 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.
+ 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>
@@ -2850,6 +2974,9 @@
</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">
@@ -2914,6 +3041,9 @@
<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>
@@ -2974,7 +3104,21 @@
</function>
<function name="StopAudioStream" messagetype="response">
</function>
+ <function name="OnAudioDataStreaming" messagetype="notification">
+ <description>Sender: SDL->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->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>
+
</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>
@@ -3041,7 +3185,7 @@
</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.
+ Array of bytes comprising CAN message.
</description>
</param>
<param name="appID" type="Integer" mandatory="true">
@@ -3051,7 +3195,7 @@
<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.
+ Array of bytes comprising CAN message result.
</description>
</param>
</function>
@@ -4038,6 +4182,12 @@
<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>
diff --git a/src/components/media_manager/CMakeLists.txt b/src/components/media_manager/CMakeLists.txt
index b16ec26e2..9a8618fa6 100644
--- a/src/components/media_manager/CMakeLists.txt
+++ b/src/components/media_manager/CMakeLists.txt
@@ -1,3 +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.
+
+
if (EXTENDED_MEDIA_MODE)
find_package(Gstreamer-1.0 REQUIRED)
find_package(Glib-2.0 REQUIRED)
@@ -5,77 +36,78 @@ find_package(PkgConfig)
pkg_check_modules(GLIB2 REQUIRED glib-2.0)
add_definitions(${GLIB2_CFLAGS})
set(default_includes
- ${GSTREAMER_gst_INCLUDE_DIR}
- ${GLIB_glib_2_INCLUDE_DIR}
+ ${GSTREAMER_gst_INCLUDE_DIR}
+ ${GLIB_glib_2_INCLUDE_DIR}
)
set(default_sources
- ./src/audio/a2dp_source_player_adapter.cc
- ./src/audio/from_mic_recorder_adapter.cc
- ./src/audio/from_mic_to_file_recorder_thread.cc
- ./src/audio/socket_audio_streamer_adapter.cc
- ./src/audio/pipe_audio_streamer_adapter.cc
- ./src/video/socket_video_streamer_adapter.cc
- ./src/video/pipe_video_streamer_adapter.cc
- ./src/video/video_stream_to_file_adapter.cc
- ./src/pipe_streamer_adapter.cc
- ./src/socket_streamer_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/audio/a2dp_source_player_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/audio/from_mic_recorder_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
+ ${COMPONENTS_DIR}/media_manager/src/audio/socket_audio_streamer_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/audio/pipe_audio_streamer_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/video/socket_video_streamer_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/video/pipe_video_streamer_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/video/video_stream_to_file_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/pipe_streamer_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/socket_streamer_adapter.cc
)
set(LIBRARIES
- ${GSTREAMER_gstreamer_LIBRARY}
- pulse-simple
- pulse
- gobject-2.0
- glib-2.0
+ ${GSTREAMER_gstreamer_LIBRARY}
+ ApplicationManager
+ pulse-simple
+ pulse
+ gobject-2.0
+ glib-2.0
)
else(EXTENDED_MEDIA_MODE)
set(default_includes
)
set(default_sources
- ./src/video/video_stream_to_file_adapter.cc
- ./src/audio/socket_audio_streamer_adapter.cc
- ./src/audio/pipe_audio_streamer_adapter.cc
- ./src/video/socket_video_streamer_adapter.cc
- ./src/video/pipe_video_streamer_adapter.cc
- ./src/video/video_stream_to_file_adapter.cc
- ./src/pipe_streamer_adapter.cc
- ./src/socket_streamer_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/video/video_stream_to_file_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/audio/socket_audio_streamer_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/audio/pipe_audio_streamer_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/video/socket_video_streamer_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/video/pipe_video_streamer_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/video/video_stream_to_file_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/pipe_streamer_adapter.cc
+ ${COMPONENTS_DIR}/media_manager/src/socket_streamer_adapter.cc
)
set(LIBRARIES
- ProtocolLibrary
+ ProtocolLibrary
)
endif()
include_directories (
- ./include
- ./include/audio/
- ./include/video/
- ../utils/include/
- ../protocol_handler/include/
- ../connection_handler/include/
- ../application_manager/include/
- ../smart_objects/include/
- ../hmi_message_handler/include/
- ../formatters/include
- ../config_profile/include/
- ${JSONCPP_INCLUDE_DIRECTORY}
- ${CMAKE_BINARY_DIR}/src/components/
- ${CMAKE_SOURCE_DIR}/src/components/policy/src/policy/include/
- ${CMAKE_SOURCE_DIR}/src/components/policy/src/policy/usage_statistics/include/
- ${default_includes}
- ${LOG4CXX_INCLUDE_DIRECTORY}
+ include
+ ${COMPONENTS_DIR}/media_manager/include/audio/
+ ${COMPONENTS_DIR}/media_manager/include/video/
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/protocol_handler/include/
+ ${COMPONENTS_DIR}/connection_handler/include/
+ ${COMPONENTS_DIR}/application_manager/include/
+ ${COMPONENTS_DIR}/smart_objects/include/
+ ${COMPONENTS_DIR}/hmi_message_handler/include/
+ ${COMPONENTS_DIR}/formatters/include/
+ ${COMPONENTS_DIR}/config_profile/include/
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${CMAKE_BINARY_DIR}/src/components/
+ ${CMAKE_SOURCE_DIR}/src/components/policy/src/policy/include/
+ ${CMAKE_SOURCE_DIR}/src/components/policy/src/policy/usage_statistics/include/
+ ${default_includes}
+ ${LOG4CXX_INCLUDE_DIRECTORY}
)
set (SOURCES
- ./src/media_adapter_impl.cc
- ./src/audio/from_mic_recorder_listener.cc
- ./src/audio/audio_stream_sender_thread.cc
- ./src/streamer_listener.cc
- ./src/media_manager_impl.cc
+ ${COMPONENTS_DIR}/media_manager/src/media_adapter_impl.cc
+ ${COMPONENTS_DIR}/media_manager/src/audio/from_mic_recorder_listener.cc
+ ${COMPONENTS_DIR}/media_manager/src/audio/audio_stream_sender_thread.cc
+ ${COMPONENTS_DIR}/media_manager/src/streamer_listener.cc
+ ${COMPONENTS_DIR}/media_manager/src/media_manager_impl.cc
)
add_library("MediaManager" ${SOURCES} ${default_sources})
target_link_libraries("MediaManager" ${LIBRARIES})
if(BUILD_TESTS)
- #add_subdirectory(test)
+ add_subdirectory(test)
endif()
diff --git a/src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h b/src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h
index ae41e19e6..257564e81 100644
--- a/src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h
+++ b/src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_A2DP_SOURCE_PLAYER_ADAPTER_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_A2DP_SOURCE_PLAYER_ADAPTER_H_
@@ -36,6 +36,7 @@
#include <map>
#include "protocol/common.h"
#include "media_manager/media_adapter_impl.h"
+#include "utils/threads/thread_delegate.h"
namespace threads {
class Thread;
@@ -56,7 +57,9 @@ class A2DPSourcePlayerAdapter : public MediaAdapterImpl {
private:
class A2DPSourcePlayerThread;
- std::map<int32_t, threads::Thread*> sources_;
+ typedef std::pair<threads::Thread*, A2DPSourcePlayerThread*> Pair;
+ typedef std::map<int32_t, Pair> SourcesMap;
+ SourcesMap sources_;
DISALLOW_COPY_AND_ASSIGN(A2DPSourcePlayerAdapter);
};
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 056ca9660..cb1c14470 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
@@ -1,34 +1,34 @@
-//
-// Copyright (c) 2013, Ford Motor Company
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided with the
-// distribution.
-//
-// Neither the name of the Ford Motor Company nor the names of its contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_AUDIO_STREAM_SENDER_THREAD_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_AUDIO_STREAM_SENDER_THREAD_H_
@@ -99,7 +99,7 @@ class AudioStreamSenderThread : public threads::ThreadDelegate {
*/
uint32_t session_key() const;
- bool exitThreadMain();
+ void exitThreadMain();
private:
/*
@@ -110,14 +110,6 @@ class AudioStreamSenderThread : public threads::ThreadDelegate {
void sendAudioChunkToMobile();
- /*
- * @brief Creates command for corresponding smart object
- *
- * @param cmd Smart object representing command
- */
- void FactoryCreateCommand(
- NsSmartDeviceLink::NsSmartObjects::SmartObject* cmd);
-
bool getShouldBeStopped();
void setShouldBeStopped(bool should_stop);
@@ -130,6 +122,7 @@ class AudioStreamSenderThread : public threads::ThreadDelegate {
static const int32_t kAudioPassThruTimeout;
+
DISALLOW_COPY_AND_ASSIGN(AudioStreamSenderThread);
};
} // namespace media_manager
diff --git a/src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h b/src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h
index 7c5a0f291..3ea458143 100644
--- a/src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h
+++ b/src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h
@@ -1,34 +1,34 @@
/*
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_RECORDER_ADAPTER_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_RECORDER_ADAPTER_H_
diff --git a/src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h b/src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h
index b2b70d5a1..7df2af7f4 100644
--- a/src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h
+++ b/src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, Ford Motor Company
+ Copyright (c) 2014, Ford Motor Company
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h b/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h
index ed40df690..7bb036fa4 100644
--- a/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h
+++ b/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_TO_FILE_RECORDER_THREAD_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_TO_FILE_RECORDER_THREAD_H_
@@ -47,10 +47,10 @@ class FromMicToFileRecorderThread : public threads::ThreadDelegate {
public:
FromMicToFileRecorderThread(const std::string& output_file,
int32_t duration);
-
+ ~FromMicToFileRecorderThread();
void threadMain();
- bool exitThreadMain();
+ void exitThreadMain();
void set_output_file(const std::string& output_file);
void set_record_duration(int32_t duration);
diff --git a/src/components/media_manager/include/media_manager/audio/pipe_audio_streamer_adapter.h b/src/components/media_manager/include/media_manager/audio/pipe_audio_streamer_adapter.h
index 9e2159446..437f34fa0 100644
--- a/src/components/media_manager/include/media_manager/audio/pipe_audio_streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/audio/pipe_audio_streamer_adapter.h
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_PIPE_AUDIO_STREAMER_ADAPTER_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_PIPE_AUDIO_STREAMER_ADAPTER_H_
diff --git a/src/components/media_manager/include/media_manager/audio/socket_audio_streamer_adapter.h b/src/components/media_manager/include/media_manager/audio/socket_audio_streamer_adapter.h
index e9c4031ab..be5951be3 100644
--- a/src/components/media_manager/include/media_manager/audio/socket_audio_streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/audio/socket_audio_streamer_adapter.h
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_SOCKET_AUDIO_STREAMER_ADAPTER_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_SOCKET_AUDIO_STREAMER_ADAPTER_H_
diff --git a/src/components/media_manager/include/media_manager/media_adapter.h b/src/components/media_manager/include/media_manager/media_adapter.h
index 91a897de4..a96ce03c8 100644
--- a/src/components/media_manager/include/media_manager/media_adapter.h
+++ b/src/components/media_manager/include/media_manager/media_adapter.h
@@ -1,33 +1,33 @@
/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_H_
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 5fa385e03..a3a296150 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
@@ -1,33 +1,33 @@
/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_IMPL_H_
@@ -56,6 +56,9 @@ class MediaAdapterImpl : public MediaAdapter {
private:
DISALLOW_COPY_AND_ASSIGN(MediaAdapterImpl);
};
+
+typedef utils::SharedPtr<MediaAdapterImpl> MediaAdapterImplPtr;
+
} // namespace media_manager
#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_IMPL_H_
diff --git a/src/components/media_manager/include/media_manager/media_adapter_listener.h b/src/components/media_manager/include/media_manager/media_adapter_listener.h
index 2f11119e3..423d41c89 100644
--- a/src/components/media_manager/include/media_manager/media_adapter_listener.h
+++ b/src/components/media_manager/include/media_manager/media_adapter_listener.h
@@ -1,33 +1,33 @@
/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_LISTENER_H_
diff --git a/src/components/media_manager/include/media_manager/media_manager.h b/src/components/media_manager/include/media_manager/media_manager.h
index 458481ca2..b4f5c9c28 100644
--- a/src/components/media_manager/include/media_manager/media_manager.h
+++ b/src/components/media_manager/include/media_manager/media_manager.h
@@ -1,55 +1,61 @@
-/**
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_H_
#include <string>
+#include "protocol_handler/protocol_handler.h"
namespace media_manager {
+
class MediaManager {
public:
virtual void PlayA2DPSource(int32_t application_key) = 0;
virtual void StopA2DPSource(int32_t application_key) = 0;
+
virtual void StartMicrophoneRecording(int32_t application_key,
const std::string& outputFileName,
int32_t duration) = 0;
virtual void StopMicrophoneRecording(int32_t application_key) = 0;
- virtual void StartVideoStreaming(int32_t application_key) = 0;
- virtual void StopVideoStreaming(int32_t application_key) = 0;
- virtual void StartAudioStreaming(int32_t application_key) = 0;
- virtual void StopAudioStreaming(int32_t application_key) = 0;
+
+ virtual void StartStreaming(
+ int32_t application_key, protocol_handler::ServiceType service_type) = 0;
+ virtual void StopStreaming(
+ int32_t application_key, protocol_handler::ServiceType service_type) = 0;
virtual ~MediaManager(){}
};
+
} // namespace media_manager
+
#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_H_
diff --git a/src/components/media_manager/include/media_manager/media_manager_impl.h b/src/components/media_manager/include/media_manager/media_manager_impl.h
index 94512a7ff..153ef4205 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
@@ -1,34 +1,34 @@
/*
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_IMPL_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_IMPL_H_
@@ -37,7 +37,6 @@
#include "utils/singleton.h"
#include "protocol_handler/protocol_observer.h"
#include "protocol_handler/protocol_handler.h"
-#include "protocol/service_type.h"
#include "media_manager/media_manager.h"
#include "media_manager/media_adapter_impl.h"
#include "media_manager/media_adapter_listener.h"
@@ -49,18 +48,22 @@ class MediaManagerImpl : public MediaManager,
public utils::Singleton<MediaManagerImpl> {
public:
virtual ~MediaManagerImpl();
- virtual void SetProtocolHandler(
- protocol_handler::ProtocolHandler* protocol_handler);
+
virtual void PlayA2DPSource(int32_t application_key);
virtual void StopA2DPSource(int32_t application_key);
+
virtual void StartMicrophoneRecording(int32_t application_key,
const std::string& outputFileName,
int32_t duration);
virtual void StopMicrophoneRecording(int32_t application_key);
- virtual void StartVideoStreaming(int32_t application_key);
- virtual void StopVideoStreaming(int32_t application_key);
- virtual void StartAudioStreaming(int32_t application_key);
- virtual void StopAudioStreaming(int32_t application_key);
+
+ virtual void StartStreaming(
+ int32_t application_key, protocol_handler::ServiceType service_type);
+ virtual void StopStreaming(
+ int32_t application_key, protocol_handler::ServiceType service_type);
+
+ virtual void SetProtocolHandler(
+ protocol_handler::ProtocolHandler* protocol_handler);
virtual void OnMessageReceived(
const ::protocol_handler::RawMessagePtr message);
virtual void OnMobileMessageSent(
@@ -70,16 +73,15 @@ class MediaManagerImpl : public MediaManager,
protected:
MediaManagerImpl();
virtual void Init();
+
protocol_handler::ProtocolHandler* protocol_handler_;
MediaAdapter* a2dp_player_;
+
MediaAdapterImpl* from_mic_recorder_;
MediaListenerPtr from_mic_listener_;
- MediaAdapterImpl* video_streamer_;
- MediaAdapterImpl* audio_streamer_;
- MediaListenerPtr video_streamer_listener_;
- MediaListenerPtr audio_streamer_listener_;
- bool video_stream_active_;
- bool audio_stream_active_;
+
+ std::map<protocol_handler::ServiceType, MediaAdapterImplPtr> streamer_;
+ std::map<protocol_handler::ServiceType, MediaListenerPtr> streamer_listener_;
private:
DISALLOW_COPY_AND_ASSIGN(MediaManagerImpl);
@@ -87,4 +89,5 @@ class MediaManagerImpl : public MediaManager,
};
} // namespace media_manager
+
#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_IMPL_H_
diff --git a/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h b/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h
index 108403a43..f6a0c687e 100644
--- a/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h
@@ -1,34 +1,34 @@
/*
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_PIPE_STREAMER_ADAPTER_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_PIPE_STREAMER_ADAPTER_H_
@@ -41,6 +41,9 @@
#include "utils/threads/thread_delegate.h"
namespace media_manager {
+
+using ::utils::MessageQueue;
+
class PipeStreamerAdapter : public MediaAdapterImpl {
public:
PipeStreamerAdapter();
@@ -82,7 +85,7 @@ class PipeStreamerAdapter : public MediaAdapterImpl {
/*
* @brief Function called by thread on exit
*/
- bool exitThreadMain();
+ void exitThreadMain();
/*
* @brief Opens pipe
diff --git a/src/components/media_manager/include/media_manager/socket_streamer_adapter.h b/src/components/media_manager/include/media_manager/socket_streamer_adapter.h
index afd78068b..a4ded9cb3 100644
--- a/src/components/media_manager/include/media_manager/socket_streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/socket_streamer_adapter.h
@@ -1,34 +1,34 @@
/*
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_SOCKET_STREAMER_ADAPTER_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_SOCKET_STREAMER_ADAPTER_H_
@@ -42,6 +42,9 @@
#include "utils/threads/thread_delegate.h"
namespace media_manager {
+
+using ::utils::MessageQueue;
+
class SocketStreamerAdapter : public MediaAdapterImpl {
public:
SocketStreamerAdapter();
@@ -85,7 +88,7 @@ class SocketStreamerAdapter : public MediaAdapterImpl {
/*
* Function called by thread on exit
*/
- bool exitThreadMain();
+ void exitThreadMain();
/*
* Checks if server is ready
@@ -125,8 +128,8 @@ class SocketStreamerAdapter : public MediaAdapterImpl {
int32_t socket_fd_;
bool is_ready_;
- threads::Thread* thread_;
Streamer* streamer_;
+ threads::Thread* thread_;
MessageQueue<protocol_handler::RawMessagePtr> messages_;
DISALLOW_COPY_AND_ASSIGN(SocketStreamerAdapter);
};
diff --git a/src/components/media_manager/include/media_manager/streamer_listener.h b/src/components/media_manager/include/media_manager/streamer_listener.h
index 38e89a2cb..d23258251 100644
--- a/src/components/media_manager/include/media_manager/streamer_listener.h
+++ b/src/components/media_manager/include/media_manager/streamer_listener.h
@@ -1,33 +1,33 @@
/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_STREAMER_LISTENER_H_
diff --git a/src/components/media_manager/include/media_manager/video/pipe_video_streamer_adapter.h b/src/components/media_manager/include/media_manager/video/pipe_video_streamer_adapter.h
index 50328cc43..62447661a 100644
--- a/src/components/media_manager/include/media_manager/video/pipe_video_streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/video/pipe_video_streamer_adapter.h
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_PIPE_VIDEO_STREAMER_ADAPTER_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_PIPE_VIDEO_STREAMER_ADAPTER_H_
diff --git a/src/components/media_manager/include/media_manager/video/socket_video_streamer_adapter.h b/src/components/media_manager/include/media_manager/video/socket_video_streamer_adapter.h
index 8752efc5e..e5eefed12 100644
--- a/src/components/media_manager/include/media_manager/video/socket_video_streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/video/socket_video_streamer_adapter.h
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_SOCKET_VIDEO_STREAMER_ADAPTER_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_SOCKET_VIDEO_STREAMER_ADAPTER_H_
diff --git a/src/components/media_manager/include/media_manager/video/video_stream_to_file_adapter.h b/src/components/media_manager/include/media_manager/video/video_stream_to_file_adapter.h
index 478401449..8ec7fff80 100644
--- a/src/components/media_manager/include/media_manager/video/video_stream_to_file_adapter.h
+++ b/src/components/media_manager/include/media_manager/video/video_stream_to_file_adapter.h
@@ -1,34 +1,34 @@
/*
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_VIDEO_STREAM_TO_FILE_ADAPTER_H_
#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_VIDEO_STREAM_TO_FILE_ADAPTER_H_
@@ -42,6 +42,8 @@
namespace media_manager {
+using ::utils::MessageQueue;
+
class VideoStreamToFileAdapter : public MediaAdapterImpl {
public:
explicit VideoStreamToFileAdapter(const std::string& file_name);
@@ -80,7 +82,7 @@ class VideoStreamToFileAdapter : public MediaAdapterImpl {
/*
* @brief Function called by thread on exit
*/
- bool exitThreadMain();
+ void exitThreadMain();
/*
* @brief Opens file
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 f8b0d9599..a6a36ef54 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
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (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 <net/if.h>
#include <pulse/simple.h>
#include <pulse/error.h>
@@ -37,7 +37,6 @@
#include "utils/threads/thread.h"
#include "media_manager/audio/a2dp_source_player_adapter.h"
#include "utils/lock.h"
-#include "utils/threads/thread_delegate.h"
#include "utils/logger.h"
#include "connection_handler/connection_handler_impl.h"
@@ -54,7 +53,7 @@ class A2DPSourcePlayerAdapter::A2DPSourcePlayerThread
void threadMain();
- bool exitThreadMain();
+ void exitThreadMain();
private:
// The Sample format to use
@@ -74,13 +73,12 @@ A2DPSourcePlayerAdapter::A2DPSourcePlayerAdapter() {
}
A2DPSourcePlayerAdapter::~A2DPSourcePlayerAdapter() {
- for (std::map<int32_t, threads::Thread*>::iterator it = sources_.begin();
- sources_.end() != it;
- ++it) {
- if (NULL != it->second) {
- it->second->stop();
- threads::DeleteThread(it->second);
- }
+ for (SourcesMap::iterator it = sources_.begin();
+ sources_.end() != it; ++it) {
+ Pair pair = it->second;
+ pair.first->join();
+ delete pair.second;
+ threads::DeleteThread(pair.first);
}
sources_.clear();
}
@@ -105,10 +103,11 @@ void A2DPSourcePlayerAdapter::StartActivity(int32_t application_key) {
// 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);
threads::Thread* new_activity = threads::CreateThread(
- mac_adddress.c_str(),
- new A2DPSourcePlayerAdapter::A2DPSourcePlayerThread(mac_adddress));
- sources_[application_key] = new_activity;
+ mac_adddress.c_str(), delegate);
+ sources_[application_key] = Pair(new_activity, delegate);
new_activity->start();
}
}
@@ -119,19 +118,12 @@ void A2DPSourcePlayerAdapter::StopActivity(int32_t application_key) {
if (application_key != current_application_) {
return;
}
- std::map<int32_t, threads::Thread*>::iterator it =
- sources_.find(application_key);
+ SourcesMap::iterator it = sources_.find(application_key);
if (sources_.end() != it) {
- LOG4CXX_DEBUG(logger_, "Source exists.");
- if (NULL != it->second) {
- LOG4CXX_DEBUG(logger_, "Sources thread was allocated");
- if ((*it).second->is_running()) {
- // Sources thread was started - stop it
- LOG4CXX_DEBUG(logger_, "Sources thread was started - stop it");
- (*it).second->stop();
- threads::DeleteThread(it->second);
- }
- }
+ Pair pair = it->second;
+ pair.first->join();
+ delete pair.second;
+ threads::DeleteThread(pair.first);
current_application_ = 0;
}
}
@@ -165,10 +157,9 @@ void A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::freeStreams() {
}
}
-bool A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::exitThreadMain() {
+void A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::exitThreadMain() {
sync_primitives::AutoLock auto_lock(should_be_stopped_lock_);
should_be_stopped_ = true;
- return true;
}
void A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::threadMain() {
@@ -239,6 +230,7 @@ void A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::threadMain() {
bool should_be_stopped;
{
+ // FIXME (dchmerev@luxoft.com): Remove these insane blockings
sync_primitives::AutoLock auto_lock(should_be_stopped_lock_);
should_be_stopped = should_be_stopped_;
}
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 a3ef5af0b..a78ca8b49 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
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2013, Ford Motor Company
+// Copyright (c) 2014, Ford Motor Company
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -38,6 +38,7 @@
#include <string>
+#include <string.h>
#include "application_manager/application_manager_impl.h"
#include "application_manager/mobile_command_factory.h"
#include "application_manager/application_impl.h"
@@ -65,14 +66,14 @@ AudioStreamSenderThread::AudioStreamSenderThread(
shouldBeStoped_(false),
shouldBeStoped_lock_(),
shouldBeStoped_cv_() {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
}
AudioStreamSenderThread::~AudioStreamSenderThread() {
}
void AudioStreamSenderThread::threadMain() {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
offset_ = 0;
@@ -82,11 +83,10 @@ void AudioStreamSenderThread::threadMain() {
sendAudioChunkToMobile();
}
- LOG4CXX_TRACE_EXIT(logger_);
}
void AudioStreamSenderThread::sendAudioChunkToMobile() {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
std::vector<uint8_t> binaryData;
std::vector<uint8_t>::iterator from;
@@ -112,10 +112,10 @@ void AudioStreamSenderThread::sendAudioChunkToMobile() {
LOG4CXX_INFO_EXT(logger_, "from != binaryData.end()");
offset_ = offset_ + to - from;
+ std::vector<uint8_t> data(from, to);
application_manager::ApplicationManagerImpl::instance()->
- SendAudioPassThroughNotification(session_key_,
- std::vector<uint8_t>(from, to));
+ SendAudioPassThroughNotification(session_key_, data);
binaryData.clear();
}
#if !defined(EXTENDED_MEDIA_MODE)
@@ -136,10 +136,9 @@ void AudioStreamSenderThread::setShouldBeStopped(bool should_stop) {
shouldBeStoped_cv_.NotifyOne();
}
-bool AudioStreamSenderThread::exitThreadMain() {
- LOG4CXX_INFO(logger_, "AudioStreamSenderThread::exitThreadMain");
+void AudioStreamSenderThread::exitThreadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
setShouldBeStopped(true);
- return true;
}
uint32_t AudioStreamSenderThread::session_key() const {
diff --git a/src/components/media_manager/src/audio/from_mic_recorder_adapter.cc b/src/components/media_manager/src/audio/from_mic_recorder_adapter.cc
index 7559512a8..ef9d5b8de 100644
--- a/src/components/media_manager/src/audio/from_mic_recorder_adapter.cc
+++ b/src/components/media_manager/src/audio/from_mic_recorder_adapter.cc
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (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 <string>
#include "utils/threads/thread.h"
@@ -44,18 +44,21 @@ FromMicRecorderAdapter::FromMicRecorderAdapter()
: recorder_thread_(NULL)
, output_file_("default_recorded_audio.wav")
, kDefaultDuration(1000)
- , duration_(0) {
- duration_ = kDefaultDuration;
+ , duration_(kDefaultDuration) {
+
}
FromMicRecorderAdapter::~FromMicRecorderAdapter() {
- LOG4CXX_INFO(logger_, "FromMicRecorderAdapter::~FromMicRecorderAdapter()");
- StopActivity(current_application_);
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (recorder_thread_) {
+ recorder_thread_->join();
+ delete recorder_thread_->delegate();
+ threads::DeleteThread(recorder_thread_);
+ }
}
void FromMicRecorderAdapter::StartActivity(int32_t application_key) {
- LOG4CXX_INFO(logger_, "FromMicRecorderAdapter::StartActivity "
- << application_key);
+ LOG4CXX_DEBUG(logger_, "Start with app " << application_key);
if (application_key == current_application_) {
LOG4CXX_WARN(logger_, "Running recording from mic for "
<< current_application_);
@@ -86,8 +89,10 @@ void FromMicRecorderAdapter::StopActivity(int32_t application_key) {
return;
}
- if (NULL != recorder_thread_) {
- recorder_thread_->stop();
+ if (recorder_thread_) {
+ recorder_thread_->join();
+ delete recorder_thread_->delegate();
+ threads::DeleteThread(recorder_thread_);
recorder_thread_ = NULL;
}
current_application_ = 0;
diff --git a/src/components/media_manager/src/audio/from_mic_recorder_listener.cc b/src/components/media_manager/src/audio/from_mic_recorder_listener.cc
index 06dce2d4e..3718e82c6 100644
--- a/src/components/media_manager/src/audio/from_mic_recorder_listener.cc
+++ b/src/components/media_manager/src/audio/from_mic_recorder_listener.cc
@@ -1,33 +1,33 @@
/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (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 "utils/threads/thread.h"
@@ -46,9 +46,11 @@ FromMicRecorderListener::FromMicRecorderListener(
}
FromMicRecorderListener::~FromMicRecorderListener() {
+ LOG4CXX_AUTO_TRACE(logger_);
if (reader_) {
- reader_->stop();
- reader_ = NULL;
+ reader_->join();
+ delete reader_->delegate();
+ threads::DeleteThread(reader_);
}
}
@@ -88,7 +90,9 @@ void FromMicRecorderListener::OnActivityEnded(int32_t application_key) {
return;
}
if (reader_) {
- reader_->stop();
+ reader_->join();
+ delete reader_->delegate();
+ threads::DeleteThread(reader_);
reader_ = NULL;
}
current_application_ = 0;
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 181c8c61b..88c358a49 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
@@ -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 "media_manager/audio/from_mic_to_file_recorder_thread.h"
#include <unistd.h>
@@ -45,23 +45,32 @@ FromMicToFileRecorderThread::FromMicToFileRecorderThread(
const std::string& output_file, int32_t duration)
: threads::ThreadDelegate(),
argc_(5),
+ argv_(NULL),
oKey_("-o"),
tKey_("-t"),
sleepThread_(NULL),
outputFileName_(output_file) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
set_record_duration(duration);
}
+FromMicToFileRecorderThread::~FromMicToFileRecorderThread() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (sleepThread_) {
+ sleepThread_->join();
+ delete sleepThread_->delegate();
+ threads::DeleteThread(sleepThread_);
+ }
+}
+
void FromMicToFileRecorderThread::set_output_file(
const std::string& output_file) {
- LOG4CXX_TRACE_ENTER(logger_);
-
+ LOG4CXX_AUTO_TRACE(logger_);
outputFileName_ = output_file;
}
void FromMicToFileRecorderThread::set_record_duration(int32_t duration) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
std::stringstream stringStream;
stringStream << duration / 1000;
@@ -69,7 +78,7 @@ void FromMicToFileRecorderThread::set_record_duration(int32_t duration) {
}
void FromMicToFileRecorderThread::initArgs() {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
argv_ = new gchar*[argc_];
@@ -87,7 +96,7 @@ void FromMicToFileRecorderThread::initArgs() {
}
void FromMicToFileRecorderThread::threadMain() {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
{
sync_primitives::AutoLock auto_lock(stopFlagLock_);
@@ -177,19 +186,25 @@ void FromMicToFileRecorderThread::threadMain() {
LOG4CXX_TRACE(logger_, "Initializing pipeline ...");
while (GST_STATE(pipeline) != GST_STATE_PLAYING) {
- LOG4CXX_TRACE(logger_, "GST_STATE(pipeline) != GST_STATE_PLAYING");
-
bool shouldBeStoped;
{
+ // FIXME(dchmerev@luxoft.com):
sync_primitives::AutoLock auto_lock(stopFlagLock_);
shouldBeStoped = shouldBeStoped_;
}
if (shouldBeStoped) {
+ gst_element_set_state(pipeline, GST_STATE_NULL);
+ gst_object_unref(GST_OBJECT(pipeline));
+ g_option_context_free(context);
+
+ if (argv_) {
+ delete [] argv_;
+ argv_ = NULL;
+ }
return;
}
}
-
LOG4CXX_TRACE(logger_, "Pipeline started ...\n");
// Start up a timer for the pipeline
@@ -211,6 +226,12 @@ void FromMicToFileRecorderThread::threadMain() {
LOG4CXX_TRACE(logger_, "Deleting pipeline\n");
gst_object_unref(GST_OBJECT(pipeline));
g_main_loop_unref(loop);
+ g_option_context_free(context);
+
+ if (argv_) {
+ delete [] argv_;
+ argv_ = NULL;
+ }
loop = NULL;
}
@@ -233,8 +254,8 @@ void FromMicToFileRecorderThread::SleepThreadDelegate::threadMain() {
}
}
-bool FromMicToFileRecorderThread::exitThreadMain() {
- LOG4CXX_TRACE_ENTER(logger_);
+void FromMicToFileRecorderThread::exitThreadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
if (NULL != loop) {
if (g_main_loop_is_running(loop)) {
@@ -243,20 +264,14 @@ bool FromMicToFileRecorderThread::exitThreadMain() {
}
}
- if (NULL != sleepThread_) {
- LOG4CXX_TRACE(logger_, "Stop sleep thread\n");
+ if (sleepThread_) {
+ LOG4CXX_DEBUG(logger_, "Stop sleep thread\n");
sleepThread_->stop();
- threads::DeleteThread(sleepThread_);
- sleepThread_ = NULL;
}
LOG4CXX_TRACE(logger_, "Set should be stopped flag\n");
- {
- sync_primitives::AutoLock auto_lock(stopFlagLock_);
- shouldBeStoped_ = true;
- }
-
- return true;
+ sync_primitives::AutoLock auto_lock(stopFlagLock_);
+ shouldBeStoped_ = true;
}
} // namespace media_manager
diff --git a/src/components/media_manager/src/audio/pipe_audio_streamer_adapter.cc b/src/components/media_manager/src/audio/pipe_audio_streamer_adapter.cc
index 5faebf93d..5c120397c 100644
--- a/src/components/media_manager/src/audio/pipe_audio_streamer_adapter.cc
+++ b/src/components/media_manager/src/audio/pipe_audio_streamer_adapter.cc
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@ namespace media_manager {
CREATE_LOGGERPTR_GLOBAL(logger, "PipeAudioStreamerAdapter")
PipeAudioStreamerAdapter::PipeAudioStreamerAdapter() {
- LOG4CXX_INFO(logger, "PipeAudioStreamerAdapter::PipeAudioStreamerAdapter");
+ LOG4CXX_AUTO_TRACE(logger);
named_pipe_path_ = profile::Profile::instance()->named_audio_pipe_path();
Init();
diff --git a/src/components/media_manager/src/audio/socket_audio_streamer_adapter.cc b/src/components/media_manager/src/audio/socket_audio_streamer_adapter.cc
index eb93032e4..06dc877d8 100644
--- a/src/components/media_manager/src/audio/socket_audio_streamer_adapter.cc
+++ b/src/components/media_manager/src/audio/socket_audio_streamer_adapter.cc
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2014 Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@ namespace media_manager {
CREATE_LOGGERPTR_GLOBAL(logger, "SocketAudioStreamerAdapter")
SocketAudioStreamerAdapter::SocketAudioStreamerAdapter() {
- LOG4CXX_INFO(logger, "SocketAudioStreamerAdapter::SocketAudioStreamerAdapter");
+ LOG4CXX_AUTO_TRACE(logger);
port_ = profile::Profile::instance()->audio_streaming_port();
ip_ = profile::Profile::instance()->server_address();
diff --git a/src/components/media_manager/src/media_adapter_impl.cc b/src/components/media_manager/src/media_adapter_impl.cc
index 1a52b003f..257801ffd 100644
--- a/src/components/media_manager/src/media_adapter_impl.cc
+++ b/src/components/media_manager/src/media_adapter_impl.cc
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (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 "media_manager/media_adapter_impl.h"
#include "utils/logger.h"
@@ -46,12 +46,12 @@ MediaAdapterImpl::~MediaAdapterImpl() {
}
void MediaAdapterImpl::AddListener(const MediaListenerPtr& listener) {
- LOG4CXX_INFO(logger_, "MediaAdapterImpl::AddListener");
+ LOG4CXX_AUTO_TRACE(logger_);
media_listeners_.insert(listener);
}
void MediaAdapterImpl::RemoveListener(const MediaListenerPtr& listener) {
- LOG4CXX_INFO(logger_, "MediaAdapterImpl::RemoveListener");
+ LOG4CXX_AUTO_TRACE(logger_);
media_listeners_.erase(listener);
}
diff --git a/src/components/media_manager/src/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc
index e8156795b..61b2c5bb9 100644
--- a/src/components/media_manager/src/media_manager_impl.cc
+++ b/src/components/media_manager/src/media_manager_impl.cc
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (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 "config_profile/profile.h"
#include "media_manager/media_manager_impl.h"
@@ -38,8 +38,10 @@
#include "application_manager/application.h"
#include "application_manager/application_manager_impl.h"
#include "application_manager/application_impl.h"
+#include "protocol_handler/protocol_handler.h"
#include "utils/file_system.h"
#include "utils/logger.h"
+#include "utils/helpers.h"
#if defined(EXTENDED_MEDIA_MODE)
#include "media_manager/audio/a2dp_source_player_adapter.h"
#include "media_manager/audio/from_mic_recorder_adapter.h"
@@ -50,19 +52,17 @@
#include "media_manager/audio/pipe_audio_streamer_adapter.h"
#include "media_manager/video/video_stream_to_file_adapter.h"
-
namespace media_manager {
+using profile::Profile;
+using timer::TimerThread;
+
CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManagerImpl")
MediaManagerImpl::MediaManagerImpl()
: protocol_handler_(NULL)
, a2dp_player_(NULL)
- , from_mic_recorder_(NULL)
- , video_streamer_(NULL)
- , audio_streamer_(NULL)
- , video_stream_active_(false)
- , audio_stream_active_(false) {
+ , from_mic_recorder_(NULL) {
Init();
}
@@ -76,24 +76,10 @@ MediaManagerImpl::~MediaManagerImpl() {
delete from_mic_recorder_;
from_mic_recorder_ = NULL;
}
-
- if (video_streamer_) {
- delete video_streamer_;
- video_streamer_ = NULL;
- }
-
- if (audio_streamer_) {
- delete audio_streamer_;
- audio_streamer_ = NULL;
- }
-}
-
-void MediaManagerImpl::SetProtocolHandler(
- protocol_handler::ProtocolHandler* protocol_handler) {
- protocol_handler_ = protocol_handler;
}
void MediaManagerImpl::Init() {
+ using namespace protocol_handler;
LOG4CXX_INFO(logger_, "MediaManagerImpl::Init()");
#if defined(EXTENDED_MEDIA_MODE)
@@ -103,44 +89,46 @@ void MediaManagerImpl::Init() {
#endif
if ("socket" == profile::Profile::instance()->video_server_type()) {
- video_streamer_ = new SocketVideoStreamerAdapter();
+ streamer_[ServiceType::kMobileNav] = new SocketVideoStreamerAdapter();
} else if ("pipe" == profile::Profile::instance()->video_server_type()) {
- video_streamer_ = new PipeVideoStreamerAdapter();
+ streamer_[ServiceType::kMobileNav] = new PipeVideoStreamerAdapter();
} else if ("file" == profile::Profile::instance()->video_server_type()) {
- video_streamer_ = new VideoStreamToFileAdapter(
+ streamer_[ServiceType::kMobileNav] = new VideoStreamToFileAdapter(
profile::Profile::instance()->video_stream_file());
}
if ("socket" == profile::Profile::instance()->audio_server_type()) {
- audio_streamer_ = new SocketAudioStreamerAdapter();
+ streamer_[ServiceType::kAudio] = new SocketAudioStreamerAdapter();
} else if ("pipe" == profile::Profile::instance()->audio_server_type()) {
- audio_streamer_ = new PipeAudioStreamerAdapter();
+ streamer_[ServiceType::kAudio] = new PipeAudioStreamerAdapter();
} else if ("file" == profile::Profile::instance()->audio_server_type()) {
- audio_streamer_ = new VideoStreamToFileAdapter(
+ streamer_[ServiceType::kAudio] = new VideoStreamToFileAdapter(
profile::Profile::instance()->audio_stream_file());
}
- video_streamer_listener_ = new StreamerListener();
- audio_streamer_listener_ = new StreamerListener();
+ streamer_listener_[ServiceType::kMobileNav] = new StreamerListener();
+ streamer_listener_[ServiceType::kAudio] = new StreamerListener();
- if (NULL != video_streamer_) {
- video_streamer_->AddListener(video_streamer_listener_);
+ if (streamer_[ServiceType::kMobileNav]) {
+ streamer_[ServiceType::kMobileNav]->AddListener(
+ streamer_listener_[ServiceType::kMobileNav]);
}
- if (NULL != audio_streamer_) {
- audio_streamer_->AddListener(audio_streamer_listener_);
+ if (streamer_[ServiceType::kAudio]) {
+ streamer_[ServiceType::kAudio]->AddListener(
+ streamer_listener_[ServiceType::kAudio]);
}
}
void MediaManagerImpl::PlayA2DPSource(int32_t application_key) {
- LOG4CXX_INFO(logger_, "MediaManagerImpl::PlayA2DPSource");
+ LOG4CXX_AUTO_TRACE(logger_);
if (a2dp_player_) {
a2dp_player_->StartActivity(application_key);
}
}
void MediaManagerImpl::StopA2DPSource(int32_t application_key) {
- LOG4CXX_INFO(logger_, "MediaManagerImpl::StopA2DPSource");
+ LOG4CXX_AUTO_TRACE(logger_);
if (a2dp_player_) {
a2dp_player_->StopActivity(application_key);
}
@@ -200,7 +188,7 @@ void MediaManagerImpl::StartMicrophoneRecording(
}
void MediaManagerImpl::StopMicrophoneRecording(int32_t application_key) {
- LOG4CXX_INFO(logger_, "MediaManagerImpl::StopMicrophoneRecording");
+ LOG4CXX_AUTO_TRACE(logger_);
#if defined(EXTENDED_MEDIA_MODE)
if (from_mic_recorder_) {
from_mic_recorder_->StopActivity(application_key);
@@ -209,70 +197,65 @@ void MediaManagerImpl::StopMicrophoneRecording(int32_t application_key) {
if (from_mic_listener_) {
from_mic_listener_->OnActivityEnded(application_key);
}
+#if defined(EXTENDED_MEDIA_MODE)
+ if (from_mic_recorder_) {
+ from_mic_recorder_->RemoveListener(from_mic_listener_);
+ }
+#endif
}
-void MediaManagerImpl::StartVideoStreaming(int32_t application_key) {
- LOG4CXX_INFO(logger_, "MediaManagerImpl::StartVideoStreaming");
+void MediaManagerImpl::StartStreaming(
+ int32_t application_key, protocol_handler::ServiceType service_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
- if (video_streamer_) {
- if (!video_stream_active_) {
- video_stream_active_ = true;
- video_streamer_->StartActivity(application_key);
- application_manager::MessageHelper::SendNaviStartStream(application_key);
- }
+ if (streamer_[service_type]) {
+ streamer_[service_type]->StartActivity(application_key);
}
}
-void MediaManagerImpl::StopVideoStreaming(int32_t application_key) {
- LOG4CXX_INFO(logger_, "MediaManagerImpl::StopVideoStreaming");
- if (video_streamer_) {
- video_stream_active_ = false;
- application_manager::MessageHelper::SendNaviStopStream(application_key);
- video_streamer_->StopActivity(application_key);
+void MediaManagerImpl::StopStreaming(
+ int32_t application_key, protocol_handler::ServiceType service_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (streamer_[service_type]) {
+ streamer_[service_type]->StopActivity(application_key);
}
}
-void MediaManagerImpl::StartAudioStreaming(int32_t application_key) {
- LOG4CXX_INFO(logger_, "MediaManagerImpl::StartAudioStreaming");
+void MediaManagerImpl::SetProtocolHandler(
+ protocol_handler::ProtocolHandler* protocol_handler) {
+ protocol_handler_ = protocol_handler;
+}
+
+void MediaManagerImpl::OnMessageReceived(
+ const ::protocol_handler::RawMessagePtr message) {
+ using namespace protocol_handler;
+ using namespace application_manager;
+ using namespace helpers;
+ LOG4CXX_AUTO_TRACE(logger_);
- if (audio_streamer_) {
- if (!audio_stream_active_) {
- audio_stream_active_ = true;
- audio_streamer_->StartActivity(application_key);
- application_manager::MessageHelper::SendAudioStartStream(application_key);
- }
+ const uint32_t streaming_app_id = message->connection_key();
+ const ServiceType service_type = message->service_type();
+
+ if (Compare<ServiceType, NEQ, ALL>(
+ service_type, ServiceType::kMobileNav, ServiceType::kAudio)) {
+ LOG4CXX_DEBUG(logger_, "Unsupported service type in MediaManager");
+ return;
}
-}
-void MediaManagerImpl::StopAudioStreaming(int32_t application_key) {
- LOG4CXX_INFO(logger_, "MediaManagerImpl::StopAudioStreaming");
- if (audio_streamer_) {
- audio_stream_active_ = false;
- application_manager::MessageHelper::SendAudioStopStream(application_key);
- audio_streamer_->StopActivity(application_key);
+ ApplicationManagerImpl* app_mgr = ApplicationManagerImpl::instance();
+ DCHECK_OR_RETURN_VOID(app_mgr);
+
+ if (!app_mgr->CanAppStream(streaming_app_id, service_type)) {
+ app_mgr->ForbidStreaming(streaming_app_id);
+ LOG4CXX_ERROR(logger_, "The application trying to stream when it should not.");
+ return;
}
-}
-void MediaManagerImpl::OnMessageReceived(
- const ::protocol_handler::RawMessagePtr message) {
- if (message->service_type()
- == protocol_handler::kMobileNav) {
- if (!(application_manager::ApplicationManagerImpl::instance()->
- IsVideoStreamingAllowed(message->connection_key()))) {
- return;
- }
- if (video_streamer_) {
- video_streamer_->SendData(message->connection_key(), message);
- }
- } else if (message->service_type()
- == protocol_handler::kAudio) {
- if (!(application_manager::ApplicationManagerImpl::instance()->
- IsAudioStreamingAllowed(message->connection_key()))) {
- return;
- }
- if (audio_streamer_) {
- audio_streamer_->SendData(message->connection_key(), message);
- }
+ ApplicationSharedPtr app = app_mgr->application(streaming_app_id);
+ if (app) {
+ app->WakeUpStreaming(service_type);
+ streamer_[service_type]->SendData(streaming_app_id, message);
}
}
diff --git a/src/components/media_manager/src/pipe_streamer_adapter.cc b/src/components/media_manager/src/pipe_streamer_adapter.cc
index 43f0d7153..5990428c6 100644
--- a/src/components/media_manager/src/pipe_streamer_adapter.cc
+++ b/src/components/media_manager/src/pipe_streamer_adapter.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,32 +41,34 @@
namespace media_manager {
-CREATE_LOGGERPTR_GLOBAL(logger, "PipeStreamerAdapter")
+CREATE_LOGGERPTR_GLOBAL(logger_, "PipeStreamerAdapter")
PipeStreamerAdapter::PipeStreamerAdapter()
: is_ready_(false),
- thread_(NULL),
+ thread_(threads::CreateThread("PipeStreamer", new Streamer(this))),
messages_() {
- LOG4CXX_INFO(logger, "PipeStreamerAdapter::PipeStreamerAdapter");
+ LOG4CXX_AUTO_TRACE(logger_);
}
PipeStreamerAdapter::~PipeStreamerAdapter() {
- LOG4CXX_INFO(logger, "PipeStreamerAdapter::~PipeStreamerAdapter");
+ LOG4CXX_AUTO_TRACE(logger_);
if ((0 != current_application_ ) && (is_ready_)) {
StopActivity(current_application_);
}
- thread_->stop();
+ thread_->join();
+ delete thread_->delegate();
+ threads::DeleteThread(thread_);
}
void PipeStreamerAdapter::SendData(
int32_t application_key,
const ::protocol_handler::RawMessagePtr message) {
- LOG4CXX_INFO(logger, "PipeStreamerAdapter::SendData");
+ LOG4CXX_AUTO_TRACE(logger_);
if (application_key != current_application_) {
- LOG4CXX_WARN(logger, "Wrong application " << application_key);
+ LOG4CXX_WARN(logger_, "Wrong application " << application_key);
return;
}
@@ -76,10 +78,10 @@ void PipeStreamerAdapter::SendData(
}
void PipeStreamerAdapter::StartActivity(int32_t application_key) {
- LOG4CXX_INFO(logger, "PipeStreamerAdapter::StartActivity");
+ LOG4CXX_AUTO_TRACE(logger_);
if (application_key == current_application_) {
- LOG4CXX_WARN(logger, "Already started activity for " << application_key);
+ LOG4CXX_WARN(logger_, "Already started activity for " << application_key);
return;
}
@@ -92,20 +94,22 @@ void PipeStreamerAdapter::StartActivity(int32_t application_key) {
(*it)->OnActivityStarted(application_key);
}
- LOG4CXX_TRACE(logger, "Pipe was opened for writing " << named_pipe_path_);
+ LOG4CXX_DEBUG(logger_, "Pipe was opened for writing " << named_pipe_path_);
}
void PipeStreamerAdapter::StopActivity(int32_t application_key) {
- LOG4CXX_INFO(logger, "PipeStreamerAdapter::StopActivity");
+ LOG4CXX_AUTO_TRACE(logger_);
if (application_key != current_application_) {
- LOG4CXX_WARN(logger, "Not performing activity for " << application_key);
+ LOG4CXX_WARN(logger_, "Not performing activity for " << application_key);
return;
}
is_ready_ = false;
current_application_ = 0;
+ messages_.Reset();
+
for (std::set<MediaListenerPtr>::iterator it = media_listeners_.begin();
media_listeners_.end() != it;
++it) {
@@ -113,18 +117,19 @@ void PipeStreamerAdapter::StopActivity(int32_t application_key) {
}
}
-bool PipeStreamerAdapter::is_app_performing_activity(
- int32_t application_key) {
+bool PipeStreamerAdapter::is_app_performing_activity( int32_t application_key) {
return (application_key == current_application_);
}
void PipeStreamerAdapter::Init() {
- if (!thread_) {
- LOG4CXX_INFO(logger, "Create and start sending thread");
- thread_ = threads::CreateThread("PipeStreamer", new Streamer(this));
- const size_t kStackSize = 16384;
- thread_->startWithOptions(threads::ThreadOptions(kStackSize));
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (thread_->is_running()) {
+ thread_->stop();
+ thread_->join();
}
+ LOG4CXX_DEBUG(logger_, "Start sending thread");
+ const size_t kStackSize = 16384;
+ thread_->start(threads::ThreadOptions(kStackSize));
}
PipeStreamerAdapter::Streamer::Streamer(
@@ -139,7 +144,7 @@ PipeStreamerAdapter::Streamer::~Streamer() {
}
void PipeStreamerAdapter::Streamer::threadMain() {
- LOG4CXX_INFO(logger, "Streamer::threadMain");
+ LOG4CXX_AUTO_TRACE(logger_);
open();
@@ -147,7 +152,7 @@ void PipeStreamerAdapter::Streamer::threadMain() {
while (!server_->messages_.empty()) {
::protocol_handler::RawMessagePtr msg = server_->messages_.pop();
if (!msg) {
- LOG4CXX_ERROR(logger, "Null pointer message");
+ LOG4CXX_ERROR(logger_, "Null pointer message");
continue;
}
@@ -155,7 +160,7 @@ void PipeStreamerAdapter::Streamer::threadMain() {
msg.get()->data_size());
if (ret == -1) {
- LOG4CXX_ERROR(logger, "Failed writing data to pipe "
+ LOG4CXX_ERROR(logger_, "Failed writing data to pipe "
<< server_->named_pipe_path_);
std::set<MediaListenerPtr>::iterator it =
@@ -164,14 +169,14 @@ void PipeStreamerAdapter::Streamer::threadMain() {
(*it)->OnErrorReceived(server_->current_application_, -1);
}
} else if (static_cast<uint32_t>(ret) != msg.get()->data_size()) {
- LOG4CXX_WARN(logger, "Couldn't write all the data to pipe "
+ LOG4CXX_WARN(logger_, "Couldn't write all the data to pipe "
<< server_->named_pipe_path_);
}
static int32_t messsages_for_session = 0;
++messsages_for_session;
- LOG4CXX_INFO(logger, "Handling map streaming message. This is "
+ LOG4CXX_DEBUG(logger_, "Handling map streaming message. This is "
<< messsages_for_session << " the message for "
<< server_->current_application_);
std::set<MediaListenerPtr>::iterator it =
@@ -186,16 +191,14 @@ void PipeStreamerAdapter::Streamer::threadMain() {
close();
}
-bool PipeStreamerAdapter::Streamer::exitThreadMain() {
- LOG4CXX_INFO(logger, "Streamer::exitThreadMain");
+void PipeStreamerAdapter::Streamer::exitThreadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
stop_flag_ = true;
server_->messages_.Shutdown();
- return false;
}
void PipeStreamerAdapter::Streamer::open() {
-
- LOG4CXX_INFO(logger, "Streamer::open() " << server_->named_pipe_path_.c_str());
+ LOG4CXX_AUTO_TRACE(logger_);
DCHECK(file_system::CreateDirectoryRecursively(
profile::Profile::instance()->app_storage_folder()));
@@ -203,22 +206,23 @@ void PipeStreamerAdapter::Streamer::open() {
if ((mkfifo(server_->named_pipe_path_.c_str(),
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) < 0)
&& (errno != EEXIST)) {
- LOG4CXX_ERROR(logger, "Cannot create pipe " << server_->named_pipe_path_);
+ LOG4CXX_ERROR(logger_, "Cannot create pipe " << server_->named_pipe_path_);
return;
}
pipe_fd_ = ::open(server_->named_pipe_path_.c_str(), O_RDWR, 0);
if (-1 == pipe_fd_) {
- LOG4CXX_ERROR(logger, "Cannot open pipe for writing "
+ LOG4CXX_ERROR(logger_, "Cannot open pipe for writing "
<< server_->named_pipe_path_);
return;
}
- LOG4CXX_TRACE(logger, "Pipe " << server_->named_pipe_path_
+ LOG4CXX_DEBUG(logger_, "Pipe " << server_->named_pipe_path_
<< " was successfully created");
}
void PipeStreamerAdapter::Streamer::close() {
+ LOG4CXX_AUTO_TRACE(logger_);
::close(pipe_fd_);
unlink(server_->named_pipe_path_.c_str());
}
diff --git a/src/components/media_manager/src/socket_streamer_adapter.cc b/src/components/media_manager/src/socket_streamer_adapter.cc
index c6da8c7a7..45b1f63a1 100644
--- a/src/components/media_manager/src/socket_streamer_adapter.cc
+++ b/src/components/media_manager/src/socket_streamer_adapter.cc
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -51,14 +51,16 @@ CREATE_LOGGERPTR_GLOBAL(logger, "SocketStreamerAdapter")
SocketStreamerAdapter::SocketStreamerAdapter()
: socket_fd_(0),
is_ready_(false),
- thread_(NULL),
- streamer_(NULL),
+ streamer_(new Streamer(this)),
+ thread_(threads::CreateThread("SocketStreamer", streamer_)),
messages_() {
}
SocketStreamerAdapter::~SocketStreamerAdapter() {
- thread_->stop();
- streamer_ = NULL;
+ LOG4CXX_AUTO_TRACE(logger);
+ thread_->join();
+ delete streamer_;
+ threads::DeleteThread(thread_);
}
void SocketStreamerAdapter::StartActivity(int32_t application_key) {
@@ -110,15 +112,9 @@ bool SocketStreamerAdapter::is_app_performing_activity(
}
void SocketStreamerAdapter::Init() {
- if (!thread_) {
- LOG4CXX_INFO(logger, "Create and start sending thread");
- streamer_ = new Streamer(this);
- thread_ = threads::CreateThread("SocketStreamer", streamer_);
- const size_t kStackSize = 16384;
- thread_->startWithOptions(threads::ThreadOptions(kStackSize));
- } else {
- LOG4CXX_WARN(logger, "thread is already exist");
- }
+ LOG4CXX_DEBUG(logger, "Start sending thread");
+ const size_t kStackSize = 16384;
+ thread_->start(threads::ThreadOptions(kStackSize));
}
void SocketStreamerAdapter::SendData(
@@ -201,19 +197,16 @@ void SocketStreamerAdapter::Streamer::threadMain() {
LOG4CXX_TRACE(logger,"exit " << this);
}
-bool SocketStreamerAdapter::Streamer::exitThreadMain() {
+void SocketStreamerAdapter::Streamer::exitThreadMain() {
LOG4CXX_TRACE(logger,"enter " << this);
stop_flag_ = true;
stop();
server_->messages_.Shutdown();
- //exith threadMainshould whait while threadMain will be finished
if (server_->socket_fd_ != -1) {
shutdown(server_->socket_fd_, SHUT_RDWR);
close(server_->socket_fd_);
}
- sync_primitives::AutoLock auto_lock(thread_lock);
LOG4CXX_TRACE(logger,"exit " << this);
- return true;
}
void SocketStreamerAdapter::Streamer::start() {
@@ -253,7 +246,7 @@ void SocketStreamerAdapter::Streamer::start() {
void SocketStreamerAdapter::Streamer::stop() {
LOG4CXX_TRACE(logger,"enter " << this);
if (0 == new_socket_fd_) {
- LOG4CXX_ERROR(logger, "Client Socket does not exits: ");
+ LOG4CXX_ERROR(logger, "Client Socket does not exist: ");
} else if (-1 == shutdown(new_socket_fd_, SHUT_RDWR)) {
LOG4CXX_ERROR(logger, "Unable to shutdown socket " << strerror(errno));
} else if (-1 == ::close(new_socket_fd_)) {
diff --git a/src/components/media_manager/src/streamer_listener.cc b/src/components/media_manager/src/streamer_listener.cc
index 17306f486..3181ba8e0 100644
--- a/src/components/media_manager/src/streamer_listener.cc
+++ b/src/components/media_manager/src/streamer_listener.cc
@@ -1,33 +1,33 @@
/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (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 "media_manager/streamer_listener.h"
@@ -59,7 +59,7 @@ void StreamerListener::OnErrorReceived(
}
void StreamerListener::OnActivityStarted(int32_t application_key) {
- LOG4CXX_INFO(logger_, "StreamerListener::OnActivityStarted");
+ LOG4CXX_AUTO_TRACE(logger_);
if (current_application_ == application_key) {
LOG4CXX_WARN(logger_, "Already performing activity for "
<< application_key);
@@ -69,7 +69,7 @@ void StreamerListener::OnActivityStarted(int32_t application_key) {
}
void StreamerListener::OnActivityEnded(int32_t application_key) {
- LOG4CXX_INFO(logger_, "StreamerListener::OnActivityEnded");
+ LOG4CXX_AUTO_TRACE(logger_);
if (current_application_ != application_key) {
LOG4CXX_WARN(logger_, "Already not performing activity for "
<< application_key);
diff --git a/src/components/media_manager/src/video/pipe_video_streamer_adapter.cc b/src/components/media_manager/src/video/pipe_video_streamer_adapter.cc
index fc0668b8d..4812e19c9 100644
--- a/src/components/media_manager/src/video/pipe_video_streamer_adapter.cc
+++ b/src/components/media_manager/src/video/pipe_video_streamer_adapter.cc
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,7 @@ namespace media_manager {
CREATE_LOGGERPTR_GLOBAL(logger, "PipeVideoStreamerAdapter")
PipeVideoStreamerAdapter::PipeVideoStreamerAdapter() {
- LOG4CXX_INFO(logger, "PipeVideoStreamerAdapter::PipeVideoStreamerAdapter");
+ LOG4CXX_AUTO_TRACE(logger);
named_pipe_path_ = profile::Profile::instance()->named_video_pipe_path();
Init();
diff --git a/src/components/media_manager/src/video/socket_video_streamer_adapter.cc b/src/components/media_manager/src/video/socket_video_streamer_adapter.cc
index 9fe16d6e9..3a83aabd1 100644
--- a/src/components/media_manager/src/video/socket_video_streamer_adapter.cc
+++ b/src/components/media_manager/src/video/socket_video_streamer_adapter.cc
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@ namespace media_manager {
CREATE_LOGGERPTR_GLOBAL(logger, "SocketVideoStreamerAdapter")
SocketVideoStreamerAdapter::SocketVideoStreamerAdapter() {
- LOG4CXX_INFO(logger, "SocketVideoStreamerAdapter::SocketVideoStreamerAdapter");
+ LOG4CXX_AUTO_TRACE(logger);
port_ = profile::Profile::instance()->video_streaming_port();
ip_ = profile::Profile::instance()->server_address();
diff --git a/src/components/media_manager/src/video/video_stream_to_file_adapter.cc b/src/components/media_manager/src/video/video_stream_to_file_adapter.cc
index 983f1278c..33b0c43ee 100644
--- a/src/components/media_manager/src/video/video_stream_to_file_adapter.cc
+++ b/src/components/media_manager/src/video/video_stream_to_file_adapter.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,25 +42,28 @@ CREATE_LOGGERPTR_GLOBAL(logger, "VideoStreamToFileAdapter")
VideoStreamToFileAdapter::VideoStreamToFileAdapter(const std::string& file_name)
: file_name_(file_name),
is_ready_(false),
- thread_(NULL) {
+ thread_(threads::CreateThread("VideoStreamer",
+ new Streamer(this))) {
Init();
}
VideoStreamToFileAdapter::~VideoStreamToFileAdapter() {
+ LOG4CXX_AUTO_TRACE(logger);
if ((0 != current_application_ ) && (is_ready_)) {
StopActivity(current_application_);
}
-
- thread_->stop();
+ thread_->join();
+ delete thread_->delegate();
+ threads::DeleteThread(thread_);
}
void VideoStreamToFileAdapter::Init() {
- if (!thread_) {
- LOG4CXX_INFO(logger, "Create and start sending thread");
- thread_ = threads::CreateThread("VideoStreamer",
- new Streamer(this));
+ if (thread_->is_running()) {
+ LOG4CXX_DEBUG(logger, "Start sending thread");
const size_t kStackSize = 16384;
- thread_->startWithOptions(threads::ThreadOptions(kStackSize));
+ thread_->start(threads::ThreadOptions(kStackSize));
+ } else {
+ LOG4CXX_WARN(logger, "thread is already running");
}
}
@@ -169,11 +172,10 @@ void VideoStreamToFileAdapter::Streamer::threadMain() {
close();
}
-bool VideoStreamToFileAdapter::Streamer::exitThreadMain() {
+void VideoStreamToFileAdapter::Streamer::exitThreadMain() {
LOG4CXX_INFO(logger, "Streamer::exitThreadMain");
stop_flag_ = true;
server_->messages_.Shutdown();
- return false;
}
void VideoStreamToFileAdapter::Streamer::open() {
diff --git a/src/components/media_manager/test/CMakeLists.txt b/src/components/media_manager/test/CMakeLists.txt
index bb5e076ce..1146aacff 100644
--- a/src/components/media_manager/test/CMakeLists.txt
+++ b/src/components/media_manager/test/CMakeLists.txt
@@ -1,14 +1,74 @@
-include_directories (
-${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/include
-${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/gtest/include)
+# 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.
-set(testSources
- main.cc
- media_adapter_impl_test.cc)
+if(BUILD_TESTS)
-set(testLibraries
- gmock
- gtest)
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/media_manager/include
+)
-add_executable(media_manager_test ${testSources})
-target_link_libraries(media_manager_test ${testLibraries})
+if(EXTENDED_MEDIA_MODE)
+ include_directories (
+ ${GSTREAMER_gst_INCLUDE_DIR}
+ ${GLIB_glib_2_INCLUDE_DIR}
+ )
+endif()
+
+set(SOURCES
+ media_manager_impl_test.cc
+)
+
+set(LIBRARIES
+ MediaManager
+ ApplicationManager
+ ProtocolHandler
+ gmock
+ connectionHandler
+ encryption
+ Resumption
+ Policy
+ ${SecurityManagerLibrary}
+)
+
+if(EXTENDED_MEDIA_MODE)
+ list(APPEND LIBRARIES
+ ${GSTREAMER_gstreamer_LIBRARY})
+endif()
+
+create_test("media_manager_test" "${SOURCES}" "${LIBRARIES}")
+
+if(ENABLE_LOG)
+ target_link_libraries("media_manager_test" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
+endif() # BUILD_TESTS
+
+# vim: set ts=2 sw=2 et:
diff --git a/src/components/media_manager/test/main.cc b/src/components/media_manager/test/main.cc
deleted file mode 100644
index 59fa20e8b..000000000
--- a/src/components/media_manager/test/main.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "gmock/gmock.h"
-
-int main(int argc, char** argv) {
- testing::InitGoogleMock(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
diff --git a/src/components/media_manager/test/media_manager_impl_test.cc b/src/components/media_manager/test/media_manager_impl_test.cc
new file mode 100644
index 000000000..615d74f9a
--- /dev/null
+++ b/src/components/media_manager/test/media_manager_impl_test.cc
@@ -0,0 +1,92 @@
+/*
+ * 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 "gmock/gmock.h"
+#include "media_manager/media_manager_impl.h"
+
+namespace test {
+namespace components {
+namespace media_manager_test {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManagerImplTest")
+
+class MediaManagerTest : public ::testing::Test {
+ protected:
+ virtual void SetUp();
+ virtual void TearDown();
+};
+
+void MediaManagerTest::SetUp() {
+}
+
+void MediaManagerTest::TearDown() {
+}
+
+TEST_F(MediaManagerTest, AddAndPlayStream) {
+ media_manager::MediaManager* mediaManager =
+ media_manager::MediaManagerImpl::instance();
+
+ const useconds_t sleeptime = 100;
+
+ mediaManager->PlayA2DPSource(1);
+ LOG4CXX_INFO(logger_, ".Playing stream");
+
+ usleep(sleeptime);
+
+ mediaManager->StopA2DPSource(1);
+
+ usleep(sleeptime);
+
+ mediaManager->PlayA2DPSource(1);
+
+ usleep(sleeptime);
+
+ mediaManager->StopA2DPSource(1);
+
+ usleep(sleeptime);
+
+ mediaManager->PlayA2DPSource(1);
+
+ usleep(sleeptime);
+
+ mediaManager->StopA2DPSource(1);
+
+ usleep(sleeptime);
+
+ mediaManager->StopA2DPSource(1);
+}
+
+} // namespace media_manager_test
+} // namespace components
+} // namespace test
+
+
diff --git a/src/components/policy/doc/readme.txt b/src/components/policy/doc/readme.txt
index 86de7da08..f80aed0ff 100644
--- a/src/components/policy/doc/readme.txt
+++ b/src/components/policy/doc/readme.txt
@@ -19,10 +19,9 @@
For example Google Chromium. Install it using:
sudo apt-get install chromium-browser
In current implementation Chromium is required for autostart HMI feature.
- For HMI autostart please create in the executable folder file named hmi_link.
- This file should contain one string with full path to HMI index.html file.
+ For HMI autostart please set path to hmi in config file
For example:
- /home/user/projects/smart_device_link/src/components/HMI/index.html
+ LinkToWebHMI = ${path_to_HMI_repository}/index.html
* Running application
====================
diff --git a/src/components/policy/src/policy/CMakeLists.txt b/src/components/policy/src/policy/CMakeLists.txt
index 37a8d4360..2b794e9db 100644
--- a/src/components/policy/src/policy/CMakeLists.txt
+++ b/src/components/policy/src/policy/CMakeLists.txt
@@ -46,6 +46,7 @@ include_directories (
${JSONCPP_INCLUDE_DIRECTORY}
#${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/src/components/utils/include/
+ ${CMAKE_SOURCE_DIR}/src/components
${CMAKE_SOURCE_DIR}/src/components/config_profile/include
${LOG4CXX_INCLUDE_DIRECTORY}
)
diff --git a/src/components/policy/src/policy/include/policy/cache_manager.h b/src/components/policy/src/policy/include/policy/cache_manager.h
index 4783a3979..ff30d9536 100644
--- a/src/components/policy/src/policy/include/policy/cache_manager.h
+++ b/src/components/policy/src/policy/include/policy/cache_manager.h
@@ -1,34 +1,34 @@
-/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_POLICY_INCLUDE_CACHE_MANAGER_H_
#define SRC_COMPONENTS_POLICY_INCLUDE_CACHE_MANAGER_H_
@@ -38,15 +38,19 @@
#include "utils/shared_ptr.h"
#include "policy/pt_representation.h"
#include "policy/pt_ext_representation.h"
-#include "utils/lock.h"
#include "usage_statistics/statistics_manager.h"
#include "policy/cache_manager_interface.h"
+#include "utils/lock.h"
+#include "utils/timer_thread.h"
+#include "utils/conditional_variable.h"
+
namespace policy {
class CacheManager : public CacheManagerInterface {
public:
CacheManager();
+ ~CacheManager();
/**
* @brief Check if specified RPC for specified application
@@ -145,11 +149,19 @@ class CacheManager : public CacheManagerInterface {
const std::vector<std::string>& msg_codes, const std::string& language);
/**
- * @brief Get list of URL to send PTS to
+ * @brief Get list of URLs related to particular service
* @param service_type If URLs for specific service are preset,
* return them otherwise default URLs.
*/
- virtual EndpointUrls GetUpdateUrls(int service_type);
+ virtual void GetServiceUrls(const std::string& service_type,
+ EndpointUrls& end_points);
+
+ /**
+ * @brief GetLockScreenIcon allows to obtain lock screen icon url;
+ *
+ * @return url which point to the resourse where lock screen icon could be obtained.
+ */
+ virtual std::string GetLockScreenIconUrl() const;
/**
* @brief Get allowed number of notifications
@@ -189,6 +201,12 @@ class CacheManager : public CacheManagerInterface {
bool ApplyUpdate(const policy_table::Table& update_pt);
/**
+ * @brief Gets list of appHMIType associated with mobile appID
+ * @param container of appHMIType
+ */
+ virtual void GetHMIAppTypeAfterUpdate(std::map<std::string, StringArray>& app_hmi_types);
+
+ /**
* Gets flag updateRequired
* @return true if update is required
*/
@@ -219,7 +237,7 @@ class CacheManager : public CacheManagerInterface {
* @param app_id application id
* @return true if application is revoked
*/
- bool IsApplicationRevoked(const std::string& app_id);
+ bool IsApplicationRevoked(const std::string& app_id) const;
/**
* @brief Get functional groupings from DB
@@ -245,10 +263,9 @@ class CacheManager : public CacheManagerInterface {
/**
* @brief SetIsDefault Sets is_default flag for application
* @param app_id app specific application
- * @param is_default true if default false otherwise.
* @return true in case opperation was done successfully.
*/
- bool SetIsDefault(const std::string& app_id, bool is_default);
+ bool SetIsDefault(const std::string& app_id);
/**
* Checks if the application has pre_data policy
@@ -425,12 +442,10 @@ class CacheManager : public CacheManagerInterface {
* groups for specific application.
* @param policy_app_id application id.
* @param device_id device id.
- * @param result the count of unconsented groups
- * @return true in case opperation has been done successfully.
+ * @return the count of unconsented groups
*/
- bool CountUnconsentedGroups(const std::string& policy_app_id,
- const std::string& device_id,
- int& result);
+ int CountUnconsentedGroups(const std::string& policy_app_id,
+ const std::string& device_id);
/**
* @brief Gets functional group names and user_consent_prompts, if any
@@ -489,32 +504,18 @@ class CacheManager : public CacheManagerInterface {
bool SetPredataPolicy(const std::string& app_id);
/**
- * @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
- */
- bool SetIsPredata(const std::string& app_id, bool is_pre_data);
-
- /**
* @brief Removes unpaired devices
* @return true if success
*/
- bool CleanupUnpairedDevices(const DeviceIds& device_ids);
+ bool CleanupUnpairedDevices();
/**
* Sets flag of unpaired device
- * @param device_id
+ * @param device_id Unique device id
+ * @param unpaired True, if should be marked as unpaired, otherwise - false
* @return true if success
*/
- bool SetUnpairedDevice(const std::string& device_id);
-
- /**
- * Gets list of unpaired devices
- * @param device_ids output list
- * @return true if success
- */
- bool UnpairedDevicesList(DeviceIds& device_ids);
+ bool SetUnpairedDevice(const std::string& device_id, bool unpaired = true);
/**
* Resets Policy Table
@@ -541,6 +542,7 @@ class CacheManager : public CacheManagerInterface {
*/
void Backup();
+
/**
* Returns heart beat timeout
* @param app_id application id
@@ -557,6 +559,13 @@ class CacheManager : public CacheManagerInterface {
*/
static int32_t GenerateHash(const std::string& str_to_hash);
+ /**
+ * @brief Gets request types for application
+ * @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;
private:
std::string currentDateTime();
struct AppHMITypeToString {
@@ -568,9 +577,7 @@ private:
void GetGroupNameByHashID(const int32_t group_id, std::string& group_name);
void FillDeviceSpecificData();
- void FillAppSpecificData();
bool AppExists(const std::string& app_id) const;
- void CopyInternalParams(const std::string &from, const std::string& to);
long ConvertSecondsToMinute(int seconds);
/**
@@ -579,17 +586,67 @@ private:
*/
void CheckSnapshotInitialization();
+ void PersistData();
+
+ void ResetCalculatedPermissions();
+
+ void AddCalculatedPermissions(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ const policy::Permissions& permissions);
+
+ bool IsPermissionsCalculated(const std::string& device_id,
+ const std::string& policy_app_id,
+ policy::Permissions& permission);
+
+private:
+ /**
+ * @brief Checks, if input string is known service represented by number, than
+ * converts input string to service number
+ * @param input Input string
+ * @param output Output service
+ * @return true, if successfully converted, otherwise - false
+ */
+ bool IsNumberService(const std::string& input, std::string& output) const;
+
private:
utils::SharedPtr<policy_table::Table> pt_;
utils::SharedPtr<policy_table::Table> snapshot_;
utils::SharedPtr<PTRepresentation> backup_;
utils::SharedPtr<PTExtRepresentation> ex_backup_;
bool update_required;
- std::map<std::string, bool> is_predata_;
- std::map<std::string, bool> is_unpaired_;
+ typedef std::set<std::string> UnpairedDevices;
+ UnpairedDevices is_unpaired_;
sync_primitives::Lock cache_lock_;
+ sync_primitives::Lock unpaired_lock_;
+
+ typedef std::map<std::string, Permissions> AppCalculatedPermissions;
+ typedef std::map<std::string, AppCalculatedPermissions> CalculatedPermissions;
+ CalculatedPermissions calculated_permissions_;
+ sync_primitives::Lock calculated_permissions_lock_;
+
+ class BackgroundBackuper: public threads::ThreadDelegate {
+ friend class CacheManager;
+ public:
+ BackgroundBackuper(CacheManager* cache_manager);
+ ~BackgroundBackuper();
+ virtual void threadMain();
+ virtual void exitThreadMain();
+ void DoBackup();
+ private:
+ void InternalBackup();
+ CacheManager* cache_manager_;
+ sync_primitives::ConditionalVariable backup_notifier_;
+ volatile bool stop_flag_;
+ volatile bool new_data_available_;
+
+ sync_primitives::Lock need_backup_lock_;
+ DISALLOW_COPY_AND_ASSIGN(BackgroundBackuper);
+ };
+ threads::Thread* backup_thread_;
+ sync_primitives::Lock backuper_locker_;
+ BackgroundBackuper* backuper_;
};
-} // policy
-
+} // namespace policy
#endif // SRC_COMPONENTS_POLICY_INCLUDE_CACHE_MANAGER_H_
diff --git a/src/components/policy/src/policy/include/policy/cache_manager_interface.h b/src/components/policy/src/policy/include/policy/cache_manager_interface.h
index a88ae1a90..56d0933e4 100644
--- a/src/components/policy/src/policy/include/policy/cache_manager_interface.h
+++ b/src/components/policy/src/policy/include/policy/cache_manager_interface.h
@@ -145,11 +145,19 @@ class CacheManagerInterface {
const std::string& language) = 0;
/**
- * @brief Get list of URL to send PTS to
+ * @brief Get list of URLs related to particular service
* @param service_type If URLs for specific service are preset,
* return them otherwise default URLs.
*/
- virtual EndpointUrls GetUpdateUrls(int service_type) = 0;
+ virtual void GetServiceUrls(const std::string& service_type,
+ EndpointUrls& end_points) = 0;
+
+ /**
+ * @brief GetLockScreenIcon allows to obtain lock screen icon url;
+ *
+ * @return url which point to the resourse where lock screen icon could be obtained.
+ */
+ virtual std::string GetLockScreenIconUrl() const = 0;
/**
* @brief Get allowed number of notifications
@@ -189,6 +197,12 @@ class CacheManagerInterface {
virtual bool ApplyUpdate(const policy_table::Table& update_pt) = 0;
/**
+ * @brief Gets list of appHMIType associated with mobile appID
+ * @param container of appHMIType
+ */
+ virtual void GetHMIAppTypeAfterUpdate(std::map<std::string, StringArray>& app_hmi_types) = 0;
+
+ /**
* Gets flag updateRequired
* @return true if update is required
*/
@@ -219,7 +233,7 @@ class CacheManagerInterface {
* @param app_id application id
* @return true if application is revoked
*/
- virtual bool IsApplicationRevoked(const std::string& app_id) = 0;
+ virtual bool IsApplicationRevoked(const std::string& app_id) const = 0;
/**
* @brief Get functional groupings from DB
@@ -246,10 +260,9 @@ class CacheManagerInterface {
/**
* @brief SetIsDefault Sets is_default flag for application
* @param app_id app specific application
- * @param is_default true if default false otherwise.
* @return true in case opperation was done successfully.
*/
- virtual bool SetIsDefault(const std::string& app_id, bool is_default) = 0;
+ virtual bool SetIsDefault(const std::string& app_id) = 0;
/**
* Checks if the application has pre_data policy
@@ -423,12 +436,10 @@ class CacheManagerInterface {
* groups for specific application.
* @param policy_app_id application id.
* @param device_id device id.
- * @param result the count of unconsented groups
- * @return true in case opperation has been done successfully.
+ * @param the count of unconsented groups
*/
- virtual bool CountUnconsentedGroups(const std::string& policy_app_id,
- const std::string& device_id,
- int& result) = 0;
+ virtual int CountUnconsentedGroups(const std::string& policy_app_id,
+ const std::string& device_id) = 0;
/**
* @brief Gets functional group names and user_consent_prompts, if any
@@ -487,32 +498,18 @@ class CacheManagerInterface {
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) = 0;
+ virtual bool CleanupUnpairedDevices() = 0;
/**
* Sets flag of unpaired device
- * @param device_id
- * @return true if success
- */
- virtual bool SetUnpairedDevice(const std::string& device_id) = 0;
-
- /**
- * Gets list of unpaired devices
- * @param device_ids output list
+ * @param device_id Unique device id
+ * @param unpaired True, if should be marked as unpaired, otherwise - false
* @return true if success
*/
- virtual bool UnpairedDevicesList(DeviceIds& device_ids) = 0;
+ virtual bool SetUnpairedDevice(const std::string& device_id, bool unpaired = true) = 0;
/**
* Resets Policy Table
@@ -546,6 +543,45 @@ class CacheManagerInterface {
* otherwise heart beat for specific application isn't set
*/
virtual uint16_t HeartBeatTimeout(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Resets all calculated permissions in cache
+ */
+ virtual void ResetCalculatedPermissions() = 0;
+
+ /**
+ * @brief Adds calculated permissions for specific app on particular device
+ * into cache
+ * @param device_id Device id
+ * @param policy_app_id Application id
+ * @param permissions Calculated permissions
+ */
+ virtual void AddCalculatedPermissions(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ const policy::Permissions& permissions) = 0;
+
+ /**
+ * @brief Checks if permissions calculated for specific app on particular
+ * device
+ * @param device_id Device id
+ * @param policy_app_id Application id
+ * @param permission Permissions to be filled, in case of presence in cache
+ * @return true if present, otherwise false
+ */
+ virtual bool IsPermissionsCalculated(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ policy::Permissions& permission) = 0;
+
+ /**
+ * @brief Gets request types for application
+ * @param policy_app_id Unique application id
+ * @param request_types Request types of application
+ */
+ virtual void GetAppRequestTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_types) const = 0;
};
typedef utils::SharedPtr<CacheManagerInterface> CacheManagerInterfaceSPtr;
diff --git a/src/components/policy/src/policy/include/policy/policy_helper.h b/src/components/policy/src/policy/include/policy/policy_helper.h
index 5d5c8e7ed..c3fcce6b2 100644
--- a/src/components/policy/src/policy/include/policy/policy_helper.h
+++ b/src/components/policy/src/policy/include/policy/policy_helper.h
@@ -83,23 +83,48 @@ struct CheckAppPolicy {
CheckAppPolicy(PolicyManagerImpl* pm,
const utils::SharedPtr<policy_table::Table> update,
const utils::SharedPtr<policy_table::Table> snapshot);
- bool HasSameGroups(const AppPoliciesValueType& app_policy,
- AppPermissions* perms) const;
- bool IsNewAppication(const std::string& application_id) const;
- void SendNotification(const AppPoliciesValueType& app_policy) const;
- void SendOnPendingPermissions(const AppPoliciesValueType& app_policy,
- AppPermissions permissions) const;
- bool IsAppRevoked(const AppPoliciesValueType& app_policy) const;
- bool NicknamesMatch(const std::string app_id,
- const AppPoliciesValueType& app_policy) const;
bool operator()(const AppPoliciesValueType& app_policy);
private:
+ enum PermissionsCheckResult {
+ RESULT_NO_CHANGES,
+ RESULT_APP_REVOKED,
+ RESULT_NICKNAME_MISMATCH,
+ RESULT_PERMISSIONS_REVOKED,
+ RESULT_CONSENT_NEEDED,
+ RESULT_CONSENT_NOT_REQIURED,
+ RESULT_PERMISSIONS_REVOKED_AND_CONSENT_NEEDED,
+ RESULT_REQUEST_TYPE_CHANGED
+ };
+
+ void SetPendingPermissions(const AppPoliciesValueType& app_policy,
+ PermissionsCheckResult result) const;
+ PermissionsCheckResult CheckPermissionsChanges(
+ const AppPoliciesValueType &app_policy) const;
+ bool HasRevokedGroups(const AppPoliciesValueType& app_policy,
+ policy_table::Strings* revoked_groups = NULL) const;
+ bool HasNewGroups(const AppPoliciesValueType& app_policy,
+ policy_table::Strings* new_groups = NULL) const;
+ bool HasConsentNeededGroups(const AppPoliciesValueType& app_policy) const;
+ std::vector<FunctionalGroupPermission> GetRevokedGroups(
+ const AppPoliciesValueType& app_policy) const;
+ void RemoveRevokedConsents(
+ const AppPoliciesValueType& app_policy,
+ const std::vector<FunctionalGroupPermission>& revoked_groups) const;
+ bool IsKnownAppication(const std::string& application_id) const;
+ void NotifySystem(const AppPoliciesValueType& app_policy) const;
+ void SendPermissionsToApp(const AppPoliciesValueType& app_policy) const;
+ bool IsAppRevoked(const AppPoliciesValueType& app_policy) const;
+ bool NicknamesMatch(const AppPoliciesValueType& app_policy) const;
/**
* @brief Allows to check if appropriate group requires any consent.
* @param group_name the group for which consent will be checked.
* @return true if consent is required, false otherwise.
*/
- bool IsConsentRequired(const std::string& group_name) const;
+ bool IsConsentRequired(const std::string& app_id,
+ const std::string& group_name) const;
+ bool IsRequestTypeChanged(const AppPoliciesValueType& app_policy) const;
+
+ private:
PolicyManagerImpl* pm_;
const utils::SharedPtr<policy_table::Table> update_;
const utils::SharedPtr<policy_table::Table> snapshot_;
diff --git a/src/components/policy/src/policy/include/policy/policy_listener.h b/src/components/policy/src/policy/include/policy/policy_listener.h
index adfcddd93..357fb20ae 100644
--- a/src/components/policy/src/policy/include/policy/policy_listener.h
+++ b/src/components/policy/src/policy/include/policy/policy_listener.h
@@ -33,6 +33,8 @@
#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_LISTENER_H_
#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_LISTENER_H_
+#include <queue>
+
#include "policy/policy_types.h"
namespace policy {
@@ -40,18 +42,41 @@ class PolicyListener {
public:
virtual ~PolicyListener() {
}
- virtual void OnPTExchangeNeeded() = 0;
virtual void OnPermissionsUpdated(const std::string& policy_app_id,
const Permissions& permissions,
const policy::HMILevel& default_hmi) = 0;
+ virtual void OnPermissionsUpdated(const std::string& policy_app_id,
+ const Permissions& permissions) = 0;
virtual void OnPendingPermissionChange(const std::string& policy_app_id) = 0;
- virtual void OnAppRevoked(const std::string& policy_app_id) = 0;
- virtual void OnUpdateStatusChanged(policy::PolicyTableStatus status) = 0;
+ virtual void OnUpdateStatusChanged(const std::string&) = 0;
virtual std::string OnCurrentDeviceIdUpdateRequired(
const std::string& policy_app_id) = 0;
virtual void OnSystemInfoUpdateRequired() = 0;
virtual std::string GetAppName(const std::string& policy_app_id) = 0;
- virtual void OnUserRequestedUpdateCheckRequired() = 0;
+ virtual void OnUpdateHMIAppType(std::map<std::string, StringArray> app_hmi_types) = 0;
+
+ /**
+ * @brief CanUpdate allows to find active application
+ * and check whether related device consented.
+ *
+ * @return true if there are at least one application has been registered
+ * with consented device.
+ */
+ virtual bool CanUpdate() = 0;
+
+ /**
+ * @brief OnSnapshotCreated the notification which will be sent
+ * when snapshot for PTU has been created.
+ *
+ * @param pt_string the snapshot
+ *
+ * @param retry_seconds retry sequence timeouts.
+ *
+ * @param timeout_exceed timeout.
+ */
+ virtual void OnSnapshotCreated(const BinaryMessage& pt_string,
+ const std::vector<int>& retry_seconds,
+ int timeout_exceed) = 0;
/**
* @brief Make appropriate changes for related applications permissions and
@@ -61,6 +86,19 @@ class PolicyListener {
*/
virtual void OnDeviceConsentChanged(const std::string& device_id,
bool is_allowed) = 0;
+
+ /**
+ * @brief GetAvailableApps allows to obtain list of registered applications.
+ */
+ virtual void GetAvailableApps(std::queue<std::string>&) = 0;
+
+ /**
+ * @brief OnCertificateUpdated the callback which signals if certificate field
+ * has been updated during PTU
+ *
+ * @param certificate_data the value of the updated field.
+ */
+ virtual void OnCertificateUpdated(const std::string& certificate_data) = 0;
};
} // namespace policy
#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_LISTENER_H_
diff --git a/src/components/policy/src/policy/include/policy/policy_manager.h b/src/components/policy/src/policy/include/policy/policy_manager.h
index 0bc553b33..4a31df443 100644
--- a/src/components/policy/src/policy/include/policy/policy_manager.h
+++ b/src/components/policy/src/policy/include/policy/policy_manager.h
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (c) 2013, Ford Motor Company
All rights reserved.
@@ -40,7 +40,6 @@
#include "usage_statistics/statistics_manager.h"
namespace policy {
-
class PolicyManager : public usage_statistics::StatisticsManager {
public:
virtual ~PolicyManager() {
@@ -73,24 +72,24 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual bool ResetPT(const std::string& file_name) = 0;
/**
- * @brief Gets URL for sending PTS to from PT itself.
- * @param service_type Service specifies user of URL
- * @return string URL
+ * @brief GetLockScreenIcon allows to obtain lock screen icon url;
+ *
+ * @return url which point to the resourse where lock screen icon could be obtained.
*/
- virtual std::string GetUpdateUrl(int service_type) = 0;
+ virtual std::string GetLockScreenIconUrl() const = 0;
/**
* @brief Gets all URLs for sending PTS to from PT itself.
* @param service_type Service specifies user of URL
* @return vector of urls
*/
- virtual EndpointUrls GetUpdateUrls(int service_type) = 0;
+ virtual void GetServiceUrls(const std::string& service_type,
+ EndpointUrls& end_points) = 0;
/**
* @brief PTU is needed, for this PTS has to be formed and sent.
- * @return BinaryMessage* PTS.
*/
- virtual BinaryMessageSptr RequestPTUpdate() = 0;
+ virtual void RequestPTUpdate() = 0;
/**
* @brief Check if specified RPC for specified application
@@ -118,27 +117,14 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* @brief Returns current status of policy table for HMI
* @return Current status of policy table
*/
- virtual PolicyTableStatus GetPolicyTableStatus() = 0;
-
- /**
- * Checks is PT exceeded IgnitionCycles
- * @return true if exceeded
- */
- virtual bool ExceededIgnitionCycles() = 0;
-
- /**
- * Checks is PT exceeded days
- * @param days current day after epoch
- * @return true if exceeded
- */
- virtual bool ExceededDays(int days) = 0;
+ virtual std::string GetPolicyTableStatus() const = 0;
/**
* Checks is PT exceeded kilometers
* @param kilometers current kilometers at odometer
* @return true if exceeded
*/
- virtual bool ExceededKilometers(int kilometers) = 0;
+ virtual void KmsChanged(int kilometers) = 0;
/**
* Increments counter of ignition cycles
@@ -146,6 +132,11 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual void IncrementIgnitionCycles() = 0;
/**
+ * @brief ExchangeByUserRequest
+ */
+ virtual std::string ForcePTExchange() = 0;
+
+ /**
* Resets retry sequence
*/
virtual void ResetRetrySequence() = 0;
@@ -295,12 +286,11 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Gets specific application permissions changes since last policy
* table update
- * @param device_id Id of device, which hosts application
* @param policy_app_id Unique application id
* @return Permissions changes
*/
virtual AppPermissions GetAppPermissionsChanges(
- const std::string& device_id, const std::string& policy_app_id) = 0;
+ const std::string& policy_app_id) = 0;
virtual void RemovePendingPermissionChanges(const std::string& app_id) = 0;
@@ -347,14 +337,6 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual void AddApplication(const std::string& application_id) = 0;
/**
- * @brief IsAppInUpdateList allows to check if specific application
- * presents in update list.
- * @param app_id id of the application that should be verified.
- * @return true in case of application is in update list, false otherwise.
- */
- virtual bool IsAppInUpdateList(const std::string& app_id) const = 0;
-
- /**
* @brief Removes unpaired device records and related records from DB
* @param device_ids List of device_id, which should be removed
* @return true, if succedeed, otherwise - false
@@ -386,12 +368,6 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual uint32_t GetNotificationsNumber(const std::string& priority) = 0;
/**
- * @brief Provide info about device consent for application
- * @return Amount of groups for which app is allowed
- */
- virtual int IsConsentNeeded(const std::string& app_id) = 0;
-
- /**
* @brief Allows to update Vehicle Identification Number in policy table.
* @param new value for the parameter.
*/
@@ -411,6 +387,48 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* otherwise heart beat for specific application isn't set
*/
virtual uint16_t HeartBeatTimeout(const std::string& app_id) const = 0;
+
+ /**
+ * @brief SaveUpdateStatusRequired alows to save update status.
+ */
+ virtual void SaveUpdateStatusRequired(bool is_update_needed) = 0;
+
+ /**
+ * @brief Handler on applications search started
+ */
+ virtual void OnAppsSearchStarted() = 0;
+
+ /**
+ * @brief Handler on applications search completed
+ */
+ virtual void OnAppsSearchCompleted() = 0;
+ /**
+ * @brief Gets request types for application
+ * @param policy_app_id Unique application id
+ * @return request_types Request types of application
+ */
+ virtual const std::vector<std::string> GetAppRequestTypes(
+ const std::string policy_app_id) const = 0;
+
+ protected:
+ /**
+ * Checks is PT exceeded IgnitionCycles
+ * @return true if exceeded
+ */
+ virtual bool ExceededIgnitionCycles() = 0;
+
+ /**
+ * Checks is PT exceeded days
+ * @return true if exceeded
+ */
+ virtual bool ExceededDays() = 0;
+
+ /**
+ * @brief StartPTExchange allows to start PTU. The function will check
+ * if one is required and starts the update flow in only case when previous
+ * condition is true.
+ */
+ virtual void StartPTExchange() = 0;
};
} // namespace policy
diff --git a/src/components/policy/src/policy/include/policy/policy_manager_impl.h b/src/components/policy/src/policy/include/policy/policy_manager_impl.h
index 9afb58386..50f9cf148 100644
--- a/src/components/policy/src/policy/include/policy/policy_manager_impl.h
+++ b/src/components/policy/src/policy/include/policy/policy_manager_impl.h
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (c) 2013, Ford Motor Company
All rights reserved.
@@ -39,7 +39,7 @@
#include "policy/policy_manager.h"
#include "policy/policy_table.h"
#include "policy/cache_manager_interface.h"
-#include "policy/update_status_manager_interface.h"
+#include "policy/update_status_manager.h"
#include "./functions.h"
#include "usage_statistics/statistics_manager.h"
@@ -51,7 +51,6 @@ struct CheckAppPolicy;
class PolicyManagerImpl : public PolicyManager {
public:
PolicyManagerImpl();
- virtual ~PolicyManagerImpl();
virtual void set_listener(PolicyListener* listener);
PolicyListener* listener() const {
return listener_;
@@ -59,20 +58,22 @@ class PolicyManagerImpl : public PolicyManager {
virtual bool InitPT(const std::string& file_name);
virtual bool LoadPT(const std::string& file, const BinaryMessage& pt_content);
virtual bool ResetPT(const std::string& file_name);
- virtual std::string GetUpdateUrl(int service_type);
- virtual EndpointUrls GetUpdateUrls(int service_type);
- virtual BinaryMessageSptr RequestPTUpdate();
+
+ virtual void GetServiceUrls(const std::string& service_type,
+ EndpointUrls& end_points);
+
+ virtual std::string GetLockScreenIconUrl() const;
+ virtual void RequestPTUpdate();
virtual void CheckPermissions(const PTString& app_id,
const PTString& hmi_level,
const PTString& rpc,
const RPCParams& rpc_params,
CheckPermissionResult& result);
virtual bool ResetUserConsent();
- virtual bool ExceededIgnitionCycles();
- virtual bool ExceededDays(int days);
- virtual bool ExceededKilometers(int kilometers);
+ virtual void KmsChanged(int kilometers);
virtual void IncrementIgnitionCycles();
- virtual PolicyTableStatus GetPolicyTableStatus();
+ virtual std::string ForcePTExchange();
+ virtual std::string GetPolicyTableStatus() const;
virtual void ResetRetrySequence();
virtual int NextRetryTimeout();
virtual int TimeoutExchange();
@@ -128,8 +129,6 @@ class PolicyManagerImpl : public PolicyManager {
virtual uint32_t GetNotificationsNumber(const std::string& priority);
- virtual int IsConsentNeeded(const std::string& app_id);
-
virtual void SetVINValue(const std::string& value);
// Interface StatisticsManager (begin)
@@ -143,8 +142,7 @@ class PolicyManagerImpl : public PolicyManager {
int32_t timespan_seconds);
// Interface StatisticsManager (end)
- AppPermissions GetAppPermissionsChanges(const std::string& device_id,
- const std::string& policy_app_id);
+ AppPermissions GetAppPermissionsChanges(const std::string& policy_app_id);
void RemovePendingPermissionChanges(const std::string& app_id);
void SendNotificationOnPermissionsUpdated(const std::string& application_id);
@@ -157,28 +155,33 @@ class PolicyManagerImpl : public PolicyManager {
void AddApplication(const std::string& application_id);
- /**
- * @brief IsAppinUpdateList
- * @param app_id
- * @return
- */
- virtual bool IsAppInUpdateList(const std::string& app_id) const;
-
virtual void RemoveAppConsentForGroup(const std::string& app_id,
const std::string& group_name);
virtual uint16_t HeartBeatTimeout(const std::string& app_id) const;
+ virtual void SaveUpdateStatusRequired(bool is_update_needed);
+
virtual bool IsPredataPolicy(const std::string& policy_app_id);
void set_cache_manager(CacheManagerInterface* cache_manager);
- void set_update_status_manager(
- UpdateStatusManagerInterface* update_manager);
+ virtual void OnAppsSearchStarted();
+
+ virtual void OnAppsSearchCompleted();
+
+ virtual const std::vector<std::string> GetAppRequestTypes(
+ const std::string policy_app_id) const;
protected:
+ #ifdef USE_HMI_PTU_DECRYPTION
virtual utils::SharedPtr<policy_table::Table> Parse(
const BinaryMessage& pt_content);
+ #else
+ virtual utils::SharedPtr<policy_table::Table> ParseArray(
+ const BinaryMessage& pt_content);
+ #endif
private:
+ void CheckTriggers();
/*
* @brief Checks policy table update along with current data for any changes
* in assigned functional group list of application
@@ -204,17 +207,6 @@ class PolicyManagerImpl : public PolicyManager {
Permissions& notification_data);
/**
- * @brief Add application id at the end of update permissions request list
- * @param Application id
- */
- void AddAppToUpdateList(const std::string& application_id);
-
- /**
- * @brief Remove first application in the update permissions request list
- */
- void RemoveAppFromUpdateList();
-
- /**
* @brief Validate PermissionConsent structure according to currently
* assigned groups
* @param permissions PermissionConsent structure that should be validated.
@@ -248,20 +240,44 @@ class PolicyManagerImpl : public PolicyManager {
*/
bool IsNewApplication(const std::string& application_id) const;
+ /**
+ * Checks existing and permissions of AppStorageFolder
+ * @return true if AppStorageFolder exists and has permissions read/write
+ */
+ bool CheckAppStorageFolder() const;
+
+ /**
+ * @brief Checks whether need ask the permission of users
+ * @return true if user consent is needed
+ */
+ virtual bool IsConsentNeeded(const std::string& app_id);
+
+ /**
+ * @brief Changes isConsentNeeded for app pending permissions, in case
+ * user set permissions before app activation.
+ * @param Unique app id
+ * @param Current permissions for app
+ */
+ void CheckPendingPermissionsChanges(
+ const std::string& policy_app_id,
+ const std::vector<FunctionalGroupPermission>& current_permissions);
+
+ virtual void StartPTExchange();
+ virtual bool ExceededDays();
+ virtual bool ExceededIgnitionCycles();
+ bool IsPTValid(utils::SharedPtr<policy_table::Table> policy_table,
+ policy_table::PolicyTableType type) const;
+
+private:
PolicyListener* listener_;
- UpdateStatusManagerInterfaceSPtr update_status_manager_;
+ UpdateStatusManager update_status_manager_;
CacheManagerInterfaceSPtr cache_;
- sync_primitives::Lock update_request_list_lock_;
sync_primitives::Lock apps_registration_lock_;
+ sync_primitives::Lock app_permissions_diff_lock_;
std::map<std::string, AppPermissions> app_permissions_diff_;
/**
- * @brief List of application, which require update of permissions
- */
- std::list<std::string> update_requests_list_;
-
- /**
* Timeout to wait response with UpdatePT
*/
int retry_sequence_timeout_;
@@ -292,10 +308,7 @@ class PolicyManagerImpl : public PolicyManager {
*/
std::string last_device_id_;
- /**
- * @brief Holds device ids, which were unpaired
- */
- DeviceIds unpaired_device_ids_;
+ bool ignition_check;
friend struct CheckAppPolicy;
};
diff --git a/src/components/policy/src/policy/include/policy/policy_types.h b/src/components/policy/src/policy/include/policy/policy_types.h
index ec3f660f2..367d0f2a0 100644
--- a/src/components/policy/src/policy/include/policy/policy_types.h
+++ b/src/components/policy/src/policy/include/policy/policy_types.h
@@ -38,7 +38,7 @@
#include <map>
#include <set>
#include "utils/shared_ptr.h"
-
+#include "utils/helpers.h"
namespace policy {
// TODO(PV): specify errors
@@ -58,16 +58,6 @@ const std::string kDefaultId = "default";
const std::string kDeviceId = "device";
/*
- *@brief Policy Services specifies Users of Updates
- * received from cloud through mobile device
- */
-enum PolicyServiceTypes {
- SERVICE_NONE = 0,
- IVSU = 0x04,
- POLICY = 0x07
-};
-
-/*
* @brief Status of policy table update
*/
enum PolicyTableStatus {
@@ -187,6 +177,16 @@ struct DeviceInfo {
std::string carrier;
uint32_t max_number_rfcom_ports;
std::string connection_type;
+
+ void AdoptDeviceType(const std::string& deviceType) {
+ connection_type = "USB_serial_number";
+ using namespace helpers;
+ if (Compare<std::string, EQ, ONE> (deviceType,
+ "BLUETOOTH",
+ "WIFI")) {
+ connection_type.assign("BTMAC");
+ }
+ }
};
/**
@@ -233,7 +233,8 @@ struct AppPermissions {
isAppPermissionsRevoked(false),
appRevoked(false),
appPermissionsConsentNeeded(false),
- appUnauthorized(false) {
+ appUnauthorized(false),
+ requestTypeChanged(false) {
}
std::string application_id;
@@ -245,6 +246,8 @@ struct AppPermissions {
bool isSDLAllowed;
std::string priority;
DeviceParams deviceInfo;
+ bool requestTypeChanged;
+ std::vector<std::string> requestType;
};
/**
@@ -263,11 +266,6 @@ struct PermissionConsent {
*/
struct UserFriendlyMessage {
std::string message_code;
- std::string tts;
- std::string label;
- std::string line1;
- std::string line2;
- std::string text_body;
};
/**
diff --git a/src/components/policy/src/policy/include/policy/pt_ext_representation.h b/src/components/policy/src/policy/include/policy/pt_ext_representation.h
index 2ed5ef8c4..55ed86e44 100644
--- a/src/components/policy/src/policy/include/policy/pt_ext_representation.h
+++ b/src/components/policy/src/policy/include/policy/pt_ext_representation.h
@@ -306,10 +306,12 @@ class PTExtRepresentation : public virtual PTRepresentation {
/**
* Sets flag of unpaired device
- * @param device_id
+ * @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) const = 0;
+ virtual bool SetUnpairedDevice(const std::string& device_id,
+ bool unpaired) const = 0;
/**
* Gets list of unpaired devices
diff --git a/src/components/policy/src/policy/include/policy/pt_representation.h b/src/components/policy/src/policy/include/policy/pt_representation.h
index f33c3a081..3c0298544 100644
--- a/src/components/policy/src/policy/include/policy/pt_representation.h
+++ b/src/components/policy/src/policy/include/policy/pt_representation.h
@@ -84,6 +84,7 @@ class PTRepresentation {
*/
virtual bool IsPTPreloaded() = 0;
+ virtual bool RefreshDB() = 0;
/**
* Gets number of ignition cycles before next update policy table
* @return number of ignition cycles
@@ -167,6 +168,13 @@ class PTRepresentation {
virtual EndpointUrls GetUpdateUrls(int service_type) = 0;
/**
+ * @brief GetLockScreenIcon allows to obtain lock screen icon url;
+ *
+ * @return url which point to the resourse where lock screen icon could be obtained.
+ */
+ virtual std::string GetLockScreenIconUrl() const = 0;
+
+ /**
* @brief Get allowed number of notifications
* depending on application priority.
* @param priority Priority of application
@@ -293,6 +301,8 @@ class PTRepresentation {
bool is_revoked,
bool is_default,
bool is_predata) = 0;
+
+ virtual void WriteDb() = 0;
};
} // namespace policy
diff --git a/src/components/policy/src/policy/include/policy/sql_pt_ext_queries.h b/src/components/policy/src/policy/include/policy/sql_pt_ext_queries.h
index 6db8425b7..2b65df45f 100644
--- a/src/components/policy/src/policy/include/policy/sql_pt_ext_queries.h
+++ b/src/components/policy/src/policy/include/policy/sql_pt_ext_queries.h
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (c) 2013, " Ford Motor Company
All rights reserved.
@@ -56,13 +56,15 @@ 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 kDeleteAppConsent;
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;
@@ -87,6 +89,7 @@ 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;
} // namespace sql_pt_ext
} // namespace policy
diff --git a/src/components/policy/src/policy/include/policy/sql_pt_ext_representation.h b/src/components/policy/src/policy/include/policy/sql_pt_ext_representation.h
index 9f784a395..1a8663fde 100644
--- a/src/components/policy/src/policy/include/policy/sql_pt_ext_representation.h
+++ b/src/components/policy/src/policy/include/policy/sql_pt_ext_representation.h
@@ -121,7 +121,7 @@ class SQLPTExtRepresentation : public SQLPTRepresentation,
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) 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,
@@ -139,15 +139,17 @@ class SQLPTExtRepresentation : public SQLPTRepresentation,
void GatherDeviceData(policy_table::DeviceData* data) const;
void GatherConsentGroup(const std::string& device_id,
policy_table::UserConsentRecords* records) const;
- bool GatherApplicationPolicies(policy_table::ApplicationPolicies* apps) 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 SaveApplicationPolicies(const policy_table::ApplicationPolicies& apps);
+ 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,
@@ -156,6 +158,12 @@ class SQLPTExtRepresentation : public SQLPTRepresentation,
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,
diff --git a/src/components/policy/src/policy/include/policy/sql_pt_queries.h b/src/components/policy/src/policy/include/policy/sql_pt_queries.h
index a8a3affd0..14c10d631 100644
--- a/src/components/policy/src/policy/include/policy/sql_pt_queries.h
+++ b/src/components/policy/src/policy/include/policy/sql_pt_queries.h
@@ -49,6 +49,7 @@ extern const std::string kSelectPreloaded;
extern const std::string kIsFirstRun;
extern const std::string kSetNotFirstRun;
extern const std::string kSelectEndpoint;
+extern const std::string kSelectLockScreenIcon;
extern const std::string kSelectModuleConfig;
extern const std::string kSelectEndpoints;
extern const std::string kSelectNotificationsPerMin;
@@ -62,6 +63,7 @@ extern const std::string kSelectAppPolicies;
extern const std::string kSelectAppGroups;
extern const std::string kSelectNicknames;
extern const std::string kSelectAppTypes;
+extern const std::string kSelectRequestTypes;
extern const std::string kSelectSecondsBetweenRetries;
extern const std::string kSelectIgnitionCycles;
extern const std::string kSelectKilometers;
@@ -74,6 +76,7 @@ extern const std::string kInsertApplication;
extern const std::string kInsertAppGroup;
extern const std::string kInsertNickname;
extern const std::string kInsertAppType;
+extern const std::string kInsertRequestType;
extern const std::string kInsertMessageType;
extern const std::string kInsertLanguage;
extern const std::string kInsertMessageString;
@@ -92,6 +95,7 @@ extern const std::string kDeleteFunctionalGroup;
extern const std::string kDeleteRpc;
extern const std::string kDeleteAppGroup;
extern const std::string kDeleteApplication;
+extern const std::string kDeleteRequestType;
extern const std::string kDeleteDevice;
extern const std::string kIncrementIgnitionCycles;
extern const std::string kResetIgnitionCycles;
diff --git a/src/components/policy/src/policy/include/policy/sql_pt_representation.h b/src/components/policy/src/policy/include/policy/sql_pt_representation.h
index ce4e4532a..2a498a6fb 100644
--- a/src/components/policy/src/policy/include/policy/sql_pt_representation.h
+++ b/src/components/policy/src/policy/include/policy/sql_pt_representation.h
@@ -66,14 +66,14 @@ class SQLPTRepresentation : public virtual PTRepresentation {
virtual void ResetIgnitionCycles();
virtual int TimeoutResponse();
virtual bool SecondsBetweenRetries(std::vector<int>* seconds);
-
+ virtual bool RefreshDB();
virtual VehicleData GetVehicleData();
virtual std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
const std::vector<std::string>& msg_codes, const std::string& language);
virtual EndpointUrls GetUpdateUrls(int service_type);
-
+ virtual std::string GetLockScreenIconUrl() const;
virtual int GetNotificationsNumber(const std::string& priority);
virtual bool GetPriority(const std::string& policy_app_id,
std::string* priority);
@@ -81,6 +81,7 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool Close();
bool Clear();
bool Drop();
+ virtual void WriteDb();
virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const;
virtual bool Save(const policy_table::Table& table);
bool GetInitialAppData(const std::string& app_id, StringArray* nicknames =
@@ -98,13 +99,15 @@ class SQLPTRepresentation : public virtual PTRepresentation {
policy_table::FunctionalGroupings* groups) const;
virtual bool GatherConsumerFriendlyMessages(
policy_table::ConsumerFriendlyMessages* messages) const;
- virtual bool GatherApplicationPolicies(
- policy_table::ApplicationPolicies* apps) const;
+ virtual bool GatherApplicationPoliciesSection(
+ policy_table::ApplicationPoliciesSection* policies) const;
bool GatherAppGroup(const std::string& app_id,
policy_table::Strings* app_groups) const;
bool GatherAppType(const std::string& app_id,
policy_table::AppHMITypes* app_types) const;
+ bool GatherRequestType(const std::string& app_id,
+ policy_table::RequestTypes* request_types) const;
bool GatherNickName(const std::string& app_id,
policy_table::Strings* nicknames) const;
@@ -122,10 +125,11 @@ class SQLPTRepresentation : public virtual PTRepresentation {
const policy_table::FunctionalGroupings& groups);
virtual bool SaveConsumerFriendlyMessages(
const policy_table::ConsumerFriendlyMessages& messages);
- virtual bool SaveApplicationPolicies(
- const policy_table::ApplicationPolicies& apps);
+ virtual bool SaveApplicationPoliciesSection(
+ const policy_table::ApplicationPoliciesSection& policies);
virtual bool SaveSpecificAppPolicy(
const policy_table::ApplicationPolicies::value_type& app);
+ virtual bool SaveDevicePolicy(const policy_table::DevicePolicy& device);
virtual bool SaveMessageString(const std::string& type,
const std::string& lang,
@@ -137,6 +141,8 @@ class SQLPTRepresentation : public virtual PTRepresentation {
const policy_table::Strings& nicknames);
bool SaveAppType(const std::string& app_id,
const policy_table::AppHMITypes& types);
+ bool SaveRequestType(const std::string& app_id,
+ const policy_table::RequestTypes& types);
public:
bool UpdateRequired() const;
diff --git a/src/components/policy/src/policy/include/policy/update_status_manager.h b/src/components/policy/src/policy/include/policy/update_status_manager.h
index 43d40d0c1..2fb0a2b18 100644
--- a/src/components/policy/src/policy/include/policy/update_status_manager.h
+++ b/src/components/policy/src/policy/include/policy/update_status_manager.h
@@ -1,16 +1,21 @@
#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H
#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H
-#include "policy/update_status_manager_interface.h"
#include "policy/policy_types.h"
#include "utils/lock.h"
#include "utils/timer_thread.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+#include "utils/conditional_variable.h"
+#include "utils/lock.h"
+#include "utils/logger.h"
+#include "utils/macro.h"
namespace policy {
class PolicyListener;
-class UpdateStatusManager : public UpdateStatusManagerInterface {
+class UpdateStatusManager {
public:
/**
* @brief Constructor
@@ -69,10 +74,52 @@ class UpdateStatusManager : public UpdateStatusManagerInterface {
void OnPolicyInit(bool is_update_required);
/**
- * @brief Returns current policy update status
- * @return
+ * @brief IsUpdateRequired allows to distiguish if update is required
+ *
+ * @return true if update required.
+ */
+ bool IsUpdateRequired() const;
+
+ /**
+ * @brief IsUpdatePending allows to distinguish if update is in pending mode.
+ *
+ * @return true if update is in pending mode.
*/
- PolicyTableStatus GetUpdateStatus();
+ bool IsUpdatePending() const;
+
+ /**
+ * @brief ScheduleUpdate allows to schedule next update.
+ * It will change state to Update_Needed, that's is.
+ */
+ void ScheduleUpdate();
+
+ /**
+ * @brief ResetUpdateSchedule allows to reset all scheduled updates.
+ */
+ void ResetUpdateSchedule();
+
+ /**
+ * @brief StringifiedUpdateStatus allows to obtain update status as a string.
+ *
+ * @return stringified update status.
+ */
+ std::string StringifiedUpdateStatus() const;
+
+ /**
+ * @brief Status handler on applications search started
+ */
+ void OnAppsSearchStarted();
+
+ /**
+ * @brief Status handler on applications search completed
+ */
+ void OnAppsSearchCompleted();
+
+ /**
+ * @brief Returns status is application search in progress
+ * @return true, if in progress, otherwise - false
+ */
+ bool IsAppsSearchInProgress();
private:
/*
@@ -102,33 +149,46 @@ private:
void CheckUpdateStatus();
private:
+
+ /**
+ * @brief Returns current policy update status
+ * @return
+ */
+ PolicyTableStatus GetUpdateStatus() const;
+
PolicyListener* listener_;
bool exchange_in_progress_;
bool update_required_;
+ bool update_scheduled_;
bool exchange_pending_;
+ bool apps_search_in_progress_;
sync_primitives::Lock exchange_in_progress_lock_;
sync_primitives::Lock update_required_lock_;
sync_primitives::Lock exchange_pending_lock_;
+ sync_primitives::Lock apps_search_in_progress_lock_;
/**
* @brief Last status of policy table update
*/
PolicyTableStatus last_update_status_;
+ class UpdateThreadDelegate: public threads::ThreadDelegate {
- /**
- * @brief The Policy update response timer class
- */
- class UpdateResponseTimer : public timer::TimerThread<UpdateStatusManager> {
- public:
- UpdateResponseTimer(UpdateStatusManager* callee) :
- timer::TimerThread<UpdateStatusManager>(
- "Policy UpdResponse",
- callee,
- &UpdateStatusManager::OnUpdateTimeoutOccurs) {
- }
- ~UpdateResponseTimer();
+ public:
+ UpdateThreadDelegate(UpdateStatusManager* update_status_manager);
+ ~UpdateThreadDelegate();
+ virtual void threadMain();
+ virtual void exitThreadMain();
+ void updateTimeOut(const uint32_t timeout_ms);
+
+ volatile uint32_t timeout_;
+ volatile bool stop_flag_;
+ sync_primitives::Lock state_lock_;
+ sync_primitives::ConditionalVariable termination_condition_;
+ UpdateStatusManager* update_status_manager_;
};
- UpdateResponseTimer update_response_timer_;
+
+ UpdateThreadDelegate* update_status_thread_delegate_;
+ threads::Thread* thread_;
};
}
diff --git a/src/components/policy/src/policy/policy_table/table_struct/enums.cc b/src/components/policy/src/policy/policy_table/table_struct/enums.cc
index a0203b7f4..5ba1efe52 100644
--- a/src/components/policy/src/policy/policy_table/table_struct/enums.cc
+++ b/src/components/policy/src/policy/policy_table/table_struct/enums.cc
@@ -292,6 +292,143 @@ bool EnumFromJsonString(const std::string& literal, AppHMIType* result) {
}
}
+bool IsValidEnum(RequestType val) {
+ switch(val) {
+ case RT_HTTP : return true;
+ case RT_FILE_RESUME : return true;
+ case RT_AUTH_REQUEST: return true;
+ case RT_AUTH_CHALLENGE: return true;
+ case RT_AUTH_ACK: return true;
+ case RT_PROPRIETARY: return true;
+ case RT_QUERY_APPS: return true;
+ case RT_LAUNCH_APP: return true;
+ case RT_LOCK_SCREEN_ICON_URL: return true;
+ case RT_TRAFFIC_MESSAGE_CHANNEL: return true;
+ case RT_DRIVER_PROFILE: return true;
+ case RT_VOICE_SEARCH: return true;
+ case RT_NAVIGATION: return true;
+ case RT_PHONE: return true;
+ case RT_CLIMATE: return true;
+ case RT_SETTINGS: return true;
+ case RT_VEHICLE_DIAGNOSTICS: return true;
+ case RT_EMERGENCY: return true;
+ case RT_MEDIA: return true;
+ case RT_FOTA: return true;
+ default: return false;
+ }
+}
+
+const char*EnumToJsonString(RequestType val) {
+ switch(val) {
+ case RT_HTTP : return "HTTP";
+ case RT_FILE_RESUME : return "FILE_RESUME";
+ case RT_AUTH_REQUEST: return "AUTH_REQUEST";
+ case RT_AUTH_CHALLENGE: return "AUTH_CHALLENGE";
+ case RT_AUTH_ACK: return "AUTH_ACK";
+ case RT_PROPRIETARY: return "PROPRIETARY";
+ case RT_QUERY_APPS: return "QUERY_APPS";
+ case RT_LAUNCH_APP: return "LAUNCH_APP";
+ case RT_LOCK_SCREEN_ICON_URL: return "LOCK_SCREEN_ICON_URL";
+ case RT_TRAFFIC_MESSAGE_CHANNEL: return "TRAFFIC_MESSAGE_CHANNEL";
+ case RT_DRIVER_PROFILE: return "DRIVER_PROFILE";
+ case RT_VOICE_SEARCH: return "VOICE_SEARCH";
+ case RT_NAVIGATION: return "NAVIGATION";
+ case RT_PHONE: return "PHONE";
+ case RT_CLIMATE: return "CLIMATE";
+ case RT_SETTINGS: return "SETTINGS";
+ case RT_VEHICLE_DIAGNOSTICS: return "VEHICLE_DIAGNOSTICS";
+ case RT_EMERGENCY: return "EMERGENCY";
+ case RT_MEDIA: return "MEDIA";
+ case RT_FOTA: return "FOTA";
+ default: return "";
+ }
+}
+
+bool EnumFromJsonString(const std::string& literal, RequestType* result) {
+ if ("HTTP" == literal) {
+ *result = RT_HTTP;
+ return true;
+ }
+ if ("FILE_RESUME" == literal) {
+ *result = RT_FILE_RESUME;
+ return true;
+ }
+ if ("AUTH_REQUEST" == literal) {
+ *result = RT_AUTH_REQUEST;
+ return true;
+ }
+ if ("AUTH_CHALLENGE" == literal) {
+ *result = RT_AUTH_CHALLENGE;
+ return true;
+ }
+ if ("AUTH_ACK" == literal) {
+ *result = RT_AUTH_ACK;
+ return true;
+ }
+ if ("PROPRIETARY" == literal) {
+ *result = RT_PROPRIETARY;
+ return true;
+ }
+ if ("QUERY_APPS" == literal) {
+ *result = RT_QUERY_APPS;
+ return true;
+ }
+ if ("LAUNCH_APP" == literal) {
+ *result = RT_LAUNCH_APP;
+ return true;
+ }
+ if ("LOCK_SCREEN_ICON_URL" == literal) {
+ *result = RT_LOCK_SCREEN_ICON_URL;
+ return true;
+ }
+ if ("TRAFFIC_MESSAGE_CHANNEL" == literal) {
+ *result = RT_TRAFFIC_MESSAGE_CHANNEL;
+ return true;
+ }
+ if ("DRIVER_PROFILE" == literal) {
+ *result = RT_DRIVER_PROFILE;
+ return true;
+ }
+ if ("VOICE_SEARCH" == literal) {
+ *result = RT_VOICE_SEARCH;
+ return true;
+ }
+ if ("NAVIGATION" == literal) {
+ *result = RT_NAVIGATION;
+ return true;
+ }
+ if ("PHONE" == literal) {
+ *result = RT_PHONE;
+ return true;
+ }
+ if ("CLIMATE" == literal) {
+ *result = RT_CLIMATE;
+ return true;
+ }
+ if ("SETTINGS" == literal) {
+ *result = RT_SETTINGS;
+ return true;
+ }
+ if ("VEHICLE_DIAGNOSTICS" == literal) {
+ *result = RT_VEHICLE_DIAGNOSTICS;
+ return true;
+ }
+ if ("EMERGENCY" == literal) {
+ *result = RT_EMERGENCY;
+ return true;
+ }
+ if ("MEDIA" == literal) {
+ *result = RT_MEDIA;
+ return true;
+ }
+ if ("FOTA" == literal) {
+ *result = RT_FOTA;
+ return true;
+ } else {
+ return false;
+ }
+}
+
const std::string kDefaultApp = "default";
const std::string kPreDataConsentApp = "pre_DataConsent";
const std::string kDeviceApp = "device";
diff --git a/src/components/policy/src/policy/policy_table/table_struct/enums.h b/src/components/policy/src/policy/policy_table/table_struct/enums.h
index e437860c6..f003679e1 100644
--- a/src/components/policy/src/policy/policy_table/table_struct/enums.h
+++ b/src/components/policy/src/policy/policy_table/table_struct/enums.h
@@ -79,6 +79,34 @@ bool IsValidEnum(AppHMIType val);
const char* EnumToJsonString(AppHMIType val);
bool EnumFromJsonString(const std::string& literal, AppHMIType* result);
+
+enum RequestType {
+ RT_HTTP,
+ RT_FILE_RESUME,
+ RT_AUTH_REQUEST,
+ RT_AUTH_CHALLENGE,
+ RT_AUTH_ACK,
+ RT_PROPRIETARY,
+ RT_QUERY_APPS,
+ RT_LAUNCH_APP,
+ RT_LOCK_SCREEN_ICON_URL,
+ RT_TRAFFIC_MESSAGE_CHANNEL,
+ RT_DRIVER_PROFILE,
+ RT_VOICE_SEARCH,
+ RT_NAVIGATION,
+ RT_PHONE,
+ RT_CLIMATE,
+ RT_SETTINGS,
+ RT_VEHICLE_DIAGNOSTICS,
+ RT_EMERGENCY,
+ RT_MEDIA,
+ RT_FOTA
+};
+
+bool IsValidEnum(RequestType val);
+const char* EnumToJsonString(RequestType val);
+bool EnumFromJsonString(const std::string& literal, RequestType* result);
+
extern const std::string kDefaultApp;
extern const std::string kPreDataConsentApp;
extern const std::string kDeviceApp;
diff --git a/src/components/policy/src/policy/policy_table/table_struct/types.cc b/src/components/policy/src/policy/policy_table/table_struct/types.cc
index 92172e42a..dcbd66dce 100644
--- a/src/components/policy/src/policy/policy_table/table_struct/types.cc
+++ b/src/components/policy/src/policy/policy_table/table_struct/types.cc
@@ -22,39 +22,224 @@ namespace policy_table_interface_base {
}
}
+ // PolicyBase methods
+ PolicyBase::PolicyBase()
+ : CompositeType(kUninitialized) {
+ }
+ PolicyBase::PolicyBase(const Strings& groups, Priority priority, HmiLevel default_hmi, bool keep_context, bool steal_focus)
+ : CompositeType(kUninitialized),
+ groups(groups),
+ priority(priority),
+ default_hmi(default_hmi),
+ keep_context(keep_context),
+ steal_focus(steal_focus) {
+ }
+ PolicyBase::~PolicyBase() {
+ }
+ PolicyBase::PolicyBase(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject)),
+ groups(impl::ValueMember(value__, "groups")),
+ preconsented_groups(impl::ValueMember(value__, "preconsented_groups")),
+ priority(impl::ValueMember(value__, "priority")),
+ default_hmi(impl::ValueMember(value__, "default_hmi")),
+ keep_context(impl::ValueMember(value__, "keep_context")),
+ steal_focus(impl::ValueMember(value__, "steal_focus")) {
+ }
+ Json::Value PolicyBase::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("groups", groups, &result__);
+ impl::WriteJsonField("preconsented_groups", preconsented_groups, &result__);
+ impl::WriteJsonField("priority", priority, &result__);
+ impl::WriteJsonField("default_hmi", default_hmi, &result__);
+ impl::WriteJsonField("keep_context", keep_context, &result__);
+ impl::WriteJsonField("steal_focus", steal_focus, &result__);
+ return result__;
+ }
+ bool PolicyBase::is_valid() const {
+ if (!groups.is_valid()) {
+ return false;
+ }
+ if (!preconsented_groups.is_valid()) {
+ return false;
+ }
+ if (!priority.is_valid()) {
+ return false;
+ }
+ if (!default_hmi.is_valid()) {
+ return false;
+ }
+ if (!keep_context.is_valid()) {
+ return false;
+ }
+ if (!steal_focus.is_valid()) {
+ return false;
+ }
+ return Validate();
+ }
+ bool PolicyBase::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+ }
+ bool PolicyBase::struct_empty() const {
+ if (groups.is_initialized()) {
+ return false;
+ }
+ if (preconsented_groups.is_initialized()) {
+ return false;
+ }
+ if (priority.is_initialized()) {
+ return false;
+ }
+ if (default_hmi.is_initialized()) {
+ return false;
+ }
+ if (keep_context.is_initialized()) {
+ return false;
+ }
+ if (steal_focus.is_initialized()) {
+ return false;
+ }
+ return true;
+ }
+ void PolicyBase::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!groups.is_valid()) {
+ groups.ReportErrors(&report__->ReportSubobject("groups"));
+ }
+ if (!preconsented_groups.is_valid()) {
+ preconsented_groups.ReportErrors(&report__->ReportSubobject("preconsented_groups"));
+ }
+ if (!priority.is_valid()) {
+ priority.ReportErrors(&report__->ReportSubobject("priority"));
+ }
+ if (!default_hmi.is_valid()) {
+ default_hmi.ReportErrors(&report__->ReportSubobject("default_hmi"));
+ }
+ if (!keep_context.is_valid()) {
+ keep_context.ReportErrors(&report__->ReportSubobject("keep_context"));
+ }
+ if (!steal_focus.is_valid()) {
+ steal_focus.ReportErrors(&report__->ReportSubobject("steal_focus"));
+ }
+ }
+
+ void PolicyBase::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ groups.SetPolicyTableType(pt_type);
+ priority.SetPolicyTableType(pt_type);
+ }
+
+ // DevicePolicy methods
+ DevicePolicy::DevicePolicy()
+ : PolicyBase() {
+ }
+ DevicePolicy::DevicePolicy(const Strings& groups, Priority priority, HmiLevel default_hmi, bool keep_context, bool steal_focus)
+ : PolicyBase(groups, priority, default_hmi, keep_context, steal_focus) {
+ }
+ DevicePolicy::~DevicePolicy() {
+ }
+ DevicePolicy::DevicePolicy(const Json::Value* value__)
+ : PolicyBase(value__) {
+ }
+
+ // AppPoliciesSection methods
+ ApplicationPoliciesSection::ApplicationPoliciesSection()
+ : CompositeType(kUninitialized) {
+ }
+ ApplicationPoliciesSection::ApplicationPoliciesSection(const ApplicationPolicies& apps, const DevicePolicy& device)
+ : CompositeType(kUninitialized),
+ apps(apps),
+ device(device) {
+ }
+ ApplicationPoliciesSection::~ApplicationPoliciesSection() {
+ }
+ ApplicationPoliciesSection::ApplicationPoliciesSection(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject)),
+ apps(value__),
+ device(impl::ValueMember(value__, "device")) {
+ // Since "device" is moved to separate struct, we have to delete it from
+ // parsed apps to avoid validation issues due to possible wrong params in
+ // device section
+ apps.erase("device");
+ }
+ Json::Value ApplicationPoliciesSection::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ result__ = apps.ToJsonValue();
+ impl::WriteJsonField("device", device, &result__);
+ return result__;
+ }
+ bool ApplicationPoliciesSection::is_valid() const {
+ if (!device.is_valid()) {
+ return false;
+ }
+ if (!apps.is_valid()) {
+ return false;
+ }
+ return Validate();
+ }
+ bool ApplicationPoliciesSection::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+ }
+ bool ApplicationPoliciesSection::struct_empty() const {
+ if (device.is_initialized()) {
+ return false;
+ }
+ if (apps.is_initialized()) {
+ return false;
+ }
+ return true;
+ }
+ void ApplicationPoliciesSection::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!device.is_valid()) {
+ device.ReportErrors(&report__->ReportSubobject("device"));
+ }
+ if (!apps.is_valid()) {
+ apps.ReportErrors(&report__->ReportSubobject("apps"));
+ }
+ }
+
+ void ApplicationPoliciesSection::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ device.SetPolicyTableType(pt_type);
+ apps.SetPolicyTableType(pt_type);
+ }
+
// ApplicationParams methods
ApplicationParams::ApplicationParams()
- : CompositeType(kUninitialized) {
+ : PolicyBase() {
}
-ApplicationParams::ApplicationParams(const Strings& groups)
- : CompositeType(kUninitialized),
- groups(groups) {
+ApplicationParams::ApplicationParams(const Strings& groups, Priority priority, HmiLevel default_hmi, bool keep_context, bool steal_focus)
+ : PolicyBase(groups, priority, default_hmi, keep_context, steal_focus) {
}
ApplicationParams::~ApplicationParams() {
}
ApplicationParams::ApplicationParams(const Json::Value* value__)
- : CompositeType(InitHelper(value__, &Json::Value::isObject)),
- groups(impl::ValueMember(value__, "groups")),
+ : PolicyBase(value__),
nicknames(impl::ValueMember(value__, "nicknames")),
AppHMIType(impl::ValueMember(value__, "AppHMIType")),
- priority(impl::ValueMember(value__, "priority")),
- memory_kb(impl::ValueMember(value__, "memory_kb")),
+ RequestType(impl::ValueMember(value__, "RequestType")),
+ memory_kb(impl::ValueMember(value__, "memory_kb"), 0),
heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms")),
- certificate(impl::ValueMember(value__, "certificate")) {
+ certificate(impl::ValueMember(value__, "certificate"), "not_specified") {
}
Json::Value ApplicationParams::ToJsonValue() const {
- Json::Value result__(Json::objectValue);
- impl::WriteJsonField("groups", groups, &result__);
+ Json::Value result__(PolicyBase::ToJsonValue());
impl::WriteJsonField("nicknames", nicknames, &result__);
impl::WriteJsonField("AppHMIType", AppHMIType, &result__);
- impl::WriteJsonField("priority", priority, &result__);
+ impl::WriteJsonField("RequestType", RequestType, &result__);
impl::WriteJsonField("memory_kb", memory_kb, &result__);
impl::WriteJsonField("heart_beat_timeout_ms", heart_beat_timeout_ms, &result__);
impl::WriteJsonField("certificate", certificate, &result__);
return result__;
}
bool ApplicationParams::is_valid() const {
- if (!groups.is_valid()) {
+ // RequestType is not validated since there is high-level validation logic,
+ // which takes into account information not available here.
+ if (!PolicyBase::is_valid()) {
return false;
}
if (!nicknames.is_valid()) {
@@ -63,9 +248,6 @@ bool ApplicationParams::is_valid() const {
if (!AppHMIType.is_valid()) {
return false;
}
- if (! priority.is_valid()) {
- return false;
- }
if (!memory_kb.is_valid()) {
return false;
}
@@ -81,30 +263,27 @@ bool ApplicationParams::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
bool ApplicationParams::struct_empty() const {
- if (groups.is_initialized()) {
+ if (!PolicyBase::is_initialized()) {
return false;
}
if (nicknames.is_initialized()) {
return false;
}
-
if (AppHMIType.is_initialized()) {
return false;
}
- if (priority.is_initialized()) {
+ if (RequestType.is_initialized()) {
return false;
}
if (memory_kb.is_initialized()) {
return false;
}
-
if (heart_beat_timeout_ms.is_initialized()) {
return false;
}
if (certificate.is_initialized()) {
return false;
}
-
return true;
}
void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
@@ -117,12 +296,27 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
if (!nicknames.is_valid()) {
nicknames.ReportErrors(&report__->ReportSubobject("nicknames"));
}
+ if (!preconsented_groups.is_valid()) {
+ preconsented_groups.ReportErrors(&report__->ReportSubobject("preconsented_groups"));
+ }
if (!AppHMIType.is_valid()) {
AppHMIType.ReportErrors(&report__->ReportSubobject("AppHMIType"));
}
+ if (!RequestType.is_valid()) {
+ RequestType.ReportErrors(&report__->ReportSubobject("RequestType"));
+ }
if (!priority.is_valid()) {
priority.ReportErrors(&report__->ReportSubobject("priority"));
}
+ if (!default_hmi.is_valid()) {
+ default_hmi.ReportErrors(&report__->ReportSubobject("default_hmi"));
+ }
+ if (!keep_context.is_valid()) {
+ keep_context.ReportErrors(&report__->ReportSubobject("keep_context"));
+ }
+ if (!steal_focus.is_valid()) {
+ steal_focus.ReportErrors(&report__->ReportSubobject("steal_focus"));
+ }
if (!memory_kb.is_valid()) {
memory_kb.ReportErrors(&report__->ReportSubobject("memory_kb"));
}
@@ -135,15 +329,13 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
- CompositeType::SetPolicyTableType(pt_type);
+ PolicyBase::SetPolicyTableType(pt_type);
AppHMIType.SetPolicyTableType(pt_type);
- groups.SetPolicyTableType(pt_type);
- priority.SetPolicyTableType(pt_type);
+ RequestType.SetPolicyTableType(pt_type);
memory_kb.SetPolicyTableType(pt_type);
heart_beat_timeout_ms.SetPolicyTableType(pt_type);
certificate.SetPolicyTableType(pt_type);
}
-
// RpcParameters methods
RpcParameters::RpcParameters()
: CompositeType(kUninitialized) {
@@ -853,9 +1045,9 @@ void DeviceParams::ReportErrors(rpc::ValidationReport* report__) const {
PolicyTable::PolicyTable()
: CompositeType(kUninitialized) {
}
-PolicyTable::PolicyTable(const ApplicationPolicies& app_policies, const FunctionalGroupings& functional_groupings, const ConsumerFriendlyMessages& consumer_friendly_messages, const ModuleConfig& module_config)
+PolicyTable::PolicyTable(const ApplicationPoliciesSection& app_policies_section, const FunctionalGroupings& functional_groupings, const ConsumerFriendlyMessages& consumer_friendly_messages, const ModuleConfig& module_config)
: CompositeType(kUninitialized),
- app_policies(app_policies),
+ app_policies_section(app_policies_section),
functional_groupings(functional_groupings),
consumer_friendly_messages(consumer_friendly_messages),
module_config(module_config) {
@@ -864,7 +1056,7 @@ PolicyTable::~PolicyTable() {
}
PolicyTable::PolicyTable(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject)),
- app_policies(impl::ValueMember(value__, "app_policies")),
+ app_policies_section(impl::ValueMember(value__, "app_policies")),
functional_groupings(impl::ValueMember(value__, "functional_groupings")),
consumer_friendly_messages(impl::ValueMember(value__, "consumer_friendly_messages")),
module_config(impl::ValueMember(value__, "module_config")),
@@ -874,7 +1066,7 @@ PolicyTable::PolicyTable(const Json::Value* value__)
}
Json::Value PolicyTable::ToJsonValue() const {
Json::Value result__(Json::objectValue);
- impl::WriteJsonField("app_policies", app_policies, &result__);
+ impl::WriteJsonField("app_policies", app_policies_section, &result__);
impl::WriteJsonField("functional_groupings", functional_groupings, &result__);
impl::WriteJsonField("consumer_friendly_messages", consumer_friendly_messages, &result__);
impl::WriteJsonField("module_config", module_config, &result__);
@@ -884,7 +1076,7 @@ Json::Value PolicyTable::ToJsonValue() const {
return result__;
}
bool PolicyTable::is_valid() const {
- if (!app_policies.is_valid()) {
+ if (!app_policies_section.is_valid()) {
return false;
}
if (!functional_groupings.is_valid()) {
@@ -911,7 +1103,7 @@ bool PolicyTable::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
bool PolicyTable::struct_empty() const {
- if (app_policies.is_initialized()) {
+ if (app_policies_section.is_initialized()) {
return false;
}
if (functional_groupings.is_initialized()) {
@@ -950,8 +1142,8 @@ void PolicyTable::ReportErrors(rpc::ValidationReport* report__) const {
report__->ReportSubobject("device_data").set_validation_info(validation_info);
}
}
- if (!app_policies.is_valid()) {
- app_policies.ReportErrors(&report__->ReportSubobject("app_policies"));
+ if (!app_policies_section.is_valid()) {
+ app_policies_section.ReportErrors(&report__->ReportSubobject("app_policies"));
}
if (!functional_groupings.is_valid()) {
functional_groupings.ReportErrors(&report__->ReportSubobject("functional_groupings"));
@@ -975,7 +1167,7 @@ void PolicyTable::ReportErrors(rpc::ValidationReport* report__) const {
void PolicyTable::SetPolicyTableType(PolicyTableType pt_type) {
CompositeType::SetPolicyTableType(pt_type);
- app_policies.SetPolicyTableType(pt_type);
+ app_policies_section.SetPolicyTableType(pt_type);
functional_groupings.SetPolicyTableType(pt_type);
consumer_friendly_messages.SetPolicyTableType(pt_type);
module_config.SetPolicyTableType(pt_type);
diff --git a/src/components/policy/src/policy/policy_table/table_struct/types.h b/src/components/policy/src/policy/policy_table/table_struct/types.h
index 5171d9fc7..622775399 100644
--- a/src/components/policy/src/policy/policy_table/table_struct/types.h
+++ b/src/components/policy/src/policy/policy_table/table_struct/types.h
@@ -54,18 +54,50 @@ typedef Map< Rpcs, 1, 255 > FunctionalGroupings;
typedef Map< DeviceParams, 0, 255 > DeviceData;
-struct ApplicationParams : CompositeType {
+typedef Array< Enum<RequestType>, 0, 255 > RequestTypes;
+
+struct PolicyBase : CompositeType {
public:
Strings groups;
+ Optional< Strings > preconsented_groups;
+ Enum<Priority> priority;
+ Enum<HmiLevel> default_hmi;
+ Boolean keep_context;
+ Boolean steal_focus;
+ public:
+ PolicyBase();
+ PolicyBase(const Strings& groups, Priority priority, HmiLevel default_hmi, bool keep_context, bool steal_focus);
+ virtual ~PolicyBase();
+ explicit PolicyBase(const Json::Value* value__);
+ Json::Value ToJsonValue() const;
+ bool is_valid() const;
+ bool is_initialized() const;
+ bool struct_empty() const;
+ void ReportErrors(rpc::ValidationReport* report__) const;
+ virtual void SetPolicyTableType(PolicyTableType pt_type);
+ private:
+ bool Validate() const;
+};
+
+struct DevicePolicy : PolicyBase {
+ public:
+ DevicePolicy();
+ DevicePolicy(const Strings& groups, Priority priority, HmiLevel default_hmi, bool keep_context, bool steal_focus);
+ ~DevicePolicy();
+ explicit DevicePolicy(const Json::Value* value__);
+};
+
+struct ApplicationParams : PolicyBase {
+ public:
Optional< Strings > nicknames;
Optional< AppHMITypes > AppHMIType;
- Enum<Priority> priority;
- Optional< Integer<uint16_t, 1, 65225> > memory_kb;
- Optional< Integer<uint16_t, 1, 65225> > heart_beat_timeout_ms;
+ Optional< RequestTypes > RequestType;
+ Optional< Integer<uint16_t, 0, 65225> > memory_kb;
+ Optional< Integer<uint16_t, 0, 65225> > heart_beat_timeout_ms;
Optional< String<0, 255> > certificate;
public:
ApplicationParams();
- explicit ApplicationParams(const Strings& groups);
+ ApplicationParams(const Strings& groups, Priority priority, HmiLevel default_hmi, bool keep_context, bool steal_focus);
~ApplicationParams();
explicit ApplicationParams(const Json::Value* value__);
Json::Value ToJsonValue() const;
@@ -78,6 +110,25 @@ struct ApplicationParams : CompositeType {
bool Validate() const;
};
+struct ApplicationPoliciesSection : CompositeType {
+ public:
+ mutable ApplicationPolicies apps;
+ DevicePolicy device;
+ public:
+ ApplicationPoliciesSection();
+ ApplicationPoliciesSection(const ApplicationPolicies& apps, const DevicePolicy& device);
+ ~ApplicationPoliciesSection();
+ explicit ApplicationPoliciesSection(const Json::Value* value__);
+ Json::Value ToJsonValue() const;
+ bool is_valid() const;
+ bool is_initialized() const;
+ bool struct_empty() const;
+ void ReportErrors(rpc::ValidationReport* report__) const;
+ virtual void SetPolicyTableType(PolicyTableType pt_type);
+ private:
+ bool Validate() const;
+};
+
struct RpcParameters : CompositeType {
public:
HmiLevels hmi_levels;
@@ -130,6 +181,7 @@ struct ModuleConfig : CompositeType {
Optional< String<1, 100> > vehicle_make;
Optional< String<1, 100> > vehicle_model;
Optional< String<4, 4> > vehicle_year;
+ Optional< String<0, 65535> > certificate;
public:
ModuleConfig();
ModuleConfig(uint8_t exchange_after_x_ignition_cycles, int64_t exchange_after_x_kilometers, uint8_t exchange_after_x_days, uint16_t timeout_after_x_seconds, const SecondsBetweenRetries& seconds_between_retries, const ServiceEndpoints& endpoints, const NumberOfNotificationsPerMinute& notifications_per_minute_by_priority);
@@ -267,7 +319,7 @@ struct DeviceParams : CompositeType {
struct PolicyTable : CompositeType {
public:
- ApplicationPolicies app_policies;
+ ApplicationPoliciesSection app_policies_section;
FunctionalGroupings functional_groupings;
Optional < ConsumerFriendlyMessages > consumer_friendly_messages;
ModuleConfig module_config;
@@ -276,7 +328,10 @@ struct PolicyTable : CompositeType {
Optional< DeviceData > device_data;
public:
PolicyTable();
- PolicyTable(const ApplicationPolicies& app_policies, const FunctionalGroupings& functional_groupings, const ConsumerFriendlyMessages& consumer_friendly_messages, const ModuleConfig& module_config);
+ PolicyTable(const ApplicationPoliciesSection& app_policies_section,
+ const FunctionalGroupings& functional_groupings,
+ const ConsumerFriendlyMessages& consumer_friendly_messages,
+ const ModuleConfig& module_config);
~PolicyTable();
explicit PolicyTable(const Json::Value* value__);
Json::Value ToJsonValue() const;
diff --git a/src/components/policy/src/policy/policy_table/table_struct/validation.cc b/src/components/policy/src/policy/policy_table/table_struct/validation.cc
index 65fc231de..be39b8022 100644
--- a/src/components/policy/src/policy/policy_table/table_struct/validation.cc
+++ b/src/components/policy/src/policy/policy_table/table_struct/validation.cc
@@ -1,8 +1,119 @@
-// This file is generated, do not edit
+#include <algorithm>
#include "./types.h"
+#include "utils/logger.h"
+
+namespace {
+bool IsTypeInvalid(rpc::Enum<rpc::policy_table_interface_base::RequestType> request) { return !request.is_valid(); }
+}
namespace rpc {
namespace policy_table_interface_base {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyTableValidation")
+
+void RemoveInvalidTypes(RequestTypes& types) {
+ types.erase(
+ std::remove_if(types.begin(), types.end(), &IsTypeInvalid),
+ types.end());
+}
+
+bool PolicyBase::Validate() const {
+ return true;
+}
+
+bool ApplicationPoliciesSection::Validate() const {
+ ApplicationPolicies::iterator it_default_policy =
+ apps.find(kDefaultApp);
+ ApplicationPolicies::iterator it_pre_data_policy =
+ apps.find(kPreDataConsentApp);
+
+ // Default and PreData policies are mandatory
+ if (apps.end() == it_default_policy || apps.end() == it_pre_data_policy) {
+ LOG4CXX_ERROR(logger_, "Default or preData policy is not present.");
+ return false;
+ }
+
+ // Device policy is mandatory
+ if (!device.is_initialized()) {
+ LOG4CXX_ERROR(logger_, "Device policy is not present.");
+ return false;
+ }
+
+ PolicyTableType pt_type = GetPolicyTableType();
+ if (PT_PRELOADED != pt_type && PT_UPDATE != pt_type) {
+ return true;
+ }
+
+ if (!it_default_policy->second.RequestType.is_valid()) {
+ LOG4CXX_WARN(logger_,
+ "Default policy RequestTypes are not valid. Will be cleaned.");
+ RemoveInvalidTypes(*it_default_policy->second.RequestType);
+ // If preloaded does not have valid default types - validation fails
+ // Otherwise default will be empty, i.e. all types allowed
+ if (PT_PRELOADED == pt_type) {
+ if (it_default_policy->second.RequestType->empty()) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Default policy RequestTypes empty after clean-up. Exiting.");
+ return false;
+ }
+ }
+ }
+
+ ApplicationPolicies::iterator iter = apps.begin();
+ ApplicationPolicies::iterator end_iter = apps.end();
+
+
+ while(iter != end_iter) {
+ ApplicationParams& app_params = (*iter).second;
+ bool is_request_type_ommited = !app_params.RequestType.is_initialized();
+ bool is_request_type_valid = app_params.RequestType.is_valid();
+ bool is_request_type_empty = app_params.RequestType->empty();
+
+ if (PT_PRELOADED == pt_type) {
+ if (!is_request_type_valid) {
+ LOG4CXX_WARN(
+ logger_,
+ "App policy RequestTypes are not valid. Will be cleaned.");
+ RemoveInvalidTypes(*app_params.RequestType);
+ if (app_params.RequestType->empty()) {
+ LOG4CXX_ERROR(
+ logger_,
+ "App policy RequestTypes empty after clean-up. Exiting.");
+ return false;
+ }
+ }
+ } else {
+ if (is_request_type_ommited) {
+ LOG4CXX_WARN(logger_, "App policy RequestTypes ommited."
+ " Will be replaced with default.");
+ app_params.RequestType = apps[kDefaultApp].RequestType;
+ ++iter;
+ continue;
+ }
+ if (!is_request_type_valid) {
+ LOG4CXX_WARN(
+ logger_,
+ "App policy RequestTypes are invalid. Will be cleaned.");
+ RemoveInvalidTypes(*app_params.RequestType);
+ if (app_params.RequestType->empty()) {
+ LOG4CXX_WARN(logger_, "App policy RequestTypes empty after clean-up."
+ " Will be replaced with default.");
+ app_params.RequestType = apps[kDefaultApp].RequestType;
+ ++iter;
+ continue;
+ }
+ }
+ if (is_request_type_empty) {
+ LOG4CXX_WARN(logger_, "App policy RequestTypes empty.");
+ }
+ }
+ ++iter;
+ }
+
+ return true;
+}
+
bool ApplicationParams::Validate() const {
return true;
}
@@ -71,16 +182,6 @@ bool DeviceParams::Validate() const {
return true;
}
bool PolicyTable::Validate() const {
- for (ApplicationPolicies::const_iterator it = app_policies.begin();
- app_policies.end() != it; ++it) {
- if (kDeviceApp == it->first) {
- if (it->second.nicknames.is_initialized()) {
- initialization_state__ = kUninitialized;
- return false;
- }
- continue;
- }
- }
if (PT_PRELOADED == GetPolicyTableType() ||
PT_UPDATE == GetPolicyTableType()) {
if (device_data.is_initialized()) {
diff --git a/src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_database.h b/src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_database.h
index f99dc5a14..caf954e1d 100644
--- a/src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_database.h
+++ b/src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_database.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_error.h b/src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_error.h
index 0f5bd36b4..cf21a66ff 100644
--- a/src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_error.h
+++ b/src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_error.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_query.h b/src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_query.h
index 1f81831c5..af46402c8 100644
--- a/src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_query.h
+++ b/src/components/policy/src/policy/qdb_wrapper/include/qdb_wrapper/sql_query.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/policy/src/policy/qdb_wrapper/src/sql_database.cc b/src/components/policy/src/policy/qdb_wrapper/src/sql_database.cc
index cb22c9dbd..ef26e6435 100644
--- a/src/components/policy/src/policy/qdb_wrapper/src/sql_database.cc
+++ b/src/components/policy/src/policy/qdb_wrapper/src/sql_database.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/policy/src/policy/qdb_wrapper/src/sql_error.cc b/src/components/policy/src/policy/qdb_wrapper/src/sql_error.cc
index 7dc31c2c2..b8f836cc2 100644
--- a/src/components/policy/src/policy/qdb_wrapper/src/sql_error.cc
+++ b/src/components/policy/src/policy/qdb_wrapper/src/sql_error.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/policy/src/policy/qdb_wrapper/src/sql_query.cc b/src/components/policy/src/policy/qdb_wrapper/src/sql_query.cc
index 355c25ca9..d3191193b 100644
--- a/src/components/policy/src/policy/qdb_wrapper/src/sql_query.cc
+++ b/src/components/policy/src/policy/qdb_wrapper/src/sql_query.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_database.h b/src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_database.h
index b7608e41f..274c64bef 100644
--- a/src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_database.h
+++ b/src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_database.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -95,6 +95,12 @@ class SQLDatabase {
void set_path(const std::string& path);
/**
+ * Checks if database is read/write
+ * @return true if database is read/write
+ */
+ bool IsReadWrite();
+
+ /**
* Call backup for opened DB
*/
bool Backup();
diff --git a/src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_error.h b/src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_error.h
index 3b5fff3c1..578b3990c 100644
--- a/src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_error.h
+++ b/src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_error.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_query.h b/src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_query.h
index 939cd1341..b477a812d 100644
--- a/src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_query.h
+++ b/src/components/policy/src/policy/sqlite_wrapper/include/sqlite_wrapper/sql_query.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/policy/src/policy/sqlite_wrapper/src/sql_database.cc b/src/components/policy/src/policy/sqlite_wrapper/src/sql_database.cc
index 423d266b4..6a1d70f00 100644
--- a/src/components/policy/src/policy/sqlite_wrapper/src/sql_database.cc
+++ b/src/components/policy/src/policy/sqlite_wrapper/src/sql_database.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -60,7 +60,16 @@ bool SQLDatabase::Open() {
return error_ == SQLITE_OK;
}
+bool SQLDatabase::IsReadWrite() {
+ const char* schema = "main";
+ return sqlite3_db_readonly(conn_, schema) == 0;
+}
+
void SQLDatabase::Close() {
+ if (!conn_) {
+ return;
+ }
+
sync_primitives::AutoLock auto_lock(conn_lock_);
error_ = sqlite3_close(conn_);
if (error_ == SQLITE_OK) {
diff --git a/src/components/policy/src/policy/sqlite_wrapper/src/sql_error.cc b/src/components/policy/src/policy/sqlite_wrapper/src/sql_error.cc
index 0f87ef2cc..6ee82cc23 100644
--- a/src/components/policy/src/policy/sqlite_wrapper/src/sql_error.cc
+++ b/src/components/policy/src/policy/sqlite_wrapper/src/sql_error.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/policy/src/policy/sqlite_wrapper/src/sql_query.cc b/src/components/policy/src/policy/sqlite_wrapper/src/sql_query.cc
index c8afdfcdb..d6a643a5d 100644
--- a/src/components/policy/src/policy/sqlite_wrapper/src/sql_query.cc
+++ b/src/components/policy/src/policy/sqlite_wrapper/src/sql_query.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/policy/src/policy/src/cache_manager.cc b/src/components/policy/src/policy/src/cache_manager.cc
index 62e96ae0e..05c36223d 100644
--- a/src/components/policy/src/policy/src/cache_manager.cc
+++ b/src/components/policy/src/policy/src/cache_manager.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 "policy/cache_manager.h"
@@ -40,9 +40,9 @@
#include "utils/file_system.h"
#include "json/reader.h"
#include "json/features.h"
+#include "json/writer.h"
#include "utils/logger.h"
-// EXTENDED_POLICY
# include "policy/sql_pt_representation.h"
namespace policy_table = rpc::policy_table_interface_base;
@@ -65,15 +65,37 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "CacheManager")
}\
}
+struct LanguageFinder {
+ LanguageFinder(const std::string& language):
+ language_(language) {
+ }
+ bool operator()(const policy_table::Languages::value_type& lang) const {
+ return !strcasecmp(language_.c_str(), lang.first.c_str());
+ }
+
+private:
+ const std::string& language_;
+};
CacheManager::CacheManager()
: CacheManagerInterface(),
backup_(
-// EXTENDED_POLICY
new SQLPTRepresentation()
),
update_required(false) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ backuper_ = new BackgroundBackuper(this);
+ backup_thread_ = threads::CreateThread("Backup thread", backuper_);
+ backup_thread_->start();
+}
+
+CacheManager::~CacheManager() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(backuper_locker_);
+ backup_thread_->join();
+ delete backup_thread_->delegate();
+ threads::DeleteThread(backup_thread_);
}
bool CacheManager::CanAppKeepContext(const std::string &app_id) {
@@ -86,9 +108,9 @@ uint16_t CacheManager::HeartBeatTimeout(const std::string &app_id) const {
CACHE_MANAGER_CHECK(0);
uint16_t result = 0;
if (AppExists(app_id)) {
- if (pt_->policy_table.app_policies[app_id].heart_beat_timeout_ms
+ if (pt_->policy_table.app_policies_section.apps[app_id].heart_beat_timeout_ms
.is_initialized()) {
- result = *(pt_->policy_table.app_policies[app_id].heart_beat_timeout_ms);
+ result = *(pt_->policy_table.app_policies_section.apps[app_id].heart_beat_timeout_ms);
}
}
return result;
@@ -104,12 +126,12 @@ bool CacheManager::GetDefaultHMI(const std::string &app_id,
std::string& default_hmi) {
CACHE_MANAGER_CHECK(false);
bool result = true;
-
return result;
}
bool CacheManager::ResetUserConsent() {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock lock (cache_lock_);
return true;
}
@@ -118,21 +140,36 @@ bool CacheManager::GetUserPermissionsForDevice(const std::string &device_id,
StringArray& consented_groups,
StringArray& disallowed_groups) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
- LOG4CXX_TRACE_EXIT(logger_);
return true;
}
void CacheManager::GetAllAppGroups(const std::string& app_id,
FunctionalGroupIDs& all_group_ids) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
+ if (kDeviceId == app_id) {
+ policy_table::DevicePolicy& device =
+ pt_->policy_table.app_policies_section.device;
+
+ policy_table::Strings::const_iterator iter = device.groups.begin();
+ policy_table::Strings::const_iterator iter_end = device.groups.end();
+
+ for (; iter != iter_end; ++iter) {
+ const uint32_t group_id =
+ static_cast<uint32_t> ((GenerateHash(*iter)));
+ all_group_ids.push_back(group_id);
+ }
+
+ return;
+ }
+
policy_table::ApplicationPolicies::const_iterator app_params_iter =
- pt_->policy_table.app_policies.find(app_id);
+ pt_->policy_table.app_policies_section.apps.find(app_id);
- if (pt_->policy_table.app_policies.end() != app_params_iter) {
+ if (pt_->policy_table.app_policies_section.apps.end() != app_params_iter) {
policy_table::Strings::const_iterator iter =
(*app_params_iter).second.groups.begin();
policy_table::Strings::const_iterator iter_end =
@@ -144,15 +181,13 @@ void CacheManager::GetAllAppGroups(const std::string& app_id,
all_group_ids.push_back(group_id);
}
}
- LOG4CXX_TRACE_EXIT(logger_);
}
void CacheManager::GetPreConsentedGroups(const std::string &app_id,
FunctionalGroupIDs& preconsented_groups) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
- LOG4CXX_TRACE_EXIT(logger_);
}
void CacheManager::GetConsentedGroups(const std::string &device_id,
@@ -160,17 +195,15 @@ void CacheManager::GetConsentedGroups(const std::string &device_id,
FunctionalGroupIDs& allowed_groups,
FunctionalGroupIDs& disallowed_groups) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
- LOG4CXX_TRACE_EXIT(logger_);
}
void CacheManager::GetUnconsentedGroups(const std::string& device_id,
const std::string& policy_app_id,
FunctionalGroupIDs& unconsented_groups) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
- LOG4CXX_TRACE_EXIT(logger_);
}
void CacheManager::RemoveAppConsentForGroup(const std::string& app_id,
@@ -179,65 +212,75 @@ void CacheManager::RemoveAppConsentForGroup(const std::string& app_id,
}
bool CacheManager::ApplyUpdate(const policy_table::Table& update_pt) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
pt_->policy_table.functional_groupings =
update_pt.policy_table.functional_groupings;
policy_table::ApplicationPolicies::const_iterator iter =
- update_pt.policy_table.app_policies.begin();
+ update_pt.policy_table.app_policies_section.apps.begin();
policy_table::ApplicationPolicies::const_iterator iter_end =
- update_pt.policy_table.app_policies.end();
+ update_pt.policy_table.app_policies_section.apps.end();
for (;iter != iter_end; ++iter) {
- pt_->policy_table.app_policies[iter->first] = iter->second;
+ if (iter->second.is_null()) {
+ pt_->policy_table.app_policies_section.apps[iter->first].set_to_null();
+ pt_->policy_table.app_policies_section.apps[iter->first].set_to_string("");
+ } else if (policy::kDefaultId == (iter->second).get_string()) {
+ pt_->policy_table.app_policies_section.apps[iter->first] =
+ pt_->policy_table.app_policies_section.apps[kDefaultId];
+ } else {
+ pt_->policy_table.app_policies_section.apps[iter->first] = iter->second;
+ }
}
- pt_->policy_table.module_config = update_pt.policy_table.module_config;
+ pt_->policy_table.app_policies_section.device =
+ update_pt.policy_table.app_policies_section.device;
if (update_pt.policy_table.consumer_friendly_messages.is_initialized()) {
pt_->policy_table.consumer_friendly_messages =
update_pt.policy_table.consumer_friendly_messages;
}
-
- LOG4CXX_TRACE_EXIT(logger_);
+ ResetCalculatedPermissions();
+ Backup();
return true;
}
-void CacheManager::Backup() {
+void CacheManager::GetHMIAppTypeAfterUpdate(std::map<std::string, StringArray>& app_hmi_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
- sync_primitives::AutoLock auto_lock(cache_lock_);
- if (backup_.valid()) {
- if (pt_.valid()) {
- backup_->Save(*pt_);
- backup_->SaveUpdateRequired(update_required);
-
-
- policy_table::ApplicationPolicies::const_iterator app_policy_iter =
- pt_->policy_table.app_policies.begin();
- policy_table::ApplicationPolicies::const_iterator app_policy_iter_end =
- pt_->policy_table.app_policies.end();
-
- for (; app_policy_iter != app_policy_iter_end; ++app_policy_iter) {
-
- const std::string app_id = (*app_policy_iter).first;
- backup_->SaveApplicationCustomData(app_id,
- IsApplicationRevoked(app_id),
- IsDefaultPolicy(app_id),
- is_predata_[app_id]);
+ policy_table::ApplicationPolicies::const_iterator policy_iter_begin =
+ pt_->policy_table.app_policies_section.apps.begin();
+ policy_table::ApplicationPolicies::const_iterator policy_iter_end =
+ pt_->policy_table.app_policies_section.apps.end();
+ std::vector<std::string> transform_app_hmi_types;
+ for(; policy_iter_begin != policy_iter_end; ++policy_iter_begin) {
+ const policy_table::ApplicationParams& app_params = (*policy_iter_begin).second;
+ if(app_params.AppHMIType.is_initialized()) {
+ if(!(transform_app_hmi_types.empty())) {
+ transform_app_hmi_types.clear();
}
-
- // In case of extended policy the meta info should be backuped as well.
+ std::transform(app_params.AppHMIType->begin(), app_params.AppHMIType->end(),
+ std::back_inserter(transform_app_hmi_types), AppHMITypeToString());
+ app_hmi_types[(*policy_iter_begin).first] = transform_app_hmi_types;
}
}
}
+void CacheManager::Backup() {
+ sync_primitives::AutoLock lock(backuper_locker_);
+ DCHECK(backuper_);
+ backuper_->DoBackup();
+}
+
std::string CacheManager::currentDateTime() {
time_t now = time(0);
struct tm tstruct;
char buf[80];
tstruct = *localtime(&now);
- strftime(buf, sizeof(buf), "%Y-%m-%d.%X", &tstruct);
+ // ISO_8601 format is expected, e.g. “2000-01-01T12:18:53Z”
+ strftime(buf, sizeof(buf), "%Y-%m-%dT%XZ", &tstruct);
return buf;
}
@@ -245,21 +288,18 @@ bool CacheManager::GetPermissionsForApp(const std::string &device_id,
const std::string &app_id,
FunctionalIdType& group_types) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
GetAllAppGroups(app_id, group_types[kTypeGeneral]);
GetAllAppGroups(kDefaultId, group_types[kTypeDefault]);
GetAllAppGroups(kPreDataConsentId, group_types[kTypePreDataConsented]);
- LOG4CXX_TRACE_EXIT(logger_);
return true;
}
bool CacheManager::GetDeviceGroupsFromPolicies(
policy_table::Strings& groups,
policy_table::Strings& preconsented_groups) {
-
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
- LOG4CXX_TRACE_EXIT(logger_);
return true;
}
@@ -271,11 +311,11 @@ bool CacheManager::SetDeviceData(const std::string &device_id,
const std::string &carrier,
const uint32_t number_of_ports,
const std::string &connection_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock auto_lock(cache_lock_);
- LOG4CXX_TRACE_ENTER(logger_);
CACHE_MANAGER_CHECK(false);
- LOG4CXX_TRACE_EXIT(logger_);
+ Backup();
return true;
}
@@ -283,19 +323,19 @@ bool CacheManager::SetUserPermissionsForDevice(
const std::string &device_id,
const StringArray &consented_groups,
const StringArray &disallowed_groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock auto_lock(cache_lock_);
- LOG4CXX_TRACE_ENTER(logger_);
CACHE_MANAGER_CHECK(false);
- LOG4CXX_TRACE_EXIT(logger_);
+ Backup();
return true;
}
bool CacheManager::ReactOnUserDevConsentForApp(const std::string &app_id,
bool is_device_allowed) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
bool result = true;
- LOG4CXX_TRACE_EXIT(logger_);
+ Backup();
return result;
}
@@ -318,10 +358,10 @@ void CacheManager::GetGroupNameByHashID(const int32_t group_id,
bool CacheManager::SetUserPermissionsForApp(
const PermissionConsent &permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock auto_lock(cache_lock_);
- LOG4CXX_TRACE_ENTER(logger_);
CACHE_MANAGER_CHECK(false);
- LOG4CXX_TRACE_EXIT(logger_);
+ Backup();
return true;
}
@@ -330,16 +370,16 @@ bool CacheManager::UpdateRequired() const {
}
void CacheManager::SaveUpdateRequired(bool status) {
-
update_required = status;
+ Backup();
}
-bool CacheManager::IsApplicationRevoked(const std::string& app_id) {
+bool CacheManager::IsApplicationRevoked(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
bool is_revoked = false;
- if (pt_->policy_table.app_policies.end() !=
- pt_->policy_table.app_policies.find(app_id)) {
- is_revoked = pt_->policy_table.app_policies[app_id].is_null();
+ if (pt_->policy_table.app_policies_section.apps.end() !=
+ pt_->policy_table.app_policies_section.apps.find(app_id)) {
+ is_revoked = pt_->policy_table.app_policies_section.apps[app_id].is_null();
}
return is_revoked;
@@ -349,21 +389,21 @@ void CacheManager::CheckPermissions(const PTString &app_id,
const PTString &hmi_level,
const PTString &rpc,
CheckPermissionResult &result) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
- if (pt_->policy_table.app_policies.end() ==
- pt_->policy_table.app_policies.find(app_id)) {
+ if (pt_->policy_table.app_policies_section.apps.end() ==
+ pt_->policy_table.app_policies_section.apps.find(app_id)) {
LOG4CXX_ERROR(logger_, "Application id " << app_id
<< " was not found in policy DB.");
return;
}
policy_table::Strings::const_iterator app_groups_iter =
- pt_->policy_table.app_policies[app_id].groups.begin();
+ pt_->policy_table.app_policies_section.apps[app_id].groups.begin();
policy_table::Strings::const_iterator app_groups_iter_end =
- pt_->policy_table.app_policies[app_id].groups.end();
+ pt_->policy_table.app_policies_section.apps[app_id].groups.end();
policy_table::FunctionalGroupings::const_iterator concrete_group;
@@ -399,7 +439,6 @@ void CacheManager::CheckPermissions(const PTString &app_id,
}
}
}
- LOG4CXX_TRACE_EXIT(logger_);
}
bool CacheManager::IsPTPreloaded() {
@@ -412,7 +451,7 @@ int CacheManager::IgnitionCyclesBeforeExchange() {
const uint8_t limit = std::max(
static_cast<int>(
pt_->policy_table.module_config.exchange_after_x_ignition_cycles), 0);
-
+ LOG4CXX_DEBUG(logger_, "IgnitionCyclesBeforeExchange limit:" << limit);
uint8_t current = 0;
@@ -421,19 +460,22 @@ int CacheManager::IgnitionCyclesBeforeExchange() {
int CacheManager::KilometersBeforeExchange(int current) {
CACHE_MANAGER_CHECK(0);
- const uint8_t limit = std::max(
+ const int limit = std::max(
static_cast<int>(
pt_->policy_table.module_config.exchange_after_x_kilometers), 0);
- uint8_t last = 0;
+ LOG4CXX_DEBUG(logger_, "KilometersBeforeExchange limit:" << limit);
+ int last = 0;
- const uint8_t actual = std::max((current - last), 0);
+ const int actual = std::max((current - last), 0);
+ LOG4CXX_DEBUG(logger_, "KilometersBeforeExchange actual:" << actual);
return std::max(limit - actual, 0);
}
bool CacheManager::SetCountersPassedForSuccessfulUpdate(int kilometers,
int days_after_epoch) {
CACHE_MANAGER_CHECK(false);
+ Backup();
return true;
}
@@ -442,19 +484,23 @@ int CacheManager::DaysBeforeExchange(int current) {
const uint8_t limit = std::max(
static_cast<int>(
pt_->policy_table.module_config.exchange_after_x_days), 0);
+ LOG4CXX_DEBUG(logger_, "DaysBeforeExchange limit:" << limit);
uint8_t last = 0;
const uint8_t actaul = std::max((current - last), 0);
+ LOG4CXX_DEBUG(logger_, "DaysBeforeExchange actual:" << actaul);
return std::max(limit - actaul, 0);
}
void CacheManager::IncrementIgnitionCycles() {
CACHE_MANAGER_CHECK_VOID();
+ Backup();
}
void CacheManager::ResetIgnitionCycles() {
CACHE_MANAGER_CHECK_VOID();
+ Backup();
}
int CacheManager::TimeoutResponse() {
@@ -486,41 +532,69 @@ VehicleData CacheManager::GetVehicleData() {
std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg(
const std::vector<std::string> &msg_codes, const std::string &language) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
std::vector<UserFriendlyMessage> result;
CACHE_MANAGER_CHECK(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) {
+ policy_table::MessageLanguages msg_languages =
+ (*pt_->policy_table.consumer_friendly_messages->messages)[*it];
+
+ policy_table::MessageString message_string;
+
+ // If message has no records with required language, fallback language
+ // should be used instead.
+ LanguageFinder finder(language);
+ policy_table::Languages::const_iterator it_language =
+ std::find_if(msg_languages.languages.begin(),
+ msg_languages.languages.end(),
+ finder);
+
+ if (msg_languages.languages.end() == it_language) {
+ LOG4CXX_WARN(logger_, "Language " << language <<
+ " haven't been found for message code: " << *it);
+
+ LanguageFinder fallback_language_finder("en-us");
+
+ policy_table::Languages::const_iterator it_fallback_language =
+ std::find_if(msg_languages.languages.begin(),
+ msg_languages.languages.end(),
+ fallback_language_finder);
+
+ if (msg_languages.languages.end() == it_fallback_language) {
+ LOG4CXX_ERROR(logger_, "No fallback language found for message code: "
+ << *it);
+ continue;
+ }
+
+ message_string = it_fallback_language->second;
+ } else {
+ message_string = it_language->second;
+ }
+
UserFriendlyMessage msg;
msg.message_code = *it;
result.push_back(msg);
}
- LOG4CXX_TRACE_EXIT(logger_);
return result;
}
-EndpointUrls CacheManager::GetUpdateUrls(int service_type) {
- LOG4CXX_TRACE_ENTER(logger_);
-
- EndpointUrls result;
- CACHE_MANAGER_CHECK(result);
- char buff[32];
- sprintf(buff, "%x", service_type);
-
- std::string serv_type(buff);
- // TODO: remove this workaround
- if (service_type <= 0x9) {
- serv_type.insert(0,"0x0", 3);
- } else {
- serv_type.insert(0,"0x", 2);
+void CacheManager::GetServiceUrls(const std::string& service_type,
+ EndpointUrls& end_points) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ std::string search_value;
+ if (!IsNumberService(service_type, search_value)) {
+ search_value = service_type;
}
+ LOG4CXX_DEBUG(logger_, "Search service value is: " << search_value);
+
policy_table::ServiceEndpoints::const_iterator iter =
- pt_->policy_table.module_config.endpoints.find(serv_type);
+ pt_->policy_table.module_config.endpoints.find(search_value);
if (pt_->policy_table.module_config.endpoints.end() != iter) {
policy_table::URLList::const_iterator url_list_iter = (*iter).second.begin();
@@ -531,11 +605,16 @@ EndpointUrls CacheManager::GetUpdateUrls(int service_type) {
std::copy((*url_list_iter).second.begin(), (*url_list_iter).second.end(),
std::back_inserter(data.url));
- result.push_back(data);
+ end_points.push_back(data);
}
}
- LOG4CXX_TRACE_EXIT(logger_);
- return result;
+}
+
+std::string CacheManager::GetLockScreenIconUrl() const {
+ if (backup_) {
+ return backup_->GetLockScreenIconUrl();
+ }
+ return std::string ("");
}
int CacheManager::GetNotificationsNumber(const std::string &priority) {
@@ -554,10 +633,17 @@ int CacheManager::GetNotificationsNumber(const std::string &priority) {
bool CacheManager::GetPriority(const std::string &policy_app_id,
std::string &priority) {
CACHE_MANAGER_CHECK(false);
+ if (kDeviceId == policy_app_id) {
+ priority = EnumToJsonString(
+ pt_->policy_table.app_policies_section.device.priority);
+ return true;
+ }
+
const policy_table::ApplicationPolicies& policies =
- pt_->policy_table.app_policies;
+ pt_->policy_table.app_policies_section.apps;
- policy_table::ApplicationPolicies::const_iterator policy_iter = policies.find(policy_app_id);
+ policy_table::ApplicationPolicies::const_iterator policy_iter =
+ policies.find(policy_app_id);
const bool app_id_exists = policies.end() != policy_iter;
if (app_id_exists) {
priority = EnumToJsonString((*policy_iter).second.priority);
@@ -576,10 +662,130 @@ void CacheManager::CheckSnapshotInitialization() {
*(snapshot_->policy_table.module_config.preloaded_pt) = false;
}
+void CacheManager::PersistData() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (backup_.valid()) {
+ if (pt_.valid()) {
+
+ cache_lock_.Acquire();
+ policy_table::Table copy_pt(*pt_);
+ cache_lock_.Release();
+
+ backup_->Save(copy_pt);
+ backup_->SaveUpdateRequired(update_required);
+
+ policy_table::ApplicationPolicies::const_iterator app_policy_iter =
+ copy_pt.policy_table.app_policies_section.apps.begin();
+ policy_table::ApplicationPolicies::const_iterator app_policy_iter_end =
+ copy_pt.policy_table.app_policies_section.apps.end();
+
+ bool is_revoked = false;
+ bool is_default_policy;
+ bool is_predata_policy;
+
+ for (; app_policy_iter != app_policy_iter_end; ++app_policy_iter) {
+
+ const std::string app_id = (*app_policy_iter).first;
+
+ if (copy_pt.policy_table.app_policies_section.apps.end() !=
+ copy_pt.policy_table.app_policies_section.apps.find(app_id)) {
+ is_revoked = copy_pt.policy_table.app_policies_section.apps[app_id].is_null();
+ }
+
+ is_default_policy = copy_pt.policy_table.app_policies_section.apps.end() !=
+ copy_pt.policy_table.app_policies_section.apps.find(app_id) &&
+ policy::kDefaultId ==
+ copy_pt.policy_table.app_policies_section.apps[app_id].get_string();
+
+ // TODO(AOleynik): Remove this field from DB
+ is_predata_policy = copy_pt.policy_table.app_policies_section.apps.end() !=
+ copy_pt.policy_table.app_policies_section.apps.find(app_id) &&
+ policy::kPreDataConsentId ==
+ copy_pt.policy_table.app_policies_section.apps[app_id].get_string();
+
+ backup_->SaveApplicationCustomData(app_id,
+ is_revoked,
+ is_default_policy,
+ is_predata_policy);
+ is_revoked = false;
+ }
+
+ // In case of extended policy the meta info should be backuped as well.
+ backup_->WriteDb();
+ }
+ }
+}
+
+void CacheManager::ResetCalculatedPermissions() {
+ LOG4CXX_TRACE(logger_, "ResetCalculatedPermissions");
+ sync_primitives::AutoLock lock(calculated_permissions_lock_);
+ calculated_permissions_.clear();
+}
+
+void CacheManager::AddCalculatedPermissions(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ const Permissions& permissions) {
+ LOG4CXX_DEBUG(logger_, "AddCalculatedPermissions for device: " << device_id
+ << " and app: " << policy_app_id);
+ sync_primitives::AutoLock lock(calculated_permissions_lock_);
+ calculated_permissions_[device_id][policy_app_id] = permissions;
+}
+
+bool CacheManager::IsPermissionsCalculated(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ Permissions& permission) {
+ LOG4CXX_DEBUG(logger_, "IsPermissionsCalculated for device: " << device_id
+ << " and app: " << policy_app_id);
+ sync_primitives::AutoLock lock(calculated_permissions_lock_);
+ CalculatedPermissions::const_iterator it =
+ calculated_permissions_.find(device_id);
+
+ if (calculated_permissions_.end() == it) {
+ return false;
+ }
+
+ AppCalculatedPermissions::const_iterator app_it =
+ (*it).second.find(policy_app_id);
+ if ((*it).second.end() == app_it) {
+ return false;
+ } else {
+ permission = (*app_it).second;
+ return true;
+ }
+ return false;
+}
+
+bool policy::CacheManager::IsNumberService(const std::string& input,
+ std::string& output) const {
+ const char* input_value = input.c_str();
+ char* endptr;
+ const int base = 10;
+ errno = 0;
+ uint32_t service_value = strtoul(input_value, &endptr, base);
+ bool is_real_zero_value =
+ (!service_value && endptr != input_value && *endptr == '\0');
+ if (!is_real_zero_value && (!service_value || errno == ERANGE)) {
+ return false;
+ }
+
+ output = input;
+ if (service_value <= 9) {
+ output.insert(0,"0x0", 3);
+ } else {
+ output.insert(0,"0x", 2);
+ }
+
+ return true;
+}
+
utils::SharedPtr<policy_table::Table>
CacheManager::GenerateSnapshot() {
CACHE_MANAGER_CHECK(snapshot_);
- snapshot_ = utils::SharedPtr<policy_table::Table>(new policy_table::Table(pt_->policy_table));
+ sync_primitives::AutoLock lock(cache_lock_);
+ snapshot_ = new policy_table::Table();
+ snapshot_->policy_table = pt_->policy_table;
CheckSnapshotInitialization();
return snapshot_;
}
@@ -588,50 +794,54 @@ bool CacheManager::GetInitialAppData(const std::string& app_id,
StringArray& nicknames,
StringArray& app_hmi_types) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
policy_table::ApplicationPolicies::const_iterator policy_iter =
- pt_->policy_table.app_policies.find(app_id);
+ pt_->policy_table.app_policies_section.apps.find(app_id);
- if (pt_->policy_table.app_policies.end() != policy_iter) {
+ if (pt_->policy_table.app_policies_section.apps.end() != policy_iter) {
const policy_table::ApplicationParams& app_params = (*policy_iter).second;
std::copy(app_params.nicknames->begin(), app_params.nicknames->end(),
std::back_inserter(nicknames));
std::transform(app_params.AppHMIType->begin(), app_params.AppHMIType->end(),
- std::back_inserter(nicknames), AppHMITypeToString());
+ std::back_inserter(app_hmi_types), AppHMITypeToString());
}
- LOG4CXX_TRACE_EXIT(logger_);
return true;
}
bool CacheManager::GetFunctionalGroupings(
policy_table::FunctionalGroupings& groups) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
const policy_table::FunctionalGroupings& f_groupings =
pt_->policy_table.functional_groupings;
groups.insert(f_groupings.begin(), f_groupings.end());
- LOG4CXX_TRACE_EXIT(logger_);
return true;
}
-bool CacheManager::CountUnconsentedGroups(const std::string& policy_app_id,
- const std::string& device_id,
- int& result) {
- LOG4CXX_TRACE_ENTER(logger_);
+int CacheManager::CountUnconsentedGroups(const std::string& policy_app_id,
+ const std::string& device_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
- LOG4CXX_TRACE_EXIT(logger_);
- return true;
+ LOG4CXX_DEBUG(logger_, "Application id: " << policy_app_id);
+ int result = 0;
+ return result;
}
bool CacheManager::SetMetaInfo(const std::string &ccpu_version,
const std::string &wers_country_code,
const std::string &language) {
CACHE_MANAGER_CHECK(false);
+
+ // We have to set preloaded flag as false in policy table on any response
+ // of GetSystemInfo (SDLAQ-CRS-2365)
+ *pt_->policy_table.module_config.preloaded_pt = false;
+
+ Backup();
return true;
}
@@ -643,11 +853,12 @@ bool CacheManager::IsMetaInfoPresent() const {
bool CacheManager::SetSystemLanguage(const std::string &language) {
CACHE_MANAGER_CHECK(false);
+ Backup();
return true;
}
bool CacheManager::GetFunctionalGroupNames(FunctionalGroupNames &names) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
rpc::policy_table_interface_base::FunctionalGroupings::iterator iter =
pt_->policy_table.functional_groupings.begin();
@@ -661,39 +872,38 @@ bool CacheManager::GetFunctionalGroupNames(FunctionalGroupNames &names) {
names.insert(std::pair<uint32_t, std::pair<std::string, std::string> >(id, value));
}
- LOG4CXX_TRACE_EXIT(logger_);
return true;
}
-bool CacheManager::CleanupUnpairedDevices(const DeviceIds &device_ids) {
+bool CacheManager::CleanupUnpairedDevices() {
CACHE_MANAGER_CHECK(false);
+ Backup();
return true;
}
void CacheManager::Increment(usage_statistics::GlobalCounterId type) {
CACHE_MANAGER_CHECK_VOID();
+ Backup();
}
void CacheManager::Increment(const std::string &app_id,
usage_statistics::AppCounterId type) {
CACHE_MANAGER_CHECK_VOID();
+ Backup();
}
void CacheManager::Set(const std::string &app_id,
usage_statistics::AppInfoId type,
const std::string &value) {
CACHE_MANAGER_CHECK_VOID();
+ Backup();
}
void CacheManager::Add(const std::string &app_id,
usage_statistics::AppStopwatchId type,
int seconds) {
CACHE_MANAGER_CHECK_VOID();
-}
-
-void CacheManager::CopyInternalParams(const std::string &from,
- const std::string& to) {
- is_predata_[to] = is_predata_[from];
+ Backup();
}
long CacheManager::ConvertSecondsToMinute(int seconds) {
@@ -704,41 +914,34 @@ long CacheManager::ConvertSecondsToMinute(int seconds) {
bool CacheManager::SetDefaultPolicy(const std::string &app_id) {
CACHE_MANAGER_CHECK(false);
policy_table::ApplicationPolicies::const_iterator iter =
- pt_->policy_table.app_policies.find(kDefaultId);
- if (pt_->policy_table.app_policies.end() != iter) {
- pt_->policy_table.app_policies[app_id] =
- pt_->policy_table.app_policies[kDefaultId];
+ pt_->policy_table.app_policies_section.apps.find(kDefaultId);
+ if (pt_->policy_table.app_policies_section.apps.end() != iter) {
+ pt_->policy_table.app_policies_section.apps[app_id] =
+ pt_->policy_table.app_policies_section.apps[kDefaultId];
- CopyInternalParams(kDefaultId, app_id);
- SetIsDefault(app_id, true);
- SetIsPredata(app_id, false);
-
- pt_->policy_table.app_policies[app_id].set_to_string(kDefaultId);
+ SetIsDefault(app_id);
}
+ Backup();
return true;
}
bool CacheManager::IsDefaultPolicy(const std::string& app_id) {
CACHE_MANAGER_CHECK(false);
const bool result =
- pt_->policy_table.app_policies.end() !=
- pt_->policy_table.app_policies.find(app_id) &&
- !pt_->policy_table.app_policies[app_id].get_string().empty();
+ pt_->policy_table.app_policies_section.apps.end() !=
+ pt_->policy_table.app_policies_section.apps.find(app_id) &&
+ policy::kDefaultId ==
+ pt_->policy_table.app_policies_section.apps[app_id].get_string();
return result;
}
-bool CacheManager::SetIsDefault(const std::string& app_id,
- bool is_default) {
+bool CacheManager::SetIsDefault(const std::string& app_id) {
CACHE_MANAGER_CHECK(false);
policy_table::ApplicationPolicies::const_iterator iter =
- pt_->policy_table.app_policies.find(app_id);
- if (pt_->policy_table.app_policies.end() != iter) {
- if (is_default) {
- pt_->policy_table.app_policies[app_id].set_to_string("default");
- } else {
- pt_->policy_table.app_policies[app_id].set_to_string("");
- }
+ pt_->policy_table.app_policies_section.apps.find(app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() != iter) {
+ pt_->policy_table.app_policies_section.apps[app_id].set_to_string(kDefaultId);
}
return true;
}
@@ -746,67 +949,85 @@ bool CacheManager::SetIsDefault(const std::string& app_id,
bool CacheManager::SetPredataPolicy(const std::string &app_id) {
CACHE_MANAGER_CHECK(false);
policy_table::ApplicationPolicies::const_iterator iter =
- pt_->policy_table.app_policies.find(kPreDataConsentId);
+ pt_->policy_table.app_policies_section.apps.find(kPreDataConsentId);
- if (pt_->policy_table.app_policies.end() != iter) {
- pt_->policy_table.app_policies[app_id] =
- pt_->policy_table.app_policies[kPreDataConsentId];
+ if (pt_->policy_table.app_policies_section.apps.end() == iter) {
+ LOG4CXX_ERROR(logger_, "Could not set " << kPreDataConsentId
+ << " permissions for app " << app_id);
+ return false;
+ }
- CopyInternalParams(kPreDataConsentId, app_id);
+ pt_->policy_table.app_policies_section.apps[app_id] =
+ pt_->policy_table.app_policies_section.apps[kPreDataConsentId];
- SetIsPredata(app_id, true);
- SetIsDefault(app_id, false);
- }
- return true;
-}
+ pt_->policy_table.app_policies_section.apps[app_id].set_to_string(kPreDataConsentId);
-bool CacheManager::SetIsPredata(const std::string &app_id, bool is_pre_data) {
- is_predata_[app_id] = is_pre_data;
+ Backup();
return true;
}
bool CacheManager::IsPredataPolicy(const std::string &app_id) {
- const bool result =
- (is_predata_.end() != is_predata_.find(app_id)) && is_predata_[app_id];
- return result;
-}
+ // TODO(AOleynik): Maybe change for comparison with pre_DataConsent
+ // permissions or check string value from get_string()
+ policy_table::ApplicationParams& pre_data_app =
+ pt_->policy_table.app_policies_section.apps[kPreDataConsentId];
+ policy_table::ApplicationParams& specific_app =
+ pt_->policy_table.app_policies_section.apps[app_id];
-bool CacheManager::SetUnpairedDevice(const std::string &device_id) {
+ policy_table::Strings res;
+ std::set_intersection(pre_data_app.groups.begin(),
+ pre_data_app.groups.end(),
+ specific_app.groups.begin(),
+ specific_app.groups.end(),
+ std::back_inserter(res));
- const bool result = is_unpaired_.end() != is_unpaired_.find(device_id);
- if (result) {
- is_unpaired_[device_id] = true;
- }
- return result;
-}
+ bool is_marked_as_predata =
+ kPreDataConsentId ==
+ pt_->policy_table.app_policies_section.apps[app_id].get_string();
-bool CacheManager::UnpairedDevicesList(DeviceIds& device_ids) {
+ return !res.empty() && is_marked_as_predata;
+}
- std::map<std::string, bool>::const_iterator iter = is_unpaired_.begin();
- std::map<std::string, bool>::const_iterator iter_end = is_unpaired_.end();
+bool CacheManager::SetUnpairedDevice(const std::string &device_id,
+ bool unpaired) {
+ const bool result =
+ pt_->policy_table.device_data->end() !=
+ pt_->policy_table.device_data->find(device_id);
+ if (!result) {
+ LOG4CXX_DEBUG(logger_, "Couldn't set unpaired flag for device id "
+ << device_id << " , since it wasn't found.");
+ return false;
+ }
- for (; iter != iter_end; ++iter) {
- if ((*iter).second) {
- device_ids.push_back((*iter).first);
- }
+ sync_primitives::AutoLock lock(unpaired_lock_);
+ if (unpaired) {
+ is_unpaired_.insert(device_id);
+ LOG4CXX_DEBUG(logger_, "Unpaired flag was set for device id " << device_id);
+ } else {
+ is_unpaired_.erase(device_id);
+ LOG4CXX_DEBUG(logger_, "Unpaired flag was removed for device id " << device_id);
}
- return true;
+ return result;
}
bool CacheManager::SetVINValue(const std::string& value) {
CACHE_MANAGER_CHECK(false);
+ Backup();
return true;
}
bool CacheManager::IsApplicationRepresented(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
+ if (kDeviceId == app_id) {
+ return true;
+ }
policy_table::ApplicationPolicies::const_iterator iter =
- pt_->policy_table.app_policies.find(app_id);
- return pt_->policy_table.app_policies.end() != iter;
+ pt_->policy_table.app_policies_section.apps.find(app_id);
+ return pt_->policy_table.app_policies_section.apps.end() != iter;
}
bool CacheManager::Init(const std::string& file_name) {
- LOG4CXX_INFO(logger_, "CacheManager::Init");
+ LOG4CXX_AUTO_TRACE(logger_);
InitResult init_result = backup_->Init();
@@ -829,83 +1050,73 @@ bool CacheManager::Init(const std::string& file_name) {
return result;
}
-void CacheManager::FillAppSpecificData() {
- CACHE_MANAGER_CHECK_VOID();
- policy_table::ApplicationPolicies::const_iterator iter =
- pt_->policy_table.app_policies.begin();
- policy_table::ApplicationPolicies::const_iterator iter_end =
- pt_->policy_table.app_policies.begin();
-
- for (; iter != iter_end; ++iter) {
- const std::string& app_name = (*iter).first;
-
- is_predata_.insert(std::make_pair(app_name, backup_->IsPredataPolicy(app_name)));
- }
-}
-
void CacheManager::FillDeviceSpecificData() {
}
bool CacheManager::LoadFromBackup() {
+ sync_primitives::AutoLock lock(cache_lock_);
pt_ = backup_->GenerateSnapshot();
update_required = backup_->UpdateRequired();
- FillAppSpecificData();
FillDeviceSpecificData();
return true;
}
bool CacheManager::LoadFromFile(const std::string& file_name) {
-
- LOG4CXX_INFO(logger_, "CacheManager::LoadFromFile");
+ LOG4CXX_AUTO_TRACE(logger_);
BinaryMessage json_string;
- bool final_result = false;
- final_result = file_system::ReadBinaryFile(file_name, json_string);
- if (!final_result) {
- LOG4CXX_WARN(logger_, "Failed to read pt file.");
- return final_result;
+ if (!file_system::ReadBinaryFile(file_name, json_string)) {
+ LOG4CXX_FATAL(logger_, "Failed to read pt file.");
+ return false;
}
Json::Value value;
Json::Reader reader(Json::Features::strictMode());
std::string json(json_string.begin(), json_string.end());
- bool ok = reader.parse(json.c_str(), value);
- if (ok) {
- pt_ = new policy_table::Table(&value);
- } else {
- LOG4CXX_WARN(logger_, reader.getFormattedErrorMessages());
- }
-
- if (!pt_) {
- LOG4CXX_WARN(logger_, "Failed to parse policy table");
+ if (!reader.parse(json.c_str(), value)) {
+ LOG4CXX_FATAL(
+ logger_,
+ "Preloaded PT is corrupted: " << reader.getFormattedErrorMessages());
return false;
}
- if (!pt_->is_valid()) {
+ LOG4CXX_TRACE(logger_, "Start create PT");
+ sync_primitives::AutoLock locker(cache_lock_);
+ backup_->Clear();
+
+ pt_ = new policy_table::Table(&value);
+ if (pt_->is_valid()) {
+ if (backup_->Save(*pt_)) {
+ backup_->WriteDb();
+ return true;
+ } else {
+ LOG4CXX_FATAL(logger_, "Failed to save PT");
+ return false;
+ }
+ } else {
rpc::ValidationReport report("policy_table");
pt_->ReportErrors(&report);
- LOG4CXX_WARN(logger_, "Parsed table is not valid " <<
- rpc::PrettyFormat(report));
+ LOG4CXX_FATAL(logger_,
+ "Parsed table is not valid " << rpc::PrettyFormat(report));
+ return false;
}
-
- final_result = backup_->Save(*pt_);
- LOG4CXX_INFO(
- logger_,
- "Loading from file was " << (final_result ? "successful" : "unsuccessful"));
- return final_result;
}
bool CacheManager::ResetPT(const std::string& file_name) {
bool result = true;
+ Backup();
return result;
}
bool CacheManager::AppExists(const std::string &app_id) const {
CACHE_MANAGER_CHECK(false);
+ if (kDeviceId == app_id) {
+ return true;
+ }
policy_table::ApplicationPolicies::iterator policy_iter =
- pt_->policy_table.app_policies.find(app_id);
- return pt_->policy_table.app_policies.end() != policy_iter;
+ pt_->policy_table.app_policies_section.apps.find(app_id);
+ return pt_->policy_table.app_policies_section.apps.end() != policy_iter;
}
int32_t CacheManager::GenerateHash(const std::string& str_to_hash) {
@@ -924,4 +1135,76 @@ int32_t CacheManager::GenerateHash(const std::string& str_to_hash) {
return result;
}
+void CacheManager::GetAppRequestTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_types) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ 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 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));
+ }
+ return;
+}
+
+CacheManager::BackgroundBackuper::BackgroundBackuper(CacheManager* cache_manager)
+ : cache_manager_(cache_manager),
+ stop_flag_(false),
+ new_data_available_(false) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+CacheManager::BackgroundBackuper::~BackgroundBackuper() {
+ LOG4CXX_AUTO_TRACE(logger_);
}
+
+void CacheManager::BackgroundBackuper::InternalBackup() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(cache_manager_);
+
+ while (new_data_available_) {
+ new_data_available_ = false;
+ LOG4CXX_DEBUG(logger_, "DoBackup");
+ cache_manager_->PersistData();
+ }
+}
+
+void CacheManager::BackgroundBackuper::threadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(need_backup_lock_);
+ while (!stop_flag_) {
+ need_backup_lock_.Release();
+ InternalBackup();
+ need_backup_lock_.Acquire();
+ if (new_data_available_ || stop_flag_) {
+ continue;
+ }
+ LOG4CXX_DEBUG(logger_, "Wait for a next backup");
+ backup_notifier_.Wait(need_backup_lock_);
+ }
+}
+
+void CacheManager::BackgroundBackuper::exitThreadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(need_backup_lock_);
+ stop_flag_ = true;
+ backup_notifier_.NotifyOne();
+}
+
+void CacheManager::BackgroundBackuper::DoBackup() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(need_backup_lock_);
+ new_data_available_ = true;
+ backup_notifier_.NotifyOne();
+}
+
+} // namespace policy
diff --git a/src/components/policy/src/policy/src/policy_helper.cc b/src/components/policy/src/policy/src/policy_helper.cc
index 71f91aea6..5a32f6f5f 100644
--- a/src/components/policy/src/policy/src/policy_helper.cc
+++ b/src/components/policy/src/policy/src/policy_helper.cc
@@ -43,21 +43,54 @@ namespace {
CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyManagerImpl")
-bool Match(const StringsValueType& first_name,
- const StringsValueType& second_name) {
- const std::string& first = first_name;
- const std::string& second = second_name;
- return (strcasecmp(first.c_str(), second.c_str()) == 0);
-}
-
bool Compare(const StringsValueType& first, const StringsValueType& second) {
const std::string& first_str = first;
const std::string& second_str = second;
return (strcasecmp(first_str.c_str(), second_str.c_str()) < 0);
}
+struct CheckGroupName {
+ CheckGroupName(const policy::StringsValueType& value)
+ : value_(value) {
+ }
+
+ bool operator()(const FunctionalGroupNames::value_type& value) {
+ return value.second.second == std::string(value_);
+ }
+
+private:
+ const policy::StringsValueType& value_;
+};
+
+struct CopyAttributes{
+ CopyAttributes(const FunctionalGroupNames& groups_attributes,
+ std::vector<FunctionalGroupPermission>& groups_permissions)
+ : groups_attributes_(groups_attributes),
+ groups_permissions_(groups_permissions) {
+ }
+
+bool operator()(const policy::StringsValueType& value) {
+ CheckGroupName checker(value);
+ FunctionalGroupNames::const_iterator it =
+ std::find_if(groups_attributes_.begin(), groups_attributes_.end(),
+ checker);
+ if (groups_attributes_.end() == it) {
+ return false;
+ }
+ FunctionalGroupPermission group;
+ group.group_name = it->second.second;
+ group.group_alias = it->second.first;
+ group.group_id = it->first;
+ groups_permissions_.push_back(group);
+ return true;
}
+private:
+ const FunctionalGroupNames& groups_attributes_;
+ std::vector<FunctionalGroupPermission>& groups_permissions_;
+};
+} // namespace
+
CompareGroupName::CompareGroupName(const StringsValueType& group_name)
: group_name_(group_name) {
}
@@ -71,7 +104,6 @@ bool CompareGroupName::operator()(
bool operator!=(const policy_table::ApplicationParams& first,
const policy_table::ApplicationParams& second) {
- // TODO(AOleynik): Add comparing of Ford-specific and other parameters
if (first.groups.size() != second.groups.size()) {
return true;
}
@@ -98,17 +130,53 @@ CheckAppPolicy::CheckAppPolicy(
snapshot_(snapshot) {
}
-bool CheckAppPolicy::HasSameGroups(const AppPoliciesValueType& app_policy,
- AppPermissions* perms) const {
- const std::string app_id = app_policy.first;
- AppPoliciesConstItr it = snapshot_->policy_table.app_policies.find(app_id);
+bool policy::CheckAppPolicy::HasRevokedGroups(
+ const policy::AppPoliciesValueType& app_policy,
+ policy_table::Strings* revoked_groups) const {
+ AppPoliciesConstItr it =
+ snapshot_->policy_table.app_policies_section.apps.find(app_policy.first);
- if (app_policy.second.is_string()) {
- return (it->second.is_string() &&
- app_policy.second.get_string().compare(it->second.get_string())
- == 0);
+ policy_table::Strings groups_new = app_policy.second.groups;
+ std::sort(groups_new.begin(), groups_new.end(), Compare);
+
+ policy_table::Strings groups_curr = (*it).second.groups;
+ std::sort(groups_curr.begin(), groups_curr.end(), Compare);
+
+ StringsConstItr it_groups_new = groups_new.begin();
+ StringsConstItr it_groups_new_end = groups_new.end();
+
+ StringsConstItr it_groups_curr = groups_curr.begin();
+ StringsConstItr it_groups_curr_end = groups_curr.end();
+
+ policy_table::Strings revoked_group_list;
+ std::set_difference(it_groups_curr, it_groups_curr_end,
+ it_groups_new, it_groups_new_end,
+ std::back_inserter(revoked_group_list), Compare);
+
+ // Remove groups which are not required user consent
+ policy_table::Strings::iterator it_revoked = revoked_group_list.begin();
+ for (;revoked_group_list.end() != it_revoked; ) {
+ if (!IsConsentRequired(app_policy.first, std::string(*it_revoked))) {
+ revoked_group_list.erase(it_revoked);
+ it_revoked = revoked_group_list.begin();
+ } else {
+ ++it_revoked;
+ }
}
+ if (revoked_groups) {
+ *revoked_groups = revoked_group_list;
+ }
+
+ return !revoked_group_list.empty();
+}
+
+bool policy::CheckAppPolicy::HasNewGroups(
+ const policy::AppPoliciesValueType& app_policy,
+ policy_table::Strings* new_groups) const {
+ AppPoliciesConstItr it =
+ snapshot_->policy_table.app_policies_section.apps.find(app_policy.first);
+
policy_table::Strings groups_new = app_policy.second.groups;
std::sort(groups_new.begin(), groups_new.end(), Compare);
@@ -121,137 +189,118 @@ bool CheckAppPolicy::HasSameGroups(const AppPoliciesValueType& app_policy,
StringsConstItr it_groups_curr = groups_curr.begin();
StringsConstItr it_groups_curr_end = groups_curr.end();
- StringsConstItr new_it = it_groups_new;
- StringsConstItr old_it = it_groups_curr;
+ policy_table::Strings new_group_list;
+ std::set_difference(it_groups_new, it_groups_new_end,
+ it_groups_curr, it_groups_curr_end,
+ std::back_inserter(new_group_list), Compare);
- std::pair<StringsConstItr, StringsConstItr> diff;
+ if (new_groups) {
+ *new_groups = new_group_list;
+ }
- while (it_groups_new_end != new_it && it_groups_curr_end != old_it) {
- size_t size = ((it_groups_new_end - new_it) > (it_groups_curr_end - old_it))
- ? it_groups_curr_end - old_it : it_groups_new_end - new_it;
- diff = std::mismatch(old_it, old_it + size, new_it, Match);
- if (it_groups_curr_end == diff.first || it_groups_new_end == diff.second) {
- new_it = diff.second;
- old_it = diff.first;
- break;
- }
- if (Compare(*diff.first, *diff.second) &&
- IsConsentRequired(*(diff.first))) {
- perms->isAppPermissionsRevoked = true;
- FunctionalGroupPermission group;
- group.group_name = *(diff.first);
- perms->appRevokedPermissions.push_back(group);
- old_it = ++diff.first;
- new_it = diff.second;
- } else {
- // according to the SDLAQ-CRS-2757 we have to set
- // appPermissionsConsentNeeded should not be set to true
- // in case if this group is auto-allowed
- perms->appPermissionsConsentNeeded = IsConsentRequired(*new_it);
- old_it = diff.first;
- new_it = ++diff.second;
- }
+ return !new_group_list.empty();
+}
+
+bool policy::CheckAppPolicy::HasConsentNeededGroups(
+ const policy::AppPoliciesValueType& app_policy) const {
+ policy_table::Strings new_groups;
+ if (!HasNewGroups(app_policy, &new_groups)) {
+ return false;
}
- for (StringsConstItr it = old_it; it != it_groups_curr_end; ++it) {
- if (!IsConsentRequired(*it)) {
- continue;
+ StringsConstItr it_new = new_groups.begin();
+ StringsConstItr it_new_end = new_groups.end();
+ for (; it_new != it_new_end; ++it_new) {
+ if (IsConsentRequired(app_policy.first, *it_new)) {
+ return true;
}
- perms->isAppPermissionsRevoked = true;
- FunctionalGroupPermission group;
- group.group_name = *it;
- perms->appRevokedPermissions.push_back(group);
}
- if (it_groups_new_end != new_it) {
- perms->appPermissionsConsentNeeded = true;
- }
+ return false;
+}
- if (perms->isAppPermissionsRevoked) {
+std::vector<FunctionalGroupPermission>
+policy::CheckAppPolicy::GetRevokedGroups(
+ const policy::AppPoliciesValueType& app_policy) const {
+ policy_table::Strings revoked_groups_names;
+ if (!HasRevokedGroups(app_policy, &revoked_groups_names)) {
+ return std::vector<FunctionalGroupPermission>();
+ }
- std::vector<policy::FunctionalGroupPermission>::const_iterator it =
- perms->appRevokedPermissions.begin();
- std::vector<policy::FunctionalGroupPermission>::const_iterator it_end =
- perms->appRevokedPermissions.end();
- for (;it != it_end; ++it) {
- pm_->RemoveAppConsentForGroup(perms->application_id, it->group_name);
- }
+ FunctionalGroupNames groups_attributes;
+ if (!pm_->cache_->GetFunctionalGroupNames(groups_attributes)) {
+ LOG4CXX_WARN(logger_, "Can't get functional group names");
+ return std::vector<FunctionalGroupPermission>();
}
+ std::vector<FunctionalGroupPermission> revoked_groups_permissions;
+ CopyAttributes copier(groups_attributes, revoked_groups_permissions);
+ std::for_each(revoked_groups_names.begin(), revoked_groups_names.end(),
+ copier);
- return !(perms->appRevokedPermissions.size() > 0
- || perms->appPermissionsConsentNeeded);
+ return revoked_groups_permissions;
}
-bool CheckAppPolicy::IsNewAppication(const std::string& application_id) const {
+void policy::CheckAppPolicy::RemoveRevokedConsents(
+ const AppPoliciesValueType& app_policy,
+ const std::vector<FunctionalGroupPermission>& revoked_groups) const {
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ revoked_groups.begin();
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it_end =
+ revoked_groups.end();
+ for (;it != it_end; ++it) {
+ pm_->RemoveAppConsentForGroup(app_policy.first, it->group_name);
+ }
+}
+
+bool CheckAppPolicy::IsKnownAppication(
+ const std::string& application_id) const {
const policy_table::ApplicationPolicies& current_policies =
- snapshot_->policy_table.app_policies;
- AppPoliciesConstItr it_app_policies_curr = current_policies.begin();
- AppPoliciesConstItr it_app_policies_curr_end = current_policies.end();
+ snapshot_->policy_table.app_policies_section.apps;
- for (; it_app_policies_curr != it_app_policies_curr_end;
- ++it_app_policies_curr) {
+ return !(current_policies.end() == current_policies.find(application_id));
+}
- // Find necessary application in current snapshot
- const std::string application_id_curr = (*it_app_policies_curr).first;
- if (application_id == application_id_curr) {
- return false;
- }
- }
- return true;
+void policy::CheckAppPolicy::NotifySystem(
+ const policy::AppPoliciesValueType& app_policy) const {
+ pm_->listener()->OnPendingPermissionChange(app_policy.first);
}
-void CheckAppPolicy::SendNotification(
+void CheckAppPolicy::SendPermissionsToApp(
const AppPoliciesValueType& app_policy) const {
- // Collecting all available rpcs and their parameters from updated
- // policies and fill notification data struct
- Permissions notification_data;
+ const std::string app_id = app_policy.first;
- // Get current user permissions for groups from DB
- std::vector<FunctionalGroupPermission> group_permissons;
- // Get current device_id from application id
- const std::string device_id = pm_->GetCurrentDeviceId(app_policy.first);
+ const std::string device_id = pm_->GetCurrentDeviceId(app_id);
if (device_id.empty()) {
- LOG4CXX_WARN(logger_, "Couldn't find device info for application id "
- "'" << app_policy.first << "'");
+ LOG4CXX_WARN(logger_, "Couldn't find device info for application id: "
+ << app_id);
return;
}
- pm_->GetPermissionsForApp(device_id, app_policy.first, group_permissons);
+ std::vector<FunctionalGroupPermission> group_permissons;
+ pm_->GetPermissionsForApp(device_id, app_id, group_permissons);
+ Permissions notification_data;
pm_->PrepareNotificationData(update_->policy_table.functional_groupings,
app_policy.second.groups,
group_permissons, notification_data);
- const std::string app_id = app_policy.first;
- LOG4CXX_INFO(logger_, "Send notification for application_id:" << app_id);
+ LOG4CXX_INFO(logger_, "Send notification for application_id: " << app_id);
// Default_hmi is Ford-specific and should not be used with basic policy
const std::string default_hmi;
pm_->listener()->OnPermissionsUpdated(app_id, notification_data, default_hmi);
}
-void CheckAppPolicy::SendOnPendingPermissions(
- const AppPoliciesValueType& app_policy, AppPermissions permissions) const {
- // TODO(AOleynik): Exclude default group(s)
- if (permissions.appPermissionsConsentNeeded) {
- }
- // TODO(AOleynik): Seems, it is unused part?
- if (permissions.isAppPermissionsRevoked) {
- pm_->app_permissions_diff_.insert(
- std::make_pair(app_policy.first, permissions));
- pm_->listener()->OnPendingPermissionChange(app_policy.first);
- }
-}
-
bool CheckAppPolicy::IsAppRevoked(
const AppPoliciesValueType& app_policy) const {
+ LOG4CXX_AUTO_TRACE(logger_);
// Application params are not initialized = application revoked
// i.e. "123":null
return app_policy.second.is_null();
}
bool CheckAppPolicy::NicknamesMatch(
- const std::string app_id,
const AppPoliciesValueType& app_policy) const {
+ const std::string& app_id = app_policy.first;
std::string app_name = pm_->listener()->GetAppName(app_id);
if (!app_name.empty() &&
app_policy.second.nicknames &&
@@ -260,7 +309,7 @@ bool CheckAppPolicy::NicknamesMatch(
app_policy.second.nicknames->begin();
app_policy.second.nicknames->end() != it; ++it) {
std::string temp = *it;
- if (temp.compare(app_name) == 0) {
+ if (!strcasecmp(temp.c_str(), app_name.c_str())) {
return true;
}
}
@@ -270,58 +319,32 @@ bool CheckAppPolicy::NicknamesMatch(
}
bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
- policy_table::ApplicationPolicies& current_policies =
- snapshot_->policy_table.app_policies;
-
const std::string app_id = app_policy.first;
- AppPermissions permissions_diff(app_id);
- permissions_diff.priority = policy_table::EnumToJsonString(
- app_policy.second.priority);
-
- // Check revocation
- if (!IsPredefinedApp(app_policy) && IsAppRevoked(app_policy)) {
- permissions_diff.appRevoked = true;
- pm_->app_permissions_diff_.insert(std::make_pair(app_id, permissions_diff));
- pm_->listener()->OnAppRevoked(app_id);
- policy_table::ApplicationPolicies::iterator it = current_policies.find(
- app_id);
- // Update snapshot with new policies for application
- if (it != current_policies.end()) {
- // Update
- (*it).second = app_policy.second;
- it->second.set_to_null();
- } else {
- // Add
- current_policies[app_policy.first] = app_policy.second;
- }
+ if (!IsKnownAppication(app_id)) {
+ LOG4CXX_WARN(logger_, "Application:" << app_id <<
+ " is not present in snapshot.");
return true;
}
- // TODO(PV): do we really need this check?
- if (IsNewAppication(app_id)) {
- // Update snapshot with policies for new application
- current_policies[app_id] = app_policy.second;
- SendNotification(app_policy);
- SendOnPendingPermissions(app_policy, permissions_diff);
+ if (!IsPredefinedApp(app_policy) && IsAppRevoked(app_policy)) {
+ SetPendingPermissions(app_policy, RESULT_APP_REVOKED);
+ NotifySystem(app_policy);
return true;
}
- if (!IsPredefinedApp(app_policy) && !NicknamesMatch(app_id, app_policy)) {
- permissions_diff.appUnauthorized = true;
- pm_->app_permissions_diff_.insert(std::make_pair(app_id, permissions_diff));
- pm_->listener()->OnPendingPermissionChange(app_policy.first);
- policy_table::ApplicationPolicies::iterator it = current_policies.find(
- app_id);
- // Update snapshot with new policies for application
- if (it != current_policies.end()) {
- (*it).second = app_policy.second;
- it->second.set_to_null();
- }
+ if (!IsPredefinedApp(app_policy) && !NicknamesMatch(app_policy)) {
+ SetPendingPermissions(app_policy, RESULT_NICKNAME_MISMATCH);
+ NotifySystem(app_policy);
return true;
}
- if (HasSameGroups(app_policy, &permissions_diff)) {
+ PermissionsCheckResult result = CheckPermissionsChanges(app_policy);
+ if (!IsPredefinedApp(app_policy) && IsRequestTypeChanged(app_policy)) {
+ SetPendingPermissions(app_policy, RESULT_REQUEST_TYPE_CHANGED);
+ NotifySystem(app_policy);
+ }
+ if (RESULT_NO_CHANGES == result) {
LOG4CXX_INFO(logger_, "Permissions for application:" << app_id <<
" wasn't changed.");
return true;
@@ -330,28 +353,127 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
LOG4CXX_INFO(logger_, "Permissions for application:" << app_id <<
" have been changed.");
- policy_table::ApplicationPolicies::iterator it = current_policies.find(
- app_id);
- // Update snapshot with new policies for application
- (*it).second = app_policy.second;
+ if (!IsPredefinedApp(app_policy) && RESULT_CONSENT_NOT_REQIURED != result) {
+ SetPendingPermissions(app_policy, result);
+ NotifySystem(app_policy);
+ }
// Don't sent notification for predefined apps (e.g. default, device etc.)
if (!IsPredefinedApp(app_policy)) {
- SendNotification(app_policy);
- SendOnPendingPermissions(app_policy, permissions_diff);
+ SendPermissionsToApp(app_policy);
}
return true;
}
-bool CheckAppPolicy::IsConsentRequired(const std::string& group_name) const {
+void policy::CheckAppPolicy::SetPendingPermissions(
+ const AppPoliciesValueType& app_policy,
+ PermissionsCheckResult result) const {
+ const std::string app_id = app_policy.first;
+ AppPermissions permissions_diff(app_id);
+ permissions_diff.priority = policy_table::EnumToJsonString(
+ app_policy.second.priority);
+
+ switch (result) {
+ case RESULT_APP_REVOKED:
+ permissions_diff.appRevoked = true;
+ break;
+ case RESULT_NICKNAME_MISMATCH:
+ permissions_diff.appUnauthorized = true;
+ break;
+ case RESULT_PERMISSIONS_REVOKED:
+ permissions_diff.isAppPermissionsRevoked = true;
+ permissions_diff.appRevokedPermissions = GetRevokedGroups(app_policy);
+ RemoveRevokedConsents(app_policy, permissions_diff.appRevokedPermissions);
+ break;
+ case RESULT_CONSENT_NEEDED:
+ permissions_diff.appPermissionsConsentNeeded = true;
+ break;
+ case RESULT_PERMISSIONS_REVOKED_AND_CONSENT_NEEDED:
+ permissions_diff.isAppPermissionsRevoked = true;
+ permissions_diff.appPermissionsConsentNeeded = true;
+ permissions_diff.appRevokedPermissions = GetRevokedGroups(app_policy);
+ RemoveRevokedConsents(app_policy, permissions_diff.appRevokedPermissions);
+ break;
+ 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));
+ }
+ }
+
+ break;
+ default:
+ return;
+ }
+ pm_->app_permissions_diff_lock_.Acquire();
+ pm_->app_permissions_diff_.insert(std::make_pair(app_id, permissions_diff));
+ pm_->app_permissions_diff_lock_.Release();
+}
+
+policy::CheckAppPolicy::PermissionsCheckResult
+policy::CheckAppPolicy::CheckPermissionsChanges(
+ const policy::AppPoliciesValueType& app_policy) const {
+
+ bool has_revoked_groups = HasRevokedGroups(app_policy);
+
+ bool has_consent_needed_groups = HasConsentNeededGroups(app_policy);
+
+ bool has_new_groups = HasNewGroups(app_policy);
+
+ if (has_revoked_groups && has_consent_needed_groups) {
+ return RESULT_PERMISSIONS_REVOKED_AND_CONSENT_NEEDED;
+ } else if (has_revoked_groups) {
+ return RESULT_PERMISSIONS_REVOKED;
+ } else if (has_consent_needed_groups) {
+ return RESULT_CONSENT_NEEDED;
+ } else if (has_new_groups) {
+ return RESULT_CONSENT_NOT_REQIURED;
+ }
+
+ return RESULT_NO_CHANGES;
+}
+
+bool CheckAppPolicy::IsConsentRequired(const std::string& app_id,
+ const std::string& group_name) const {
const policy_table::FunctionalGroupings& functional_groupings =
snapshot_->policy_table.functional_groupings;
+
FuncGroupConstItr it = functional_groupings.find(group_name);
+
if (functional_groupings.end() == it) {
return false;
}
- return it->second.user_consent_prompt.is_initialized();
+ bool is_preconsented = false;
+ return it->second.user_consent_prompt.is_initialized() && !is_preconsented;
+}
+
+bool CheckAppPolicy::IsRequestTypeChanged(
+ 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.RequestType->empty()) {
+ return true;
+ }
+ return false;
+ }
+ if (it->second.RequestType->size() != app_policy.second.RequestType->size()) {
+ return true;
+ }
+ policy_table::RequestTypes diff;
+ std::set_difference(it->second.RequestType->begin(),
+ it->second.RequestType->end(),
+ app_policy.second.RequestType->begin(),
+ app_policy.second.RequestType->end(),
+ std::back_inserter(diff));
+ return diff.size();
}
FillNotificationData::FillNotificationData(Permissions& data,
diff --git a/src/components/policy/src/policy/src/policy_manager_impl.cc b/src/components/policy/src/policy/src/policy_manager_impl.cc
index a712019c7..4cfab1506 100644
--- a/src/components/policy/src/policy/src/policy_manager_impl.cc
+++ b/src/components/policy/src/policy/src/policy_manager_impl.cc
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (c) 2013, Ford Motor Company
All rights reserved.
@@ -33,6 +33,7 @@
#include <algorithm>
#include <set>
+#include <queue>
#include <iterator>
#include "json/reader.h"
#include "json/writer.h"
@@ -41,52 +42,15 @@
#include "policy/policy_helper.h"
#include "utils/file_system.h"
#include "utils/logger.h"
+#include "utils/date_time.h"
#include "policy/cache_manager.h"
#include "policy/update_status_manager.h"
+#include "config_profile/profile.h"
policy::PolicyManager* CreateManager() {
return new policy::PolicyManagerImpl();
}
-namespace {
-
-struct CheckGroupName {
- CheckGroupName(const std::string& name)
- : name_(name) {
- }
-
- bool operator()(const policy::FunctionalGroupPermission& value) {
- return value.group_name == name_;
- }
-
-private:
- const std::string& name_;
-};
-
-struct CopyPermissions{
- CopyPermissions(const std::vector<policy::FunctionalGroupPermission>& groups)
- : groups_(groups) {
- }
-
-bool operator()(policy::FunctionalGroupPermission& value) {
- CheckGroupName checker(value.group_name);
- std::vector<policy::FunctionalGroupPermission>::const_iterator it =
- std::find_if(groups_.begin(), groups_.end(), checker);
- if (groups_.end() == it) {
- return false;
- }
- value.group_alias = it->group_alias;
- value.group_id = it->group_id;
- value.state = it->state;
- return true;
-}
-
-private:
- const std::vector<policy::FunctionalGroupPermission>& groups_;
-};
-
-}
-
namespace policy {
CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyManagerImpl")
@@ -94,28 +58,21 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyManagerImpl")
PolicyManagerImpl::PolicyManagerImpl()
: PolicyManager(),
listener_(NULL),
- update_status_manager_(new UpdateStatusManager),
cache_(new CacheManager),
retry_sequence_timeout_(60),
- retry_sequence_index_(0) {
+ retry_sequence_index_(0),
+ ignition_check(true) {
}
void PolicyManagerImpl::set_listener(PolicyListener* listener) {
listener_ = listener;
- update_status_manager_->set_listener(listener);
+ update_status_manager_.set_listener(listener);
}
-PolicyManagerImpl::~PolicyManagerImpl() {
- LOG4CXX_INFO(logger_, "Destroying policy manager.");
- const bool update_required =
- policy::StatusUpToDate != update_status_manager_->GetUpdateStatus()
- ? true : false;
- cache_->SaveUpdateRequired(update_required);
- cache_->Backup();
-}
+#ifdef USE_HMI_PTU_DECRYPTION
utils::SharedPtr<policy_table::Table> PolicyManagerImpl::Parse(
- const BinaryMessage& pt_content) {
+ const BinaryMessage& pt_content) {
std::string json(pt_content.begin(), pt_content.end());
Json::Value value;
Json::Reader reader;
@@ -123,6 +80,44 @@ utils::SharedPtr<policy_table::Table> PolicyManagerImpl::Parse(
return new policy_table::Table(&value);
} else {
return utils::SharedPtr<policy_table::Table>();
+ }
+}
+
+#else
+
+utils::SharedPtr<policy_table::Table> PolicyManagerImpl::ParseArray(
+ 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)) {
+ //For PT Update received from SDL Server.
+ if (value["data"].size()!=0) {
+ Json::Value data = value["data"];
+ //First Element in
+ return new policy_table::Table(&data[0]);
+ } else {
+ return new policy_table::Table(&value);
+ }
+ } else {
+ return utils::SharedPtr<policy_table::Table>();
+ }
+}
+
+#endif
+
+void PolicyManagerImpl::CheckTriggers() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const bool exceed_ignition_cycles = ExceededIgnitionCycles();
+ const bool exceed_days = ExceededDays();
+
+ LOG4CXX_DEBUG(
+ logger_,
+ "\nDays exceeded: " << std::boolalpha << exceed_ignition_cycles <<
+ "\nStatusUpdateRequired: " << std::boolalpha<< exceed_days);
+
+ if (exceed_ignition_cycles || exceed_days) {
+ update_status_manager_.ScheduleUpdate();
}
}
@@ -130,29 +125,32 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
const BinaryMessage& pt_content) {
LOG4CXX_INFO(logger_, "LoadPT of size " << pt_content.size());
+ #ifdef USE_HMI_PTU_DECRYPTION
+ // 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);
+ #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);
+ #endif
if (!pt_update) {
LOG4CXX_WARN(logger_, "Parsed table pointer is 0.");
- update_status_manager_->OnWrongUpdateReceived();
+ update_status_manager_.OnWrongUpdateReceived();
return false;
}
- pt_update->SetPolicyTableType(policy_table::PT_UPDATE);
- if (!pt_update->is_valid()) {
- rpc::ValidationReport report("policy_table");
- pt_update->ReportErrors(&report);
- LOG4CXX_WARN(logger_, "Parsed table is not valid " <<
- rpc::PrettyFormat(report));
-
- update_status_manager_->OnWrongUpdateReceived();
+ if (!IsPTValid(pt_update, policy_table::PT_UPDATE)) {
+ update_status_manager_.OnWrongUpdateReceived();
return false;
}
- update_status_manager_->OnValidUpdateReceived();
+ update_status_manager_.OnValidUpdateReceived();
+ cache_->SaveUpdateRequired(false);
- sync_primitives::AutoLock lock(apps_registration_lock_);
+ apps_registration_lock_.Acquire();
// Get current DB data, since it could be updated during awaiting of PTU
utils::SharedPtr<policy_table::Table> policy_table_snapshot =
@@ -162,44 +160,42 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
return false;
}
- // Replace predefined policies with its actual setting, e.g. "123":"default"
- // to actual values of default section
- UnwrapAppPolicies(pt_update->policy_table.app_policies);
-
- // Check and update permissions for applications, send notifications
+ // Checking of difference between PTU and current policy state
+ // Must to be done before PTU applying since it is possible, that functional
+ // groups, which had been present before are absent in PTU and will be
+ // removed after update. So in case of revoked groups system has to know
+ // names and ids of revoked groups before they will be removed.
CheckPermissionsChanges(pt_update, policy_table_snapshot);
// Replace current data with updated
-
-
if (!cache_->ApplyUpdate(*pt_update)) {
LOG4CXX_WARN(logger_, "Unsuccessful save of updated policy table.");
return false;
}
- // Removing last app request from update requests
- RemoveAppFromUpdateList();
- // If there was a user request for policy table update, it should be started
- // right after current update is finished
- if(listener_) {
- RefreshRetrySequence();
- listener_->OnUserRequestedUpdateCheckRequired();
- return true;
+ if (pt_update->policy_table.module_config.certificate.is_initialized()) {
+ listener_->OnCertificateUpdated(*(pt_update->policy_table.module_config.certificate));
}
-
- // TODO(AOleynik): Check, if there is updated info present for apps in list
- // and skip update in this case for given app
- if (!update_requests_list_.empty()) {
- if (listener_) {
- listener_->OnPTExchangeNeeded();
- }
+ std::map<std::string, StringArray> app_hmi_types;
+ cache_->GetHMIAppTypeAfterUpdate(app_hmi_types);
+ if (!app_hmi_types.empty()) {
+ LOG4CXX_INFO(logger_, "app_hmi_types is full calling OnUpdateHMIAppType");
+ listener_->OnUpdateHMIAppType(app_hmi_types);
} else {
- LOG4CXX_INFO(logger_, "Update request queue is empty.");
+ LOG4CXX_INFO(logger_, "app_hmi_types empty" << pt_content.size());
}
- RefreshRetrySequence();
+ apps_registration_lock_.Release();
+
+ // If there was a user request for policy table update, it should be started
+ // right after current update is finished
+ if (update_status_manager_.IsUpdateRequired()) {
+ StartPTExchange();
+ return true;
+ }
+ RefreshRetrySequence();
return true;
}
@@ -208,8 +204,12 @@ void PolicyManagerImpl::CheckPermissionsChanges(
const utils::SharedPtr<policy_table::Table> snapshot) {
LOG4CXX_INFO(logger_, "Checking incoming permissions.");
- std::for_each(pt_update->policy_table.app_policies.begin(),
- pt_update->policy_table.app_policies.end(),
+ // Replace predefined policies with its actual setting, e.g. "123":"default"
+ // to actual values of default section
+ UnwrapAppPolicies(pt_update->policy_table.app_policies_section.apps);
+
+ std::for_each(pt_update->policy_table.app_policies_section.apps.begin(),
+ pt_update->policy_table.app_policies_section.apps.end(),
CheckAppPolicy(this, pt_update, snapshot));
}
@@ -224,76 +224,93 @@ void PolicyManagerImpl::PrepareNotificationData(
std::for_each(group_names.begin(), group_names.end(), processor);
}
-void PolicyManagerImpl::AddAppToUpdateList(const std::string& application_id) {
- sync_primitives::AutoLock lock(update_request_list_lock_);
- LOG4CXX_INFO(logger_,
- "Adding application " << application_id << " to update list");
- // Add application id only once
- std::list<std::string>::const_iterator it = std::find(
- update_requests_list_.begin(), update_requests_list_.end(),
- application_id);
- if (it == update_requests_list_.end()) {
- update_requests_list_.push_back(application_id);
- }
+void PolicyManagerImpl::GetServiceUrls(const std::string& service_type,
+ EndpointUrls& end_points) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->GetServiceUrls(service_type, end_points);
}
-void PolicyManagerImpl::RemoveAppFromUpdateList() {
- sync_primitives::AutoLock lock(update_request_list_lock_);
- if (update_requests_list_.empty()) {
+void PolicyManagerImpl::RequestPTUpdate() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ cache_->GenerateSnapshot();
+ if (!policy_table_snapshot) {
+ LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
return;
}
- LOG4CXX_INFO(
- logger_,
- "Removing application " << update_requests_list_.front() << " from update list");
- update_requests_list_.pop_front();
-}
-std::string PolicyManagerImpl::GetUpdateUrl(int service_type) {
- LOG4CXX_INFO(logger_, "PolicyManagerImpl::GetUpdateUrl");
- EndpointUrls urls = cache_->GetUpdateUrls(service_type);
+ IsPTValid(policy_table_snapshot, policy_table::PT_SNAPSHOT);
- static uint32_t index = 0;
- std::string url;
+ Json::Value value = policy_table_snapshot->ToJsonValue();
+ Json::FastWriter writer;
+ std::string message_string = writer.write(value);
- if (!urls.empty() && index >= urls.size()) {
- index = 0;
- }
- url = urls[index].url.empty() ? "" :urls[index].url[0];
+ LOG4CXX_DEBUG(logger_, "Snapshot contents is : " << message_string );
- ++index;
- return url;
+ BinaryMessage update(message_string.begin(), message_string.end());
+
+
+ listener_->OnSnapshotCreated(update,
+ RetrySequenceDelaysSeconds(),
+ TimeoutExchange());
+
+ // Need to reset update schedule since all currenly registered applications
+ // were already added to the snapshot so no update for them required.
+ update_status_manager_.ResetUpdateSchedule();
}
-EndpointUrls PolicyManagerImpl::GetUpdateUrls(int service_type) {
- LOG4CXX_INFO(logger_, "PolicyManagerImpl::GetUpdateUrls");
- return cache_->GetUpdateUrls(service_type);
+std::string PolicyManagerImpl::GetLockScreenIconUrl() const {
+ return cache_->GetLockScreenIconUrl();
}
-BinaryMessageSptr PolicyManagerImpl::RequestPTUpdate() {
- LOG4CXX_INFO(logger_, "Creating PT Snapshot");
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
- cache_->GenerateSnapshot();
- if (!policy_table_snapshot) {
- LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
- return NULL;
+void PolicyManagerImpl::StartPTExchange() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (update_status_manager_.IsAppsSearchInProgress()) {
+ update_status_manager_.ScheduleUpdate();
+ LOG4CXX_INFO(logger_, "Starting exchange skipped, since applications "
+ "search is in progress.");
+ return;
}
- policy_table_snapshot->SetPolicyTableType(policy_table::PT_SNAPSHOT);
- if (false == policy_table_snapshot->is_valid()) {
- LOG4CXX_INFO(
- logger_, "Policy snappshot is not valid");
- rpc::ValidationReport report("policy_table");
- policy_table_snapshot->ReportErrors(&report);
- LOG4CXX_INFO(logger_,
- "Errors: " << rpc::PrettyFormat(report));
+ if (update_status_manager_.IsUpdatePending()) {
+ update_status_manager_.ScheduleUpdate();
+ LOG4CXX_INFO(logger_, "Starting exchange skipped, since another exchange "
+ "is in progress.");
+ return;
}
- Json::Value value = policy_table_snapshot->ToJsonValue();
- Json::FastWriter writer;
- std::string message_string = writer.write(value);
- return new BinaryMessage(message_string.begin(), message_string.end());
+ if (listener_ && listener_->CanUpdate()) {
+ if (ignition_check) {
+ CheckTriggers();
+ ignition_check = false;
+ }
+
+ if (update_status_manager_.IsUpdateRequired()) {
+ RequestPTUpdate();
+ }
+ }
+}
+
+void PolicyManagerImpl::OnAppsSearchStarted() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ update_status_manager_.OnAppsSearchStarted();
}
+void PolicyManagerImpl::OnAppsSearchCompleted() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ update_status_manager_.OnAppsSearchCompleted();
+ if (update_status_manager_.IsUpdateRequired()) {
+ StartPTExchange();
+ }
+}
+
+const std::vector<std::string> PolicyManagerImpl::GetAppRequestTypes(
+ const std::string policy_app_id) const {
+ std::vector<std::string> request_types;
+ cache_->GetAppRequestTypes(policy_app_id, request_types);
+ return request_types;
+}
void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
const PTString& hmi_level,
const PTString& rpc,
@@ -315,6 +332,7 @@ bool PolicyManagerImpl::ResetUserConsent() {
void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
const std::string& application_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
const std::string device_id = GetCurrentDeviceId(application_id);
if (device_id.empty()) {
LOG4CXX_WARN(logger_, "Couldn't find device info for application id "
@@ -342,28 +360,30 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
notification_data);
LOG4CXX_INFO(logger_, "Send notification for application_id:" << application_id);
+
std::string default_hmi;
default_hmi = "NONE";
+
listener()->OnPermissionsUpdated(application_id, notification_data,
default_hmi);
}
bool PolicyManagerImpl::CleanupUnpairedDevices() {
LOG4CXX_INFO(logger_, "CleanupUnpairedDevices");
-// EXTENDED_POLICY
// For SDL-specific it doesn't matter
return true;
}
DeviceConsent PolicyManagerImpl::GetUserConsentForDevice(
const std::string& device_id) {
- LOG4CXX_INFO(logger_, "GetUserConsentForDevice");
+ LOG4CXX_AUTO_TRACE(logger_);
return kDeviceAllowed;
}
void PolicyManagerImpl::SetUserConsentForDevice(const std::string& device_id,
bool is_allowed) {
LOG4CXX_INFO(logger_, "SetUserConsentForDevice");
+ LOG4CXX_DEBUG(logger_, "Device :" << device_id);
DeviceConsent current_consent = GetUserConsentForDevice(device_id);
bool is_current_device_allowed =
DeviceConsent::kDeviceAllowed == current_consent ? true : false;
@@ -394,6 +414,7 @@ bool PolicyManagerImpl::GetInitialAppData(const std::string& application_id,
void PolicyManagerImpl::SetDeviceInfo(const std::string& device_id,
const DeviceInfo& device_info) {
LOG4CXX_INFO(logger_, "SetDeviceInfo");
+ LOG4CXX_DEBUG(logger_, "Device :" << device_id);
}
PermissionConsent PolicyManagerImpl::EnsureCorrectPermissionConsent(
@@ -430,6 +451,48 @@ PermissionConsent PolicyManagerImpl::EnsureCorrectPermissionConsent(
return permissions_to_set;
}
+void PolicyManagerImpl::CheckPendingPermissionsChanges(
+ const std::string& policy_app_id,
+ const std::vector<FunctionalGroupPermission>& current_permissions) {
+ LOG4CXX_INFO(logger_, "CheckPendingPermissionsChanges");
+ sync_primitives::AutoLock lock(app_permissions_diff_lock_);
+ std::map<std::string, AppPermissions>::iterator it_pending =
+ app_permissions_diff_.find(policy_app_id);
+ if (app_permissions_diff_.end() == it_pending) {
+ LOG4CXX_WARN(logger_,
+ "No pending permissions had been found for appID: "
+ << policy_app_id);
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Pending permissions had been found for appID: "
+ << policy_app_id);
+
+ // Change appPermissionsConsentNeeded depending on unconsented groups
+ // presence
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it_groups =
+ current_permissions.begin();
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it_end_groups =
+ current_permissions.end();
+
+ for (; it_groups != it_end_groups; ++it_groups) {
+ if (policy::kGroupUndefined == it_groups->state) {
+ LOG4CXX_DEBUG(logger_,
+ "Unconsented groups still present for appID: "
+ << policy_app_id);
+ it_pending->second.appPermissionsConsentNeeded = true;
+ return;
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Unconsented groups not present anymore for appID: "
+ << policy_app_id);
+ it_pending->second.appPermissionsConsentNeeded = false;
+ return;
+}
+
void PolicyManagerImpl::SetUserConsentForApp(
const PermissionConsent& permissions) {
LOG4CXX_INFO(logger_, "SetUserConsentForApp");
@@ -515,7 +578,8 @@ void PolicyManagerImpl::GetPermissionsForApp(
if (cache_->IsDefaultPolicy(policy_app_id)) {
app_id_to_check = kDefaultId;
allowed_by_default = true;
- } else if (cache_->IsPredataPolicy(policy_app_id)) {
+ } else if (cache_->IsPredataPolicy(policy_app_id) ||
+ policy::kDeviceDisallowed == GetUserConsentForDevice(device_id)) {
app_id_to_check = kPreDataConsentId;
allowed_by_default = true;
}
@@ -539,7 +603,7 @@ void PolicyManagerImpl::GetPermissionsForApp(
// The "default" and "pre_DataConsent" are auto-allowed groups
// So, check if application in the one of these mode.
if (allowed_by_default) {
- LOG4CXX_INFO(logger_, "Get auto allowe groups");
+ LOG4CXX_INFO(logger_, "Get auto allowed groups");
GroupType type = (kDefaultId == app_id_to_check ?
kTypeDefault : kTypePreDataConsented);
@@ -596,20 +660,51 @@ bool PolicyManagerImpl::ExceededIgnitionCycles() {
return 0 == cache_->IgnitionCyclesBeforeExchange();
}
-bool PolicyManagerImpl::ExceededDays(int days) {
+bool PolicyManagerImpl::IsPTValid(
+ utils::SharedPtr<policy_table::Table> policy_table,
+ policy_table::PolicyTableType type) const {
+ policy_table->SetPolicyTableType(type);
+ if (!policy_table->is_valid()) {
+ LOG4CXX_ERROR(
+ logger_, "Policy table is not valid.");
+ rpc::ValidationReport report("policy_table");
+ policy_table->ReportErrors(&report);
+ LOG4CXX_DEBUG(logger_,
+ "Errors: " << rpc::PrettyFormat(report));
+ return false;
+ }
+ return true;
+}
+
+bool PolicyManagerImpl::ExceededDays() {
+
+ TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const int kSecondsInDay = 60 * 60 * 24;
+ int days = current_time.tv_sec / kSecondsInDay;
+
return 0 == cache_->DaysBeforeExchange(days);
}
-bool PolicyManagerImpl::ExceededKilometers(int kilometers) {
- return 0 == cache_->KilometersBeforeExchange(kilometers);
+void PolicyManagerImpl::KmsChanged(int kilometers) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (0 == cache_->KilometersBeforeExchange(kilometers)) {
+ LOG4CXX_INFO(logger_, "Enough kilometers passed to send for PT update.");
+ StartPTExchange();
+ }
}
void PolicyManagerImpl::IncrementIgnitionCycles() {
cache_->IncrementIgnitionCycles();
}
-PolicyTableStatus PolicyManagerImpl::GetPolicyTableStatus() {
- return update_status_manager_->GetUpdateStatus();
+std::string PolicyManagerImpl::ForcePTExchange() {
+ update_status_manager_.ScheduleUpdate();
+ StartPTExchange();
+ return update_status_manager_.StringifiedUpdateStatus();
+}
+
+std::string PolicyManagerImpl::GetPolicyTableStatus() const {
+ return update_status_manager_.StringifiedUpdateStatus();
}
int PolicyManagerImpl::NextRetryTimeout() {
@@ -634,7 +729,7 @@ void PolicyManagerImpl::RefreshRetrySequence() {
void PolicyManagerImpl::ResetRetrySequence() {
sync_primitives::AutoLock auto_lock(retry_sequence_lock_);
retry_sequence_index_ = 0;
- update_status_manager_->OnResetRetrySequence();
+ update_status_manager_.OnResetRetrySequence();
}
int PolicyManagerImpl::TimeoutExchange() {
@@ -647,13 +742,14 @@ const std::vector<int> PolicyManagerImpl::RetrySequenceDelaysSeconds() {
}
void PolicyManagerImpl::OnExceededTimeout() {
- update_status_manager_->OnUpdateTimeoutOccurs();
+ update_status_manager_.OnUpdateTimeoutOccurs();
}
void PolicyManagerImpl::OnUpdateStarted() {
int update_timeout = TimeoutExchange();
LOG4CXX_INFO(logger_, "Update timeout will be set to: " << update_timeout);
- update_status_manager_->OnUpdateSentOut(update_timeout);
+ update_status_manager_.OnUpdateSentOut(update_timeout);
+ cache_->SaveUpdateRequired(true);
}
void PolicyManagerImpl::PTUpdatedAt(int kilometers, int days_after_epoch) {
@@ -691,31 +787,23 @@ void PolicyManagerImpl::Add(const std::string& app_id,
}
bool PolicyManagerImpl::IsApplicationRevoked(const std::string& app_id) const {
- return const_cast<PolicyManagerImpl*>(this)->cache_->IsApplicationRevoked(app_id);
+ return cache_->IsApplicationRevoked(app_id);
}
-int PolicyManagerImpl::IsConsentNeeded(const std::string& app_id) {
- return 0;
+bool PolicyManagerImpl::IsConsentNeeded(const std::string& app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return false;
}
void PolicyManagerImpl::SetVINValue(const std::string& value) {
}
AppPermissions PolicyManagerImpl::GetAppPermissionsChanges(
- const std::string& device_id,
const std::string& policy_app_id) {
typedef std::map<std::string, AppPermissions>::iterator PermissionsIt;
PermissionsIt app_id_diff = app_permissions_diff_.find(policy_app_id);
AppPermissions permissions(policy_app_id);
if (app_permissions_diff_.end() != app_id_diff) {
- // At this point we're able to know the device id for which user consents
- // could be evaluated
- std::vector<FunctionalGroupPermission> groups;
- GetUserConsentForApp(device_id, policy_app_id, groups);
- CopyPermissions copier(groups);
- std::for_each(app_id_diff->second.appRevokedPermissions.begin(),
- app_id_diff->second.appRevokedPermissions.end(),
- copier);
permissions = app_id_diff->second;
} else {
permissions.appPermissionsConsentNeeded = IsConsentNeeded(policy_app_id);
@@ -749,23 +837,14 @@ void PolicyManagerImpl::AddApplication(const std::string& application_id) {
if (IsNewApplication(application_id)) {
AddNewApplication(application_id, device_consent);
- AddAppToUpdateList(application_id);
- if (PolicyTableStatus::StatusUpToDate == GetPolicyTableStatus()) {
- update_status_manager_->OnNewApplicationAdded();
- }
+ update_status_manager_.OnNewApplicationAdded();
} else {
PromoteExistedApplication(application_id, device_consent);
}
+ StartPTExchange();
SendNotificationOnPermissionsUpdated(application_id);
}
-bool PolicyManagerImpl::IsAppInUpdateList(const std::string& app_id) const {
- return update_requests_list_.end() !=
- std::find(update_requests_list_.begin(),
- update_requests_list_.end(),
- app_id);
-}
-
void PolicyManagerImpl::RemoveAppConsentForGroup(const std::string& app_id,
const std::string& group_name) {
cache_->RemoveAppConsentForGroup(app_id, group_name);
@@ -778,24 +857,18 @@ bool PolicyManagerImpl::IsPredataPolicy(const std::string &policy_app_id) {
void PolicyManagerImpl::AddNewApplication(const std::string& application_id,
DeviceConsent device_consent) {
- LOG4CXX_INFO(logger_, "PolicyManagerImpl::AddNewApplication");
+ LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_INFO(
- logger_,
- "Setting default permissions for application id: " << application_id);
cache_->SetDefaultPolicy(application_id);
}
void PolicyManagerImpl::PromoteExistedApplication(
const std::string& application_id, DeviceConsent device_consent) {
-
- if (kDeviceHasNoConsent != device_consent
+ // If device consent changed to allowed during application being
+ // disconnected, app permissions should be changed also
+ if (kDeviceAllowed == device_consent
&& cache_->IsPredataPolicy(application_id)) {
- // If device consent changed to allowed during application being
- // disconnected, app permissions should be changed also
- if (kDeviceAllowed == device_consent) {
- cache_->SetDefaultPolicy(application_id);
- }
+ cache_->SetDefaultPolicy(application_id);
}
}
@@ -805,6 +878,7 @@ bool PolicyManagerImpl::IsNewApplication(
}
bool PolicyManagerImpl::ResetPT(const std::string& file_name) {
+ cache_->ResetCalculatedPermissions();
const bool result = cache_->ResetPT(file_name);
if (result) {
RefreshRetrySequence();
@@ -812,11 +886,36 @@ bool PolicyManagerImpl::ResetPT(const std::string& file_name) {
return result;
}
+bool PolicyManagerImpl::CheckAppStorageFolder() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string app_storage_folder =
+ profile::Profile::instance()->app_storage_folder();
+ LOG4CXX_DEBUG(logger_, "AppStorageFolder " << app_storage_folder);
+ if (!file_system::DirectoryExists(app_storage_folder)) {
+ LOG4CXX_WARN(logger_,
+ "Storage directory doesn't exist " << app_storage_folder);
+ return false;
+ }
+ if (!(file_system::IsWritingAllowed(app_storage_folder) &&
+ file_system::IsReadingAllowed(app_storage_folder))) {
+ LOG4CXX_WARN(
+ logger_,
+ "Storage directory doesn't have read/write permissions " << app_storage_folder);
+ return false;
+ }
+ return true;
+}
+
bool PolicyManagerImpl::InitPT(const std::string& file_name) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!CheckAppStorageFolder()) {
+ LOG4CXX_ERROR(logger_, "Can not read/write into AppStorageFolder");
+ return false;
+ }
const bool ret = cache_->Init(file_name);
if (ret) {
RefreshRetrySequence();
- update_status_manager_->OnPolicyInit(cache_->UpdateRequired());
+ update_status_manager_.OnPolicyInit(cache_->UpdateRequired());
}
return ret;
}
@@ -825,15 +924,14 @@ uint16_t PolicyManagerImpl::HeartBeatTimeout(const std::string& app_id) const {
return cache_->HeartBeatTimeout(app_id);
}
+void PolicyManagerImpl::SaveUpdateStatusRequired(bool is_update_needed) {
+ cache_->SaveUpdateRequired(is_update_needed);
+}
+
void PolicyManagerImpl::set_cache_manager(
CacheManagerInterface* cache_manager) {
cache_ = cache_manager;
}
-void PolicyManagerImpl::set_update_status_manager(
- UpdateStatusManagerInterface* update_manager) {
- update_status_manager_ = update_manager;
-}
-
} // namespace policy
diff --git a/src/components/policy/src/policy/src/policy_table.cc b/src/components/policy/src/policy/src/policy_table.cc
index c0ac3c99f..991f2ee08 100644
--- a/src/components/policy/src/policy/src/policy_table.cc
+++ b/src/components/policy/src/policy/src/policy_table.cc
@@ -32,7 +32,6 @@
#include "policy/policy_table.h"
-// EXTENDED_POLICY
# include "policy/sql_pt_representation.h"
#include "utils/logger.h"
@@ -43,7 +42,6 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyTable")
PolicyTable::PolicyTable()
: pt_data_(
-// EXTENDED_POLICY
new SQLPTRepresentation()
) {
}
diff --git a/src/components/policy/src/policy/src/sql_pt_ext_queries.cc b/src/components/policy/src/policy/src/sql_pt_ext_queries.cc
index ae6666461..776b31899 100644
--- a/src/components/policy/src/policy/src/sql_pt_ext_queries.cc
+++ b/src/components/policy/src/policy/src/sql_pt_ext_queries.cc
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (c) 2013, " Ford Motor Company
All rights reserved.
@@ -67,9 +67,9 @@ const std::string kUpdateDevice =
" `connection_type` = ? WHERE `id` = ? ";
const std::string kInsertDeviceConsentedGroup =
- "INSERT OR IGNORE INTO `device_consent_group` "
- "(`device_id`, `functional_group_id`, `is_consented`, `input`) "
- "VALUES (?,?,?,?)";
+ "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` "
@@ -113,15 +113,21 @@ const std::string kSelectAppLevels =
" `app_registration_language_gui`, "
" `app_registration_language_vui` "
"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 IGNORE INTO `consent_group` "
- "(`device_id`, `application_id`, `functional_group_id`, `is_consented`, `input`) "
- "VALUES (?,?,?,?,?)";
+ "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` = ? ";
@@ -155,6 +161,12 @@ const std::string kUpdateMetaParams = "UPDATE `module_meta` SET "
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`";
diff --git a/src/components/policy/src/policy/src/sql_pt_ext_representation.cc b/src/components/policy/src/policy/src/sql_pt_ext_representation.cc
index b6d4d84c0..a24141999 100644
--- a/src/components/policy/src/policy/src/sql_pt_ext_representation.cc
+++ b/src/components/policy/src/policy/src/sql_pt_ext_representation.cc
@@ -472,7 +472,7 @@ bool SQLPTExtRepresentation::SetUserPermissionsForApp(
}
std::vector<UserFriendlyMessage> SQLPTExtRepresentation::GetUserFriendlyMsg(
- const std::vector<std::string>& msg_codes, const std::string& language) {
+ const std::vector<std::string>& msg_codes, const std::string& language) {
dbms::SQLQuery query(db());
std::vector<UserFriendlyMessage> result;
if (!query.Prepare(sql_pt_ext::kSelectFriendlyMsg)) {
@@ -493,7 +493,7 @@ std::vector<UserFriendlyMessage> SQLPTExtRepresentation::GetUserFriendlyMsg(
query.Bind(0, *it);
query.Bind(1, msg_language);
- if (!query.Exec()) {
+ if (!query.Exec() || !query.Reset()) {
LOG4CXX_WARN(logger_, "Incorrect select from friendly messages.");
return result;
}
@@ -562,7 +562,7 @@ bool SQLPTExtRepresentation::GatherConsumerFriendlyMessages(
bool SQLPTExtRepresentation::SetMetaInfo(const std::string& ccpu_version,
const std::string& wers_country_code,
const std::string& language) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt_ext::kUpdateMetaParams)) {
LOG4CXX_WARN(logger_, "Incorrect statement for insert to module meta.");
@@ -577,7 +577,6 @@ bool SQLPTExtRepresentation::SetMetaInfo(const std::string& ccpu_version,
LOG4CXX_WARN(logger_, "Incorrect insert to module meta.");
return false;
}
- LOG4CXX_TRACE_EXIT(logger_);
return true;
}
@@ -615,8 +614,8 @@ bool SQLPTExtRepresentation::SetSystemLanguage(const std::string& language) {
return true;
}
-bool SQLPTExtRepresentation::SaveApplicationPolicies(
- const policy_table::ApplicationPolicies& apps) {
+bool SQLPTExtRepresentation::SaveApplicationPoliciesSection(
+ const policy_table::ApplicationPoliciesSection& policies) {
LOG4CXX_INFO(logger_, "SaveApplicationPolicies ext");
dbms::SQLQuery query_delete(db());
if (!query_delete.Exec(sql_pt::kDeleteAppGroup)) {
@@ -635,33 +634,35 @@ bool SQLPTExtRepresentation::SaveApplicationPolicies(
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 =
- apps.find(kDefaultId);
- if (apps.end() != 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 =
- apps.find(kPreDataConsentId);
- if (apps.end() != it_pre_data_consent) {
+ policies.apps.find(kPreDataConsentId);
+ if (policies.apps.end() != it_pre_data_consent) {
if (!SaveSpecificAppPolicy(*it_pre_data_consent)) {
return false;
}
}
- policy_table::ApplicationPolicies::const_iterator it_device =
- apps.find(kDeviceId);
- if (apps.end() != it_device) {
- if (!SaveSpecificAppPolicy(*it_device)) {
- return false;
- }
+
+ if (!SaveDevicePolicy(policies.device)) {
+ return false;
}
- policy_table::ApplicationPolicies::const_iterator it;
- for (it = apps.begin(); it != apps.end(); ++it) {
+ 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;
@@ -681,16 +682,25 @@ 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;
+ }
}
// Stop saving other params, since predefined permissions already set
return true;
}
+ SetIsDefault(app.first, false);
+ SetIsPredata(app.first, false);
+
dbms::SQLQuery app_query(db());
if (!app_query.Prepare(sql_pt_ext::kInsertApplication)) {
LOG4CXX_WARN(logger_, "Incorrect insert statement into application.");
@@ -735,8 +745,42 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
return true;
}
-bool SQLPTExtRepresentation::GatherApplicationPolicies(
- policy_table::ApplicationPolicies* apps) const {
+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");
dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt_ext::kSelectAppPolicies)) {
@@ -749,14 +793,31 @@ bool SQLPTExtRepresentation::GatherApplicationPolicies(
const std::string& app_id = query.GetString(0);
if (IsApplicationRevoked(app_id)) {
params.set_to_null();
- (*apps)[app_id] = params;
+ (*policies).apps[app_id] = params;
continue;
}
if (IsDefaultPolicy(app_id)) {
- (*apps)[app_id].set_to_string(kDefaultId);
+ (*policies).apps[app_id].set_to_string(kDefaultId);
}
if (IsPredataPolicy(app_id)) {
- (*apps)[app_id].set_to_string(kPreDataConsentId);
+ (*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);
@@ -774,17 +835,17 @@ bool SQLPTExtRepresentation::GatherApplicationPolicies(
if (!GatherAppGroup(app_id, &params.groups)) {
return false;
}
- // TODO(IKozyrenko): Check logic if optional container is missing
if (!GatherNickName(app_id, &*params.nicknames)) {
return false;
}
- // TODO(IKozyrenko): Check logic if optional container is missing
if (!GatherAppType(app_id, &*params.AppHMIType)) {
return false;
}
- // TODO(IKozyrenko): Check logic if optional container is missing
+ if (!GatherRequestType(app_id, &*params.RequestType)) {
+ return false;
+ }
GatherPreconsentedGroup(app_id, &*params.preconsented_groups);
- (*apps)[app_id] = params;
+ (*policies).apps[app_id] = params;
}
return true;
}
@@ -929,7 +990,29 @@ void SQLPTExtRepresentation::GatherConsentGroup(
}
bool SQLPTExtRepresentation::SaveDeviceData(
- const policy_table::DeviceData& devices) {
+const policy_table::DeviceData& devices) {
+ LOG4CXX_INFO(logger_, "SaveDeviceData");
+ 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;
+ }
+
+ 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;
+ }
+
+ 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;
+ }
+
dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt_ext::kInsertDeviceData)) {
LOG4CXX_WARN(logger_, "Incorrect insert statement for device data.");
@@ -989,6 +1072,11 @@ bool SQLPTExtRepresentation::SaveConsentGroup(
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_,
@@ -1002,6 +1090,11 @@ bool SQLPTExtRepresentation::SaveConsentGroup(
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()) {
@@ -1346,6 +1439,37 @@ bool SQLPTExtRepresentation::SaveMessageString(
bool SQLPTExtRepresentation::SaveUsageAndErrorCounts(
const policy_table::UsageAndErrorCounts& counts) {
+ return SaveAppCounters(*counts.app_level) && SaveGlobalCounters(counts);
+}
+
+bool SQLPTExtRepresentation::SaveModuleMeta(
+ const policy_table::ModuleMeta& meta) {
+ 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) {
dbms::SQLQuery query(db());
if (!query.Exec(sql_pt::kDeleteAppLevel)) {
LOG4CXX_WARN(logger_, "Incorrect delete from app level.");
@@ -1357,7 +1481,6 @@ bool SQLPTExtRepresentation::SaveUsageAndErrorCounts(
}
policy_table::AppLevels::const_iterator it;
- const policy_table::AppLevels& app_levels = *counts.app_level;
for (it = app_levels.begin(); it != app_levels.end(); ++it) {
query.Bind(0, it->first);
query.Bind(1, it->second.minutes_in_hmi_full);
@@ -1374,7 +1497,7 @@ bool SQLPTExtRepresentation::SaveUsageAndErrorCounts(
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);
- if (!query.Exec()) {
+ if (!query.Exec() || !query.Reset()) {
LOG4CXX_WARN(logger_, "Incorrect insert into app level.");
return false;
}
@@ -1382,6 +1505,26 @@ bool SQLPTExtRepresentation::SaveUsageAndErrorCounts(
return true;
}
+bool SQLPTExtRepresentation::SaveGlobalCounters(
+ const rpc::policy_table_interface_base::UsageAndErrorCounts& counts) {
+ 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_INFO(logger_, "CleanupUnpairedDevices");
@@ -1541,7 +1684,8 @@ bool SQLPTExtRepresentation::SetIsPredata(const std::string& app_id,
return true;
}
-bool SQLPTExtRepresentation::SetUnpairedDevice(const std::string& device_id) const {
+bool SQLPTExtRepresentation::SetUnpairedDevice(const std::string& device_id,
+ bool unpaired) const {
LOG4CXX_TRACE(logger_, "Set unpaired device: " << device_id);
dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt_ext::kUpdateUnpairedDevice)) {
@@ -1549,7 +1693,7 @@ bool SQLPTExtRepresentation::SetUnpairedDevice(const std::string& device_id) con
return false;
}
- query.Bind(0, true);
+ query.Bind(0, unpaired);
query.Bind(1, device_id);
if (!query.Exec()) {
LOG4CXX_WARN(logger_, "Failed update unpaired device");
diff --git a/src/components/policy/src/policy/src/sql_pt_queries.cc b/src/components/policy/src/policy/src/sql_pt_queries.cc
index 1b7fcdfb6..efc2d60c2 100644
--- a/src/components/policy/src/policy/src/sql_pt_queries.cc
+++ b/src/components/policy/src/policy/src/sql_pt_queries.cc
@@ -67,6 +67,7 @@ const std::string kCreateSchema =
"); "
"CREATE TABLE IF NOT EXISTS `module_config`( "
" `preloaded_pt` BOOL NOT NULL, "
+ " `is_first_run` BOOL NOT NULL, "
" `exchange_after_x_ignition_cycles` INTEGER NOT NULL, "
" `exchange_after_x_kilometers` INTEGER NOT NULL, "
" `exchange_after_x_days` INTEGER NOT NULL, "
@@ -188,7 +189,7 @@ const std::string kCreateSchema =
" `functional_group_id` INTEGER NOT NULL, "
" `is_consented` BOOL NOT NULL, "
" `input` VARCHAR(45), "
- " `time_stamp` DATETIME DEFAULT CURRENT_TIMESTAMP, "
+ " `time_stamp` VARCHAR(45), "
" PRIMARY KEY(`device_id`,`functional_group_id`), "
" CONSTRAINT `fk_device_has_functional_group_device1` "
" FOREIGN KEY(`device_id`) "
@@ -253,6 +254,14 @@ const std::string kCreateSchema =
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
+ "CREATE TABLE IF NOT EXISTS `request_type`( "
+ " `request_type` VARCHAR(50) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL, "
+ " PRIMARY KEY(`request_type`,`application_id`), "
+ " CONSTRAINT `fk_app_type_application1` "
+ " FOREIGN KEY(`application_id`) "
+ " REFERENCES `application`(`id`) "
+ "); "
"CREATE INDEX IF NOT EXISTS `app_type.fk_app_type_application1_idx` "
" ON `app_type`(`application_id`); "
"CREATE TABLE IF NOT EXISTS `consent_group`( "
@@ -261,7 +270,7 @@ const std::string kCreateSchema =
" `functional_group_id` INTEGER NOT NULL, "
" `is_consented` BOOL NOT NULL, "
" `input` VARCHAR(45), "
- " `time_stamp` DATETIME DEFAULT CURRENT_TIMESTAMP, "
+ " `time_stamp` VARCHAR(45), "
" PRIMARY KEY(`application_id`,`functional_group_id`,`device_id`), "
" CONSTRAINT `fk_consent_group_device1` "
" FOREIGN KEY(`device_id`) "
@@ -279,7 +288,7 @@ const std::string kCreateSchema =
"CREATE INDEX IF NOT EXISTS `consent_group.fk_consent_group_functional_group1_idx` "
" ON `consent_group`(`functional_group_id`); "
"CREATE TABLE IF NOT EXISTS `endpoint`( "
- " `service` INTEGER NOT NULL, "
+ " `service` VARCHAR(100) NOT NULL, "
" `url` VARCHAR(100) NOT NULL, "
" `application_id` VARCHAR(45) NOT NULL, "
" CONSTRAINT `fk_endpoint_application1` "
@@ -318,10 +327,10 @@ const std::string kInsertInitData =
" `pt_exchanged_x_days_after_epoch`, `ignition_cycles_since_last_exchange`,"
" `flag_update_required`) "
" VALUES (0, 0, 0, 0); "
- "INSERT OR IGNORE INTO `module_config` (`preloaded_pt`, "
+ "INSERT OR IGNORE INTO `module_config` (`preloaded_pt`, `is_first_run`,"
" `exchange_after_x_ignition_cycles`, `exchange_after_x_kilometers`, "
" `exchange_after_x_days`, `timeout_after_x_seconds`) "
- " VALUES(1, 0, 0, 0, 0); "
+ " VALUES(1, 0, 0, 0, 0, 0); "
"INSERT OR IGNORE INTO `priority`(`value`) VALUES ('EMERGENCY'); "
"INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NAVIGATION'); "
"INSERT OR IGNORE INTO `priority`(`value`) VALUES ('VOICECOMMUNICATION'); "
@@ -439,6 +448,9 @@ const std::string kSetNotFirstRun =
const std::string kSelectEndpoint =
"SELECT `url`, `application_id` FROM `endpoint` WHERE `service` = ? ";
+const std::string kSelectLockScreenIcon =
+ "SELECT `url` FROM `endpoint` WHERE `service` = ? AND `application_id` = ?";
+
const std::string kInsertFunctionalGroup =
"INSERT INTO `functional_group` (`id`, `name`, `user_consent_prompt`) "
" VALUES (?, ?, ?)";
@@ -465,6 +477,9 @@ const std::string kInsertNickname =
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`) VALUES (?, ?)";
+
const std::string kUpdateVersion = "UPDATE `version` SET `number`= ?";
const std::string kInsertMessageType =
@@ -532,9 +547,7 @@ const std::string kSelectModuleConfig =
" FROM `module_config`";
const std::string kSelectEndpoints =
- "SELECT `url`, `service`, `application_id` "
- "FROM `endpoint` "
- "GROUP BY `application_id`";
+ "SELECT `url`, `service`, `application_id` FROM `endpoint` ";
const std::string kSelectNotificationsPerMin =
"SELECT `priority_value`, `value` FROM notifications_by_priority";
@@ -571,6 +584,9 @@ const std::string kSelectNicknames = "SELECT DISTINCT `name` FROM `nickname` "
const std::string kSelectAppTypes = "SELECT DISTINCT `name` FROM `app_type` "
"WHERE `application_id` = ?";
+const std::string kSelectRequestTypes =
+ "SELECT DISTINCT `request_type` FROM `request_type` WHERE `application_id` = ?";
+
const std::string kSelectSecondsBetweenRetries =
"SELECT `value` FROM `seconds_between_retry` ORDER BY `index`";
@@ -613,6 +629,8 @@ const std::string kUpdateCountersSuccessfulUpdate =
const std::string kDeleteApplication = "DELETE FROM `application`";
+const std::string kDeleteRequestType = "DELETE FROM `request_type`";
+
const std::string kSelectApplicationRevoked =
"SELECT `is_revoked` FROM `application` WHERE `id` = ?";
diff --git a/src/components/policy/src/policy/src/sql_pt_representation.cc b/src/components/policy/src/policy/src/sql_pt_representation.cc
index 4946284f3..47eae02dd 100644
--- a/src/components/policy/src/policy/src/sql_pt_representation.cc
+++ b/src/components/policy/src/policy/src/sql_pt_representation.cc
@@ -34,6 +34,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
+#include <unistd.h>
#include "utils/logger.h"
#include "policy/sql_pt_representation.h"
@@ -41,9 +42,7 @@
#include "policy/sql_pt_queries.h"
#include "policy/policy_helper.h"
#include "policy/cache_manager.h"
-#ifndef __QNX__
-# include "config_profile/profile.h"
-#endif // __QNX__
+#include "config_profile/profile.h"
namespace policy {
@@ -61,7 +60,6 @@ template<typename T, typename K> void InsertUnique(K value, T* array) {
}
} // namespace
-// CUSTOMER_PASA
const std::string SQLPTRepresentation::kDatabaseName = "policy";
SQLPTRepresentation::SQLPTRepresentation()
@@ -75,7 +73,6 @@ SQLPTRepresentation::SQLPTRepresentation()
}
SQLPTRepresentation::~SQLPTRepresentation() {
- db_->Backup();
db_->Close();
delete db_;
}
@@ -153,8 +150,7 @@ int SQLPTRepresentation::KilometersBeforeExchange(int current) {
bool SQLPTRepresentation::SetCountersPassedForSuccessfulUpdate(
int kilometers, int days_after_epoch) {
- LOG4CXX_INFO(logger_,
- "SQLPTRepresentation::SetCountersPassedForSuccessfulUpdate");
+ LOG4CXX_AUTO_TRACE(logger_);
dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt::kUpdateCountersSuccessfulUpdate)) {
LOG4CXX_WARN(logger_,
@@ -249,6 +245,29 @@ EndpointUrls SQLPTRepresentation::GetUpdateUrls(int service_type) {
return ret;
}
+std::string SQLPTRepresentation::GetLockScreenIconUrl() const {
+ dbms::SQLQuery query(db());
+ std::string ret;
+ if (query.Prepare(sql_pt::kSelectLockScreenIcon)) {
+ query.Bind(0, std::string("lock_screen_icon_url"));
+ query.Bind(1, std::string("default"));
+
+ if(!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect select from notifications by priority.");
+ return ret;
+ }
+
+ if (!query.IsNull(0)) {
+ ret = query.GetString(0);
+ }
+
+ } else {
+ LOG4CXX_WARN(logger_, "Invalid select endpoints statement.");
+ }
+ return ret;
+}
+
+
int SQLPTRepresentation::GetNotificationsNumber(const std::string& priority) {
LOG4CXX_INFO(logger_, "GetNotificationsNumber");
dbms::SQLQuery query(db());
@@ -301,12 +320,43 @@ bool SQLPTRepresentation::GetPriority(const std::string& policy_app_id,
}
InitResult SQLPTRepresentation::Init() {
- LOG4CXX_INFO(logger_, "SQLPTRepresentation::Init");
+ LOG4CXX_AUTO_TRACE(logger_);
if (!db_->Open()) {
- LOG4CXX_ERROR(logger_, "Failed opening database");
+ LOG4CXX_ERROR(logger_, "Failed opening database.");
+ LOG4CXX_INFO(logger_, "Starting opening retries.");
+ const uint16_t attempts =
+ profile::Profile::instance()->attempts_to_open_policy_db();
+ LOG4CXX_DEBUG(logger_, "Total attempts number is: " << attempts);
+ bool is_opened = false;
+ const uint16_t open_attempt_timeout_ms =
+ profile::Profile::instance()->open_attempt_timeout_ms();
+ const useconds_t sleep_interval_mcsec = open_attempt_timeout_ms * 1000;
+ LOG4CXX_DEBUG(logger_, "Open attempt timeout(ms) is: "
+ << open_attempt_timeout_ms);
+ for (int i = 0; i < attempts; ++i) {
+ usleep(sleep_interval_mcsec);
+ LOG4CXX_INFO(logger_, "Attempt: " << i+1);
+ if (db_->Open()){
+ LOG4CXX_INFO(logger_, "Database opened.");
+ is_opened = true;
+ break;
+ }
+ }
+ if (!is_opened) {
+ LOG4CXX_ERROR(logger_, "Open retry sequence failed. Tried "
+ << attempts << " attempts with "
+ << open_attempt_timeout_ms
+ << " open timeout(ms) for each.");
+ return InitResult::FAIL;
+ }
+ }
+#ifndef __QNX__
+ if (!db_->IsReadWrite()) {
+ LOG4CXX_ERROR(logger_, "There are no read/write permissions for database");
return InitResult::FAIL;
}
+#endif // __QNX__
dbms::SQLQuery check_pages(db());
if (!check_pages.Prepare(sql_pt::kCheckPgNumber) || !check_pages.Next()) {
LOG4CXX_WARN(logger_, "Incorrect pragma for page counting.");
@@ -377,6 +427,10 @@ bool SQLPTRepresentation::Drop() {
return true;
}
+void SQLPTRepresentation::WriteDb() {
+ db_->Backup();
+}
+
bool SQLPTRepresentation::Clear() {
dbms::SQLQuery query(db());
if (!query.Exec(sql_pt::kDeleteData)) {
@@ -393,6 +447,28 @@ bool SQLPTRepresentation::Clear() {
return true;
}
+bool SQLPTRepresentation::RefreshDB() {
+ dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kDropSchema)) {
+ LOG4CXX_WARN(logger_,
+ "Failed dropping database: " << query.LastError().text());
+ return false;
+ }
+ if (!query.Exec(sql_pt::kCreateSchema)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed creating schema of database: " << query.LastError().text());
+ return false;
+ }
+ if (!query.Exec(sql_pt::kInsertInitData)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed insert init data to database: " << query.LastError().text());
+ return false;
+ }
+ return true;
+}
+
utils::SharedPtr<policy_table::Table>
SQLPTRepresentation::GenerateSnapshot() const {
LOG4CXX_INFO(logger_, "GenerateSnapshot");
@@ -404,7 +480,7 @@ SQLPTRepresentation::GenerateSnapshot() const {
GatherFunctionalGroupings(&table->policy_table.functional_groupings);
GatherConsumerFriendlyMessages(
&*table->policy_table.consumer_friendly_messages);
- GatherApplicationPolicies(&table->policy_table.app_policies);
+ GatherApplicationPoliciesSection(&table->policy_table.app_policies_section);
return table;
}
@@ -437,9 +513,7 @@ void SQLPTRepresentation::GatherModuleConfig(
LOG4CXX_WARN(logger_, "Incorrect select statement for endpoints");
} else {
while (endpoints.Next()) {
- std::stringstream stream;
- stream << "0x0" << endpoints.GetInteger(1);
- config->endpoints[stream.str()][endpoints.GetString(2)]
+ config->endpoints[endpoints.GetString(1)][endpoints.GetString(2)]
.push_back(endpoints.GetString(0));
}
}
@@ -523,7 +597,6 @@ bool SQLPTRepresentation::GatherFunctionalGroupings(
if (!rpcs.IsNull(2)) {
policy_table::Parameter param;
if (policy_table::EnumFromJsonString(rpcs.GetString(2), &param)) {
- // TODO(IKozyrenko): Check logic if optional container is missing
InsertUnique(param, &(*rpcs_tbl.rpcs[rpcs.GetString(0)].parameters));
}
}
@@ -549,8 +622,8 @@ bool SQLPTRepresentation::GatherConsumerFriendlyMessages(
return true;
}
-bool SQLPTRepresentation::GatherApplicationPolicies(
- policy_table::ApplicationPolicies* apps) const {
+bool SQLPTRepresentation::GatherApplicationPoliciesSection(
+ policy_table::ApplicationPoliciesSection* policies) const {
LOG4CXX_INFO(logger_, "Gather applications policies");
dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt::kSelectAppPolicies)) {
@@ -563,14 +636,21 @@ bool SQLPTRepresentation::GatherApplicationPolicies(
const std::string& app_id = query.GetString(0);
if (IsApplicationRevoked(app_id)) {
params.set_to_null();
- (*apps)[app_id] = params;
+ (*policies).apps[app_id] = params;
continue;
}
if (IsDefaultPolicy(app_id)) {
- (*apps)[app_id].set_to_string(kDefaultId);
+ (*policies).apps[app_id].set_to_string(kDefaultId);
}
if (IsPredataPolicy(app_id)) {
- (*apps)[app_id].set_to_string(kPreDataConsentId);
+ (*policies).apps[app_id].set_to_string(kPreDataConsentId);
+ }
+ if (kDeviceId == app_id) {
+ // Priority is only SDL-specific item for device
+ policy_table::Priority priority;
+ policy_table::EnumFromJsonString(query.GetString(1), &priority);
+ (*policies).device.priority = priority;
+ continue;
}
policy_table::Priority priority;
policy_table::EnumFromJsonString(query.GetString(1), &priority);
@@ -584,27 +664,29 @@ bool SQLPTRepresentation::GatherApplicationPolicies(
if (!GatherAppGroup(app_id, &params.groups)) {
return false;
}
- // TODO(IKozyrenko): Check logic if optional container is missing
if (!GatherNickName(app_id, &*params.nicknames)) {
return false;
}
- // TODO(IKozyrenko): Check logic if optional container is missing
if (!GatherAppType(app_id, &*params.AppHMIType)) {
return false;
}
- (*apps)[app_id] = params;
+ if (!GatherRequestType(app_id, &*params.RequestType)) {
+ return false;
+ }
+
+ (*policies).apps[app_id] = params;
}
return true;
}
bool SQLPTRepresentation::Save(const policy_table::Table& table) {
- LOG4CXX_INFO(logger_, "SQLPTRepresentation::Save");
+ LOG4CXX_AUTO_TRACE(logger_);
db_->BeginTransaction();
if (!SaveFunctionalGroupings(table.policy_table.functional_groupings)) {
db_->RollbackTransaction();
return false;
}
- if (!SaveApplicationPolicies(table.policy_table.app_policies)) {
+ if (!SaveApplicationPoliciesSection(table.policy_table.app_policies_section)) {
db_->RollbackTransaction();
return false;
}
@@ -703,9 +785,9 @@ bool SQLPTRepresentation::SaveRpcs(int64_t group_id,
for (ps_it = parameters.begin(); ps_it != parameters.end(); ++ps_it) {
query_parameter.Bind(0, it->first);
query_parameter.Bind(
- 1, std::string(policy_table::EnumToJsonString(*hmi_it)));
+ 1, std::string(policy_table::EnumToJsonString(*hmi_it)));
query_parameter.Bind(
- 2, std::string(policy_table::EnumToJsonString(*ps_it)));
+ 2, std::string(policy_table::EnumToJsonString(*ps_it)));
query_parameter.Bind(3, group_id);
if (!query_parameter.Exec() || !query_parameter.Reset()) {
LOG4CXX_WARN(logger_, "Incorrect insert into rpc with parameter");
@@ -727,8 +809,8 @@ bool SQLPTRepresentation::SaveRpcs(int64_t group_id,
return true;
}
-bool SQLPTRepresentation::SaveApplicationPolicies(
- const policy_table::ApplicationPolicies& apps) {
+bool SQLPTRepresentation::SaveApplicationPoliciesSection(
+ const policy_table::ApplicationPoliciesSection& policies) {
dbms::SQLQuery query_delete(db());
if (!query_delete.Exec(sql_pt::kDeleteAppGroup)) {
LOG4CXX_WARN(logger_, "Incorrect delete from app_group.");
@@ -739,32 +821,35 @@ bool SQLPTRepresentation::SaveApplicationPolicies(
return false;
}
+ if (!query_delete.Exec(sql_pt::kDeleteRequestType)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from request type.");
+ 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
policy_table::ApplicationPolicies::const_iterator it_default =
- apps.find(kDefaultId);
- if (apps.end() != 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_consented =
- apps.find(kPreDataConsentId);
- if (apps.end() != it_pre_data_consented) {
+ policies.apps.find(kPreDataConsentId);
+ if (policies.apps.end() != it_pre_data_consented) {
if (!SaveSpecificAppPolicy(*it_pre_data_consented)) {
return false;
}
}
- policy_table::ApplicationPolicies::const_iterator it_device =
- apps.find(kDeviceId);
- if (apps.end() != it_pre_data_consented) {
- if (!SaveSpecificAppPolicy(*it_device)) {
- return false;
- }
+
+ if (!SaveDevicePolicy(policies.device)) {
+ return false;
}
+
policy_table::ApplicationPolicies::const_iterator it;
- for (it = apps.begin(); it != apps.end(); ++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;
@@ -781,7 +866,7 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
const policy_table::ApplicationPolicies::value_type& app) {
dbms::SQLQuery app_query(db());
if (!app_query.Prepare(sql_pt::kInsertApplication)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement into application.");
+ LOG4CXX_WARN(logger_, "Incorrect insert statement into application (device).");
return false;
}
@@ -811,15 +896,44 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
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;
}
+ if (!SaveRequestType(app.first, *app.second.RequestType)) {
+ return false;
+ }
+
+ return true;
+}
+
+bool policy::SQLPTRepresentation::SaveDevicePolicy(
+ const policy_table::DevicePolicy& device) {
+ dbms::SQLQuery app_query(db());
+ if (!app_query.Prepare(sql_pt::kInsertApplication)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement into application.");
+ return false;
+ }
+
+ app_query.Bind(0, kDeviceId);
+ app_query.Bind(1, std::string(policy_table::EnumToJsonString(device.priority)));
+ app_query.Bind(2, false);
+ app_query.Bind(3, 0);
+ app_query.Bind(4, 0);
+ app_query.Bind(5);
+
+ if (!app_query.Exec() || !app_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into application.");
+ return false;
+ }
+
+ if (!SaveAppGroup(kDeviceId, device.groups)) {
+ return false;
+ }
+
return true;
}
@@ -890,6 +1004,28 @@ bool SQLPTRepresentation::SaveAppType(const std::string& app_id,
return true;
}
+bool SQLPTRepresentation::SaveRequestType(
+ const std::string& app_id,
+ const policy_table::RequestTypes& types) {
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertRequestType)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for request types.");
+ return false;
+ }
+
+ policy_table::RequestTypes::const_iterator it;
+ 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;
+ }
+ }
+
+ return true;
+}
+
bool SQLPTRepresentation::SaveModuleMeta(const policy_table::ModuleMeta& meta) {
// Section Module Meta is empty for SDL specific
return true;
@@ -903,8 +1039,10 @@ bool SQLPTRepresentation::SaveModuleConfig(
return false;
}
- config.preloaded_pt.is_initialized() ?
- query.Bind(0, config.preloaded_pt) : query.Bind(0, false);
+ bool is_preloaded = config.preloaded_pt.is_initialized() &&
+ *config.preloaded_pt;
+
+ query.Bind(0, is_preloaded);
query.Bind(1, config.exchange_after_x_ignition_cycles);
query.Bind(2, config.exchange_after_x_kilometers);
query.Bind(3, config.exchange_after_x_days);
@@ -958,11 +1096,7 @@ bool SQLPTRepresentation::SaveServiceEndpoints(
const policy_table::URL& urls = app_it->second;
policy_table::URL::const_iterator url_it;
for (url_it = urls.begin(); url_it != urls.end(); ++url_it) {
- std::stringstream temp_stream(it->first);
- int service;
- temp_stream.seekg(3);
- temp_stream >> service;
- query.Bind(0, service);
+ query.Bind(0, it->first);
query.Bind(1, *url_it);
query.Bind(2, app_it->first);
if (!query.Exec() || !query.Reset()) {
@@ -978,7 +1112,7 @@ bool SQLPTRepresentation::SaveServiceEndpoints(
bool SQLPTRepresentation::SaveConsumerFriendlyMessages(
const policy_table::ConsumerFriendlyMessages& messages) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
// According CRS-2419 If there is no “consumer_friendly_messages” key,
// the current local consumer_friendly_messages section shall be maintained in
@@ -1133,6 +1267,7 @@ bool SQLPTRepresentation::SaveDeviceData(
bool SQLPTRepresentation::SaveUsageAndErrorCounts(
const policy_table::UsageAndErrorCounts& counts) {
+ const_cast<policy_table::UsageAndErrorCounts&>(counts).mark_initialized();
dbms::SQLQuery query(db());
if (!query.Exec(sql_pt::kDeleteAppLevel)) {
LOG4CXX_WARN(logger_, "Incorrect delete from app level.");
@@ -1145,6 +1280,7 @@ bool SQLPTRepresentation::SaveUsageAndErrorCounts(
policy_table::AppLevels::const_iterator it;
const policy_table::AppLevels& app_levels = *counts.app_level;
+ const_cast<policy_table::AppLevels&>(*counts.app_level).mark_initialized();
for (it = app_levels.begin(); it != app_levels.end(); ++it) {
query.Bind(0, it->first);
if (!query.Exec()) {
@@ -1248,6 +1384,26 @@ bool SQLPTRepresentation::GatherAppType(
return true;
}
+bool SQLPTRepresentation::GatherRequestType(
+ const std::string& app_id,
+ policy_table::RequestTypes* request_types) const {
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectRequestTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from request types.");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ policy_table::RequestType type;
+ if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
+ return false;
+ }
+ request_types->push_back(type);
+ }
+ return true;
+}
+
bool SQLPTRepresentation::GatherNickName(
const std::string& app_id, policy_table::Strings* nicknames) const {
dbms::SQLQuery query(db());
@@ -1308,9 +1464,12 @@ bool SQLPTRepresentation::IsApplicationRevoked(
if (!query.Prepare(sql_pt::kSelectApplicationRevoked)) {
LOG4CXX_WARN(logger_, "Incorrect select from is_revoked of application");
}
- if (!query.Exec()) {
+
+ query.Bind(0, app_id);
+
+ if (!query.Exec()) {
LOG4CXX_WARN(logger_, "Failed select is_revoked of application");
- return false;
+ return false;
}
return query.IsNull(0) ? false : query.GetBoolean(0);
}
diff --git a/src/components/policy/src/policy/src/update_status_manager.cc b/src/components/policy/src/policy/src/update_status_manager.cc
index 872e0c3e9..e5cc74a31 100644
--- a/src/components/policy/src/policy/src/update_status_manager.cc
+++ b/src/components/policy/src/policy/src/update_status_manager.cc
@@ -42,13 +42,22 @@ UpdateStatusManager::UpdateStatusManager() :
listener_(NULL),
exchange_in_progress_(false),
update_required_(false),
+ update_scheduled_(false),
exchange_pending_(false),
- last_update_status_(policy::StatusUnknown),
- update_response_timer_(this) {
+ apps_search_in_progress_(false),
+ last_update_status_(policy::StatusUnknown) {
+ update_status_thread_delegate_ = new UpdateThreadDelegate(this);
+ thread_ = threads::CreateThread("UpdateStatusThread", update_status_thread_delegate_);
+ thread_->start();
}
UpdateStatusManager::~UpdateStatusManager() {
- LOG4CXX_DEBUG(logger_, "Destroy update Status manager");
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(update_status_thread_delegate_);
+ DCHECK(thread_);
+ thread_->join();
+ delete update_status_thread_delegate_;
+ threads::DeleteThread(thread_);
}
void UpdateStatusManager::set_listener(PolicyListener* listener) {
@@ -57,26 +66,34 @@ void UpdateStatusManager::set_listener(PolicyListener* listener) {
void UpdateStatusManager::OnUpdateSentOut(uint32_t update_timeout) {
LOG4CXX_INFO(logger_, "OnUpdateSentOut");
- update_response_timer_.start(update_timeout);
+ DCHECK(update_status_thread_delegate_);
+ const unsigned milliseconds_in_second = 1000;
+ update_status_thread_delegate_->updateTimeOut(update_timeout *
+ milliseconds_in_second);
set_exchange_in_progress(true);
+ set_exchange_pending(true);
+ set_update_required(false);
}
void UpdateStatusManager::OnUpdateTimeoutOccurs() {
LOG4CXX_INFO(logger_, "OnUpdateTimeoutOccurs");
set_update_required(true);
set_exchange_in_progress(false);
+ set_exchange_pending(false);
+ DCHECK(update_status_thread_delegate_);
+ update_status_thread_delegate_->updateTimeOut(0); // Stop Timer
}
void UpdateStatusManager::OnValidUpdateReceived() {
LOG4CXX_INFO(logger_, "OnValidUpdateReceived");
- update_response_timer_.stop();
- set_update_required(false);
+ update_status_thread_delegate_->updateTimeOut(0); // Stop Timer
+ set_exchange_pending(false);
set_exchange_in_progress(false);
}
void UpdateStatusManager::OnWrongUpdateReceived() {
LOG4CXX_INFO(logger_, "OnWrongUpdateReceived");
- update_response_timer_.stop();
+ update_status_thread_delegate_->updateTimeOut(0); // Stop Timer
set_update_required(true);
set_exchange_in_progress(false);
}
@@ -107,8 +124,8 @@ void UpdateStatusManager::OnPolicyInit(bool is_update_required) {
update_required_ = is_update_required;
}
-PolicyTableStatus UpdateStatusManager::GetUpdateStatus() {
- LOG4CXX_INFO(logger_, "GetUpdateStatus");
+PolicyTableStatus UpdateStatusManager::GetUpdateStatus() const {
+ LOG4CXX_AUTO_TRACE(logger_);
if (!exchange_in_progress_ && !exchange_pending_ && !update_required_) {
return PolicyTableStatus::StatusUpToDate;
}
@@ -120,11 +137,61 @@ PolicyTableStatus UpdateStatusManager::GetUpdateStatus() {
return PolicyTableStatus::StatusUpdatePending;
}
+bool UpdateStatusManager::IsUpdateRequired() const {
+ return update_required_ || update_scheduled_;
+}
+
+bool UpdateStatusManager::IsUpdatePending() const {
+ return exchange_pending_;
+}
+
+void UpdateStatusManager::ScheduleUpdate() {
+ update_scheduled_ = true;
+ update_required_ = true;
+}
+
+void UpdateStatusManager::ResetUpdateSchedule() {
+ update_scheduled_ = false;
+}
+
+std::string UpdateStatusManager::StringifiedUpdateStatus() const {
+ switch (GetUpdateStatus()) {
+ case policy::StatusUpdatePending:
+ return "UPDATING";
+ case policy::StatusUpdateRequired:
+ return "UPDATE_NEEDED";
+ case policy::StatusUpToDate:
+ return "UP_TO_DATE";
+ default: {
+ return "UNKNOWN";
+ }
+ }
+}
+
+void policy::UpdateStatusManager::OnAppsSearchStarted() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(apps_search_in_progress_lock_);
+ apps_search_in_progress_ = true;
+}
+
+void policy::UpdateStatusManager::OnAppsSearchCompleted() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(apps_search_in_progress_lock_);
+ apps_search_in_progress_ = false;
+}
+
+bool policy::UpdateStatusManager::IsAppsSearchInProgress() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(apps_search_in_progress_lock_);
+ return apps_search_in_progress_;
+}
+
void UpdateStatusManager::CheckUpdateStatus() {
- LOG4CXX_INFO(logger_, "CheckUpdateStatus");
+ LOG4CXX_AUTO_TRACE(logger_);
policy::PolicyTableStatus status = GetUpdateStatus();
if (listener_ && last_update_status_ != status) {
- listener_->OnUpdateStatusChanged(status);
+ LOG4CXX_INFO(logger_, "Send OnUpdateStatusChanged");
+ listener_->OnUpdateStatusChanged(StringifiedUpdateStatus());
}
last_update_status_ = status;
}
@@ -152,8 +219,50 @@ void UpdateStatusManager::set_update_required(bool value) {
CheckUpdateStatus();
}
-UpdateStatusManager::UpdateResponseTimer::~UpdateResponseTimer() {
- LOG4CXX_DEBUG(logger_, "Destroy update Status manager timer");
+UpdateStatusManager::UpdateThreadDelegate::UpdateThreadDelegate(UpdateStatusManager* update_status_manager):
+ timeout_(0),
+ stop_flag_(false),
+ state_lock_(true),
+ update_status_manager_(update_status_manager) {
+ LOG4CXX_INFO(logger_, "Create UpdateThreadDelegate");
+}
+
+UpdateStatusManager::UpdateThreadDelegate::~UpdateThreadDelegate() {
+ LOG4CXX_INFO(logger_, "Delete UpdateThreadDelegate");
+}
+
+void UpdateStatusManager::UpdateThreadDelegate::threadMain() {
+ LOG4CXX_DEBUG(logger_, "UpdateStatusManager thread started (started normal)");
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ while (false == stop_flag_) {
+ if (timeout_ > 0) {
+ LOG4CXX_DEBUG(logger_, "Timeout is greater then 0");
+ sync_primitives::ConditionalVariable::WaitStatus wait_status =
+ termination_condition_.WaitFor(auto_lock, timeout_);
+ if (sync_primitives::ConditionalVariable::kTimeout == wait_status ) {
+ if (update_status_manager_) {
+ update_status_manager_->OnUpdateTimeoutOccurs();
+ }
+ }
+ } else {
+ // Time is not active, wait, while timeout will be seted,
+ // or UpdateStatusManager will be deleted
+ termination_condition_.Wait(auto_lock);
+ }
+ }
+}
+
+void UpdateStatusManager::UpdateThreadDelegate::exitThreadMain() {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ stop_flag_ = true;
+ LOG4CXX_INFO(logger_, "before notify");
+ termination_condition_.NotifyOne();
+}
+
+void UpdateStatusManager::UpdateThreadDelegate::updateTimeOut(const uint32_t timeout_ms) {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ timeout_ = timeout_ms;
+ termination_condition_.NotifyOne();
}
} // namespace policy
diff --git a/src/components/policy/src/policy/usage_statistics/include/usage_statistics/counter.h b/src/components/policy/src/policy/usage_statistics/include/usage_statistics/counter.h
index 35147344c..6ccfb0a42 100644
--- a/src/components/policy/src/policy/usage_statistics/include/usage_statistics/counter.h
+++ b/src/components/policy/src/policy/usage_statistics/include/usage_statistics/counter.h
@@ -36,6 +36,8 @@
#include <ctime>
#include "usage_statistics/statistics_manager.h"
#include "utils/shared_ptr.h"
+#include "utils/timer_thread.h"
+
namespace usage_statistics {
class GlobalCounter {
@@ -76,16 +78,21 @@ class AppStopwatch {
public:
AppStopwatch(utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
const std::string& app_id);
+ AppStopwatch(utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ const std::string& app_id,
+ std::uint32_t time_out);
~AppStopwatch();
void Start(AppStopwatchId stopwatch_type);
void Switch(AppStopwatchId stopwatch_type);
- void Stop();
+ void WriteTime();
private:
// Fields
std::string app_id_;
AppStopwatchId stopwatch_type_;
utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager_;
- time_t start_time_;
+ typedef timer::TimerThread<AppStopwatch> Timer;
+ Timer* timer_;
+ const std::uint32_t time_out_;
};
} // namespace usage_statistics
diff --git a/src/components/policy/src/policy/usage_statistics/src/counter.cc b/src/components/policy/src/policy/usage_statistics/src/counter.cc
index 6375db8f8..070de140b 100644
--- a/src/components/policy/src/policy/usage_statistics/src/counter.cc
+++ b/src/components/policy/src/policy/usage_statistics/src/counter.cc
@@ -83,33 +83,41 @@ AppStopwatch::AppStopwatch(utils::SharedPtr<usage_statistics::StatisticsManager>
: app_id_(app_id),
stopwatch_type_(SECONDS_HMI_NONE),
statistics_manager_(statistics_manager),
- start_time_() {
+ timer_(new Timer("HMI levels timer",this, &AppStopwatch::WriteTime, true)),
+ time_out_(60) {
+}
+
+AppStopwatch::AppStopwatch(utils::SharedPtr<StatisticsManager> statistics_manager,
+ const std::string& app_id,
+ std::uint32_t time_out)
+ : app_id_(app_id),
+ stopwatch_type_(SECONDS_HMI_NONE),
+ statistics_manager_(statistics_manager),
+ timer_(new Timer("HMI levels timer",this, &AppStopwatch::WriteTime, true)),
+ time_out_(time_out) {
+
}
AppStopwatch::~AppStopwatch() {
- if (start_time_) {
- Stop();
+ if (NULL != timer_) {
+ timer_->stop();
+ delete timer_;
}
}
void AppStopwatch::Start(AppStopwatchId stopwatch_type) {
- assert(0 == start_time_);
stopwatch_type_ = stopwatch_type;
- start_time_ = time(NULL);
+ timer_->start(time_out_);
}
void AppStopwatch::Switch(AppStopwatchId stopwatch_type) {
- Stop();
Start(stopwatch_type);
}
-void AppStopwatch::Stop() {
- assert(start_time_ != 0);
- double difference = difftime(time(NULL), start_time_);
+void AppStopwatch::WriteTime() {
if (statistics_manager_) {
- statistics_manager_->Add(app_id_, stopwatch_type_, int32_t(difference));
+ statistics_manager_->Add(app_id_, stopwatch_type_, time_out_);
}
- start_time_ = 0;
}
} // namespace usage_statistics
diff --git a/src/components/policy/test/CMakeLists.txt b/src/components/policy/test/CMakeLists.txt
index 1b39d5a25..d23a50e7f 100644
--- a/src/components/policy/test/CMakeLists.txt
+++ b/src/components/policy/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2013-2014, Ford Motor Company
+# Copyright (c) 2015, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -32,34 +32,31 @@ include_directories(
include
${GMOCK_INCLUDE_DIRECTORY}
${JSONCPP_INCLUDE_DIRECTORY}
- ../src/policy/include/
- ../src/policy/sqlite_wrapper/include
- ../src/policy/qdb_wrapper/include
- ../src/policy/usage_statistics/include
- ${CMAKE_SOURCE_DIR}/src/components/rpc_base/include
- ${CMAKE_SOURCE_DIR}/src/components/utils/include/
+ ${COMPONENTS_DIR}/policy/src/policy/include/
+ ${COMPONENTS_DIR}/policy/src/policy/sqlite_wrapper/include
+ ${COMPONENTS_DIR}/policy/src/policy/qdb_wrapper/include
+ ${COMPONENTS_DIR}/policy/src/policy/usage_statistics/include
+ ${COMPONENTS_DIR}/rpc_base/include
+ ${COMPONENTS_DIR}/config_profile/include
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/policy/src/policy/policy_table/
)
set(testLibraries
- gtest
gmock
Utils
Policy
- ${RTLIB}
- dl
UsageStatistics
- dbms
)
set(testSources
- main.cc
- usage_statistics_test.cc
- shared_library_test.cc
- generated_code_test.cc
- policy_manager_impl_test.cc
+ usage_statistics_test.cc
+ shared_library_test.cc
+ generated_code_test.cc
+ #policy_manager_impl_test.cc
)
- include_directories(../src/policy/policy_table/table_struct)
+ include_directories(${COMPONENTS_DIR}/policy/src/policy/policy_table/table_struct)
list (APPEND testSources
sql_pt_representation_test.cc
)
@@ -80,17 +77,19 @@ else ()
find_package(Sqlite3 REQUIRED)
include_directories(../src/policy/sqlite_wrapper/include)
list (APPEND testSources
- sqlite_wrapper/sql_database_test.cc
- sqlite_wrapper/sql_query_test.cc
- generated_code_with_sqlite_test.cc
- policy_manager_impl_stress_test.cc
+ sqlite_wrapper/sql_database_test.cc
+ sqlite_wrapper/sql_query_test.cc
+ generated_code_with_sqlite_test.cc
+
+ # TODO{ALeshin} AssertTrue in SetUpTestCase() return false
+ #policy_manager_impl_stress_test.cc
)
list (APPEND testLibraries sqlite3)
endif()
-add_executable(policy_test ${testSources})
-target_link_libraries(policy_test ${testLibraries})
+create_test("policy_test" "${testSources}" "${testLibraries}")
file(COPY valid_sdl_pt_update.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY sdl_preloaded_pt.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY smartDeviceLink.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/src/components/policy/test/generated_code_test.cc b/src/components/policy/test/generated_code_test.cc
index 3c5b013c3..5b590ce46 100644
--- a/src/components/policy/test/generated_code_test.cc
+++ b/src/components/policy/test/generated_code_test.cc
@@ -45,7 +45,8 @@ namespace test {
namespace components {
namespace policy {
-TEST(PolicyGeneratedCodeTest, TestValidPTPreloadJsonIsValid) {
+TEST(PolicyGeneratedCodeTest, DISABLED_TestValidPTPreloadJsonIsValid) {
+ // TODO(AGaliuzov) APPLINK-10657 neet to enable this tests
std::ifstream json_file("sdl_preloaded_pt.json");
ASSERT_TRUE(json_file.is_open());
Json::Value valid_table;
@@ -56,7 +57,8 @@ TEST(PolicyGeneratedCodeTest, TestValidPTPreloadJsonIsValid) {
ASSERT_RPCTYPE_VALID(table);
}
-TEST(PolicyGeneratedCodeTest, TestValidPTUpdateJsonIsValid) {
+TEST(PolicyGeneratedCodeTest, DISABLED_TestValidPTUpdateJsonIsValid) {
+ // TODO(AGaliuzov) APPLINK-10657 neet to enable this tests
std::ifstream json_file("valid_sdl_pt_update.json");
ASSERT_TRUE(json_file.is_open());
Json::Value valid_table;
diff --git a/src/components/policy/test/generated_code_with_sqlite_test.cc b/src/components/policy/test/generated_code_with_sqlite_test.cc
index 8c9eef371..76737c366 100644
--- a/src/components/policy/test/generated_code_with_sqlite_test.cc
+++ b/src/components/policy/test/generated_code_with_sqlite_test.cc
@@ -1,38 +1,36 @@
-/* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (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 <sqlite3.h>
-
#include "gtest/gtest.h"
-
#include "generated_code_with_sqlite_test.h"
namespace rpc {
@@ -62,55 +60,83 @@ class GeneratedCodeTest : public ::testing::Test {
const std::string GeneratedCodeTest::kDatabaseName = "test_db";
-const std::string GeneratedCodeTest::kEndpointsCreation = "CREATE TABLE Endpoints ("
- "endpoint_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"
- "service_id VARCHAR(45) NOT NULL,"
- "application_id VARCHAR(45),"
- "url VARCHAR(45) NOT NULL,"
- "is_default INTEGER NOT NULL CHECK(is_default>=0))";
-
-const std::string GeneratedCodeTest::kEndpointsContent = "INSERT INTO Endpoints "
- "VALUES (1, '0x07', null, 'http://test.example.com', 1)";
-
-const std::string GeneratedCodeTest::kAppPoliciesCreation = "CREATE TABLE AppPolicies ("
- "id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"
- "application_id VARCHAR(45),"
- "priority VARCHAR(45),"
- "is_default INTEGER NOT NULL CHECK(is_default>=0))";
+const std::string GeneratedCodeTest::kEndpointsCreation =
+ "CREATE TABLE Endpoints ("
+ "endpoint_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"
+ "service_id VARCHAR(45) NOT NULL,"
+ "application_id VARCHAR(45),"
+ "url VARCHAR(45) NOT NULL,"
+ "is_default INTEGER NOT NULL CHECK(is_default>=0))";
+
+const std::string GeneratedCodeTest::kEndpointsContent =
+ "INSERT INTO Endpoints "
+ "VALUES (1, '0x07', null, 'http://test.example.com', 1)";
+
+const std::string GeneratedCodeTest::kAppPoliciesCreation =
+ "CREATE TABLE AppPolicies ("
+ "id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"
+ "application_id VARCHAR(45),"
+ "priority VARCHAR(45),"
+ "is_default INTEGER NOT NULL CHECK(is_default>=0))";
const std::string GeneratedCodeTest::kGroupsCreation = "CREATE TABLE Groups ("
- "id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"
- "application_id VARCHAR(45) NOT NULL,"
- "group_name VARCHAR(45) NOT NULL )";
+ "id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"
+ "application_id VARCHAR(45) NOT NULL,"
+ "group_name VARCHAR(45) NOT NULL )";
+TEST_F(GeneratedCodeTest, FindSectionEndpoints_OpenDBSetDefaultUrl_ExpectDefaultUrl) {
-TEST_F(GeneratedCodeTest, FindSectionEndpoints) {
+ //arrange
dbms::SQLDatabase db(GeneratedCodeTest::kDatabaseName);
+
+ //assert
EXPECT_TRUE(db.Open());
policy_table::ServiceEndpoints ep;
+
+ //assert
EXPECT_TRUE(policy_table::FindSection(&db, ep));
EXPECT_EQ(1u, ep.size());
+
+ //act
std::string url = ep["0x07"]["default"].front();
+
+ //assert
EXPECT_EQ("http://test.example.com", url);
}
-TEST_F(GeneratedCodeTest, RemoveSectionEndpoints) {
+TEST_F(GeneratedCodeTest, RemoveSectionEndpoints_RemoveSectionEndpoints_Expect0EndPoints) {
+ //arrange
dbms::SQLDatabase db(GeneratedCodeTest::kDatabaseName);
+
+ //assert
EXPECT_TRUE(db.Open());
+
+ //act
policy_table::ServiceEndpoints ep;
+
+ //assert
EXPECT_TRUE(policy_table::RemoveSection(&db, ep));
dbms::SQLQuery sqlquery(&db);
+
+ //act
std::string check_query = "select count (*) from endpoints";
+
+ //assert
EXPECT_TRUE(sqlquery.Prepare(check_query));
EXPECT_TRUE(sqlquery.Exec());
// Index for binding starts from 1, index for results starts from 0
EXPECT_EQ(0, sqlquery.GetInteger(0));
}
-TEST_F(GeneratedCodeTest, UpdateSectionEndpoints) {
+TEST_F(GeneratedCodeTest, UpdateSectionEndpoints_SetUrlPoint_ExpectPointEqualsUrl) {
+
+ //arrange
dbms::SQLDatabase db(GeneratedCodeTest::kDatabaseName);
+
+ //assert
EXPECT_TRUE(db.Open());
+ //act
std::string test_url = "http://url.example.com";
policy_table::URL urls;
@@ -122,35 +148,52 @@ TEST_F(GeneratedCodeTest, UpdateSectionEndpoints) {
policy_table::ServiceEndpoints ep;
ep["0x07"] = urllist;
+ //assert
EXPECT_TRUE(policy_table::UpdateSection(&db, ep));
dbms::SQLQuery sqlquery(&db);
std::string num_of_records_check = "select count (*) from endpoints";
+
+ //assert
EXPECT_TRUE(sqlquery.Prepare(num_of_records_check));
EXPECT_TRUE(sqlquery.Exec());
// Index for binding starts from 1, index for results starts from 0
EXPECT_EQ(1, sqlquery.GetInteger(0));
EXPECT_TRUE(sqlquery.Reset());
+
+ //act
std::string url_check_query = "select * from endpoints";
+
+ //assert
EXPECT_TRUE(sqlquery.Prepare(url_check_query));
EXPECT_TRUE(sqlquery.Exec());
// Index for binding starts from 1, index for results starts from 0
EXPECT_EQ(test_url, sqlquery.GetString(3));
}
-TEST_F(GeneratedCodeTest, UpdateSectionAppPolicies) {
+TEST_F(GeneratedCodeTest, UpdateSectionAppPolicies_SetAppParams_ExpectDBHasThem) {
+
+ //arrange
dbms::SQLDatabase db(GeneratedCodeTest::kDatabaseName);
+
+ //assert
EXPECT_TRUE(db.Open());
+ //act
policy_table::ApplicationPolicies ap;
const std::string application_id = "12345678";
ap[application_id].groups.push_back("Base-4");
ap[application_id].priority = policy_table::P_NORMAL;
+ //assert
EXPECT_TRUE(policy_table::UpdateSection(&db, ap));
+ //act
dbms::SQLQuery sqlquery(&db);
+
+
+ //assert
EXPECT_TRUE(sqlquery.Prepare("select count (*) from AppPolicies"));
EXPECT_TRUE(sqlquery.Exec());
// Index for binding starts from 1, index for results starts from 0
@@ -163,7 +206,9 @@ TEST_F(GeneratedCodeTest, UpdateSectionAppPolicies) {
EXPECT_EQ(1, sqlquery.GetInteger(0));
EXPECT_TRUE(sqlquery.Reset());
- EXPECT_TRUE(sqlquery.Prepare("select application_id from Groups where group_name='Base-4'"));
+ EXPECT_TRUE(
+ sqlquery.Prepare(
+ "select application_id from Groups where group_name='Base-4'"));
EXPECT_TRUE(sqlquery.Exec());
// Index for binding starts from 1, index for results starts from 0
EXPECT_EQ(application_id, sqlquery.GetString(0));
diff --git a/src/components/policy/test/include.cmake b/src/components/policy/test/include.cmake
index fa9622e1c..0474df54d 100644
--- a/src/components/policy/test/include.cmake
+++ b/src/components/policy/test/include.cmake
@@ -58,14 +58,8 @@ list(APPEND testSources
# ${POLICY_DIR}/test/shared_library_test.cc
)
-if (EXTENDED_POLICY_FLAG)
- add_definitions(-DEXTENDED_POLICY)
- include_directories(${POLICY_DIR}/src/policy/policy_table/table_struct_ext)
- list (APPEND testSources ${POLICY_DIR}/test/sql_pt_ext_representation_test.cc)
-else ()
include_directories(${POLICY_DIR}/src/policy/policy_table/table_struct)
list (APPEND testSources ${POLICY_DIR}/test/sql_pt_representation_test.cc)
-endif ()
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
list(REMOVE_ITEM test_exec_libraries dl)
diff --git a/src/components/policy/test/include/mock_cache_manager.h b/src/components/policy/test/include/mock_cache_manager.h
index 610a7a3fb..0494eae4f 100644
--- a/src/components/policy/test/include/mock_cache_manager.h
+++ b/src/components/policy/test/include/mock_cache_manager.h
@@ -72,8 +72,10 @@ class MockCacheManagerInterface : public CacheManagerInterface {
bool(const std::string& value));
MOCK_METHOD2(GetUserFriendlyMsg,
std::vector<UserFriendlyMessage>(const std::vector<std::string>& msg_codes, const std::string& language));
- MOCK_METHOD1(GetUpdateUrls,
- EndpointUrls(int service_type));
+ MOCK_METHOD2(GetServiceUrls,
+ void(const std::string& service_type, EndpointUrls& end_points));
+ MOCK_CONST_METHOD0(GetLockScreenIconUrl,
+ std::string());
MOCK_METHOD1(GetNotificationsNumber,
int(const std::string& priority));
MOCK_METHOD2(GetPriority,
@@ -92,7 +94,7 @@ class MockCacheManagerInterface : public CacheManagerInterface {
void(bool status));
MOCK_METHOD3(GetInitialAppData,
bool(const std::string& app_id, StringArray& nicknames, StringArray& app_hmi_types));
- MOCK_METHOD1(IsApplicationRevoked,
+ MOCK_CONST_METHOD1(IsApplicationRevoked,
bool(const std::string& app_id));
MOCK_METHOD1(GetFunctionalGroupings,
bool(policy_table::FunctionalGroupings& groups));
@@ -100,8 +102,8 @@ class MockCacheManagerInterface : public CacheManagerInterface {
bool(const std::string& app_id));
MOCK_METHOD1(IsDefaultPolicy,
bool(const std::string& app_id));
- MOCK_METHOD2(SetIsDefault,
- bool(const std::string& app_id, bool is_default));
+ MOCK_METHOD1(SetIsDefault,
+ bool(const std::string& app_id));
MOCK_METHOD1(IsPredataPolicy,
bool(const std::string& app_id));
MOCK_METHOD1(SetDefaultPolicy,
@@ -142,8 +144,8 @@ class MockCacheManagerInterface : public CacheManagerInterface {
void(const std::string& app_id, usage_statistics::AppInfoId type, const std::string& value));
MOCK_METHOD3(Add,
void(const std::string& app_id, usage_statistics::AppStopwatchId type, int seconds));
- MOCK_METHOD3(CountUnconsentedGroups,
- bool(const std::string& policy_app_id, const std::string& device_id, int& result));
+ MOCK_METHOD2(CountUnconsentedGroups,
+ int(const std::string& policy_app_id, const std::string& device_id));
MOCK_METHOD1(GetFunctionalGroupNames,
bool(FunctionalGroupNames& names));
MOCK_METHOD2(GetAllAppGroups,
@@ -158,12 +160,10 @@ class MockCacheManagerInterface : public CacheManagerInterface {
void(const std::string& app_id, const std::string& group_name));
MOCK_METHOD1(SetPredataPolicy,
bool(const std::string& app_id));
- MOCK_METHOD2(SetIsPredata,
- bool(const std::string& app_id, bool is_pre_data));
- MOCK_METHOD1(CleanupUnpairedDevices,
- bool(const DeviceIds& device_ids));
- MOCK_METHOD1(SetUnpairedDevice,
- bool(const std::string& device_id));
+ MOCK_METHOD0(CleanupUnpairedDevices,
+ bool());
+ MOCK_METHOD2(SetUnpairedDevice,
+ bool(const std::string& device_id, bool unpaired));
MOCK_METHOD1(UnpairedDevicesList,
bool(DeviceIds& device_ids));
MOCK_METHOD1(ResetPT,
@@ -176,6 +176,18 @@ class MockCacheManagerInterface : public CacheManagerInterface {
void());
MOCK_CONST_METHOD1(HeartBeatTimeout,
uint16_t(const std::string& app_id));
+ MOCK_CONST_METHOD2(GetAppRequestTypes,
+ void(const std::string& policy_app_id,
+ std::vector<std::string>& request_types));
+ MOCK_METHOD1(GetHMIAppTypeAfterUpdate,
+ void(std::map<std::string, StringArray>& app_hmi_types));
+ MOCK_METHOD0(ResetCalculatedPermissions,
+ void());
+ MOCK_METHOD3(AddCalculatedPermissions,
+ void(const std::string& device_id, const std::string& policy_app_id, const policy::Permissions& permissions));
+ MOCK_METHOD3(IsPermissionsCalculated,
+ bool(const std::string& device_id, const std::string& policy_app_id, policy::Permissions& permission));
+ MOCK_CONST_METHOD0(RemoteAppsUrl, std::string());
};
} // namespace policy
diff --git a/src/components/policy/test/include/mock_policy_listener.h b/src/components/policy/test/include/mock_policy_listener.h
index 8e7a67c1f..6cbca0557 100644
--- a/src/components/policy/test/include/mock_policy_listener.h
+++ b/src/components/policy/test/include/mock_policy_listener.h
@@ -47,18 +47,17 @@ namespace policy {
class MockPolicyListener : public PolicyListener {
public:
- MOCK_METHOD0(OnPTExchangeNeeded,
- void());
MOCK_METHOD3(OnPermissionsUpdated,
void(const std::string& policy_app_id,
const Permissions& permissions,
const policy::HMILevel& default_hmi));
+ MOCK_METHOD2(OnPermissionsUpdated,
+ void(const std::string& policy_app_id,
+ const Permissions& permissions));
MOCK_METHOD1(OnPendingPermissionChange,
void(const std::string& policy_app_id));
- MOCK_METHOD1(OnAppRevoked,
- void(const std::string& policy_app_id));
MOCK_METHOD1(OnUpdateStatusChanged,
- void(policy::PolicyTableStatus status));
+ void(const std::string& status));
MOCK_METHOD1(OnCurrentDeviceIdUpdateRequired,
std::string(const std::string& policy_app_id));
MOCK_METHOD0(OnSystemInfoUpdateRequired,
@@ -70,6 +69,17 @@ class MockPolicyListener : public PolicyListener {
MOCK_METHOD2(OnDeviceConsentChanged,
void(const std::string& device_id,
bool is_allowed));
+ MOCK_METHOD1(OnUpdateHMIAppType,
+ void(std::map<std::string, StringArray>));
+ MOCK_METHOD1(GetAvailableApps,
+ void(std::queue<std::string>&));
+ MOCK_METHOD3(OnSnapshotCreated,
+ void(const BinaryMessage& pt_string,
+ const std::vector<int>& retry_seconds,
+ int timeout_exceed));
+ MOCK_METHOD0(CanUpdate,
+ bool());
+ MOCK_METHOD1(OnCertificateUpdated, void (const std::string&));
};
} // namespace policy
diff --git a/src/components/policy/test/include/mock_pt_ext_representation.h b/src/components/policy/test/include/mock_pt_ext_representation.h
index dbd421706..fd779dc1f 100644
--- a/src/components/policy/test/include/mock_pt_ext_representation.h
+++ b/src/components/policy/test/include/mock_pt_ext_representation.h
@@ -121,7 +121,7 @@ class MockPTExtRepresentation : public MockPTRepresentation,
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_METHOD1(SetUnpairedDevice, bool(const std::string& device_id));
+ 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));
diff --git a/src/components/policy/test/include/mock_pt_representation.h b/src/components/policy/test/include/mock_pt_representation.h
index f9b188983..720c646ab 100644
--- a/src/components/policy/test/include/mock_pt_representation.h
+++ b/src/components/policy/test/include/mock_pt_representation.h
@@ -79,8 +79,8 @@ class MockPTRepresentation : virtual public PTRepresentation {
MOCK_METHOD2(GetUserFriendlyMsg,
std::vector<UserFriendlyMessage>(const std::vector<std::string>& msg_code,
const std::string& language));
- MOCK_METHOD1(GetUpdateUrls,
- EndpointUrls(int service_type));
+ MOCK_METHOD2(GetUpdateUrls,
+ void(int service_type, EndpointUrls&));
MOCK_METHOD1(GetNotificationsNumber,
int(const std::string& priority));
MOCK_METHOD0(Init,
diff --git a/src/components/policy/test/include/mock_update_status_manager.h b/src/components/policy/test/include/mock_update_status_manager.h
index 9956a34c5..005027680 100644
--- a/src/components/policy/test/include/mock_update_status_manager.h
+++ b/src/components/policy/test/include/mock_update_status_manager.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -34,11 +34,11 @@
#include "gmock/gmock.h"
-#include "policy/update_status_manager_interface.h"
+#include "policy/update_status_manager.h"
namespace policy {
-class MockUpdateStatusManagerInterface : public UpdateStatusManagerInterface {
+class MockUpdateStatusManager : public UpdateStatusManager {
public:
MOCK_METHOD1(set_listener,
void(PolicyListener* listener));
diff --git a/src/components/policy/test/log4cxx.properties b/src/components/policy/test/log4cxx.properties
index 632ab540c..1c0944498 100644
--- a/src/components/policy/test/log4cxx.properties
+++ b/src/components/policy/test/log4cxx.properties
@@ -14,8 +14,20 @@ log4j.appender.SQLPTRepresentationLogFile.layout.ConversionPattern=%-5p [%d{dd M
log4j.appender.SQLPTRepresentationLogFile.Schedule=DAILY
log4j.appender.SQLPTRepresentationLogFile.DatePattern='.' yyyy-MM-dd
+# Log for all PolicyManagerImpl messages
+log4j.appender.PolicyManagerImplLogFile=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.PolicyManagerImplLogFile.File=PolicyManagerImpl.log
+log4j.appender.PolicyManagerImplLogFile.ImmediateFlush=true
+log4j.appender.PolicyManagerImplLogFile.layout=org.apache.log4j.PatternLayout
+log4j.appender.PolicyManagerImplLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}] :%L %M: %m%n
+log4j.appender.PolicyManagerImplLogFile.Schedule=DAILY
+log4j.appender.PolicyManagerImplLogFile.DatePattern='.' yyyy-MM-dd
+
# All SmartDeviceLinkCore logs
log4j.rootLogger=ALL, Console
# SQLPTRepresentation logs
-log4j.logger.SQLPTRepresentation=ALL, SQLPTRepresentationLogFile \ No newline at end of file
+log4j.logger.SQLPTRepresentation=ALL, SQLPTRepresentationLogFile
+
+# PolicyManagerImpl logs
+log4j.logger.PolicyManagerImpl=ALL, PolicyManagerImplLogFile
diff --git a/src/components/policy/test/policy.sql b/src/components/policy/test/policy.sql
index 406579f6b..c9905f3f8 100644
--- a/src/components/policy/test/policy.sql
+++ b/src/components/policy/test/policy.sql
@@ -1,295 +1,295 @@
-BEGIN TRANSACTION;
- CREATE TABLE IF NOT EXISTS `device`(
- `id` VARCHAR(100) PRIMARY KEY NOT NULL,
- `hardware` VARCHAR(45),
- `firmware_rev` VARCHAR(45),
- `os` VARCHAR(45),
- `os_version` VARCHAR(45),
- `carrier` VARCHAR(45),
+BEGIN TRANSACTION;
+ CREATE TABLE IF NOT EXISTS `device`(
+ `id` VARCHAR(100) PRIMARY KEY NOT NULL,
+ `hardware` VARCHAR(45),
+ `firmware_rev` VARCHAR(45),
+ `os` VARCHAR(45),
+ `os_version` VARCHAR(45),
+ `carrier` VARCHAR(45),
`max_number_rfcom_ports` INTEGER ,
`connection_type` VARCHAR(45),
- `unpaired` BOOL
- );
- CREATE TABLE IF NOT EXISTS `usage_and_error_count`(
- `count_of_iap_buffer_full` INTEGER,
- `count_sync_out_of_memory` INTEGER,
- `count_of_sync_reboots` INTEGER
- );
- INSERT OR IGNORE INTO `usage_and_error_count` (
- `count_of_iap_buffer_full`, `count_sync_out_of_memory`,
- `count_of_sync_reboots`) VALUES (0, 0, 0);
- CREATE TABLE IF NOT EXISTS `module_meta`(
- `ccpu_version` VARCHAR(45),
- `language` VARCHAR(45),
- `wers_country_code` VARCHAR(45),
- `pt_exchanged_at_odometer_x` INTEGER NOT NULL DEFAULT 0,
- `pt_exchanged_x_days_after_epoch` INTEGER NOT NULL DEFAULT 0,
- `ignition_cycles_since_last_exchange` INTEGER NOT NULL DEFAULT 0,
+ `unpaired` BOOL
+ );
+ CREATE TABLE IF NOT EXISTS `usage_and_error_count`(
+ `count_of_iap_buffer_full` INTEGER,
+ `count_sync_out_of_memory` INTEGER,
+ `count_of_sync_reboots` INTEGER
+ );
+ INSERT OR IGNORE INTO `usage_and_error_count` (
+ `count_of_iap_buffer_full`, `count_sync_out_of_memory`,
+ `count_of_sync_reboots`) VALUES (0, 0, 0);
+ CREATE TABLE IF NOT EXISTS `module_meta`(
+ `ccpu_version` VARCHAR(45),
+ `language` VARCHAR(45),
+ `wers_country_code` VARCHAR(45),
+ `pt_exchanged_at_odometer_x` INTEGER NOT NULL DEFAULT 0,
+ `pt_exchanged_x_days_after_epoch` INTEGER NOT NULL DEFAULT 0,
+ `ignition_cycles_since_last_exchange` INTEGER NOT NULL DEFAULT 0,
`vin` VARCHAR(45),
- `flag_update_required` BOOL NOT NULL
- );
- INSERT OR IGNORE INTO `module_meta` (`pt_exchanged_at_odometer_x`,
+ `flag_update_required` BOOL NOT NULL
+ );
+ INSERT OR IGNORE INTO `module_meta` (`pt_exchanged_at_odometer_x`,
`pt_exchanged_x_days_after_epoch`, `ignition_cycles_since_last_exchange`,
- `flag_update_required`)
- VALUES (0, 0, 0, 0);
- CREATE TABLE IF NOT EXISTS `module_config`(
- `preloaded_pt` BOOL NOT NULL,
+ `flag_update_required`)
+ VALUES (0, 0, 0, 0);
+ CREATE TABLE IF NOT EXISTS `module_config`(
+ `preloaded_pt` BOOL NOT NULL,
`is_first_run` BOOL NOT NULL,
- `exchange_after_x_ignition_cycles` INTEGER NOT NULL,
- `exchange_after_x_kilometers` INTEGER NOT NULL,
- `exchange_after_x_days` INTEGER NOT NULL,
- `timeout_after_x_seconds` INTEGER NOT NULL,
- `vehicle_make` VARCHAR(45),
- `vehicle_model` VARCHAR(45),
- `vehicle_year` VARCHAR(4)
- );
+ `exchange_after_x_ignition_cycles` INTEGER NOT NULL,
+ `exchange_after_x_kilometers` INTEGER NOT NULL,
+ `exchange_after_x_days` INTEGER NOT NULL,
+ `timeout_after_x_seconds` INTEGER NOT NULL,
+ `vehicle_make` VARCHAR(45),
+ `vehicle_model` VARCHAR(45),
+ `vehicle_year` VARCHAR(4)
+ );
INSERT OR IGNORE INTO `module_config` (`preloaded_pt`, `is_first_run`,
- `exchange_after_x_ignition_cycles`, `exchange_after_x_kilometers`,
- `exchange_after_x_days`, `timeout_after_x_seconds`)
- VALUES(1, 1, 0, 0, 0, 0);
- CREATE TABLE IF NOT EXISTS `functional_group`(
- `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
- `user_consent_prompt` TEXT UNIQUE ON CONFLICT REPLACE,
- `name` VARCHAR(100) NOT NULL
- );
- CREATE TABLE IF NOT EXISTS `priority`(
- `value` VARCHAR(45) PRIMARY KEY NOT NULL
- );
+ `exchange_after_x_ignition_cycles`, `exchange_after_x_kilometers`,
+ `exchange_after_x_days`, `timeout_after_x_seconds`)
+ VALUES(1, 1, 0, 0, 0, 0);
+ CREATE TABLE IF NOT EXISTS `functional_group`(
+ `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ `user_consent_prompt` TEXT UNIQUE ON CONFLICT REPLACE,
+ `name` VARCHAR(100) NOT NULL
+ );
+ CREATE TABLE IF NOT EXISTS `priority`(
+ `value` VARCHAR(45) PRIMARY KEY NOT NULL
+ );
INSERT OR IGNORE INTO `priority`(`value`) VALUES ('EMERGENCY');
INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NAVIGATION');
INSERT OR IGNORE INTO `priority`(`value`) VALUES ('VOICECOMMUNICATION');
INSERT OR IGNORE INTO `priority`(`value`) VALUES ('COMMUNICATION');
INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NORMAL');
INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NONE');
- CREATE TABLE IF NOT EXISTS `hmi_level`(
- `value` VARCHAR(45) PRIMARY KEY NOT NULL
- );
+ CREATE TABLE IF NOT EXISTS `hmi_level`(
+ `value` VARCHAR(45) PRIMARY KEY NOT NULL
+ );
INSERT OR IGNORE INTO `hmi_level`(`value`) VALUES ('FULL');
INSERT OR IGNORE INTO `hmi_level`(`value`) VALUES ('LIMITED');
INSERT OR IGNORE INTO `hmi_level`(`value`) VALUES ('BACKGROUND');
INSERT OR IGNORE INTO `hmi_level`(`value`) VALUES ('NONE');
- CREATE TABLE IF NOT EXISTS `notifications_by_priority`(
- `priority_value` VARCHAR(45) PRIMARY KEY NOT NULL,
- `value` INTEGER NOT NULL,
- CONSTRAINT `fk_notifications_by_priority_priority1`
- FOREIGN KEY(`priority_value`)
- REFERENCES `priority`(`value`)
- );
- CREATE INDEX IF NOT EXISTS
- `notifications_by_priority.fk_notifications_by_priority_priority1_idx`
- ON `notifications_by_priority`(`priority_value`);
- CREATE TABLE IF NOT EXISTS `language`(
- `code` VARCHAR(25) PRIMARY KEY NOT NULL
- );
- CREATE TABLE IF NOT EXISTS `message_type`(
- `name` VARCHAR(45) PRIMARY KEY NOT NULL
- );
- CREATE TABLE IF NOT EXISTS `version`(
- `number` VARCHAR(45) NOT NULL
- );
- INSERT OR IGNORE INTO `version` (`number`) VALUES('0');
- CREATE TABLE IF NOT EXISTS `rpc`(
- `id` INTEGER PRIMARY KEY NOT NULL,
- `name` VARCHAR(45) NOT NULL,
- `parameter` VARCHAR(45),
- `hmi_level_value` VARCHAR(45) NOT NULL,
- `functional_group_id` INTEGER NOT NULL,
- CONSTRAINT `fk_rpc_hmi_level1`
- FOREIGN KEY(`hmi_level_value`)
- REFERENCES `hmi_level`(`value`),
- CONSTRAINT `fk_rpc_functional_group1`
- FOREIGN KEY(`functional_group_id`)
- REFERENCES `functional_group`(`id`)
- );
- CREATE INDEX IF NOT EXISTS `rpc.fk_rpc_hmi_level1_idx`
- ON `rpc`(`hmi_level_value`);
- CREATE INDEX IF NOT EXISTS `rpc.fk_rpc_functional_group1_idx`
- ON `rpc`(`functional_group_id`);
- CREATE INDEX `rpc.select_rpc_name_hmi_level`
+ CREATE TABLE IF NOT EXISTS `notifications_by_priority`(
+ `priority_value` VARCHAR(45) PRIMARY KEY NOT NULL,
+ `value` INTEGER NOT NULL,
+ CONSTRAINT `fk_notifications_by_priority_priority1`
+ FOREIGN KEY(`priority_value`)
+ REFERENCES `priority`(`value`)
+ );
+ CREATE INDEX IF NOT EXISTS
+ `notifications_by_priority.fk_notifications_by_priority_priority1_idx`
+ ON `notifications_by_priority`(`priority_value`);
+ CREATE TABLE IF NOT EXISTS `language`(
+ `code` VARCHAR(25) PRIMARY KEY NOT NULL
+ );
+ CREATE TABLE IF NOT EXISTS `message_type`(
+ `name` VARCHAR(45) PRIMARY KEY NOT NULL
+ );
+ CREATE TABLE IF NOT EXISTS `version`(
+ `number` VARCHAR(45) NOT NULL
+ );
+ INSERT OR IGNORE INTO `version` (`number`) VALUES('0');
+ CREATE TABLE IF NOT EXISTS `rpc`(
+ `id` INTEGER PRIMARY KEY NOT NULL,
+ `name` VARCHAR(45) NOT NULL,
+ `parameter` VARCHAR(45),
+ `hmi_level_value` VARCHAR(45) NOT NULL,
+ `functional_group_id` INTEGER NOT NULL,
+ CONSTRAINT `fk_rpc_hmi_level1`
+ FOREIGN KEY(`hmi_level_value`)
+ REFERENCES `hmi_level`(`value`),
+ CONSTRAINT `fk_rpc_functional_group1`
+ FOREIGN KEY(`functional_group_id`)
+ REFERENCES `functional_group`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS `rpc.fk_rpc_hmi_level1_idx`
+ ON `rpc`(`hmi_level_value`);
+ CREATE INDEX IF NOT EXISTS `rpc.fk_rpc_functional_group1_idx`
+ ON `rpc`(`functional_group_id`);
+ CREATE INDEX `rpc.select_rpc_name_hmi_level`
ON `rpc`(`name`,`hmi_level_value`);
- CREATE TABLE IF NOT EXISTS `application`(
- `id` VARCHAR(45) PRIMARY KEY NOT NULL,
- `keep_context` BOOLEAN,
- `steal_focus` BOOLEAN,
- `default_hmi` VARCHAR(45),
- `priority_value` VARCHAR(45),
- `is_revoked` BOOLEAN,
- `is_default` BOOLEAN,
+ CREATE TABLE IF NOT EXISTS `application`(
+ `id` VARCHAR(45) PRIMARY KEY NOT NULL,
+ `keep_context` BOOLEAN,
+ `steal_focus` BOOLEAN,
+ `default_hmi` VARCHAR(45),
+ `priority_value` VARCHAR(45),
+ `is_revoked` BOOLEAN,
+ `is_default` BOOLEAN,
`is_predata` BOOLEAN,
- `memory_kb` INTEGER NOT NULL,
- `heart_beat_timeout_ms` INTEGER NOT NULL,
- `certificate` VARCHAR(45),
- CONSTRAINT `fk_application_hmi_level1`
- FOREIGN KEY(`default_hmi`)
- REFERENCES `hmi_level`(`value`),
- CONSTRAINT `fk_application_priorities1`
- FOREIGN KEY(`priority_value`)
- REFERENCES `priority`(`value`)
- );
- CREATE INDEX IF NOT EXISTS `application.fk_application_hmi_level1_idx`
- ON `application`(`default_hmi`);
- CREATE INDEX IF NOT EXISTS `application.fk_application_priorities1_idx`
- ON `application`(`priority_value`);
- CREATE TABLE IF NOT EXISTS `app_group`(
- `application_id` VARCHAR(45) NOT NULL,
- `functional_group_id` INTEGER NOT NULL,
- PRIMARY KEY(`application_id`,`functional_group_id`),
- CONSTRAINT `fk_application_has_functional_group_application1`
- FOREIGN KEY(`application_id`)
- REFERENCES `application`(`id`),
- CONSTRAINT `fk_application_has_functional_group_functional_group1`
- FOREIGN KEY(`functional_group_id`)
- REFERENCES `functional_group`(`id`)
- );
- CREATE INDEX IF NOT EXISTS `app_group.fk_application_has_functional_group_functional_group1_idx`
- ON `app_group`(`functional_group_id`);
- CREATE INDEX IF NOT EXISTS `app_group.fk_application_has_functional_group_application1_idx`
- ON `app_group`(`application_id`);
- CREATE TABLE IF NOT EXISTS `preconsented_group`(
- `application_id` VARCHAR(45) NOT NULL,
- `functional_group_id` INTEGER NOT NULL,
- PRIMARY KEY(`application_id`,`functional_group_id`),
- CONSTRAINT `fk_application_has_functional_group_application2`
- FOREIGN KEY(`application_id`)
- REFERENCES `application`(`id`),
- CONSTRAINT `fk_application_has_functional_group_functional_group2`
- FOREIGN KEY(`functional_group_id`)
- REFERENCES `functional_group`(`id`)
- );
- CREATE INDEX IF NOT EXISTS
- `preconsented_group.fk_application_has_functional_group_functional_group2_idx`
- ON `preconsented_group`(`functional_group_id`);
- CREATE INDEX IF NOT EXISTS
- `preconsented_group.fk_application_has_functional_group_application2_idx`
- ON `preconsented_group`(`application_id`);
- CREATE TABLE IF NOT EXISTS `seconds_between_retry`(
- `index` INTEGER PRIMARY KEY NOT NULL,
- `value` INTEGER NOT NULL
- );
- CREATE TABLE IF NOT EXISTS `device_consent_group`(
- `device_id` VARCHAR(100) NOT NULL,
- `functional_group_id` INTEGER NOT NULL,
- `is_consented` BOOL NOT NULL,
- `input` VARCHAR(45),
- `time_stamp` DATETIME DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY(`device_id`,`functional_group_id`),
- CONSTRAINT `fk_device_has_functional_group_device1`
- FOREIGN KEY(`device_id`)
- REFERENCES `device`(`id`),
- CONSTRAINT `fk_device_has_functional_group_functional_group1`
- FOREIGN KEY(`functional_group_id`)
- REFERENCES `functional_group`(`id`)
- );
- CREATE INDEX IF NOT EXISTS
- `device_consent_group.fk_device_has_functional_group_functional_group1_idx`
- ON `device_consent_group`(`functional_group_id`);
- CREATE INDEX IF NOT EXISTS
- `device_consent_group.fk_device_has_functional_group_device1_idx`
- ON `device_consent_group`(`device_id`);
- CREATE TABLE IF NOT EXISTS `app_level`(
- `application_id` VARCHAR(45) PRIMARY KEY NOT NULL,
- `minutes_in_hmi_full` INTEGER DEFAULT 0,
- `minutes_in_hmi_limited` INTEGER DEFAULT 0,
- `minutes_in_hmi_background` INTEGER DEFAULT 0,
- `minutes_in_hmi_none` INTEGER DEFAULT 0,
+ `memory_kb` INTEGER NOT NULL,
+ `heart_beat_timeout_ms` INTEGER NOT NULL,
+ `certificate` VARCHAR(45),
+ CONSTRAINT `fk_application_hmi_level1`
+ FOREIGN KEY(`default_hmi`)
+ REFERENCES `hmi_level`(`value`),
+ CONSTRAINT `fk_application_priorities1`
+ FOREIGN KEY(`priority_value`)
+ REFERENCES `priority`(`value`)
+ );
+ CREATE INDEX IF NOT EXISTS `application.fk_application_hmi_level1_idx`
+ ON `application`(`default_hmi`);
+ CREATE INDEX IF NOT EXISTS `application.fk_application_priorities1_idx`
+ ON `application`(`priority_value`);
+ CREATE TABLE IF NOT EXISTS `app_group`(
+ `application_id` VARCHAR(45) NOT NULL,
+ `functional_group_id` INTEGER NOT NULL,
+ PRIMARY KEY(`application_id`,`functional_group_id`),
+ CONSTRAINT `fk_application_has_functional_group_application1`
+ FOREIGN KEY(`application_id`)
+ REFERENCES `application`(`id`),
+ CONSTRAINT `fk_application_has_functional_group_functional_group1`
+ FOREIGN KEY(`functional_group_id`)
+ REFERENCES `functional_group`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS `app_group.fk_application_has_functional_group_functional_group1_idx`
+ ON `app_group`(`functional_group_id`);
+ CREATE INDEX IF NOT EXISTS `app_group.fk_application_has_functional_group_application1_idx`
+ ON `app_group`(`application_id`);
+ CREATE TABLE IF NOT EXISTS `preconsented_group`(
+ `application_id` VARCHAR(45) NOT NULL,
+ `functional_group_id` INTEGER NOT NULL,
+ PRIMARY KEY(`application_id`,`functional_group_id`),
+ CONSTRAINT `fk_application_has_functional_group_application2`
+ FOREIGN KEY(`application_id`)
+ REFERENCES `application`(`id`),
+ CONSTRAINT `fk_application_has_functional_group_functional_group2`
+ FOREIGN KEY(`functional_group_id`)
+ REFERENCES `functional_group`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS
+ `preconsented_group.fk_application_has_functional_group_functional_group2_idx`
+ ON `preconsented_group`(`functional_group_id`);
+ CREATE INDEX IF NOT EXISTS
+ `preconsented_group.fk_application_has_functional_group_application2_idx`
+ ON `preconsented_group`(`application_id`);
+ CREATE TABLE IF NOT EXISTS `seconds_between_retry`(
+ `index` INTEGER PRIMARY KEY NOT NULL,
+ `value` INTEGER NOT NULL
+ );
+ CREATE TABLE IF NOT EXISTS `device_consent_group`(
+ `device_id` VARCHAR(100) NOT NULL,
+ `functional_group_id` INTEGER NOT NULL,
+ `is_consented` BOOL NOT NULL,
+ `input` VARCHAR(45),
+ `time_stamp` DATETIME DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY(`device_id`,`functional_group_id`),
+ CONSTRAINT `fk_device_has_functional_group_device1`
+ FOREIGN KEY(`device_id`)
+ REFERENCES `device`(`id`),
+ CONSTRAINT `fk_device_has_functional_group_functional_group1`
+ FOREIGN KEY(`functional_group_id`)
+ REFERENCES `functional_group`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS
+ `device_consent_group.fk_device_has_functional_group_functional_group1_idx`
+ ON `device_consent_group`(`functional_group_id`);
+ CREATE INDEX IF NOT EXISTS
+ `device_consent_group.fk_device_has_functional_group_device1_idx`
+ ON `device_consent_group`(`device_id`);
+ CREATE TABLE IF NOT EXISTS `app_level`(
+ `application_id` VARCHAR(45) PRIMARY KEY NOT NULL,
+ `minutes_in_hmi_full` INTEGER DEFAULT 0,
+ `minutes_in_hmi_limited` INTEGER DEFAULT 0,
+ `minutes_in_hmi_background` INTEGER DEFAULT 0,
+ `minutes_in_hmi_none` INTEGER DEFAULT 0,
- `count_of_user_selections` INTEGER DEFAULT 0,
- `count_of_rejections_sync_out_of_memory` INTEGER DEFAULT 0,
- `count_of_rejections_nickname_mismatch` INTEGER DEFAULT 0,
- `count_of_rejections_duplicate_name` INTEGER DEFAULT 0,
- `count_of_rejected_rpcs_calls` INTEGER DEFAULT 0,
- `count_of_rpcs_sent_in_hmi_none` INTEGER DEFAULT 0,
- `count_of_removals_for_bad_behavior` INTEGER DEFAULT 0,
- `count_of_run_attempts_while_revoked` INTEGER DEFAULT 0,
- `app_registration_language_gui` VARCHAR(25),
- `app_registration_language_vui` VARCHAR(25),
- CONSTRAINT `fk_app_levels_application1`
- FOREIGN KEY(`application_id`)
- REFERENCES `application`(`id`),
- CONSTRAINT `fk_app_level_language1`
- FOREIGN KEY(`app_registration_language_gui`)
- REFERENCES `language`(`code`),
- CONSTRAINT `fk_app_level_language2`
- FOREIGN KEY(`app_registration_language_vui`)
- REFERENCES `language`(`code`)
- );
- CREATE INDEX IF NOT EXISTS `app_level.fk_app_levels_application1_idx`
- ON `app_level`(`application_id`);
- CREATE INDEX IF NOT EXISTS `app_level.fk_app_level_language1_idx`
- ON `app_level`(`app_registration_language_gui`);
- CREATE INDEX IF NOT EXISTS `app_level.fk_app_level_language2_idx`
- ON `app_level`(`app_registration_language_vui`);
- CREATE TABLE IF NOT EXISTS `nickname`(
- `name` VARCHAR(100) NOT NULL,
- `application_id` VARCHAR(45) NOT NULL,
- PRIMARY KEY(`name`,`application_id`),
- CONSTRAINT `fk_nickname_application1`
- FOREIGN KEY(`application_id`)
- REFERENCES `application`(`id`)
- );
- CREATE INDEX IF NOT EXISTS `nickname.fk_nickname_application1_idx`
- ON `nickname`(`application_id`);
- CREATE TABLE IF NOT EXISTS `app_type`(
- `name` VARCHAR(50) NOT NULL,
- `application_id` VARCHAR(45) NOT NULL,
- PRIMARY KEY(`name`,`application_id`),
- CONSTRAINT `fk_app_type_application1`
- FOREIGN KEY(`application_id`)
- REFERENCES `application`(`id`)
- );
- CREATE INDEX IF NOT EXISTS `app_type.fk_app_type_application1_idx`
- ON `app_type`(`application_id`);
- CREATE TABLE IF NOT EXISTS `consent_group`(
- `device_id` VARCHAR(100) NOT NULL,
- `application_id` VARCHAR(45) NOT NULL,
- `functional_group_id` INTEGER NOT NULL,
- `is_consented` BOOL NOT NULL,
- `input` VARCHAR(45),
- `time_stamp` DATETIME DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY(`application_id`,`functional_group_id`,`device_id`),
- CONSTRAINT `fk_consent_group_device1`
- FOREIGN KEY(`device_id`)
- REFERENCES `device`(`id`),
- CONSTRAINT `fk_consent_group_application1`
- FOREIGN KEY(`application_id`)
- REFERENCES `application`(`id`),
- CONSTRAINT `fk_consent_group_functional_group1`
- FOREIGN KEY(`functional_group_id`)
- REFERENCES `functional_group`(`id`)
- );
- CREATE INDEX IF NOT EXISTS
- `consent_group.fk_consent_group_device1_idx`
- ON `device_consent_group`(`device_id`);
- CREATE INDEX IF NOT EXISTS `consent_group.fk_consent_group_functional_group1_idx`
- ON `consent_group`(`functional_group_id`);
- CREATE TABLE IF NOT EXISTS `endpoint`(
- `service` INTEGER NOT NULL,
- `url` VARCHAR(100) NOT NULL,
- `application_id` VARCHAR(45) NOT NULL,
- CONSTRAINT `fk_endpoint_application1`
- FOREIGN KEY(`application_id`)
- REFERENCES `application`(`id`)
- );
- CREATE INDEX IF NOT EXISTS `endpoint.fk_endpoint_application1_idx`
- ON `endpoint`(`application_id`);
- CREATE TABLE IF NOT EXISTS `message`(
- `id` INTEGER PRIMARY KEY NOT NULL,
- `tts` TEXT,
- `label` TEXT,
- `line1` TEXT,
- `line2` TEXT,
- `textBody` TEXT,
- `language_code` VARCHAR(25) NOT NULL,
- `message_type_name` VARCHAR(45) NOT NULL,
- CONSTRAINT `fk_messages_languages1`
- FOREIGN KEY(`language_code`)
- REFERENCES `language`(`code`),
- CONSTRAINT `fk_message_consumer_friendly_messages1`
- FOREIGN KEY(`message_type_name`)
- REFERENCES `message_type`(`name`)
- );
- CREATE INDEX IF NOT EXISTS `message.fk_messages_languages1_idx`
+ `count_of_user_selections` INTEGER DEFAULT 0,
+ `count_of_rejections_sync_out_of_memory` INTEGER DEFAULT 0,
+ `count_of_rejections_nickname_mismatch` INTEGER DEFAULT 0,
+ `count_of_rejections_duplicate_name` INTEGER DEFAULT 0,
+ `count_of_rejected_rpcs_calls` INTEGER DEFAULT 0,
+ `count_of_rpcs_sent_in_hmi_none` INTEGER DEFAULT 0,
+ `count_of_removals_for_bad_behavior` INTEGER DEFAULT 0,
+ `count_of_run_attempts_while_revoked` INTEGER DEFAULT 0,
+ `app_registration_language_gui` VARCHAR(25),
+ `app_registration_language_vui` VARCHAR(25),
+ CONSTRAINT `fk_app_levels_application1`
+ FOREIGN KEY(`application_id`)
+ REFERENCES `application`(`id`),
+ CONSTRAINT `fk_app_level_language1`
+ FOREIGN KEY(`app_registration_language_gui`)
+ REFERENCES `language`(`code`),
+ CONSTRAINT `fk_app_level_language2`
+ FOREIGN KEY(`app_registration_language_vui`)
+ REFERENCES `language`(`code`)
+ );
+ CREATE INDEX IF NOT EXISTS `app_level.fk_app_levels_application1_idx`
+ ON `app_level`(`application_id`);
+ CREATE INDEX IF NOT EXISTS `app_level.fk_app_level_language1_idx`
+ ON `app_level`(`app_registration_language_gui`);
+ CREATE INDEX IF NOT EXISTS `app_level.fk_app_level_language2_idx`
+ ON `app_level`(`app_registration_language_vui`);
+ CREATE TABLE IF NOT EXISTS `nickname`(
+ `name` VARCHAR(100) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL,
+ PRIMARY KEY(`name`,`application_id`),
+ CONSTRAINT `fk_nickname_application1`
+ FOREIGN KEY(`application_id`)
+ REFERENCES `application`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS `nickname.fk_nickname_application1_idx`
+ ON `nickname`(`application_id`);
+ CREATE TABLE IF NOT EXISTS `app_type`(
+ `name` VARCHAR(50) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL,
+ PRIMARY KEY(`name`,`application_id`),
+ CONSTRAINT `fk_app_type_application1`
+ FOREIGN KEY(`application_id`)
+ REFERENCES `application`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS `app_type.fk_app_type_application1_idx`
+ ON `app_type`(`application_id`);
+ CREATE TABLE IF NOT EXISTS `consent_group`(
+ `device_id` VARCHAR(100) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL,
+ `functional_group_id` INTEGER NOT NULL,
+ `is_consented` BOOL NOT NULL,
+ `input` VARCHAR(45),
+ `time_stamp` DATETIME DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY(`application_id`,`functional_group_id`,`device_id`),
+ CONSTRAINT `fk_consent_group_device1`
+ FOREIGN KEY(`device_id`)
+ REFERENCES `device`(`id`),
+ CONSTRAINT `fk_consent_group_application1`
+ FOREIGN KEY(`application_id`)
+ REFERENCES `application`(`id`),
+ CONSTRAINT `fk_consent_group_functional_group1`
+ FOREIGN KEY(`functional_group_id`)
+ REFERENCES `functional_group`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS
+ `consent_group.fk_consent_group_device1_idx`
+ ON `device_consent_group`(`device_id`);
+ CREATE INDEX IF NOT EXISTS `consent_group.fk_consent_group_functional_group1_idx`
+ ON `consent_group`(`functional_group_id`);
+ CREATE TABLE IF NOT EXISTS `endpoint`(
+ `service` VARCHAR(100) NOT NULL,
+ `url` VARCHAR(100) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL,
+ CONSTRAINT `fk_endpoint_application1`
+ FOREIGN KEY(`application_id`)
+ REFERENCES `application`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS `endpoint.fk_endpoint_application1_idx`
+ ON `endpoint`(`application_id`);
+ CREATE TABLE IF NOT EXISTS `message`(
+ `id` INTEGER PRIMARY KEY NOT NULL,
+ `tts` TEXT,
+ `label` TEXT,
+ `line1` TEXT,
+ `line2` TEXT,
+ `textBody` TEXT,
+ `language_code` VARCHAR(25) NOT NULL,
+ `message_type_name` VARCHAR(45) NOT NULL,
+ CONSTRAINT `fk_messages_languages1`
+ FOREIGN KEY(`language_code`)
+ REFERENCES `language`(`code`),
+ CONSTRAINT `fk_message_consumer_friendly_messages1`
+ FOREIGN KEY(`message_type_name`)
+ REFERENCES `message_type`(`name`)
+ );
+ CREATE INDEX IF NOT EXISTS `message.fk_messages_languages1_idx`
ON `message`(`language_code`);
- CREATE INDEX IF NOT EXISTS `message.fk_message_consumer_friendly_messages1_idx`
+ CREATE INDEX IF NOT EXISTS `message.fk_message_consumer_friendly_messages1_idx`
ON `message`(`message_type_name`);
COMMIT;
diff --git a/src/components/policy/test/policy_manager_impl_stress_test.cc b/src/components/policy/test/policy_manager_impl_stress_test.cc
index 6c5e5d1a7..1f85f738c 100644
--- a/src/components/policy/test/policy_manager_impl_stress_test.cc
+++ b/src/components/policy/test/policy_manager_impl_stress_test.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Ford Motor Company
+/* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,16 +29,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-#include <string>
-#include <set>
-#include <sstream>
-#include <fstream>
-
#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-
+#include <fstream>
+#include "config_profile/profile.h"
#include "mock_policy_listener.h"
#include "policy/policy_manager_impl.h"
@@ -54,8 +47,8 @@ namespace policy {
class PolicyManagerImplStressTest : public ::testing::Test {
protected:
static const std::string kNameFile;
- static const int kNumberGroups = 10;
- static const int kNumberFuncs = 100;
+ static const int kNumberGroups = 3; //10;
+ static const int kNumberFuncs = 4; //100;
static const int kNumberApps = 5;
static const int kNumberAppGroups = 5;
static PolicyManagerImpl* manager;
@@ -70,7 +63,8 @@ class PolicyManagerImplStressTest : public ::testing::Test {
static void CreateAppGroups(std::ofstream& ofs);
};
-const std::string PolicyManagerImplStressTest::kNameFile = "pt.json";
+const std::string PolicyManagerImplStressTest::kNameFile =
+ "sdl_preloaded_pt.json";
PolicyManagerImpl* PolicyManagerImplStressTest::manager = 0;
MockPolicyListener* PolicyManagerImplStressTest::mock_listener = 0;
@@ -80,10 +74,13 @@ void PolicyManagerImplStressTest::SetUpTestCase() {
CreateTable(ofs);
ofs.close();
+ profile::Profile::instance()->config_file_name("smartDeviceLink.ini");
+
manager = new PolicyManagerImpl();
mock_listener = new MockPolicyListener();
manager->set_listener(mock_listener);
+ //TODO(AGaliuzov) APPLINK-10657
ASSERT_TRUE(manager->InitPT(kNameFile));
}
@@ -102,61 +99,46 @@ void PolicyManagerImplStressTest::CreateGroups(std::ofstream& ofs) {
for (int i = 0; i < kNumberGroups - 1; ++i) {
ss << i << std::endl;
ss >> number;
- ofs << "\"Group-" << number << "\":{ \"rpcs\":{";
+ ofs << "\"Group-" << number << "\":{\n \t\"rpcs\":{\n";
CreateFuncs(ofs);
ofs << "} },\n";
}
ss << kNumberGroups - 1 << std::endl;
ss >> number;
- ofs << "\"Group-" << number << "\":{ \"rpcs\":{";
+ ofs << "\"Group-" << number << "\":{\n \t\"rpcs\":{\n";
CreateFuncs(ofs);
ofs << "} }\n";
}
void PolicyManagerImplStressTest::CreateFuncs(std::ofstream& ofs) {
- std::string func = "{"
- "\"hmi_levels\":["
+ std::string func = "{\n"
+ "\t\t\"hmi_levels\":["
"\"BACKGROUND\","
"\"FULL\","
"\"LIMITED\""
- "],"
- "\"parameters\":["
- "\"gps\","
- "\"speed\","
- "\"enginetorque\","
- "\"externaltemperature\","
- "\"fuellevel\","
- "\"fuellevel_state\","
- "\"headlampstatus\","
- "\"instantfuelconsumption\","
- "\"odometer\","
- "\"tirepressure\","
- "\"wiperstatus\","
- "\"vin\","
- "\"accpedalposition\","
- "\"beltstatus\","
- "\"driverbraking\","
- "\"prndl\","
- "\"rpm\","
- "\"steeringwheelangle\""
"]"
- "}\n";
+ "}";
std::stringstream ss;
std::string number;
for (int i = 0; i < kNumberFuncs - 1; ++i) {
ss << i << std::endl;
ss >> number;
- ofs << "\"Func-" << number << "\":" << func << ",";
+ ofs << "\t\"Func-" << number << "\":" << func << ",\n";
}
ss << kNumberFuncs - 1 << std::endl;
ss >> number;
- ofs << "\"Func-" << number << "\":" + func;
+ ofs << "\t\"Func-" << number << "\":" + func;
}
void PolicyManagerImplStressTest::CreateApps(std::ofstream& ofs) {
- ofs << "\"default\":{"
- "\"groups\":["
+
+ ofs << "\"default\":{\n";
+ ofs << "\"keep_context\": true,\n"
+ "\"steal_focus\": true,\n"
+ "\"priority\": \"NORMAL\",\n"
+ "\"default_hmi\": \"FULL\",\n";
+ ofs << "\"groups\":["
"\"Group-1\""
"]"
"},\n";
@@ -166,13 +148,25 @@ void PolicyManagerImplStressTest::CreateApps(std::ofstream& ofs) {
for (int i = 0; i < kNumberApps - 1; ++i) {
ss << i << std::endl;
ss >> number;
- ofs << "\"" << number << "\": { \"groups\": ";
+ ofs << "\"" << number << "\" : {";
+ ofs << "\n\"keep_context\": true,\n"
+ "\"steal_focus\": true,\n"
+ "\"priority\": \"NORMAL\",\n"
+ "\"default_hmi\": \"FULL\",\n";
+
+ ofs << "\"groups\": ";
CreateAppGroups(ofs);
ofs << "},\n";
}
ss << kNumberApps - 1 << std::endl;
ss >> number;
- ofs << "\"" << number << "\": { \"groups\": ";
+ ofs << "\"" << number << "\" : {";
+ ofs << "\n\"keep_context\": true,\n"
+ "\"steal_focus\": true,\n"
+ "\"priority\": \"NORMAL\",\n"
+ "\"default_hmi\": \"FULL\",\n";
+
+ ofs << "\"groups\": ";
CreateAppGroups(ofs);
ofs << "}\n";
}
@@ -202,26 +196,35 @@ void PolicyManagerImplStressTest::CreateAppGroups(std::ofstream& ofs) {
void PolicyManagerImplStressTest::CreateTable(std::ofstream& ofs) {
ofs << "{"
- "\"policy_table\":{"
- "\"module_config\":{"
- "\"preloaded_pt\":true,"
- "\"endpoints\":{"
- "\"default\": {"
- "\"default\":["
+ "\"policy_table\":{\n"
+ "\"module_config\":{\n"
+ "\t\"preloaded_pt\":true,\n"
+ "\t\"endpoints\":{\n"
+ "\t\t\"default\": {\n"
+ "\t\t\t\"default\":["
"\"http://sdl.net/api\""
- "]"
- "}"
- "},"
- "\"exchange_after_x_ignition_cycles\": 40,"
- "\"exchange_after_x_kilometers\" : 2,"
- "\"exchange_after_x_days\" : 23,"
- "\"timeout_after_x_seconds\" : 20,"
- "\"seconds_between_retries\" : [10, 7, 5, 3, 1]"
+ "]\n"
+ "\t\t}\n"
+ "\t},\n"
+
+ "\"notifications_per_minute_by_priority\": {\n"
+ "\t\"EMERGENCY\": 60,\n"
+ "\t\"NAVIGATION\": 15,\n"
+ "\t\"COMMUNICATION\": 6,\n"
+ "\t\"NORMAL\": 4,\n"
+ "\t\"NONE\": 0\n"
+ "},\n"
+
+ "\"exchange_after_x_ignition_cycles\": 40,\n"
+ "\"exchange_after_x_kilometers\" : 2,\n"
+ "\"exchange_after_x_days\" : 23,\n"
+ "\"timeout_after_x_seconds\" : 20,\n"
+ "\"seconds_between_retries\" : [10, 7, 5, 3, 1]\n"
"},"
- "\"consumer_friendly_messages\":{"
- "\"version\":\"001.001.001\","
- "\"messages\":{} },\n"
- "\"functional_groupings\":{";
+ "\"consumer_friendly_messages\":{\n"
+ "\t\"version\":\"001.001.001\",\n"
+ "\t\"messages\":{} },\n"
+ "\"functional_groupings\":{\n";
CreateGroups(ofs);
@@ -232,36 +235,36 @@ void PolicyManagerImplStressTest::CreateTable(std::ofstream& ofs) {
ofs << "} } }";
}
-TEST_F(PolicyManagerImplStressTest, OneCheck) {
+TEST_F(PolicyManagerImplStressTest, OneCheck_AppAndFunctuionExisting_RpcAllowed) {
::policy::RPCParams input_params;
::policy::CheckPermissionResult output;
- manager->CheckPermissions("2", "FULL", "Func-1",input_params, output);
+ manager->CheckPermissions("2", "FULL", "Func-1", input_params, output);
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
}
-TEST_F(PolicyManagerImplStressTest, NoApp) {
+TEST_F(PolicyManagerImplStressTest, NoApp_AppDoesNotExisted_RpcDissallowed) {
::policy::RPCParams input_params;
::policy::CheckPermissionResult output;
- manager->CheckPermissions("150", "FULL", "Func-88",input_params, output);
+ manager->CheckPermissions("150", "FULL", "Func-88", input_params, output);
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
}
-TEST_F(PolicyManagerImplStressTest, NoFunc) {
+TEST_F(PolicyManagerImplStressTest, NoFunc_FuncDoesNotExisted_RpcDissallowed) {
::policy::RPCParams input_params;
::policy::CheckPermissionResult output;
- manager->CheckPermissions("2", "FULL", "Func-400",input_params, output);
+ manager->CheckPermissions("2", "FULL", "Func-400", input_params, output);
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
}
-TEST_F(PolicyManagerImplStressTest, NoHmi) {
+TEST_F(PolicyManagerImplStressTest, NoHmi_HMIInLevelNone_RpcDissallowed) {
::policy::RPCParams input_params;
::policy::CheckPermissionResult output;
- manager->CheckPermissions("2", "NONE", "Func-88",input_params, output);
+ manager->CheckPermissions("2", "NONE", "Func-88", input_params, output);
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
}
-TEST_F(PolicyManagerImplStressTest, FewChecks) {
- const int kNumberOfCheckings = 100;
+TEST_F(PolicyManagerImplStressTest, FewChecks_CheckSeveralFunctions_RpcAllowed) {
+ const int kNumberOfCheckings = kNumberFuncs; //100;
std::stringstream ss;
int app, func;
std::string app_number, func_number;
diff --git a/src/components/policy/test/policy_manager_impl_test.cc b/src/components/policy/test/policy_manager_impl_test.cc
index 6930c2832..84fbcf111 100644
--- a/src/components/policy/test/policy_manager_impl_test.cc
+++ b/src/components/policy/test/policy_manager_impl_test.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Ford Motor Company
+/* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,36 +32,30 @@
#include <vector>
#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-
#include "mock_policy_listener.h"
-#include "mock_pt_representation.h"
#include "mock_pt_ext_representation.h"
#include "mock_cache_manager.h"
#include "mock_update_status_manager.h"
#include "policy/policy_manager_impl.h"
-#include "policy/update_status_manager_interface.h"
-#include "policy/cache_manager_interface.h"
-#include "json/value.h"
-#include "utils/shared_ptr.h"
using ::testing::_;
using ::testing::Return;
using ::testing::DoAll;
using ::testing::SetArgReferee;
using ::testing::NiceMock;
+using ::testing::AtLeast;
using ::policy::PTRepresentation;
using ::policy::MockPolicyListener;
using ::policy::MockPTRepresentation;
using ::policy::MockPTExtRepresentation;
using ::policy::MockCacheManagerInterface;
-using ::policy::MockUpdateStatusManagerInterface;
+
+using ::policy::MockUpdateStatusManager;
+
using ::policy::PolicyManagerImpl;
using ::policy::PolicyTable;
using ::policy::EndpointUrls;
-using ::policy::CacheManagerInterfaceSPtr;
-using ::policy::UpdateStatusManagerInterfaceSPtr;
namespace policy_table = rpc::policy_table_interface_base;
@@ -73,7 +67,7 @@ class PolicyManagerImplTest : public ::testing::Test {
protected:
PolicyManagerImpl* manager;
MockCacheManagerInterface* cache_manager;
- MockUpdateStatusManagerInterface* update_manager;
+ MockUpdateStatusManager update_manager;
MockPolicyListener* listener;
void SetUp() {
@@ -82,19 +76,11 @@ class PolicyManagerImplTest : public ::testing::Test {
cache_manager = new MockCacheManagerInterface();
manager->set_cache_manager(cache_manager);
- update_manager = new MockUpdateStatusManagerInterface();
- manager->set_update_status_manager(update_manager);
-
listener = new MockPolicyListener();
- EXPECT_CALL(*update_manager, set_listener(listener)).Times(1);
manager->set_listener(listener);
}
void TearDown() {
- EXPECT_CALL(*update_manager, GetUpdateStatus()).Times(1)
- .WillOnce(Return(::policy::StatusUpToDate));
- EXPECT_CALL(*cache_manager, Backup()).Times(1);
- EXPECT_CALL(*cache_manager, SaveUpdateRequired(_)).Times(1);
delete manager;
delete listener;
}
@@ -107,107 +93,88 @@ class PolicyManagerImplTest : public ::testing::Test {
table.ReportErrors(&report);
return ::testing::AssertionFailure() << ::rpc::PrettyFormat(report);
}
- }
+ }
};
-TEST_F(PolicyManagerImplTest, ExceededIgnitionCycles) {
- EXPECT_CALL(*cache_manager, IgnitionCyclesBeforeExchange()).Times(2).WillOnce(
- Return(5)).WillOnce(Return(0));
- EXPECT_CALL(*cache_manager, IncrementIgnitionCycles()).Times(1);
-
- EXPECT_FALSE(manager->ExceededIgnitionCycles());
- manager->IncrementIgnitionCycles();
- EXPECT_TRUE(manager->ExceededIgnitionCycles());
-}
-
-TEST_F(PolicyManagerImplTest, ExceededDays) {
- EXPECT_CALL(*cache_manager, DaysBeforeExchange(_)).Times(2).WillOnce(
- Return(5)).WillOnce(Return(0));
+TEST_F(PolicyManagerImplTest, RefreshRetrySequence_SetSecondsBetweenRetries_ExpectRetryTimeoutSequenceWithSameSeconds) {
- EXPECT_FALSE(manager->ExceededDays(5));
- EXPECT_TRUE(manager->ExceededDays(15));
-}
-
-TEST_F(PolicyManagerImplTest, ExceededKilometers) {
- EXPECT_CALL(*cache_manager, KilometersBeforeExchange(_)).Times(2).WillOnce(
- Return(50)).WillOnce(Return(0));
-
- EXPECT_FALSE(manager->ExceededKilometers(50));
- EXPECT_TRUE(manager->ExceededKilometers(150));
-}
-
-TEST_F(PolicyManagerImplTest, RefreshRetrySequence) {
+ //arrange
std::vector<int> seconds;
seconds.push_back(50);
seconds.push_back(100);
seconds.push_back(200);
- EXPECT_CALL(*cache_manager, TimeoutResponse()).Times(1).WillOnce(Return(60));
- EXPECT_CALL(*cache_manager, SecondsBetweenRetries(_)).Times(1).WillOnce(
+ //assert
+ EXPECT_CALL(*cache_manager, TimeoutResponse()).WillOnce(Return(60));
+ EXPECT_CALL(*cache_manager, SecondsBetweenRetries(_)).WillOnce(
DoAll(SetArgReferee<0>(seconds), Return(true)));
+ //act
manager->RefreshRetrySequence();
+
+ //assert
EXPECT_EQ(50, manager->NextRetryTimeout());
EXPECT_EQ(100, manager->NextRetryTimeout());
EXPECT_EQ(200, manager->NextRetryTimeout());
EXPECT_EQ(0, manager->NextRetryTimeout());
}
-TEST_F(PolicyManagerImplTest, RefreshRetrySequence) {
- ::testing::NiceMock<MockPTRepresentation> mock_pt;
- std::vector<int> seconds, seconds_empty;
- seconds.push_back(50);
- seconds.push_back(100);
- seconds.push_back(200);
+TEST_F(PolicyManagerImplTest, DISABLED_GetUpdateUrl) {
- EXPECT_CALL(mock_pt, TimeoutResponse()).Times(2).WillOnce(Return(0)).WillOnce(
- Return(60));
- EXPECT_CALL(mock_pt, SecondsBetweenRetries(_)).Times(2).WillOnce(
- DoAll(SetArgPointee<0>(seconds_empty), Return(true))).WillOnce(
- DoAll(SetArgPointee<0>(seconds), Return(true)));
+ EXPECT_CALL(*cache_manager, GetServiceUrls("7",_));
+ EXPECT_CALL(*cache_manager, GetServiceUrls("4",_));
+
+ EndpointUrls ep_7;
+
+ manager->GetServiceUrls("7", ep_7);
+ EXPECT_EQ("http://policies.telematics.ford.com/api/policies", ep_7[0].url[0] );
+
+ EndpointUrls ep_4;
+ manager->GetServiceUrls("4", ep_4);
+ EXPECT_EQ("http://policies.ford.com/api/policies", ep_4[0].url[0]);
- PolicyManagerImpl* manager = new PolicyManagerImpl();
- manager->ResetDefaultPT(::policy::PolicyTable(&mock_pt));
- manager->RefreshRetrySequence();
- EXPECT_EQ(60, manager->TimeoutExchange());
- EXPECT_EQ(50, manager->NextRetryTimeout());
- EXPECT_EQ(100, manager->NextRetryTimeout());
- EXPECT_EQ(200, manager->NextRetryTimeout());
}
TEST_F(PolicyManagerImplTest, ResetPT) {
EXPECT_CALL(*cache_manager, ResetPT("filename")).WillOnce(Return(true))
.WillOnce(Return(false));
- EXPECT_CALL(*cache_manager, TimeoutResponse()).Times(1);
- EXPECT_CALL(*cache_manager, SecondsBetweenRetries(_)).Times(1);
+ EXPECT_CALL(*cache_manager, TimeoutResponse());
+ EXPECT_CALL(*cache_manager, SecondsBetweenRetries(_));
EXPECT_TRUE(manager->ResetPT("filename"));
EXPECT_FALSE(manager->ResetPT("filename"));
}
-// EXTENDED_POLICY
-TEST_F(PolicyManagerImplTest, CheckPermissions) {
+TEST_F(PolicyManagerImplTest, CheckPermissions_SetHmiLevelFullForAlert_ExpectAllowedPermissions) {
+
+ //arrange
::policy::CheckPermissionResult expected;
expected.hmi_level_permitted = ::policy::kRpcAllowed;
expected.list_of_allowed_params.push_back("speed");
expected.list_of_allowed_params.push_back("gps");
- EXPECT_CALL(*cache_manager, CheckPermissions("12345678", "FULL", "Alert", _))
- .Times(1).WillOnce(SetArgReferee<3>(expected));
+ //assert
+ EXPECT_CALL(*cache_manager, CheckPermissions("12345678", "FULL", "Alert", _)).
+ WillOnce(SetArgReferee<3>(expected));
+ //act
::policy::RPCParams input_params;
::policy::CheckPermissionResult output;
manager->CheckPermissions("12345678", "FULL", "Alert", input_params, output);
+ //assert
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+
ASSERT_TRUE(!output.list_of_allowed_params.empty());
ASSERT_EQ(2u, output.list_of_allowed_params.size());
EXPECT_EQ("speed", output.list_of_allowed_params[0]);
EXPECT_EQ("gps", output.list_of_allowed_params[1]);
}
-TEST_F(PolicyManagerImplTest, LoadPT) {
+TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) {
+
+ //arrange
Json::Value table(Json::objectValue);
table["policy_table"] = Json::Value(Json::objectValue);
@@ -288,51 +255,57 @@ TEST_F(PolicyManagerImplTest, LoadPT) {
policy_table::Table update(&table);
update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+
+ //assert
ASSERT_TRUE(IsValid(update));
+
+ //act
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);
+ utils::SharedPtr<policy_table::Table> snapshot = new policy_table::Table(
+ update.policy_table);
- EXPECT_CALL(*update_manager, OnValidUpdateReceived()).Times(1);
- EXPECT_CALL(*cache_manager, GenerateSnapshot()).Times(1).WillOnce(Return(snapshot));
- EXPECT_CALL(*cache_manager, ApplyUpdate(_)).Times(1).WillOnce(Return(true));
- EXPECT_CALL(*listener, GetAppName("1234")).Times(1).WillOnce(Return(""));
- EXPECT_CALL(*cache_manager, TimeoutResponse()).Times(1);
- EXPECT_CALL(*cache_manager, SecondsBetweenRetries(_)).Times(1);
- EXPECT_CALL(*listener, OnUserRequestedUpdateCheckRequired()).Times(1);
+ //assert
+ EXPECT_CALL(*cache_manager, GenerateSnapshot()).WillOnce(Return(snapshot));
+ EXPECT_CALL(*cache_manager, ApplyUpdate(_)).WillOnce(Return(true));
+ EXPECT_CALL(*listener, GetAppName("1234")).WillOnce(Return(""));
+ EXPECT_CALL(*listener, OnUpdateStatusChanged(_));
+ EXPECT_CALL(*cache_manager, SaveUpdateRequired(false));
+ EXPECT_CALL(*cache_manager, TimeoutResponse());
+ EXPECT_CALL(*cache_manager, SecondsBetweenRetries(_));
EXPECT_TRUE(manager->LoadPT("file_pt_update.json", msg));
}
-TEST_F(PolicyManagerImplTest, RequestPTUpdate) {
- ::utils::SharedPtr< ::policy_table::Table> p_table =
+TEST_F(PolicyManagerImplTest, RequestPTUpdate_SetPT_GeneratedSnapshotAndPTUpdate) {
+
+ //arrange
+ ::utils::SharedPtr< ::policy_table::Table > p_table =
new ::policy_table::Table();
- std::string json = p_table->ToJsonValue().toStyledString();
- ::policy::BinaryMessageSptr expect = new ::policy::BinaryMessage(json.begin(),
- json.end());
+ //assert
EXPECT_CALL(*cache_manager, GenerateSnapshot()).WillOnce(Return(p_table));
- ::policy::BinaryMessageSptr output = manager->RequestPTUpdate();
- EXPECT_EQ(*expect, *output);
+ //act
+ manager->RequestPTUpdate();
}
-TEST_F(PolicyManagerImplTest, AddApplication) {
+TEST_F(PolicyManagerImplTest, DISABLED_AddApplication) {
// TODO(AOleynik): Implementation of method should be changed to avoid
// using of snapshot
//manager->AddApplication("12345678");
}
-TEST_F(PolicyManagerImplTest, GetPolicyTableStatus) {
+TEST_F(PolicyManagerImplTest, DISABLED_GetPolicyTableStatus) {
// TODO(AOleynik): Test is not finished, to be continued
//manager->GetPolicyTableStatus();
}
-} // namespace policy
-} // namespace components
+}
+// namespace policy
+}// namespace components
} // namespace test
diff --git a/src/components/policy/test/qdb_wrapper/sql_database_test.cc b/src/components/policy/test/qdb_wrapper/sql_database_test.cc
index 5ebf18804..a732128f6 100644
--- a/src/components/policy/test/qdb_wrapper/sql_database_test.cc
+++ b/src/components/policy/test/qdb_wrapper/sql_database_test.cc
@@ -1,33 +1,33 @@
/* Copyright (c) 2013, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#include <cstdlib>
diff --git a/src/components/policy/test/sdl_preloaded_pt.json b/src/components/policy/test/sdl_preloaded_pt.json
index 52b7684b0..6ef60616c 100644
--- a/src/components/policy/test/sdl_preloaded_pt.json
+++ b/src/components/policy/test/sdl_preloaded_pt.json
@@ -1,1937 +1,1937 @@
-{
- "policy_table": {
- "module_config": {
- "preloaded_pt": true,
- "exchange_after_x_ignition_cycles": 100,
- "exchange_after_x_kilometers": 1800,
- "exchange_after_x_days": 30,
- "timeout_after_x_seconds": 60,
- "seconds_between_retries": [1,
- 5,
- 25,
- 125,
- 625],
- "endpoints": {
- "0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
- }
- },
- "notifications_per_minute_by_priority": {
- "EMERGENCY": 60,
- "NAVIGATION": 15,
- "COMMUNICATION": 6,
- "NORMAL": 4,
- "NONE": 0
- }
- },
- "functional_groupings": {
- "Base-4": {
- "rpcs": {
- "AddCommand": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "AddSubMenu": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "Alert": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "ChangeRegistration": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "CreateInteractionChoiceSet": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "DeleteCommand": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "DeleteFile": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "DeleteInteractionChoiceSet": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "DeleteSubMenu": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "EncodedSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "EndAudioPassThru": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "GenericResponse": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "ListFiles": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnAppInterfaceUnregistered": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnAudioPassThru": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "OnButtonEvent": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "OnButtonPress": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "OnCommand": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "OnDriverDistraction": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "OnEncodedSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnHashChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnHMIStatus": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnLanguageChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnPermissionsChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnSystemRequest": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "PerformAudioPassThru": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "PerformInteraction": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "PutFile": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "RegisterAppInterface": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "ResetGlobalProperties": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "ScrollableMessage": {
- "hmi_levels": ["FULL"]
- },
- "SetAppIcon": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetDisplayLayout": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetGlobalProperties": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "SetMediaClockTimer": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "Show": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "Slider": {
- "hmi_levels": ["FULL"]
- },
- "Speak": {
- "hmi_levels": ["FULL",
- "LIMITED"]
- },
- "SubscribeButton": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "SystemRequest": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "UnregisterAppInterface": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "UnsubscribeButton": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "Location-1": {
- "user_consent_prompt": "Location",
- "rpcs": {
- "GetVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["gps",
- "speed"]
- },
- "OnVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["gps",
- "speed"]
- },
- "SubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["gps",
- "speed"]
- },
- "UnsubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["gps",
- "speed"]
- }
- }
- },
- "Notifications": {
- "user_consent_prompt": "Notifications",
- "rpcs": {
- "Alert": {
- "hmi_levels": ["BACKGROUND"]
- }
- }
- },
- "DrivingCharacteristics-3": {
- "user_consent_prompt": "DrivingCharacteristics",
- "rpcs": {
- "GetVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["accPedalPosition",
- "beltStatus",
- "driverBraking",
- "myKey",
- "prndl",
- "rpm",
- "steeringWheelAngle"]
- },
- "OnVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["accPedalPosition",
- "beltStatus",
- "driverBraking",
- "myKey",
- "prndl",
- "rpm",
- "steeringWheelAngle"]
- },
- "SubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["accPedalPosition",
- "beltStatus",
- "driverBraking",
- "myKey",
- "prndl",
- "rpm",
- "steeringWheelAngle"]
- },
- "UnsubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["accPedalPosition",
- "beltStatus",
- "driverBraking",
- "myKey",
- "prndl",
- "rpm",
- "steeringWheelAngle"]
- }
- }
- },
- "VehicleInfo-3": {
- "user_consent_prompt": "VehicleInfo",
- "rpcs": {
- "GetVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["bodyInformation",
- "deviceStatus",
- "engineTorque",
- "externalTemperature",
- "fuelLevel",
- "fuelLevel_State",
- "headLampStatus",
- "instantFuelConsumption",
- "odometer",
- "tirePressure",
- "vin",
- "wiperStatus"]
- },
- "OnVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["bodyInformation",
- "deviceStatus",
- "engineTorque",
- "externalTemperature",
- "fuelLevel",
- "fuelLevel_State",
- "headLampStatus",
- "instantFuelConsumption",
- "odometer",
- "tirePressure",
- "vin",
- "wiperStatus"]
- },
- "SubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["bodyInformation",
- "deviceStatus",
- "engineTorque",
- "externalTemperature",
- "fuelLevel",
- "fuelLevel_State",
- "headLampStatus",
- "instantFuelConsumption",
- "odometer",
- "tirePressure",
- "wiperStatus"]
- },
- "UnsubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["bodyInformation",
- "deviceStatus",
- "engineTorque",
- "externalTemperature",
- "fuelLevel",
- "fuelLevel_State",
- "headLampStatus",
- "instantFuelConsumption",
- "odometer",
- "tirePressure",
- "wiperStatus"]
- }
- }
- },
- "PropriataryData-1": {
- "rpcs": {
- "DiagnosticMessage": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "GetDTCs": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "ReadDID": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "Emergency-1": {
- "rpcs": {
- "GetVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["airbagStatus",
- "clusterModeStatus",
- "eCallInfo",
- "emergencyEvent"]
- },
- "OnVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["airbagStatus",
- "clusterModeStatus",
- "eCallInfo",
- "emergencyEvent"]
- },
- "SubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["airbagStatus",
- "clusterModeStatus",
- "eCallInfo",
- "emergencyEvent"]
- },
- "UnsubscribeVehicleData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"],
- "parameters": ["airbagStatus",
- "clusterModeStatus",
- "eCallInfo",
- "emergencyEvent"]
- }
- }
- },
- "Navigation-1": {
- "rpcs": {
- "AlertManeuver": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "ShowConstantTBT": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- },
- "UpdateTurnList": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED"]
- }
- }
- },
- "DataConsent-2": {
- "user_consent_prompt": "DataConsent",
- "rpcs": null
- },
- "BaseBeforeDataConsent": {
- "rpcs": {
- "ChangeRegistration": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "DeleteFile": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "EncodedSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "ListFiles": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnAppInterfaceUnregistered": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnEncodedSyncPData": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnHashChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnHMIStatus": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnLanguageChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnPermissionsChange": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "OnSystemRequest": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "PutFile": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "RegisterAppInterface": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetAppIcon": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SetDisplayLayout": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "SystemRequest": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- },
- "UnregisterAppInterface": {
- "hmi_levels": ["BACKGROUND",
- "FULL",
- "LIMITED",
- "NONE"]
- }
- }
- }
- },
- "consumer_friendly_messages": {
- "version": "001.001.019",
- "messages": {
- "AppPermissions": {
- "languages": {
- "de-de": {
- "tts": "%appName% benötigt die folgenden Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Wenn Sie Ja drücken, erklären Sie sich damit einverstanden, dass %vehicleMake% nicht für Schäden oder Verletzungen der Privatsphäre haftet, die im Zusammenhang mit der Nutzung Ihrer Benutzerdaten durch %appName% entstehen. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab.",
- "line1": "Zugriffsanfrage(n)",
- "line2": "erlauben?"
- },
- "en-au": {
- "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.",
- "line1": "Grant requested",
- "line2": "permission(s)?"
- },
- "en-gb": {
- "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. Please press Yes to allow or No to deny.",
- "line1": "Grant requested",
- "line2": "permission(s)?",
- "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu."
- },
- "en-ie": {
- "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.",
- "line1": "Grant requested",
- "line2": "permission(s)?"
- },
- "en-us": {
- "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. Please press yes to allow or no to deny.",
- "line1": "Grant Requested",
- "line2": "Permission(s)?",
- "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. \n\nIf you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu."
- },
- "es-en": {
- "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.",
- "line1": "¿Otorgar permiso(s)",
- "line2": "solicitado(s)?",
- "textBody": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar. \n\n Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles."
- },
- "es-es": {
- "tts": "%appName% está solicitando el uso de los siguientes permisos e información del vehículo: %functionalGroupLabels%. Si pulsa sí, acepta que %vehicleMake% no será responsable de los daños o la pérdida de privacidad relacionados con el uso de sus datos por parte de %appName%. Pulse sí para permitir o no para denegar.",
- "line1": "¿Conceder permisos",
- "line2": "solicitados?"
- },
- "es-mx": {
- "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.",
- "line1": "¿Otorgar permiso(s)",
- "line2": "solicitado(s)?"
- },
- "fr-ca": {
- "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.",
- "line1": "Accorder permission(s)",
- "line2": "demandée(s)",
- "textBody": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles."
- },
- "fr-fr": {
- "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.",
- "line1": "Accorder permission(s)",
- "line2": "demandée(s)"
- },
- "it-it": {
- "tts": "%appName% richiede l'uso delle seguenti informazioni e autorizzazioni sul veicolo: %functionalGroupLabels%. Se si preme Sì, si acconsente che %vehicleMake% non sarà responsabile per danni o perdita di privacy in relazione all'impiego dei dati da parte di %appName%. Premere Sì per consentire e No per negare.",
- "line1": "Concedi autorizzaz.",
- "line2": "richiesta(e)?"
- },
- "nl-nl": {
- "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. Als u op Ja drukt, gaat u ermee akkoord dat %vehicleMake% in geen geval aansprakelijk gesteld kan worden voor schade of verlies van privacy als gevolg van het feit dat %appName% gebruik maakt van uw gegevens. Druk op Ja om dit toe te staan of Nee om te weigeren.",
- "line1": "Aangevraagde",
- "line2": "permissie(s) verlenen?"
- },
- "pl-pl": {
- "tts": "%appName% wymaga następujących informacji o pojeździe oraz pozwoleń: %functionalGroupLabels%. Naciśnięcie TAK oznacza zgodę na fakt, iż %vehicleMake% nie będzie ponosić odpowiedzialności za szkody ani utratę prywatności w związku z wykorzystaniem przez %appName% danych, należących do użytkownika. Naciśnij TAK w celu udzielenia zgody lub NIE w celu odrzucenia żądania.",
- "line1": "Udzielić żądanych",
- "line2": "pozwoleń?"
- },
- "pt-br": {
- "tts": "%appName% está solicitando o uso das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se pressionar sim, você concorda que a %vehicleMake% não será responsável por danos ou perdas de privacidade relacionados ao uso dos seus dados por %appName%. Pressione sim para permitir ou não para negar.",
- "line1": "Conceder permissão",
- "line2": "solicitada?"
- },
- "pt-pt": {
- "tts": "%appName% está a solicitar a utilização das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se premir “Sim”, concorda que %vehicleMake% não será responsável por quaisquer danos ou perda de privacidade relacionada com a utilização dos seus dados por parte de %appName%. Prima “Sim” para permitir ou “Não” para recusar.",
- "line1": "Conceder permiss.",
- "line2": "solicitada(s)?"
- },
- "ru-ru": {
- "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны.",
- "line1": "Предост. заправш.",
- "line2": "разрешения?"
- },
- "sv-se": {
- "tts": "%appName% begär att få tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Om du trycker Ja godkänner du att %vehicleMake% ska hållas skadeslös för alla skador som kan uppstå eller eventuella integritetsintrång som uppstår när %appName% använder dina data. Tryck Ja för att godkänna eller Nej för att neka.",
- "line1": "Vill du ge",
- "line2": "tillstånd?"
- },
- "tr-tr": {
- "tts": "%appName%, şu araç bilgilerini ve izinleri kullanma isteğinde bulunuyor: %functionalGroupLabels%. Evet'e basarsanız, %appName%'in verilerinizi kullanması sonucunda oluşabilecek hasarlardan veya gizlilik kaybından %vehicleMake%'in sorumlu olmayacağını kabul etmiş olacaksınız. Lütfen kabul etmek için Evet'e veya reddetmek için Hayır'a basın.",
- "line1": "İstenen izinler",
- "line2": "verilsin mi?"
- },
- "zh-cn": {
- "tts": "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。",
- "line1": "是否允许请求的",
- "line2": "权限?"
- },
- "zh-tw": {
- "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。",
- "line1": "允許",
- "line2": "授權請求?"
- }
- }
- },
- "AppPermissionsHelp": {
- "languages": {
- "de-de": {
- "tts": "%appName% fordert folgende Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Im Einstellungsmenü der mobilen Apps können Sie diese Berechtigungen ändern und sich detaillierte Beschreibungen anhören. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab."
- },
- "en-au": {
- "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
- },
- "en-gb": {
- "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
- },
- "en-ie": {
- "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
- },
- "en-us": {
- "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press yes to grant permissions or no to deny."
- },
- "es-en": {
- "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
- },
- "es-es": {
- "tts": "%appName% está solicitando los siguientes permisos e información del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y escuchar descripciones detalladas en el menú de configuración de la aplicación móvil. Pulse sí para conceder el permiso o no para denegarlo."
- },
- "es-mx": {
- "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
- },
- "fr-ca": {
- "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
- },
- "fr-fr": {
- "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
- },
- "it-it": {
- "tts": "%appName% richiede le seguenti informazioni e autorizzazioni riguardo il veicolo: %functionalGroupLabels%. È possibile modificare tali autorizzazioni e ascoltare descrizioni dettagliate nel menu impostazioni delle app mobili. Premere Sì per concedere le autorizzazioni e No per negarle."
- },
- "nl-nl": {
- "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. U kunt deze toestemmingen wijzigen en gedetailleerde beschrijvingen beluisteren in het instellingenmenu voor mobiele apps. Druk op Ja om permissies te verlenen of op Nee om te weigeren."
- },
- "pl-pl": {
- "tts": "%appName% wymaga następujących informacji o pojeździe oraz zezwoleń: %functionalGroupLabels%. W menu ustawień aplikacji mobilnych można zmienić owe zezwolenia i usłyszeć ich szczegółowy opis. Naciśnij TAK, aby wyrazić zgodę lub NIE w celu odrzucenia żądania."
- },
- "pt-br": {
- "tts": "%appName% está solicitando as seguintes informações e permissões do veículo: %functionalGroupLabels%. Você pode alterar estas permissões e ouvir descrições detalhadas no menu de configurações de aplicativos móveis. Pressione sim para conceder as permissões ou não para negar."
- },
- "pt-pt": {
- "tts": "%appName% está a solicitar as seguintes informações e permissões do veículo: %functionalGroupLabels%. Pode alterar estas permissões e ouvir descrições detalhadas no menu de definições das aplicações móveis. Prima \"\"Sim\"\" para permitir ou \"\"Não\"\" para recusar."
- },
- "ru-ru": {
- "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Вы можете изменить эти разрешения и прослушать подробные их описания в меню настроек мобильного приложения. Нажмите \"\"да\"\", чтобы предоставить разрешения, или \"\"нет\"\", чтобы не предоставлять."
- },
- "sv-se": {
- "tts": "%appName% begär tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Du kan ändra tillstånden och höra detaljerade beskrivningar i menyn för mobilappsinställningar. Tryck Ja för att ge tillstånd eller Nej för att neka."
- },
- "tr-tr": {
- "tts": "%appName%, şu araç bilgilerini ve izinleri istiyor: %functionalGroupLabels%. Bu izinleri değiştirebilir ve mobil uygulamalar ayarlar menüsünden ayrıntılı açıklamaları dinleyebilirsiniz. Lütfen izin vermek için Evet'e veya reddetmek için Hayır'a basın."
- },
- "zh-cn": {
- "tts": "%appName% 正在请求下列车辆信息和权限: %functionalGroupLabels%。您可在移动应用程序设置菜单中更改这些权限,并听取详细说明。请按“是”允许权限或按“否”拒绝。"
- },
- "zh-tw": {
- "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。您可在行動應用程式設定清單中更改這些許可,並聆聽詳細說明。給予許可請按「是」,拒絕請按「否」。"
- }
- }
- },
- "AppPermissionsRevoked": {
- "languages": {
- "de-de": {
- "tts": "Die Autorisierungsdaten der App wurden geändert. %appName% hat keinen Zugriff auf %functionalGroupLabels% mehr. Installieren Sie die neueste Version der App auf Ihrem Gerät.."
- },
- "en-au": {
- "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
- },
- "en-gb": {
- "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
- },
- "en-ie": {
- "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
- },
- "en-us": {
- "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
- },
- "es-en": {
- "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
- },
- "es-es": {
- "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de que tiene la versión más reciente de la aplicación instalada en su dispositivo móvil."
- },
- "es-mx": {
- "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
- },
- "fr-ca": {
- "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
- },
- "fr-fr": {
- "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
- },
- "it-it": {
- "tts": "Le autorizzazioni dell'app sono cambiate. %appName% non è più in grado di accedere a %functionalGroupLabels%. Assicurarsi di avere la versione più recente dell'app installata sul dispositivo mobile."
- },
- "nl-nl": {
- "tts": "De app-autorisaties zijn gewijzigd. %appName% heeft geen toegang meer tot %functionalGroupLabels%. Zorg ervoor dat u de meest recente app-versie op uw mobiele apparaat geïnstalleerd hebt."
- },
- "pl-pl": {
- "tts": "Dane dostępu aplikacji zostały zmienione. %appName% nie ma już dostępu do %functionalGroupLabels%. Sprawdź, czy na telefonie komórkowym zainstalowano najnowszą wersję aplikacji."
- },
- "pt-br": {
- "tts": "As autorizações dos aplicativos foram alteradas. %appName% não pode mais acessar %functionalGroupLabels%. Certifique-se de que a versão mais recente do aplicativo está instalada no seu dispositivo móvel."
- },
- "pt-pt": {
- "tts": "As autorizações das aplicações mudaram. %appName% já não consegue aceder a %functionalGroupLabels%. Certifique-se de que tem a última versão da aplicação no seu dispositivo móvel."
- },
- "ru-ru": {
- "tts": "Авторизации приложения изменены. %appName% больше не имеет доступа к %functionalGroupLabels%. Убедитесь, что на вашем мобильном устройстве установлена самая новая версия приложения."
- },
- "sv-se": {
- "tts": "Appens behörigheter har ändrats. %appName% har inte längre åtkomst till %functionalGroupLabels%. Kontrollera att du har installerat den senaste versionen av appen på mobilenheten."
- },
- "tr-tr": {
- "tts": "Uygulama yetkileri değişti. %appName% artık %functionalGroupLabels%'e erişemeyecek. Lütfen mobil aygıtınızda en son uygulama sürümünün yüklü olduğundan emin olun."
- },
- "zh-cn": {
- "tts": "应用程序授权已变更。 %appName% 将不能再访问 %functionalGroupLabels%。 请确认您的移动设备上安装的应用程序是最新版本。"
- },
- "zh-tw": {
- "tts": "應用程式授權已改變。%appName% 已無法進入 %functionalGroupLabels%。請確認您的行動裝置上安裝了最新版應用程式。"
- }
- }
- },
- "AppUnauthorized": {
- "languages": {
- "de-de": {
- "tts": "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren.",
- "line1": "nicht autorisiert"
- },
- "en-au": {
- "tts": "This version of %appName% is not authorized and will not work with SYNC.",
- "line1": "not authorized"
- },
- "en-gb": {
- "tts": "This version of %appName% is not authorized and will not work with SYNC.",
- "line1": "not authorized",
- "textBody": "This version of %appName% is not authorized and will not work with SYNC."
- },
- "en-ie": {
- "tts": "This version of %appName% is not authorized and will not work with SYNC.",
- "line1": "not authorized"
- },
- "en-us": {
- "tts": "This version of %appName% is not authorized and will not work with SYNC.",
- "line1": "Not Authorized",
- "textBody": "This version of %appName% is no longer authorized to work with AppLink. Please update to the latest version of %appName%."
- },
- "es-en": {
- "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
- "line1": "no autorizada",
- "textBody": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
- },
- "es-es": {
- "tts": "Esta versión de %appName% no está autorizada y no funcionará con SYNC.",
- "line1": "No autorizada"
- },
- "es-mx": {
- "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
- "line1": "no autorizada"
- },
- "fr-ca": {
- "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
- "line1": "non autorisée",
- "textBody": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
- },
- "fr-fr": {
- "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
- "line1": "non autorisée"
- },
- "it-it": {
- "tts": "Questa versione di %appName% non è autorizzata e non funziona con il SYNC.",
- "line1": "non autorizzata"
- },
- "nl-nl": {
- "tts": "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC.",
- "line1": "niet geautoriseerd"
- },
- "pl-pl": {
- "tts": "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC.",
- "line1": "brak autoryzacji"
- },
- "pt-br": {
- "tts": "Esta versão do %appName% não tem autorização e não funcionará com o SYNC.",
- "line1": "não autorizado"
- },
- "pt-pt": {
- "tts": "Esta versão de %appName% não está autorizada e não funcionará com o SYNC.",
- "line1": "não autorizada"
- },
- "ru-ru": {
- "tts": "Эта версия %appName% не авторизирована и не будет работать с SYNC.",
- "line1": "не авторизировано"
- },
- "sv-se": {
- "tts": "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC.",
- "line1": "är ej godkänd"
- },
- "tr-tr": {
- "tts": "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz.",
- "line1": "için izin yok"
- },
- "zh-cn": {
- "tts": "此版本的%appName% 未得到授权,无法在SYNC上使用。",
- "line1": "未得到授权"
- },
- "zh-tw": {
- "tts": "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。",
- "line1": "無授權"
- }
- }
- },
- "AppUnsupported": {
- "languages": {
- "de-de": {
- "tts": "Diese Version von %appName% wird von SYNC nicht unterstützt.",
- "line1": "nicht unterstützt"
- },
- "en-au": {
- "tts": "This version of %appName% is not supported by SYNC.",
- "line1": "not supported"
- },
- "en-gb": {
- "tts": "This version of %appName% is not supported by SYNC.",
- "line1": "not supported",
- "textBody": "This version of %appName% is not supported by SYNC."
- },
- "en-ie": {
- "tts": "This version of %appName% is not supported by SYNC.",
- "line1": "not supported"
- },
- "en-us": {
- "tts": "This version of %appName% is not supported by SYNC.",
- "line1": "Not Supported",
- "textBody": "Your version of %appName% is not supported by SYNC."
- },
- "es-en": {
- "tts": "Esta versión de %appName% no es compatible con SYNC.",
- "line1": "no compatible",
- "textBody": "Esta versión de %appName% no es compatible con SYNC."
- },
- "es-es": {
- "tts": "Esta versión de %appName% no es compatible con SYNC.",
- "line1": "No compatible"
- },
- "es-mx": {
- "tts": "Esta versión de %appName% no es compatible con SYNC.",
- "line1": "no compatible"
- },
- "fr-ca": {
- "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.",
- "line1": "incompatible",
- "textBody": "Cette version de %appName% n’est pas prise en charge par SYNC."
- },
- "fr-fr": {
- "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.",
- "line1": "incompatible"
- },
- "it-it": {
- "tts": "Questa versione di %appName% non è supportata dal SYNC.",
- "line1": "non supportata"
- },
- "nl-nl": {
- "tts": "Deze versie van %appName% wordt niet ondersteund door SYNC.",
- "line1": "niet ondersteund"
- },
- "pl-pl": {
- "tts": "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC.",
- "line1": "aplikacja nie obsług."
- },
- "pt-br": {
- "tts": "Esta versão do %appName% não é suportada pelo SYNC.",
- "line1": "não suportado"
- },
- "pt-pt": {
- "tts": "Esta versão de %appName% não é suportado pelo SYNC.",
- "line1": "não suportada"
- },
- "ru-ru": {
- "tts": "Эта версия %appName% не поддерживается SYNC.",
- "line1": "не поддерживается"
- },
- "sv-se": {
- "tts": "SYNC har inte stöd för den här versionen av %appName%.",
- "line1": "stöds ej"
- },
- "tr-tr": {
- "tts": "Bu %appName% sürümü SYNC tarafından desteklenmiyor.",
- "line1": "desteklenmiyor"
- },
- "zh-cn": {
- "tts": "SYNC不支持此版本的%appName%。",
- "line1": "不受支持"
- },
- "zh-tw": {
- "tts": "SYNC 不支援此版本的%appName% 。",
- "line1": "不支援"
- }
- }
- },
- "DataConsent": {
- "languages": {
- "en-gb": {
- "textBody": "Would you like to enable Mobile Apps on SYNC? To use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S. Updates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information."
- },
- "en-us": {
- "line1": "Enable Mobile Apps",
- "line2": "on SYNC? (Uses Data)",
- "textBody": "Would you like to enable Mobile Apps on SYNC?\n\nTo use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S.\n\nUpdates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information."
- },
- "es-en": {
- "textBody": "Para usar aplicaciones móviles con SYNC, este debe comunicarse con Ford al menos una vez al mes a través del plan de datos de su dispositivo móvil. Pueden aplicar tarifas normales. SYNC enviará su VIN y el número de módulo de SYNC a Ford de Estados Unidos de América. Las actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario. /r Presione Sí para permitir y No para denegar."
- },
- "fr-ca": {
- "textBody": "Pour utiliser AppLink, SYNC devra communiquer avec Ford au moins une fois par mois en utilisant le forfait de données de votre appareil mobile. Les tarifs réguliers peuvent s’appliquer. SYNC enverra votre NIV et le numéro de votre module SYNC à Ford États-Unis. Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements. /r Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser."
- }
- }
- },
- "DataConsentHelp": {
- "languages": {
- "en-us": {
- "textBody": "Updates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. See your Owner Guide for more information."
- },
- "es-en": {
- "textBody": "Las actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario."
- },
- "fr-ca": {
- "textBody": "Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements."
- }
- }
- },
- "DisableApps": {
- "languages": {
- "de-de": {
- "tts": "Ausschalten der automatischen Updates führt zum Ausschalten von SYNC mobile Apps. Sie können Ihre mobilen Apps dann nicht mehr mit SYNC nutzen. Bitte drücken Sie Ja zur Bestätigung oder Nein, um abzubrechen.",
- "line1": "Auto-Update",
- "line2": "und Mobile Apps deaktivieren"
- },
- "en-au": {
- "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
- "line1": "Disable auto-updates",
- "line2": "and Mobile Apps?"
- },
- "en-gb": {
- "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
- "line1": "Disable auto-updates",
- "line2": "and Mobile Apps?",
- "textBody": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel."
- },
- "en-ie": {
- "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
- "line1": "Disable auto-updates",
- "line2": "and Mobile Apps?"
- },
- "en-us": {
- "tts": "Disabling automatic updates will also disable sync mobile apps. You will not be able to use any mobile apps with SYNC. Please press yes to confirm or no to cancel.",
- "line1": "Disable Auto-Updates",
- "line2": "and Mobile Apps?",
- "textBody": "Disabling automatic updates will also disable sync mobile apps. You will not be able to use any mobile apps with SYNC. Please press yes to confirm or no to cancel."
- },
- "es-en": {
- "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.",
- "line1": "¿Deshab. actualiz.",
- "line2": "autom. y aplic. móv.?",
- "textBody": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar."
- },
- "es-es": {
- "tts": "Si desactiva las actualizaciones automáticas, también se desactivará la sincronización de las aplicaciones móviles. No podrá utilizar ninguna aplicación móvil con SYNC. Pulse sí para confirmar o no para cancelar.",
- "line1": "¿Desact. actual. auto",
- "line2": "y apl. móviles?"
- },
- "es-mx": {
- "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.",
- "line1": "¿Deshab. actualiz.",
- "line2": "autom. y aplic. móv.?"
- },
- "fr-ca": {
- "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.",
- "line1": "Désactiver màj autom.",
- "line2": "et app. mobiles?",
- "textBody": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler."
- },
- "fr-fr": {
- "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.",
- "line1": "Désactiver màj autom.",
- "line2": "et app. mobiles?"
- },
- "it-it": {
- "tts": "Disabilitando gli aggiornamenti automatici si disattiva anche la sincronizzazione delle app mobili. Non sarà possibile usare app mobili con il SYNC. Premere Sì per confermare e No per cancellare.",
- "line1": "Disabilitare agg. aut.",
- "line2": "e app mobili?"
- },
- "nl-nl": {
- "tts": "Door automatische updates uit te schakelen, schakelt u ook SYNC-mobiele apps uit. U kunt dan geen mobiele apps meer gebruiken met SYNC. Druk op Ja om te bevestigen of op Nee om te annuleren.",
- "line1": "Auto-updates en mob.",
- "line2": "apps uitschakelen?"
- },
- "pl-pl": {
- "tts": "Wyłączenie automatycznych aktualizacji spowoduje także wyłączenie aplikacji mobilnych SYNC. Korzystanie z mobilnych aplikacji za pomocą SYNC będzie niemożliwe. Naciśnij TAK, by potwierdzić lub NIE, by anulować.",
- "line1": "Wył. automat. aktual.",
- "line2": "i aplikacje mobilne?"
- },
- "pt-br": {
- "tts": "Se as atualizações automáticas forem desativadas, os aplicativos também serão desativados. Você não poderá usar nenhum aplicativo com o SYNC. Pressione sim para confirmar ou não para cancelar.",
- "line1": "Desativar atualizações",
- "line2": "autom. e aplicativos?"
- },
- "pt-pt": {
- "tts": "A desactivação das actualizações automáticas desactiva igualmente as aplicações móveis do SYNC. Não poderá utilizar quaisquer aplicações móveis com o SYNC. Prima \"\"Sim\"\" para confirmar ou \"\"Não\"\" para cancelar.",
- "line1": "Desact. actual. autom.",
- "line2": "e aplicações móveis?"
- },
- "ru-ru": {
- "tts": "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены.",
- "line1": "Откл. автообновления",
- "line2": "и мобил. прилож.?"
- },
- "sv-se": {
- "tts": "Om du avaktiverar automatisk uppdatering avaktiverar du även synkning av mobilappar. Du kommer inte längre att kunna använda dina mobilappar med SYNC. Tryck Ja för att bekräfta eller Nej för att avbryta.",
- "line1": "Avaktiverar autouppdat.",
- "line2": "och mobilappar?"
- },
- "tr-tr": {
- "tts": "Otomatik güncellemeleri devre dışı bırakırsanız sync mobil uygulamalar da devre dışı kalır. SYNC ile mobil uygulama kullanmanız mümkün olmaz. Lütfen onaylamak için Evet'e veya iptal etmek için Hayır'a basın.",
- "line1": "Oto. güncelleme ve",
- "line2": "mobil uygul. kapat?"
- },
- "zh-cn": {
- "tts": "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。",
- "line1": "是否禁用自动更新和",
- "line2": "移动应用程序?"
- },
- "zh-tw": {
- "tts": "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。",
- "line1": "停用自動更新",
- "line2": "和行動應用程式?"
- }
- }
- },
- "DrivingCharacteristics": {
- "languages": {
- "de-de": {
- "tts": "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus.",
- "label": "Fahreigenschaften"
- },
- "en-au": {
- "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
- "label": "Driving characteristics"
- },
- "en-gb": {
- "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
- "label": "Driving characteristics",
- "textBody": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
- },
- "en-ie": {
- "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
- "label": "Driving characteristics"
- },
- "en-us": {
- "tts": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status.",
- "label": "Driving Characteristics",
- "textBody": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
- },
- "es-en": {
- "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.",
- "label": "Características del manejo",
- "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
- },
- "es-es": {
- "tts": "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad.",
- "label": "Características de conducción"
- },
- "es-mx": {
- "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.",
- "label": "Características del manejo"
- },
- "fr-ca": {
- "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.",
- "label": "Caractéristiques de conduite",
- "textBody": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
- },
- "fr-fr": {
- "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.",
- "label": "Caractéristiques de conduite"
- },
- "it-it": {
- "tts": "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza.",
- "label": "Caratteristiche di guida"
- },
- "nl-nl": {
- "tts": "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus.",
- "label": "Rijkenmerken"
- },
- "pl-pl": {
- "tts": "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa.",
- "label": "Informacje dotyczące stylu jazdy"
- },
- "pt-br": {
- "tts": "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança.",
- "label": "Características de condução"
- },
- "pt-pt": {
- "tts": "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança.",
- "label": "Características de condução"
- },
- "ru-ru": {
- "tts": "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности.",
- "label": "Характеристики движения"
- },
- "sv-se": {
- "tts": "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus.",
- "label": "Köregenskaper"
- },
- "tr-tr": {
- "tts": "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu.",
- "label": "Sürüş karakteristikleri"
- },
- "zh-cn": {
- "tts": "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态",
- "label": "行驶特性"
- },
- "zh-tw": {
- "tts": "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態",
- "label": "駕駛特性"
- }
- }
- },
- "Location": {
- "languages": {
- "de-de": {
- "tts": "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs.",
- "label": "GPS und Geschwindigkeit"
- },
- "en-au": {
- "tts": "An app can access vehicle GPS and speed.",
- "label": "GPS and speed"
- },
- "en-gb": {
- "tts": "An app can access vehicle GPS and speed.",
- "label": "GPS and speed",
- "textBody": "An app can access vehicle GPS and speed."
- },
- "en-ie": {
- "tts": "An app can access vehicle GPS and speed.",
- "label": "GPS and speed"
- },
- "en-us": {
- "tts": "An app can access vehicle GPS and speed.",
- "label": "GPS and speed",
- "textBody": "An app can access vehicle GPS and speed."
- },
- "es-en": {
- "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
- "label": "GPS y velocidad",
- "textBody": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
- },
- "es-es": {
- "tts": "Una aplicación puede acceder al GPS y la velocidad del vehículo.",
- "label": "GPS y velocidad"
- },
- "es-mx": {
- "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
- "label": "GPS y velocidad"
- },
- "fr-ca": {
- "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.",
- "label": "GPS et vitesse",
- "textBody": "Une application peut accéder au GPS et à la vitesse du véhicule."
- },
- "fr-fr": {
- "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.",
- "label": "GPS et vitesse"
- },
- "it-it": {
- "tts": "Un'app può avere accesso a GPS e velocità del veicolo.",
- "label": "GPS e velocità"
- },
- "nl-nl": {
- "tts": "Een app heeft toegang tot gps en de snelheid van het voertuig.",
- "label": "Gps en snelheid"
- },
- "pl-pl": {
- "tts": "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu.",
- "label": "GPS i prędkość"
- },
- "pt-br": {
- "tts": "Um aplicativo pode acessar o GPS e a velocidade do veículo.",
- "label": "GPS e velocidade"
- },
- "pt-pt": {
- "tts": "Uma aplicação consegue aceder ao GPS e à velocidade do veículo.",
- "label": "GPS e velocidade"
- },
- "ru-ru": {
- "tts": "Приложение имеет доступ к GPS и скорости автомобиля.",
- "label": "GPS и скорость"
- },
- "sv-se": {
- "tts": "Appen kan komma åt fordonets GPS och hastighetsmätare.",
- "label": "GPS och hastighet"
- },
- "tr-tr": {
- "tts": "Bu uygulama aracın GPS ve hız bilgilerine erişebilir.",
- "label": "GPS ve hız"
- },
- "zh-cn": {
- "tts": "移动应用程序可以访问车辆 GPS 和车速信息。",
- "label": "GPS 和车速"
- },
- "zh-tw": {
- "tts": "應用程式可存取車輛的GPS和速度。",
- "label": "GPS和車速"
- }
- }
- },
- "Notifications": {
- "languages": {
- "de-de": {
- "tts": "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden.",
- "label": "Push-Benachrichtigungen"
- },
- "en-au": {
- "tts": "An app can send notifications when running in the background.",
- "label": "Push notifications"
- },
- "en-gb": {
- "tts": "An app can send notifications when running in the background.",
- "label": "Push notifications",
- "textBody": "An app can send notifications when running in the background."
- },
- "en-ie": {
- "tts": "An app can send notifications when running in the background.",
- "label": "Push notifications"
- },
- "en-us": {
- "tts": "An app can send notifications when running in the background.",
- "label": "Push notifications",
- "textBody": "An app can send notifications when running in the background."
- },
- "es-en": {
- "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
- "label": "Notificaciones tipo Push",
- "textBody": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
- },
- "es-es": {
- "tts": "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano.",
- "label": "Notificaciones push"
- },
- "es-mx": {
- "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
- "label": "Notificaciones tipo Push"
- },
- "fr-ca": {
- "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
- "label": "Notifications instantanées",
- "textBody": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
- },
- "fr-fr": {
- "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
- "label": "Notifications push"
- },
- "it-it": {
- "tts": "Un'app può inviare notifiche se eseguita in background.",
- "label": "Notifiche push"
- },
- "nl-nl": {
- "tts": "Een app kan meldingen versturen als deze op de achtergrond actief is.",
- "label": "Push-meldingen"
- },
- "pl-pl": {
- "tts": "Aplikacja może wysyłać powiadomienia, działając w tle.",
- "label": "Powiadomienia Push"
- },
- "pt-br": {
- "tts": "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano.",
- "label": "Notificações Push"
- },
- "pt-pt": {
- "tts": "Uma aplicação consegue enviar notificações quando está activa em segundo plano.",
- "label": "Notificações push"
- },
- "ru-ru": {
- "tts": "Если приложение работает в фоновом режиме, оно может отправлять оповещения.",
- "label": "Оповещения о пересылке"
- },
- "sv-se": {
- "tts": "Appen kan skicka meddelanden när den körs i bakgrunden.",
- "label": "Push-notiser"
- },
- "tr-tr": {
- "tts": "Bir uygulama arka planda çalışırken bildirim gönderebilir.",
- "label": "Anlık bildirimleri"
- },
- "zh-cn": {
- "tts": "移动应用程序在后台运行时可推送通知。",
- "label": "推送通知"
- },
- "zh-tw": {
- "tts": "車輛行進時,應用程式可在背景中傳送通知。",
- "label": "傳送通知"
- }
- }
- },
- "SettingDisableUpdates": {
- "languages": {
- "de-de": {
- "line1": "Updates deakt."
- },
- "en-au": {
- "line1": "Disable updates"
- },
- "en-gb": {
- "line1": "Disable updates"
- },
- "en-ie": {
- "line1": "Disable updates"
- },
- "en-us": {
- "line1": "Disable Updates",
- "textBody": "Disable Updates"
- },
- "es-en": {
- "line1": "Deshab. actual.",
- "textBody": "Deshab. actual."
- },
- "es-es": {
- "line1": "Desact. actual."
- },
- "es-mx": {
- "line1": "Deshab. actual."
- },
- "fr-ca": {
- "line1": "Désactiver MAJ",
- "textBody": "Désactiver MAJ"
- },
- "fr-fr": {
- "line1": "Désactiver màj"
- },
- "it-it": {
- "line1": "Disabilita agg."
- },
- "nl-nl": {
- "line1": "Upd. uitschak."
- },
- "pl-pl": {
- "line1": "Wyłącz aktual."
- },
- "pt-br": {
- "line1": "Desat. atualiz."
- },
- "pt-pt": {
- "line1": "Desact. actualiz."
- },
- "ru-ru": {
- "line1": "Откл. обновл."
- },
- "sv-se": {
- "line1": "Inaktivera uppd."
- },
- "tr-tr": {
- "line1": "Güncell. Kapat"
- },
- "zh-cn": {
- "line1": "禁用更新"
- },
- "zh-tw": {
- "line1": "停用更新"
- }
- }
- },
- "SettingEnableUpdates": {
- "languages": {
- "de-de": {
- "line1": "Apps aktivieren"
- },
- "en-au": {
- "line1": "Enable Apps"
- },
- "en-gb": {
- "line1": "Enable Apps"
- },
- "en-ie": {
- "line1": "Enable Apps"
- },
- "en-us": {
- "line1": "Enable Apps"
- },
- "es-en": {
- "line1": "Hab. aplic."
- },
- "es-es": {
- "line1": "Activar apl."
- },
- "es-mx": {
- "line1": "Hab. aplic."
- },
- "fr-ca": {
- "line1": "Activer app.",
- "textBody": "Activer app."
- },
- "fr-fr": {
- "line1": "Activer app."
- },
- "it-it": {
- "line1": "Abilita app"
- },
- "nl-nl": {
- "line1": "Apps inschak."
- },
- "pl-pl": {
- "line1": "Włącz aplikacje"
- },
- "pt-br": {
- "line1": "Ativar aplic."
- },
- "pt-pt": {
- "line1": "Activar actualiz."
- },
- "ru-ru": {
- "line1": "Вкл. прилож."
- },
- "sv-se": {
- "line1": "Aktivera appar"
- },
- "tr-tr": {
- "line1": "Uygulamaları aç"
- },
- "zh-cn": {
- "line1": "启用应用程序"
- },
- "zh-tw": {
- "line1": "啟用應用程式"
- }
- }
- },
- "SettingUpdateAuto": {
- "languages": {
- "de-de": {
- "line1": "Update anford."
- },
- "en-au": {
- "line1": "Request update"
- },
- "en-gb": {
- "line1": "Request update"
- },
- "en-ie": {
- "line1": "Request update"
- },
- "en-us": {
- "line1": "Request Update",
- "textBody": "Select `Update now` to receive app authorization information for your SYNC-enabled mobile apps. This may enable additional functionality depending on the app and your settings. If your phone has a working data connection, an update should complete in less than 1 minute."
- },
- "es-en": {
- "line1": "Solicit. actualiz.",
- "textBody": "Solicit. actualiz."
- },
- "es-es": {
- "line1": "Solicitar actual."
- },
- "es-mx": {
- "line1": "Solicit. actualiz."
- },
- "fr-ca": {
- "line1": "Demander MAJ",
- "textBody": "Demander MAJ"
- },
- "fr-fr": {
- "line1": "Demander màj"
- },
- "it-it": {
- "line1": "Rich. aggiorn."
- },
- "nl-nl": {
- "line1": "Upd. aanvragen"
- },
- "pl-pl": {
- "line1": "Zażądaj aktual."
- },
- "pt-br": {
- "line1": "Solicitar atualiz."
- },
- "pt-pt": {
- "line1": "Solicit. actualiz."
- },
- "ru-ru": {
- "line1": "Запрос на обн."
- },
- "sv-se": {
- "line1": "Begär uppdat."
- },
- "tr-tr": {
- "line1": "Güncelleme iste"
- },
- "zh-cn": {
- "line1": "请求更新"
- },
- "zh-tw": {
- "line1": "請求更新"
- }
- }
- },
- "StatusNeeded": {
- "languages": {
- "de-de": {
- "line1": "Update benötigt"
- },
- "en-au": {
- "line1": "Update needed"
- },
- "en-gb": {
- "line1": "Update needed",
- "textBody": "Update needed"
- },
- "en-ie": {
- "line1": "Update needed"
- },
- "en-us": {
- "line1": "Update Needed",
- "textBody": "Update Needed"
- },
- "es-en": {
- "line1": "Actualiz. neces.",
- "textBody": "Actualiz. neces."
- },
- "es-es": {
- "line1": "Actu. necesaria"
- },
- "es-mx": {
- "line1": "Actualiz. neces."
- },
- "fr-ca": {
- "line1": "Màj requise",
- "textBody": "Màj requise"
- },
- "fr-fr": {
- "line1": "Mise à jour requise"
- },
- "it-it": {
- "line1": "Necess. aggiorn."
- },
- "nl-nl": {
- "line1": "Update nodig"
- },
- "pl-pl": {
- "line1": "Potrzeba aktual."
- },
- "pt-br": {
- "line1": "Atualiz. necess."
- },
- "pt-pt": {
- "line1": "Actual. necess."
- },
- "ru-ru": {
- "line1": "Необх. обновл."
- },
- "sv-se": {
- "line1": "Uppdat. krävs"
- },
- "tr-tr": {
- "line1": "Güncellenmeli"
- },
- "zh-cn": {
- "line1": "需要进行更新"
- },
- "zh-tw": {
- "line1": "需更新"
- }
- }
- },
- "StatusPending": {
- "languages": {
- "de-de": {
- "line1": "Aktualisieren..."
- },
- "en-au": {
- "line1": "Updating..."
- },
- "en-gb": {
- "line1": "Updating...",
- "textBody": "Updating..."
- },
- "en-ie": {
- "line1": "Updating..."
- },
- "en-us": {
- "line1": "Updating...",
- "textBody": "Updating..."
- },
- "es-en": {
- "line1": "Actualizando...",
- "textBody": "Actualizando..."
- },
- "es-es": {
- "line1": "Actualizando..."
- },
- "es-mx": {
- "line1": "Actualizando..."
- },
- "fr-ca": {
- "line1": "MAJ en cours...",
- "textBody": "MAJ en cours..."
- },
- "fr-fr": {
- "line1": "Màj en cours..."
- },
- "it-it": {
- "line1": "Aggiornamento"
- },
- "nl-nl": {
- "line1": "Updaten..."
- },
- "pl-pl": {
- "line1": "Aktualizowanie"
- },
- "pt-br": {
- "line1": "Atualizando..."
- },
- "pt-pt": {
- "line1": "A actualizar..."
- },
- "ru-ru": {
- "line1": "Обновление..."
- },
- "sv-se": {
- "line1": "Uppdaterar..."
- },
- "tr-tr": {
- "line1": "Güncelleniyor..."
- },
- "zh-cn": {
- "line1": "正在更新......"
- },
- "zh-tw": {
- "line1": "更新中..."
- }
- }
- },
- "StatusUpToDate": {
- "languages": {
- "de-de": {
- "line1": "Aktuelle Version"
- },
- "en-au": {
- "line1": "Up-to-date"
- },
- "en-gb": {
- "line1": "Up-to-date",
- "textBody": "Up-to-date"
- },
- "en-ie": {
- "line1": "Up-to-date"
- },
- "en-us": {
- "line1": "Up-To-Date",
- "textBody": "Up-To-Date"
- },
- "es-en": {
- "line1": "Actualizado",
- "textBody": "Actualizado"
- },
- "es-es": {
- "line1": "Actualizada"
- },
- "es-mx": {
- "line1": "Actualizado"
- },
- "fr-ca": {
- "line1": "Déjà à jour",
- "textBody": "Déjà à jour"
- },
- "fr-fr": {
- "line1": "Déjà à jour"
- },
- "it-it": {
- "line1": "più recente"
- },
- "nl-nl": {
- "line1": "Up-to-date"
- },
- "pl-pl": {
- "line1": "Aktualne"
- },
- "pt-br": {
- "line1": "Atualizado"
- },
- "pt-pt": {
- "line1": "Actualizado"
- },
- "ru-ru": {
- "line1": "Обновлено"
- },
- "sv-se": {
- "line1": "Uppdat. krävs ej"
- },
- "tr-tr": {
- "line1": "Güncel"
- },
- "zh-cn": {
- "line1": "最新更新"
- },
- "zh-tw": {
- "line1": "更新最新"
- }
- }
- },
- "VehicleInfo": {
- "languages": {
- "de-de": {
- "tts": "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck.",
- "label": "Fahrzeuginformationen"
- },
- "en-au": {
- "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.",
- "label": "Vehicle information"
- },
- "en-gb": {
- "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure.",
- "label": "Vehicle information",
- "textBody": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure."
- },
- "en-ie": {
- "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.",
- "label": "Vehicle information"
- },
- "en-us": {
- "tts": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure.",
- "label": "Vehicle information",
- "textBody": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
- },
- "es-en": {
- "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.",
- "label": "Información del vehículo",
- "textBody": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos."
- },
- "es-es": {
- "tts": "Una aplicación puede acceder a la siguiente información del vehículo: Nivel de combustible, Ahorro de combustible, RPM del motor, Cuentakilómetros, VIN, Temperatura aire exterior, Marcha engranada, Presión de neumáticos.",
- "label": "Información del vehículo"
- },
- "es-mx": {
- "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.",
- "label": "Información del vehículo"
- },
- "fr-ca": {
- "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus.",
- "label": "Renseignements du véhicule",
- "textBody": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus."
- },
- "fr-fr": {
- "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Vitesse de moteur, Compteur kilométrique, NIV, Température extérieure, Position de vitesse, Pression des pneus.",
- "label": "Renseignements du véhicule"
- },
- "it-it": {
- "tts": "Un'app può avere accesso alle seguenti informazioni del veicolo: Livello carburante, Consumi carburante, Numero giri motore, Contachilometri, VIN, Temperatura esterna, Posizione marcia, Pressione pneumatici.",
- "label": "Informazioni sul veicolo"
- },
- "nl-nl": {
- "tts": "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning.",
- "label": "Voertuiginformatie"
- },
- "pl-pl": {
- "tts": "Aplikacja może uzyskać dostęp do następujących informacji o pojeździe: Poziom paliwa, Zużycie paliwa, Obroty silnika, Licznik przebiegu, Numer VIN, Temperatura zewnętrzna, Aktualny bieg, Ciśnienie opon.",
- "label": "Informacje o pojeździe"
- },
- "pt-br": {
- "tts": "Um aplicativo pode acessar as seguintes informações sobre o veículo: Nível de combustível, Economia de combustível, RPM do motor, Hodômetro, VIN, Temperatura externa, Posição das marchas, Pressão dos pneus.",
- "label": "Informações sobre o veículo"
- },
- "pt-pt": {
- "tts": "Uma aplicação consegue aceder às seguintes informações do veículo: Nível de combustível, Poupança de combustível, RPM do motor, Conta-quilómetros, VIN, Temperatura exterior, Posição da mudança de velocidade, Pressão dos pneus.",
- "label": "Informações do veículo"
- },
- "ru-ru": {
- "tts": "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин.",
- "label": "Информация об автомобиле"
- },
- "sv-se": {
- "tts": "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck.",
- "label": "Fordonsinformation"
- },
- "tr-tr": {
- "tts": "Bir uygulama şu araç bilgilerine erişebilir: Yakıt seviyesi, Yakıt ekonomisi, Motor devirleri, Kilometre sayacı, VIN, Dış sıcaklık, Vites konumu, Lastik basıncı.",
- "label": "Araç bilgisi"
- },
- "zh-cn": {
- "tts": "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压.",
- "label": "车辆信息"
- },
- "zh-tw": {
- "tts": "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓.",
- "label": "車輛資訊"
- }
- }
- }
- }
- },
- "app_policies": {
- "default": {
- "keep_context": false,
- "steal_focus": false,
- "priority": "NONE",
- "default_hmi": "NONE",
- "groups": ["Base-4"]
- },
- "device": {
- "keep_context": false,
- "steal_focus": false,
- "priority": "NONE",
- "default_hmi": "NONE",
- "groups": ["DataConsent-2"]
- },
- "pre_DataConsent": {
- "keep_context": false,
- "steal_focus": false,
- "priority": "NONE",
- "default_hmi": "NONE",
- "groups": ["BaseBeforeDataConsent"]
- }
- }
- }
-} \ No newline at end of file
+ {
+ "policy_table": {
+ "module_config": {
+ "preloaded_pt": true,
+ "exchange_after_x_ignition_cycles": 100,
+ "exchange_after_x_kilometers": 1800,
+ "exchange_after_x_days": 30,
+ "timeout_after_x_seconds": 60,
+ "seconds_between_retries": [1,
+ 5,
+ 25,
+ 125,
+ 625],
+ "endpoints": {
+ "0x07": {
+ "default": ["http://policies.telematics.ford.com/api/policies"]
+ }
+ },
+ "notifications_per_minute_by_priority": {
+ "EMERGENCY": 60,
+ "NAVIGATION": 15,
+ "COMMUNICATION": 6,
+ "NORMAL": 4,
+ "NONE": 0
+ }
+ },
+ "functional_groupings": {
+ "Base-4": {
+ "rpcs": {
+ "AddCommand": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "AddSubMenu": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "Alert": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "ChangeRegistration": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "CreateInteractionChoiceSet": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "DeleteCommand": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "DeleteFile": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "DeleteInteractionChoiceSet": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "DeleteSubMenu": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "EncodedSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "EndAudioPassThru": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "GenericResponse": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ListFiles": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnAppInterfaceUnregistered": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnAudioPassThru": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "OnButtonEvent": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "OnButtonPress": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "OnCommand": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "OnDriverDistraction": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "OnEncodedSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnHashChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnHMIStatus": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnLanguageChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnPermissionsChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnSystemRequest": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "PerformAudioPassThru": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "PerformInteraction": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "PutFile": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "RegisterAppInterface": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "ResetGlobalProperties": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ScrollableMessage": {
+ "hmi_levels": ["FULL"]
+ },
+ "SetAppIcon": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetDisplayLayout": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetGlobalProperties": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "SetMediaClockTimer": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "Show": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "Slider": {
+ "hmi_levels": ["FULL"]
+ },
+ "Speak": {
+ "hmi_levels": ["FULL",
+ "LIMITED"]
+ },
+ "SubscribeButton": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "SystemRequest": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "UnregisterAppInterface": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "UnsubscribeButton": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "Location-1": {
+ "user_consent_prompt": "Location",
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["gps",
+ "speed"]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["gps",
+ "speed"]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["gps",
+ "speed"]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["gps",
+ "speed"]
+ }
+ }
+ },
+ "Notifications": {
+ "user_consent_prompt": "Notifications",
+ "rpcs": {
+ "Alert": {
+ "hmi_levels": ["BACKGROUND"]
+ }
+ }
+ },
+ "DrivingCharacteristics-3": {
+ "user_consent_prompt": "DrivingCharacteristics",
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["accPedalPosition",
+ "beltStatus",
+ "driverBraking",
+ "myKey",
+ "prndl",
+ "rpm",
+ "steeringWheelAngle"]
+ }
+ }
+ },
+ "VehicleInfo-3": {
+ "user_consent_prompt": "VehicleInfo",
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["bodyInformation",
+ "deviceStatus",
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["bodyInformation",
+ "deviceStatus",
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["bodyInformation",
+ "deviceStatus",
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["bodyInformation",
+ "deviceStatus",
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"]
+ }
+ }
+ },
+ "PropriataryData-1": {
+ "rpcs": {
+ "DiagnosticMessage": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "GetDTCs": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ReadDID": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "Emergency-1": {
+ "rpcs": {
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": ["airbagStatus",
+ "clusterModeStatus",
+ "eCallInfo",
+ "emergencyEvent"]
+ }
+ }
+ },
+ "Navigation-1": {
+ "rpcs": {
+ "AlertManeuver": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "ShowConstantTBT": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "UpdateTurnList": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ }
+ }
+ },
+ "DataConsent-2": {
+ "user_consent_prompt": "DataConsent",
+ "rpcs": null
+ },
+ "BaseBeforeDataConsent": {
+ "rpcs": {
+ "ChangeRegistration": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "DeleteFile": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "EncodedSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "ListFiles": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnAppInterfaceUnregistered": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnEncodedSyncPData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnHashChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnHMIStatus": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnLanguageChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnPermissionsChange": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnSystemRequest": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "PutFile": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "RegisterAppInterface": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetAppIcon": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SetDisplayLayout": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "SystemRequest": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "UnregisterAppInterface": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ }
+ }
+ }
+ },
+ "consumer_friendly_messages": {
+ "version": "001.001.019",
+ "messages": {
+ "AppPermissions": {
+ "languages": {
+ "de-de": {
+ "tts": "%appName% benötigt die folgenden Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Wenn Sie Ja drücken, erklären Sie sich damit einverstanden, dass %vehicleMake% nicht für Schäden oder Verletzungen der Privatsphäre haftet, die im Zusammenhang mit der Nutzung Ihrer Benutzerdaten durch %appName% entstehen. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab.",
+ "line1": "Zugriffsanfrage(n)",
+ "line2": "erlauben?"
+ },
+ "en-au": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.",
+ "line1": "Grant requested",
+ "line2": "permission(s)?"
+ },
+ "en-gb": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. Please press Yes to allow or No to deny.",
+ "line1": "Grant requested",
+ "line2": "permission(s)?",
+ "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu."
+ },
+ "en-ie": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.",
+ "line1": "Grant requested",
+ "line2": "permission(s)?"
+ },
+ "en-us": {
+ "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. Please press yes to allow or no to deny.",
+ "line1": "Grant Requested",
+ "line2": "Permission(s)?",
+ "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. \n\nIf you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu."
+ },
+ "es-en": {
+ "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.",
+ "line1": "¿Otorgar permiso(s)",
+ "line2": "solicitado(s)?",
+ "textBody": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar. \n\n Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles."
+ },
+ "es-es": {
+ "tts": "%appName% está solicitando el uso de los siguientes permisos e información del vehículo: %functionalGroupLabels%. Si pulsa sí, acepta que %vehicleMake% no será responsable de los daños o la pérdida de privacidad relacionados con el uso de sus datos por parte de %appName%. Pulse sí para permitir o no para denegar.",
+ "line1": "¿Conceder permisos",
+ "line2": "solicitados?"
+ },
+ "es-mx": {
+ "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.",
+ "line1": "¿Otorgar permiso(s)",
+ "line2": "solicitado(s)?"
+ },
+ "fr-ca": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.",
+ "line1": "Accorder permission(s)",
+ "line2": "demandée(s)",
+ "textBody": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles."
+ },
+ "fr-fr": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.",
+ "line1": "Accorder permission(s)",
+ "line2": "demandée(s)"
+ },
+ "it-it": {
+ "tts": "%appName% richiede l'uso delle seguenti informazioni e autorizzazioni sul veicolo: %functionalGroupLabels%. Se si preme Sì, si acconsente che %vehicleMake% non sarà responsabile per danni o perdita di privacy in relazione all'impiego dei dati da parte di %appName%. Premere Sì per consentire e No per negare.",
+ "line1": "Concedi autorizzaz.",
+ "line2": "richiesta(e)?"
+ },
+ "nl-nl": {
+ "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. Als u op Ja drukt, gaat u ermee akkoord dat %vehicleMake% in geen geval aansprakelijk gesteld kan worden voor schade of verlies van privacy als gevolg van het feit dat %appName% gebruik maakt van uw gegevens. Druk op Ja om dit toe te staan of Nee om te weigeren.",
+ "line1": "Aangevraagde",
+ "line2": "permissie(s) verlenen?"
+ },
+ "pl-pl": {
+ "tts": "%appName% wymaga następujących informacji o pojeździe oraz pozwoleń: %functionalGroupLabels%. Naciśnięcie TAK oznacza zgodę na fakt, iż %vehicleMake% nie będzie ponosić odpowiedzialności za szkody ani utratę prywatności w związku z wykorzystaniem przez %appName% danych, należących do użytkownika. Naciśnij TAK w celu udzielenia zgody lub NIE w celu odrzucenia żądania.",
+ "line1": "Udzielić żądanych",
+ "line2": "pozwoleń?"
+ },
+ "pt-br": {
+ "tts": "%appName% está solicitando o uso das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se pressionar sim, você concorda que a %vehicleMake% não será responsável por danos ou perdas de privacidade relacionados ao uso dos seus dados por %appName%. Pressione sim para permitir ou não para negar.",
+ "line1": "Conceder permissão",
+ "line2": "solicitada?"
+ },
+ "pt-pt": {
+ "tts": "%appName% está a solicitar a utilização das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se premir “Sim”, concorda que %vehicleMake% não será responsável por quaisquer danos ou perda de privacidade relacionada com a utilização dos seus dados por parte de %appName%. Prima “Sim” para permitir ou “Não” para recusar.",
+ "line1": "Conceder permiss.",
+ "line2": "solicitada(s)?"
+ },
+ "ru-ru": {
+ "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны.",
+ "line1": "Предост. заправш.",
+ "line2": "разрешения?"
+ },
+ "sv-se": {
+ "tts": "%appName% begär att få tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Om du trycker Ja godkänner du att %vehicleMake% ska hållas skadeslös för alla skador som kan uppstå eller eventuella integritetsintrång som uppstår när %appName% använder dina data. Tryck Ja för att godkänna eller Nej för att neka.",
+ "line1": "Vill du ge",
+ "line2": "tillstånd?"
+ },
+ "tr-tr": {
+ "tts": "%appName%, şu araç bilgilerini ve izinleri kullanma isteğinde bulunuyor: %functionalGroupLabels%. Evet'e basarsanız, %appName%'in verilerinizi kullanması sonucunda oluşabilecek hasarlardan veya gizlilik kaybından %vehicleMake%'in sorumlu olmayacağını kabul etmiş olacaksınız. Lütfen kabul etmek için Evet'e veya reddetmek için Hayır'a basın.",
+ "line1": "İstenen izinler",
+ "line2": "verilsin mi?"
+ },
+ "zh-cn": {
+ "tts": "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。",
+ "line1": "是否允许请求的",
+ "line2": "权限?"
+ },
+ "zh-tw": {
+ "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。",
+ "line1": "允許",
+ "line2": "授權請求?"
+ }
+ }
+ },
+ "AppPermissionsHelp": {
+ "languages": {
+ "de-de": {
+ "tts": "%appName% fordert folgende Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Im Einstellungsmenü der mobilen Apps können Sie diese Berechtigungen ändern und sich detaillierte Beschreibungen anhören. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab."
+ },
+ "en-au": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-gb": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-ie": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny."
+ },
+ "en-us": {
+ "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press yes to grant permissions or no to deny."
+ },
+ "es-en": {
+ "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
+ },
+ "es-es": {
+ "tts": "%appName% está solicitando los siguientes permisos e información del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y escuchar descripciones detalladas en el menú de configuración de la aplicación móvil. Pulse sí para conceder el permiso o no para denegarlo."
+ },
+ "es-mx": {
+ "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar."
+ },
+ "fr-ca": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
+ },
+ "fr-fr": {
+ "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser."
+ },
+ "it-it": {
+ "tts": "%appName% richiede le seguenti informazioni e autorizzazioni riguardo il veicolo: %functionalGroupLabels%. È possibile modificare tali autorizzazioni e ascoltare descrizioni dettagliate nel menu impostazioni delle app mobili. Premere Sì per concedere le autorizzazioni e No per negarle."
+ },
+ "nl-nl": {
+ "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. U kunt deze toestemmingen wijzigen en gedetailleerde beschrijvingen beluisteren in het instellingenmenu voor mobiele apps. Druk op Ja om permissies te verlenen of op Nee om te weigeren."
+ },
+ "pl-pl": {
+ "tts": "%appName% wymaga następujących informacji o pojeździe oraz zezwoleń: %functionalGroupLabels%. W menu ustawień aplikacji mobilnych można zmienić owe zezwolenia i usłyszeć ich szczegółowy opis. Naciśnij TAK, aby wyrazić zgodę lub NIE w celu odrzucenia żądania."
+ },
+ "pt-br": {
+ "tts": "%appName% está solicitando as seguintes informações e permissões do veículo: %functionalGroupLabels%. Você pode alterar estas permissões e ouvir descrições detalhadas no menu de configurações de aplicativos móveis. Pressione sim para conceder as permissões ou não para negar."
+ },
+ "pt-pt": {
+ "tts": "%appName% está a solicitar as seguintes informações e permissões do veículo: %functionalGroupLabels%. Pode alterar estas permissões e ouvir descrições detalhadas no menu de definições das aplicações móveis. Prima \"\"Sim\"\" para permitir ou \"\"Não\"\" para recusar."
+ },
+ "ru-ru": {
+ "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Вы можете изменить эти разрешения и прослушать подробные их описания в меню настроек мобильного приложения. Нажмите \"\"да\"\", чтобы предоставить разрешения, или \"\"нет\"\", чтобы не предоставлять."
+ },
+ "sv-se": {
+ "tts": "%appName% begär tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Du kan ändra tillstånden och höra detaljerade beskrivningar i menyn för mobilappsinställningar. Tryck Ja för att ge tillstånd eller Nej för att neka."
+ },
+ "tr-tr": {
+ "tts": "%appName%, şu araç bilgilerini ve izinleri istiyor: %functionalGroupLabels%. Bu izinleri değiştirebilir ve mobil uygulamalar ayarlar menüsünden ayrıntılı açıklamaları dinleyebilirsiniz. Lütfen izin vermek için Evet'e veya reddetmek için Hayır'a basın."
+ },
+ "zh-cn": {
+ "tts": "%appName% 正在请求下列车辆信息和权限: %functionalGroupLabels%。您可在移动应用程序设置菜单中更改这些权限,并听取详细说明。请按“是”允许权限或按“否”拒绝。"
+ },
+ "zh-tw": {
+ "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。您可在行動應用程式設定清單中更改這些許可,並聆聽詳細說明。給予許可請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "AppPermissionsRevoked": {
+ "languages": {
+ "de-de": {
+ "tts": "Die Autorisierungsdaten der App wurden geändert. %appName% hat keinen Zugriff auf %functionalGroupLabels% mehr. Installieren Sie die neueste Version der App auf Ihrem Gerät.."
+ },
+ "en-au": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-gb": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-ie": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "en-us": {
+ "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device."
+ },
+ "es-en": {
+ "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
+ },
+ "es-es": {
+ "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de que tiene la versión más reciente de la aplicación instalada en su dispositivo móvil."
+ },
+ "es-mx": {
+ "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil."
+ },
+ "fr-ca": {
+ "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
+ },
+ "fr-fr": {
+ "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile."
+ },
+ "it-it": {
+ "tts": "Le autorizzazioni dell'app sono cambiate. %appName% non è più in grado di accedere a %functionalGroupLabels%. Assicurarsi di avere la versione più recente dell'app installata sul dispositivo mobile."
+ },
+ "nl-nl": {
+ "tts": "De app-autorisaties zijn gewijzigd. %appName% heeft geen toegang meer tot %functionalGroupLabels%. Zorg ervoor dat u de meest recente app-versie op uw mobiele apparaat geïnstalleerd hebt."
+ },
+ "pl-pl": {
+ "tts": "Dane dostępu aplikacji zostały zmienione. %appName% nie ma już dostępu do %functionalGroupLabels%. Sprawdź, czy na telefonie komórkowym zainstalowano najnowszą wersję aplikacji."
+ },
+ "pt-br": {
+ "tts": "As autorizações dos aplicativos foram alteradas. %appName% não pode mais acessar %functionalGroupLabels%. Certifique-se de que a versão mais recente do aplicativo está instalada no seu dispositivo móvel."
+ },
+ "pt-pt": {
+ "tts": "As autorizações das aplicações mudaram. %appName% já não consegue aceder a %functionalGroupLabels%. Certifique-se de que tem a última versão da aplicação no seu dispositivo móvel."
+ },
+ "ru-ru": {
+ "tts": "Авторизации приложения изменены. %appName% больше не имеет доступа к %functionalGroupLabels%. Убедитесь, что на вашем мобильном устройстве установлена самая новая версия приложения."
+ },
+ "sv-se": {
+ "tts": "Appens behörigheter har ändrats. %appName% har inte längre åtkomst till %functionalGroupLabels%. Kontrollera att du har installerat den senaste versionen av appen på mobilenheten."
+ },
+ "tr-tr": {
+ "tts": "Uygulama yetkileri değişti. %appName% artık %functionalGroupLabels%'e erişemeyecek. Lütfen mobil aygıtınızda en son uygulama sürümünün yüklü olduğundan emin olun."
+ },
+ "zh-cn": {
+ "tts": "应用程序授权已变更。 %appName% 将不能再访问 %functionalGroupLabels%。 请确认您的移动设备上安装的应用程序是最新版本。"
+ },
+ "zh-tw": {
+ "tts": "應用程式授權已改變。%appName% 已無法進入 %functionalGroupLabels%。請確認您的行動裝置上安裝了最新版應用程式。"
+ }
+ }
+ },
+ "AppUnauthorized": {
+ "languages": {
+ "de-de": {
+ "tts": "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren.",
+ "line1": "nicht autorisiert"
+ },
+ "en-au": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "not authorized"
+ },
+ "en-gb": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "not authorized",
+ "textBody": "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-ie": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "not authorized"
+ },
+ "en-us": {
+ "tts": "This version of %appName% is not authorized and will not work with SYNC.",
+ "line1": "Not Authorized",
+ "textBody": "This version of %appName% is no longer authorized to work with AppLink. Please update to the latest version of %appName%."
+ },
+ "es-en": {
+ "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
+ "line1": "no autorizada",
+ "textBody": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "es-es": {
+ "tts": "Esta versión de %appName% no está autorizada y no funcionará con SYNC.",
+ "line1": "No autorizada"
+ },
+ "es-mx": {
+ "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
+ "line1": "no autorizada"
+ },
+ "fr-ca": {
+ "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
+ "line1": "non autorisée",
+ "textBody": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "fr-fr": {
+ "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
+ "line1": "non autorisée"
+ },
+ "it-it": {
+ "tts": "Questa versione di %appName% non è autorizzata e non funziona con il SYNC.",
+ "line1": "non autorizzata"
+ },
+ "nl-nl": {
+ "tts": "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC.",
+ "line1": "niet geautoriseerd"
+ },
+ "pl-pl": {
+ "tts": "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC.",
+ "line1": "brak autoryzacji"
+ },
+ "pt-br": {
+ "tts": "Esta versão do %appName% não tem autorização e não funcionará com o SYNC.",
+ "line1": "não autorizado"
+ },
+ "pt-pt": {
+ "tts": "Esta versão de %appName% não está autorizada e não funcionará com o SYNC.",
+ "line1": "não autorizada"
+ },
+ "ru-ru": {
+ "tts": "Эта версия %appName% не авторизирована и не будет работать с SYNC.",
+ "line1": "не авторизировано"
+ },
+ "sv-se": {
+ "tts": "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC.",
+ "line1": "är ej godkänd"
+ },
+ "tr-tr": {
+ "tts": "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz.",
+ "line1": "için izin yok"
+ },
+ "zh-cn": {
+ "tts": "此版本的%appName% 未得到授权,无法在SYNC上使用。",
+ "line1": "未得到授权"
+ },
+ "zh-tw": {
+ "tts": "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。",
+ "line1": "無授權"
+ }
+ }
+ },
+ "AppUnsupported": {
+ "languages": {
+ "de-de": {
+ "tts": "Diese Version von %appName% wird von SYNC nicht unterstützt.",
+ "line1": "nicht unterstützt"
+ },
+ "en-au": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "not supported"
+ },
+ "en-gb": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "not supported",
+ "textBody": "This version of %appName% is not supported by SYNC."
+ },
+ "en-ie": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "not supported"
+ },
+ "en-us": {
+ "tts": "This version of %appName% is not supported by SYNC.",
+ "line1": "Not Supported",
+ "textBody": "Your version of %appName% is not supported by SYNC."
+ },
+ "es-en": {
+ "tts": "Esta versión de %appName% no es compatible con SYNC.",
+ "line1": "no compatible",
+ "textBody": "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-es": {
+ "tts": "Esta versión de %appName% no es compatible con SYNC.",
+ "line1": "No compatible"
+ },
+ "es-mx": {
+ "tts": "Esta versión de %appName% no es compatible con SYNC.",
+ "line1": "no compatible"
+ },
+ "fr-ca": {
+ "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.",
+ "line1": "incompatible",
+ "textBody": "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "fr-fr": {
+ "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.",
+ "line1": "incompatible"
+ },
+ "it-it": {
+ "tts": "Questa versione di %appName% non è supportata dal SYNC.",
+ "line1": "non supportata"
+ },
+ "nl-nl": {
+ "tts": "Deze versie van %appName% wordt niet ondersteund door SYNC.",
+ "line1": "niet ondersteund"
+ },
+ "pl-pl": {
+ "tts": "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC.",
+ "line1": "aplikacja nie obsług."
+ },
+ "pt-br": {
+ "tts": "Esta versão do %appName% não é suportada pelo SYNC.",
+ "line1": "não suportado"
+ },
+ "pt-pt": {
+ "tts": "Esta versão de %appName% não é suportado pelo SYNC.",
+ "line1": "não suportada"
+ },
+ "ru-ru": {
+ "tts": "Эта версия %appName% не поддерживается SYNC.",
+ "line1": "не поддерживается"
+ },
+ "sv-se": {
+ "tts": "SYNC har inte stöd för den här versionen av %appName%.",
+ "line1": "stöds ej"
+ },
+ "tr-tr": {
+ "tts": "Bu %appName% sürümü SYNC tarafından desteklenmiyor.",
+ "line1": "desteklenmiyor"
+ },
+ "zh-cn": {
+ "tts": "SYNC不支持此版本的%appName%。",
+ "line1": "不受支持"
+ },
+ "zh-tw": {
+ "tts": "SYNC 不支援此版本的%appName% 。",
+ "line1": "不支援"
+ }
+ }
+ },
+ "DataConsent": {
+ "languages": {
+ "en-gb": {
+ "textBody": "Would you like to enable Mobile Apps on SYNC? To use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S. Updates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information."
+ },
+ "en-us": {
+ "line1": "Enable Mobile Apps",
+ "line2": "on SYNC? (Uses Data)",
+ "textBody": "Would you like to enable Mobile Apps on SYNC?\n\nTo use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S.\n\nUpdates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information."
+ },
+ "es-en": {
+ "textBody": "Para usar aplicaciones móviles con SYNC, este debe comunicarse con Ford al menos una vez al mes a través del plan de datos de su dispositivo móvil. Pueden aplicar tarifas normales. SYNC enviará su VIN y el número de módulo de SYNC a Ford de Estados Unidos de América. Las actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario. /r Presione Sí para permitir y No para denegar."
+ },
+ "fr-ca": {
+ "textBody": "Pour utiliser AppLink, SYNC devra communiquer avec Ford au moins une fois par mois en utilisant le forfait de données de votre appareil mobile. Les tarifs réguliers peuvent s’appliquer. SYNC enverra votre NIV et le numéro de votre module SYNC à Ford États-Unis. Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements. /r Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser."
+ }
+ }
+ },
+ "DataConsentHelp": {
+ "languages": {
+ "en-us": {
+ "textBody": "Updates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. See your Owner Guide for more information."
+ },
+ "es-en": {
+ "textBody": "Las actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario."
+ },
+ "fr-ca": {
+ "textBody": "Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements."
+ }
+ }
+ },
+ "DisableApps": {
+ "languages": {
+ "de-de": {
+ "tts": "Ausschalten der automatischen Updates führt zum Ausschalten von SYNC mobile Apps. Sie können Ihre mobilen Apps dann nicht mehr mit SYNC nutzen. Bitte drücken Sie Ja zur Bestätigung oder Nein, um abzubrechen.",
+ "line1": "Auto-Update",
+ "line2": "und Mobile Apps deaktivieren"
+ },
+ "en-au": {
+ "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
+ "line1": "Disable auto-updates",
+ "line2": "and Mobile Apps?"
+ },
+ "en-gb": {
+ "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
+ "line1": "Disable auto-updates",
+ "line2": "and Mobile Apps?",
+ "textBody": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel."
+ },
+ "en-ie": {
+ "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.",
+ "line1": "Disable auto-updates",
+ "line2": "and Mobile Apps?"
+ },
+ "en-us": {
+ "tts": "Disabling automatic updates will also disable sync mobile apps. You will not be able to use any mobile apps with SYNC. Please press yes to confirm or no to cancel.",
+ "line1": "Disable Auto-Updates",
+ "line2": "and Mobile Apps?",
+ "textBody": "Disabling automatic updates will also disable sync mobile apps. You will not be able to use any mobile apps with SYNC. Please press yes to confirm or no to cancel."
+ },
+ "es-en": {
+ "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.",
+ "line1": "¿Deshab. actualiz.",
+ "line2": "autom. y aplic. móv.?",
+ "textBody": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar."
+ },
+ "es-es": {
+ "tts": "Si desactiva las actualizaciones automáticas, también se desactivará la sincronización de las aplicaciones móviles. No podrá utilizar ninguna aplicación móvil con SYNC. Pulse sí para confirmar o no para cancelar.",
+ "line1": "¿Desact. actual. auto",
+ "line2": "y apl. móviles?"
+ },
+ "es-mx": {
+ "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.",
+ "line1": "¿Deshab. actualiz.",
+ "line2": "autom. y aplic. móv.?"
+ },
+ "fr-ca": {
+ "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.",
+ "line1": "Désactiver màj autom.",
+ "line2": "et app. mobiles?",
+ "textBody": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler."
+ },
+ "fr-fr": {
+ "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.",
+ "line1": "Désactiver màj autom.",
+ "line2": "et app. mobiles?"
+ },
+ "it-it": {
+ "tts": "Disabilitando gli aggiornamenti automatici si disattiva anche la sincronizzazione delle app mobili. Non sarà possibile usare app mobili con il SYNC. Premere Sì per confermare e No per cancellare.",
+ "line1": "Disabilitare agg. aut.",
+ "line2": "e app mobili?"
+ },
+ "nl-nl": {
+ "tts": "Door automatische updates uit te schakelen, schakelt u ook SYNC-mobiele apps uit. U kunt dan geen mobiele apps meer gebruiken met SYNC. Druk op Ja om te bevestigen of op Nee om te annuleren.",
+ "line1": "Auto-updates en mob.",
+ "line2": "apps uitschakelen?"
+ },
+ "pl-pl": {
+ "tts": "Wyłączenie automatycznych aktualizacji spowoduje także wyłączenie aplikacji mobilnych SYNC. Korzystanie z mobilnych aplikacji za pomocą SYNC będzie niemożliwe. Naciśnij TAK, by potwierdzić lub NIE, by anulować.",
+ "line1": "Wył. automat. aktual.",
+ "line2": "i aplikacje mobilne?"
+ },
+ "pt-br": {
+ "tts": "Se as atualizações automáticas forem desativadas, os aplicativos também serão desativados. Você não poderá usar nenhum aplicativo com o SYNC. Pressione sim para confirmar ou não para cancelar.",
+ "line1": "Desativar atualizações",
+ "line2": "autom. e aplicativos?"
+ },
+ "pt-pt": {
+ "tts": "A desactivação das actualizações automáticas desactiva igualmente as aplicações móveis do SYNC. Não poderá utilizar quaisquer aplicações móveis com o SYNC. Prima \"\"Sim\"\" para confirmar ou \"\"Não\"\" para cancelar.",
+ "line1": "Desact. actual. autom.",
+ "line2": "e aplicações móveis?"
+ },
+ "ru-ru": {
+ "tts": "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены.",
+ "line1": "Откл. автообновления",
+ "line2": "и мобил. прилож.?"
+ },
+ "sv-se": {
+ "tts": "Om du avaktiverar automatisk uppdatering avaktiverar du även synkning av mobilappar. Du kommer inte längre att kunna använda dina mobilappar med SYNC. Tryck Ja för att bekräfta eller Nej för att avbryta.",
+ "line1": "Avaktiverar autouppdat.",
+ "line2": "och mobilappar?"
+ },
+ "tr-tr": {
+ "tts": "Otomatik güncellemeleri devre dışı bırakırsanız sync mobil uygulamalar da devre dışı kalır. SYNC ile mobil uygulama kullanmanız mümkün olmaz. Lütfen onaylamak için Evet'e veya iptal etmek için Hayır'a basın.",
+ "line1": "Oto. güncelleme ve",
+ "line2": "mobil uygul. kapat?"
+ },
+ "zh-cn": {
+ "tts": "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。",
+ "line1": "是否禁用自动更新和",
+ "line2": "移动应用程序?"
+ },
+ "zh-tw": {
+ "tts": "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。",
+ "line1": "停用自動更新",
+ "line2": "和行動應用程式?"
+ }
+ }
+ },
+ "DrivingCharacteristics": {
+ "languages": {
+ "de-de": {
+ "tts": "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus.",
+ "label": "Fahreigenschaften"
+ },
+ "en-au": {
+ "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
+ "label": "Driving characteristics"
+ },
+ "en-gb": {
+ "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
+ "label": "Driving characteristics",
+ "textBody": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-ie": {
+ "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
+ "label": "Driving characteristics"
+ },
+ "en-us": {
+ "tts": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status.",
+ "label": "Driving Characteristics",
+ "textBody": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.",
+ "label": "Características del manejo",
+ "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad.",
+ "label": "Características de conducción"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.",
+ "label": "Características del manejo"
+ },
+ "fr-ca": {
+ "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.",
+ "label": "Caractéristiques de conduite",
+ "textBody": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "fr-fr": {
+ "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.",
+ "label": "Caractéristiques de conduite"
+ },
+ "it-it": {
+ "tts": "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza.",
+ "label": "Caratteristiche di guida"
+ },
+ "nl-nl": {
+ "tts": "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus.",
+ "label": "Rijkenmerken"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa.",
+ "label": "Informacje dotyczące stylu jazdy"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança.",
+ "label": "Características de condução"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança.",
+ "label": "Características de condução"
+ },
+ "ru-ru": {
+ "tts": "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности.",
+ "label": "Характеристики движения"
+ },
+ "sv-se": {
+ "tts": "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus.",
+ "label": "Köregenskaper"
+ },
+ "tr-tr": {
+ "tts": "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu.",
+ "label": "Sürüş karakteristikleri"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态",
+ "label": "行驶特性"
+ },
+ "zh-tw": {
+ "tts": "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態",
+ "label": "駕駛特性"
+ }
+ }
+ },
+ "Location": {
+ "languages": {
+ "de-de": {
+ "tts": "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs.",
+ "label": "GPS und Geschwindigkeit"
+ },
+ "en-au": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed"
+ },
+ "en-gb": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed",
+ "textBody": "An app can access vehicle GPS and speed."
+ },
+ "en-ie": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed"
+ },
+ "en-us": {
+ "tts": "An app can access vehicle GPS and speed.",
+ "label": "GPS and speed",
+ "textBody": "An app can access vehicle GPS and speed."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
+ "label": "GPS y velocidad",
+ "textBody": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede acceder al GPS y la velocidad del vehículo.",
+ "label": "GPS y velocidad"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
+ "label": "GPS y velocidad"
+ },
+ "fr-ca": {
+ "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.",
+ "label": "GPS et vitesse",
+ "textBody": "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "fr-fr": {
+ "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.",
+ "label": "GPS et vitesse"
+ },
+ "it-it": {
+ "tts": "Un'app può avere accesso a GPS e velocità del veicolo.",
+ "label": "GPS e velocità"
+ },
+ "nl-nl": {
+ "tts": "Een app heeft toegang tot gps en de snelheid van het voertuig.",
+ "label": "Gps en snelheid"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu.",
+ "label": "GPS i prędkość"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode acessar o GPS e a velocidade do veículo.",
+ "label": "GPS e velocidade"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue aceder ao GPS e à velocidade do veículo.",
+ "label": "GPS e velocidade"
+ },
+ "ru-ru": {
+ "tts": "Приложение имеет доступ к GPS и скорости автомобиля.",
+ "label": "GPS и скорость"
+ },
+ "sv-se": {
+ "tts": "Appen kan komma åt fordonets GPS och hastighetsmätare.",
+ "label": "GPS och hastighet"
+ },
+ "tr-tr": {
+ "tts": "Bu uygulama aracın GPS ve hız bilgilerine erişebilir.",
+ "label": "GPS ve hız"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序可以访问车辆 GPS 和车速信息。",
+ "label": "GPS 和车速"
+ },
+ "zh-tw": {
+ "tts": "應用程式可存取車輛的GPS和速度。",
+ "label": "GPS和車速"
+ }
+ }
+ },
+ "Notifications": {
+ "languages": {
+ "de-de": {
+ "tts": "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden.",
+ "label": "Push-Benachrichtigungen"
+ },
+ "en-au": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications"
+ },
+ "en-gb": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications",
+ "textBody": "An app can send notifications when running in the background."
+ },
+ "en-ie": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications"
+ },
+ "en-us": {
+ "tts": "An app can send notifications when running in the background.",
+ "label": "Push notifications",
+ "textBody": "An app can send notifications when running in the background."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
+ "label": "Notificaciones tipo Push",
+ "textBody": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano.",
+ "label": "Notificaciones push"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
+ "label": "Notificaciones tipo Push"
+ },
+ "fr-ca": {
+ "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
+ "label": "Notifications instantanées",
+ "textBody": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "fr-fr": {
+ "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
+ "label": "Notifications push"
+ },
+ "it-it": {
+ "tts": "Un'app può inviare notifiche se eseguita in background.",
+ "label": "Notifiche push"
+ },
+ "nl-nl": {
+ "tts": "Een app kan meldingen versturen als deze op de achtergrond actief is.",
+ "label": "Push-meldingen"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może wysyłać powiadomienia, działając w tle.",
+ "label": "Powiadomienia Push"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano.",
+ "label": "Notificações Push"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue enviar notificações quando está activa em segundo plano.",
+ "label": "Notificações push"
+ },
+ "ru-ru": {
+ "tts": "Если приложение работает в фоновом режиме, оно может отправлять оповещения.",
+ "label": "Оповещения о пересылке"
+ },
+ "sv-se": {
+ "tts": "Appen kan skicka meddelanden när den körs i bakgrunden.",
+ "label": "Push-notiser"
+ },
+ "tr-tr": {
+ "tts": "Bir uygulama arka planda çalışırken bildirim gönderebilir.",
+ "label": "Anlık bildirimleri"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序在后台运行时可推送通知。",
+ "label": "推送通知"
+ },
+ "zh-tw": {
+ "tts": "車輛行進時,應用程式可在背景中傳送通知。",
+ "label": "傳送通知"
+ }
+ }
+ },
+ "SettingDisableUpdates": {
+ "languages": {
+ "de-de": {
+ "line1": "Updates deakt."
+ },
+ "en-au": {
+ "line1": "Disable updates"
+ },
+ "en-gb": {
+ "line1": "Disable updates"
+ },
+ "en-ie": {
+ "line1": "Disable updates"
+ },
+ "en-us": {
+ "line1": "Disable Updates",
+ "textBody": "Disable Updates"
+ },
+ "es-en": {
+ "line1": "Deshab. actual.",
+ "textBody": "Deshab. actual."
+ },
+ "es-es": {
+ "line1": "Desact. actual."
+ },
+ "es-mx": {
+ "line1": "Deshab. actual."
+ },
+ "fr-ca": {
+ "line1": "Désactiver MAJ",
+ "textBody": "Désactiver MAJ"
+ },
+ "fr-fr": {
+ "line1": "Désactiver màj"
+ },
+ "it-it": {
+ "line1": "Disabilita agg."
+ },
+ "nl-nl": {
+ "line1": "Upd. uitschak."
+ },
+ "pl-pl": {
+ "line1": "Wyłącz aktual."
+ },
+ "pt-br": {
+ "line1": "Desat. atualiz."
+ },
+ "pt-pt": {
+ "line1": "Desact. actualiz."
+ },
+ "ru-ru": {
+ "line1": "Откл. обновл."
+ },
+ "sv-se": {
+ "line1": "Inaktivera uppd."
+ },
+ "tr-tr": {
+ "line1": "Güncell. Kapat"
+ },
+ "zh-cn": {
+ "line1": "禁用更新"
+ },
+ "zh-tw": {
+ "line1": "停用更新"
+ }
+ }
+ },
+ "SettingEnableUpdates": {
+ "languages": {
+ "de-de": {
+ "line1": "Apps aktivieren"
+ },
+ "en-au": {
+ "line1": "Enable Apps"
+ },
+ "en-gb": {
+ "line1": "Enable Apps"
+ },
+ "en-ie": {
+ "line1": "Enable Apps"
+ },
+ "en-us": {
+ "line1": "Enable Apps"
+ },
+ "es-en": {
+ "line1": "Hab. aplic."
+ },
+ "es-es": {
+ "line1": "Activar apl."
+ },
+ "es-mx": {
+ "line1": "Hab. aplic."
+ },
+ "fr-ca": {
+ "line1": "Activer app.",
+ "textBody": "Activer app."
+ },
+ "fr-fr": {
+ "line1": "Activer app."
+ },
+ "it-it": {
+ "line1": "Abilita app"
+ },
+ "nl-nl": {
+ "line1": "Apps inschak."
+ },
+ "pl-pl": {
+ "line1": "Włącz aplikacje"
+ },
+ "pt-br": {
+ "line1": "Ativar aplic."
+ },
+ "pt-pt": {
+ "line1": "Activar actualiz."
+ },
+ "ru-ru": {
+ "line1": "Вкл. прилож."
+ },
+ "sv-se": {
+ "line1": "Aktivera appar"
+ },
+ "tr-tr": {
+ "line1": "Uygulamaları aç"
+ },
+ "zh-cn": {
+ "line1": "启用应用程序"
+ },
+ "zh-tw": {
+ "line1": "啟用應用程式"
+ }
+ }
+ },
+ "SettingUpdateAuto": {
+ "languages": {
+ "de-de": {
+ "line1": "Update anford."
+ },
+ "en-au": {
+ "line1": "Request update"
+ },
+ "en-gb": {
+ "line1": "Request update"
+ },
+ "en-ie": {
+ "line1": "Request update"
+ },
+ "en-us": {
+ "line1": "Request Update",
+ "textBody": "Select `Update now` to receive app authorization information for your SYNC-enabled mobile apps. This may enable additional functionality depending on the app and your settings. If your phone has a working data connection, an update should complete in less than 1 minute."
+ },
+ "es-en": {
+ "line1": "Solicit. actualiz.",
+ "textBody": "Solicit. actualiz."
+ },
+ "es-es": {
+ "line1": "Solicitar actual."
+ },
+ "es-mx": {
+ "line1": "Solicit. actualiz."
+ },
+ "fr-ca": {
+ "line1": "Demander MAJ",
+ "textBody": "Demander MAJ"
+ },
+ "fr-fr": {
+ "line1": "Demander màj"
+ },
+ "it-it": {
+ "line1": "Rich. aggiorn."
+ },
+ "nl-nl": {
+ "line1": "Upd. aanvragen"
+ },
+ "pl-pl": {
+ "line1": "Zażądaj aktual."
+ },
+ "pt-br": {
+ "line1": "Solicitar atualiz."
+ },
+ "pt-pt": {
+ "line1": "Solicit. actualiz."
+ },
+ "ru-ru": {
+ "line1": "Запрос на обн."
+ },
+ "sv-se": {
+ "line1": "Begär uppdat."
+ },
+ "tr-tr": {
+ "line1": "Güncelleme iste"
+ },
+ "zh-cn": {
+ "line1": "请求更新"
+ },
+ "zh-tw": {
+ "line1": "請求更新"
+ }
+ }
+ },
+ "StatusNeeded": {
+ "languages": {
+ "de-de": {
+ "line1": "Update benötigt"
+ },
+ "en-au": {
+ "line1": "Update needed"
+ },
+ "en-gb": {
+ "line1": "Update needed",
+ "textBody": "Update needed"
+ },
+ "en-ie": {
+ "line1": "Update needed"
+ },
+ "en-us": {
+ "line1": "Update Needed",
+ "textBody": "Update Needed"
+ },
+ "es-en": {
+ "line1": "Actualiz. neces.",
+ "textBody": "Actualiz. neces."
+ },
+ "es-es": {
+ "line1": "Actu. necesaria"
+ },
+ "es-mx": {
+ "line1": "Actualiz. neces."
+ },
+ "fr-ca": {
+ "line1": "Màj requise",
+ "textBody": "Màj requise"
+ },
+ "fr-fr": {
+ "line1": "Mise à jour requise"
+ },
+ "it-it": {
+ "line1": "Necess. aggiorn."
+ },
+ "nl-nl": {
+ "line1": "Update nodig"
+ },
+ "pl-pl": {
+ "line1": "Potrzeba aktual."
+ },
+ "pt-br": {
+ "line1": "Atualiz. necess."
+ },
+ "pt-pt": {
+ "line1": "Actual. necess."
+ },
+ "ru-ru": {
+ "line1": "Необх. обновл."
+ },
+ "sv-se": {
+ "line1": "Uppdat. krävs"
+ },
+ "tr-tr": {
+ "line1": "Güncellenmeli"
+ },
+ "zh-cn": {
+ "line1": "需要进行更新"
+ },
+ "zh-tw": {
+ "line1": "需更新"
+ }
+ }
+ },
+ "StatusPending": {
+ "languages": {
+ "de-de": {
+ "line1": "Aktualisieren..."
+ },
+ "en-au": {
+ "line1": "Updating..."
+ },
+ "en-gb": {
+ "line1": "Updating...",
+ "textBody": "Updating..."
+ },
+ "en-ie": {
+ "line1": "Updating..."
+ },
+ "en-us": {
+ "line1": "Updating...",
+ "textBody": "Updating..."
+ },
+ "es-en": {
+ "line1": "Actualizando...",
+ "textBody": "Actualizando..."
+ },
+ "es-es": {
+ "line1": "Actualizando..."
+ },
+ "es-mx": {
+ "line1": "Actualizando..."
+ },
+ "fr-ca": {
+ "line1": "MAJ en cours...",
+ "textBody": "MAJ en cours..."
+ },
+ "fr-fr": {
+ "line1": "Màj en cours..."
+ },
+ "it-it": {
+ "line1": "Aggiornamento"
+ },
+ "nl-nl": {
+ "line1": "Updaten..."
+ },
+ "pl-pl": {
+ "line1": "Aktualizowanie"
+ },
+ "pt-br": {
+ "line1": "Atualizando..."
+ },
+ "pt-pt": {
+ "line1": "A actualizar..."
+ },
+ "ru-ru": {
+ "line1": "Обновление..."
+ },
+ "sv-se": {
+ "line1": "Uppdaterar..."
+ },
+ "tr-tr": {
+ "line1": "Güncelleniyor..."
+ },
+ "zh-cn": {
+ "line1": "正在更新......"
+ },
+ "zh-tw": {
+ "line1": "更新中..."
+ }
+ }
+ },
+ "StatusUpToDate": {
+ "languages": {
+ "de-de": {
+ "line1": "Aktuelle Version"
+ },
+ "en-au": {
+ "line1": "Up-to-date"
+ },
+ "en-gb": {
+ "line1": "Up-to-date",
+ "textBody": "Up-to-date"
+ },
+ "en-ie": {
+ "line1": "Up-to-date"
+ },
+ "en-us": {
+ "line1": "Up-To-Date",
+ "textBody": "Up-To-Date"
+ },
+ "es-en": {
+ "line1": "Actualizado",
+ "textBody": "Actualizado"
+ },
+ "es-es": {
+ "line1": "Actualizada"
+ },
+ "es-mx": {
+ "line1": "Actualizado"
+ },
+ "fr-ca": {
+ "line1": "Déjà à jour",
+ "textBody": "Déjà à jour"
+ },
+ "fr-fr": {
+ "line1": "Déjà à jour"
+ },
+ "it-it": {
+ "line1": "più recente"
+ },
+ "nl-nl": {
+ "line1": "Up-to-date"
+ },
+ "pl-pl": {
+ "line1": "Aktualne"
+ },
+ "pt-br": {
+ "line1": "Atualizado"
+ },
+ "pt-pt": {
+ "line1": "Actualizado"
+ },
+ "ru-ru": {
+ "line1": "Обновлено"
+ },
+ "sv-se": {
+ "line1": "Uppdat. krävs ej"
+ },
+ "tr-tr": {
+ "line1": "Güncel"
+ },
+ "zh-cn": {
+ "line1": "最新更新"
+ },
+ "zh-tw": {
+ "line1": "更新最新"
+ }
+ }
+ },
+ "VehicleInfo": {
+ "languages": {
+ "de-de": {
+ "tts": "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck.",
+ "label": "Fahrzeuginformationen"
+ },
+ "en-au": {
+ "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.",
+ "label": "Vehicle information"
+ },
+ "en-gb": {
+ "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure.",
+ "label": "Vehicle information",
+ "textBody": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure."
+ },
+ "en-ie": {
+ "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.",
+ "label": "Vehicle information"
+ },
+ "en-us": {
+ "tts": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure.",
+ "label": "Vehicle information",
+ "textBody": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
+ },
+ "es-en": {
+ "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.",
+ "label": "Información del vehículo",
+ "textBody": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos."
+ },
+ "es-es": {
+ "tts": "Una aplicación puede acceder a la siguiente información del vehículo: Nivel de combustible, Ahorro de combustible, RPM del motor, Cuentakilómetros, VIN, Temperatura aire exterior, Marcha engranada, Presión de neumáticos.",
+ "label": "Información del vehículo"
+ },
+ "es-mx": {
+ "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.",
+ "label": "Información del vehículo"
+ },
+ "fr-ca": {
+ "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus.",
+ "label": "Renseignements du véhicule",
+ "textBody": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus."
+ },
+ "fr-fr": {
+ "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Vitesse de moteur, Compteur kilométrique, NIV, Température extérieure, Position de vitesse, Pression des pneus.",
+ "label": "Renseignements du véhicule"
+ },
+ "it-it": {
+ "tts": "Un'app può avere accesso alle seguenti informazioni del veicolo: Livello carburante, Consumi carburante, Numero giri motore, Contachilometri, VIN, Temperatura esterna, Posizione marcia, Pressione pneumatici.",
+ "label": "Informazioni sul veicolo"
+ },
+ "nl-nl": {
+ "tts": "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning.",
+ "label": "Voertuiginformatie"
+ },
+ "pl-pl": {
+ "tts": "Aplikacja może uzyskać dostęp do następujących informacji o pojeździe: Poziom paliwa, Zużycie paliwa, Obroty silnika, Licznik przebiegu, Numer VIN, Temperatura zewnętrzna, Aktualny bieg, Ciśnienie opon.",
+ "label": "Informacje o pojeździe"
+ },
+ "pt-br": {
+ "tts": "Um aplicativo pode acessar as seguintes informações sobre o veículo: Nível de combustível, Economia de combustível, RPM do motor, Hodômetro, VIN, Temperatura externa, Posição das marchas, Pressão dos pneus.",
+ "label": "Informações sobre o veículo"
+ },
+ "pt-pt": {
+ "tts": "Uma aplicação consegue aceder às seguintes informações do veículo: Nível de combustível, Poupança de combustível, RPM do motor, Conta-quilómetros, VIN, Temperatura exterior, Posição da mudança de velocidade, Pressão dos pneus.",
+ "label": "Informações do veículo"
+ },
+ "ru-ru": {
+ "tts": "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин.",
+ "label": "Информация об автомобиле"
+ },
+ "sv-se": {
+ "tts": "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck.",
+ "label": "Fordonsinformation"
+ },
+ "tr-tr": {
+ "tts": "Bir uygulama şu araç bilgilerine erişebilir: Yakıt seviyesi, Yakıt ekonomisi, Motor devirleri, Kilometre sayacı, VIN, Dış sıcaklık, Vites konumu, Lastik basıncı.",
+ "label": "Araç bilgisi"
+ },
+ "zh-cn": {
+ "tts": "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压.",
+ "label": "车辆信息"
+ },
+ "zh-tw": {
+ "tts": "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓.",
+ "label": "車輛資訊"
+ }
+ }
+ }
+ }
+ },
+ "app_policies": {
+ "default": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": ["Base-4"]
+ },
+ "device": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": ["DataConsent-2"]
+ },
+ "pre_DataConsent": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": ["BaseBeforeDataConsent"]
+ }
+ }
+ }
+ }
diff --git a/src/components/policy/test/shared_library_test.cc b/src/components/policy/test/shared_library_test.cc
index c0e111b08..f8f77f1fd 100644
--- a/src/components/policy/test/shared_library_test.cc
+++ b/src/components/policy/test/shared_library_test.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Ford Motor Company
+/* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -45,18 +45,27 @@ namespace policy {
}
}
-TEST(SharedLibraryTest, Full) {
+TEST(SharedLibraryTest, FullTest_OpenLibrarySetSymbolCloseLibrary_ExpectActsWithoutErrors) {
+ //Arrange
const std::string kLib = "../src/policy/libPolicy.so";
void* handle = dlopen(kLib.c_str(), RTLD_LAZY);
+
+ //Assert
EXPECT_FALSE(IsError(dlerror()));
ASSERT_TRUE(handle);
+ //Act
const std::string kSymbol = "CreateManager";
void* symbol = dlsym(handle, kSymbol.c_str());
+
+ //Assert
EXPECT_FALSE(IsError(dlerror()));
EXPECT_TRUE(symbol);
+ //Act
int ret = dlclose(handle);
+
+ //Assert
EXPECT_FALSE(ret);
EXPECT_FALSE(IsError(dlerror()));
}
diff --git a/src/components/policy/test/sql_pt_ext_representation_test.cc b/src/components/policy/test/sql_pt_ext_representation_test.cc
index bb444ee20..fddbc0014 100644
--- a/src/components/policy/test/sql_pt_ext_representation_test.cc
+++ b/src/components/policy/test/sql_pt_ext_representation_test.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Ford Motor Company
+/* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,16 +30,10 @@
*/
#include <vector>
-#include <algorithm>
-
#include "gtest/gtest.h"
-
+#include <algorithm>
#include "driver_dbms.h"
-#include "json/value.h"
#include "policy/sql_pt_ext_representation.h"
-#include "policy/policy_types.h"
-#include "./types.h"
-#include "./enums.h"
using policy::SQLPTExtRepresentation;
@@ -86,7 +80,9 @@ const std::string SQLPTExtRepresentationTest::kDatabaseName = "policy.sqlite";
}
}
-TEST_F(SQLPTExtRepresentationTest, SaveGenerateSnapshot) {
+TEST_F(SQLPTExtRepresentationTest, GenerateSnapshot_SetPolicyTable_SnapshotIsPresent) {
+
+ //arrange
Json::Value table(Json::objectValue);
table["policy_table"] = Json::Value(Json::objectValue);
@@ -114,13 +110,13 @@ TEST_F(SQLPTExtRepresentationTest, SaveGenerateSnapshot) {
module_config["notifications_per_minute_by_priority"] = Json::Value(
Json::objectValue);
module_config["notifications_per_minute_by_priority"]["emergency"] =
- Json::Value(1);
+ Json::Value(1);
module_config["notifications_per_minute_by_priority"]["navigation"] =
- Json::Value(2);
+ Json::Value(2);
module_config["notifications_per_minute_by_priority"]["VOICECOMM"] =
- Json::Value(3);
+ Json::Value(3);
module_config["notifications_per_minute_by_priority"]["communication"] =
- Json::Value(4);
+ Json::Value(4);
module_config["notifications_per_minute_by_priority"]["normal"] = Json::Value(
5);
module_config["notifications_per_minute_by_priority"]["none"] = Json::Value(
@@ -140,10 +136,11 @@ TEST_F(SQLPTExtRepresentationTest, SaveGenerateSnapshot) {
default_group["rpcs"]["Update"]["parameters"][0] = Json::Value("speed");
Json::Value& consumer_friendly_messages =
- policy_table["consumer_friendly_messages"];
+ policy_table["consumer_friendly_messages"];
consumer_friendly_messages["version"] = Json::Value("1.2");
consumer_friendly_messages["messages"] = Json::Value(Json::objectValue);
- consumer_friendly_messages["messages"]["MSG1"] = Json::Value(Json::objectValue);
+ consumer_friendly_messages["messages"]["MSG1"] = Json::Value(
+ Json::objectValue);
Json::Value& msg1 = consumer_friendly_messages["messages"]["MSG1"];
msg1["languages"] = Json::Value(Json::objectValue);
msg1["languages"]["en-us"] = Json::Value(Json::objectValue);
@@ -168,8 +165,11 @@ TEST_F(SQLPTExtRepresentationTest, SaveGenerateSnapshot) {
policy_table::Table update(&table);
update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+ //assert
ASSERT_TRUE(IsValid(update));
ASSERT_TRUE(reps->Save(update));
+
+ //act
utils::SharedPtr<policy_table::Table> snapshot = reps->GenerateSnapshot();
snapshot->SetPolicyTableType(rpc::policy_table_interface_base::PT_SNAPSHOT);
@@ -193,112 +193,180 @@ TEST_F(SQLPTExtRepresentationTest, SaveGenerateSnapshot) {
policy_table::Table expected(&table);
+ //assert
EXPECT_EQ(expected.ToJsonValue().toStyledString(),
- snapshot->ToJsonValue().toStyledString());
+ snapshot->ToJsonValue().toStyledString());
}
-TEST_F(SQLPTExtRepresentationTest, CanAppKeepContext) {
+TEST_F(SQLPTExtRepresentationTest, CanAppKeepContext_InsertKeepContext_ExpectValuesThatSetInKeepContextParams) {
+
+ //arrange
const char* query_delete = "DELETE FROM `application`; ";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_delete));
+
+ //act
const char* query_insert = "INSERT INTO `application` (`id`, `memory_kb`,"
- " `heart_beat_timeout_ms`, `keep_context`) VALUES ('12345', 5, 10, 1)";
+ " `heart_beat_timeout_ms`, `keep_context`) VALUES ('12345', 5, 10, 1)";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_insert));
EXPECT_FALSE(reps->CanAppKeepContext("0"));
EXPECT_TRUE(reps->CanAppKeepContext("12345"));
}
-TEST_F(SQLPTExtRepresentationTest, CanAppStealFocus) {
+TEST_F(SQLPTExtRepresentationTest, CanAppStealFocus_SetStealFocus_ExpectValuesThatSetInStealFocusParam) {
+
+ //arrange
const char* query_delete = "DELETE FROM `application`; ";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_delete));
+
+ //act
const char* query_insert = "INSERT INTO `application` (`id`, `memory_kb`,"
- " `heart_beat_timeout_ms`, `steal_focus`) VALUES ('12345', 5, 10, 1)";
+ " `heart_beat_timeout_ms`, `steal_focus`) VALUES ('12345', 5, 10, 1)";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_insert));
EXPECT_TRUE(reps->CanAppStealFocus("12345"));
EXPECT_FALSE(reps->CanAppStealFocus("0"));
}
-TEST_F(SQLPTExtRepresentationTest, IncrementGlobalCounter) {
+TEST_F(SQLPTExtRepresentationTest, IncrementGlobalCounter_IncrementThreeTimes_ExpectCountEqual3) {
+
+ //arrange
const char* query_update = "UPDATE `usage_and_error_count` SET"
- " `count_of_sync_reboots` = 0";
+ " `count_of_sync_reboots` = 0";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_update));
+ //act
reps->Increment("count_of_sync_reboots");
reps->Increment("count_of_sync_reboots");
reps->Increment("count_of_sync_reboots");
const char* query_select =
- "SELECT `count_of_sync_reboots` FROM `usage_and_error_count`";
+ "SELECT `count_of_sync_reboots` FROM `usage_and_error_count`";
+ //assert
EXPECT_EQ(3, dbms->FetchOneInt(query_select));
}
-TEST_F(SQLPTExtRepresentationTest, IncrementAppCounter) {
+TEST_F(SQLPTExtRepresentationTest, IncrementAppCounter_IncrementCountOfUserSelections3Times_ExpectCountEqual3) {
+
+ //arrange
const char* query_delete =
- "DELETE FROM `app_level` WHERE `application_id` = '12345'";
+ "DELETE FROM `app_level` WHERE `application_id` = '12345'";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_delete));
+ //act
reps->Increment("12345", "count_of_user_selections");
reps->Increment("12345", "count_of_user_selections");
reps->Increment("12345", "count_of_user_selections");
const char* query_select =
- "SELECT `count_of_user_selections` FROM `app_level`"
- " WHERE `application_id` = '12345'";
+ "SELECT `count_of_user_selections` FROM `app_level`"
+ " WHERE `application_id` = '12345'";
+
+ //assert
EXPECT_EQ(3, dbms->FetchOneInt(query_select));
}
-TEST_F(SQLPTExtRepresentationTest, SetAppInfo) {
+TEST_F(SQLPTExtRepresentationTest, AppInfo_SetLanguageRuInGUIAndEnInVUI_ExpectRuInGUIAndEnInVUI) {
+
+ //arrange
const char* query_delete =
- "DELETE FROM `app_level` WHERE `application_id` = '12345'";
+ "DELETE FROM `app_level` WHERE `application_id` = '12345'";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_delete));
+ //act
reps->Set("12345", "app_registration_language_gui", "ru-ru");
reps->Set("12345", "app_registration_language_vui", "en-en");
const char* query_select_gui = "SELECT `app_registration_language_gui`"
- " FROM `app_level` WHERE `application_id` = '12345'";
+ " FROM `app_level` WHERE `application_id` = '12345'";
const char* query_select_vui = "SELECT `app_registration_language_vui`"
- " FROM `app_level` WHERE `application_id` = '12345'";
+ " FROM `app_level` WHERE `application_id` = '12345'";
+ //assert
EXPECT_EQ("ru-ru", dbms->FetchOneString(query_select_gui));
EXPECT_EQ("en-en", dbms->FetchOneString(query_select_vui));
}
-TEST_F(SQLPTExtRepresentationTest, AddAppStopwatch) {
+TEST_F(SQLPTExtRepresentationTest, AddAppStopwatch_Set10And60MinutesForStopwatch_Expect70Minutes) {
+
+ //arrange
const char* query_delete =
- "DELETE FROM `app_level` WHERE `application_id` = '12345'";
+ "DELETE FROM `app_level` WHERE `application_id` = '12345'";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_delete));
+ //act
reps->Add("12345", "minutes_in_hmi_full", 10);
reps->Add("12345", "minutes_in_hmi_full", 60);
const char* query_select = "SELECT `minutes_in_hmi_full` FROM `app_level`"
- " WHERE `application_id` = '12345'";
+ " WHERE `application_id` = '12345'";
+
+ //assert
EXPECT_EQ(70, dbms->FetchOneInt(query_select));
}
-TEST_F(SQLPTExtRepresentationTest, SetUnpairedDevice) {
+TEST_F(SQLPTExtRepresentationTest, SetUnpairedDevice_SetUnpairedDeviceId12345_ExpectUnpairedDeviceIdEquals12345) {
+
+ //arrange
const char* query_delete = "DELETE FROM `device`";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_delete));
+
+ //act
const char* query_insert = "INSERT INTO `device` (`id`) VALUES('12345')";
- ASSERT_TRUE(dbms->Exec(query_insert));
- ASSERT_TRUE(reps->SetUnpairedDevice("12345"));
+ //assert
+ ASSERT_TRUE(dbms->Exec(query_insert));
+ ASSERT_TRUE(reps->SetUnpairedDevice("12345", true));
+ //act
const char* query_select = "SELECT `id` FROM `device` WHERE `unpaired` = 1";
+
+ //assert
EXPECT_EQ("12345", dbms->FetchOneString(query_select));
}
-TEST_F(SQLPTExtRepresentationTest, UnpairedDevicesList) {
+TEST_F(SQLPTExtRepresentationTest, UnpairedDevicesList_SetUnpairedDevicesWithId12345AndId54321_Expect2UnpairedDevices) {
+
+ //arrange
const char* query_delete = "DELETE FROM `device`";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_delete));
+
+ //act
const char* query_insert = "INSERT INTO `device` (`id`, `unpaired`)"
- " VALUES('12345', 1)";
+ " VALUES('12345', 1)";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_insert));
+
+ //act
query_insert = "INSERT INTO `device` (`id`, `unpaired`) VALUES('54321', 1)";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_insert));
- std::vector<std::string> output;
+ //act
+ std::vector < std::string > output;
+
+ //assert
ASSERT_TRUE(reps->UnpairedDevicesList(&output));
ASSERT_EQ(2u, output.size());
EXPECT_NE(output.end(), std::find(output.begin(), output.end(), "12345"));
diff --git a/src/components/policy/test/sql_pt_representation_test.cc b/src/components/policy/test/sql_pt_representation_test.cc
index bba65e41a..088975ecd 100644
--- a/src/components/policy/test/sql_pt_representation_test.cc
+++ b/src/components/policy/test/sql_pt_representation_test.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Ford Motor Company
+/* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,15 +30,12 @@
*/
#include <vector>
-
#include "gtest/gtest.h"
-
#include "driver_dbms.h"
-#include "json/value.h"
#include "policy/sql_pt_representation.h"
#include "policy/policy_types.h"
-#include "./types.h"
-#include "./enums.h"
+#include "json/writer.h"
+#include "json/reader.h"
using policy::SQLPTRepresentation;
using policy::CheckPermissionResult;
@@ -68,15 +65,130 @@ class SQLPTRepresentationTest : public ::testing::Test {
dbms->Close();
}
+void PolicyTableUpdatePrepare(Json::Value& table) {
+ table["policy_table"] = Json::Value(Json::objectValue);
+ Json::Value& policy_table = table["policy_table"];
+ policy_table["module_config"] = Json::Value(Json::objectValue);
+ policy_table["functional_groupings"] = Json::Value(Json::objectValue);
+ policy_table["consumer_friendly_messages"] = Json::Value(Json::objectValue);
+ policy_table["app_policies"] = Json::Value(Json::objectValue);
+
+ Json::Value& module_config = policy_table["module_config"];
+ module_config["preloaded_pt"] = Json::Value(false);
+ module_config["preloaded_date"] = Json::Value("25-04-2015");
+ module_config["exchange_after_x_ignition_cycles"] = Json::Value(10);
+ module_config["exchange_after_x_kilometers"] = Json::Value(100);
+ module_config["exchange_after_x_days"] = Json::Value(5);
+ module_config["timeout_after_x_seconds"] = Json::Value(500);
+ module_config["seconds_between_retries"] = Json::Value(Json::arrayValue);
+ Json::Value& seconds_between_retries =
+ module_config["seconds_between_retries"];
+ seconds_between_retries[0] = Json::Value(10);
+ seconds_between_retries[1] = Json::Value(20);
+ seconds_between_retries[2] = Json::Value(30);
+ module_config["endpoints"] = Json::Value(Json::objectValue);
+ Json::Value& endpoins = module_config["endpoints"];
+ endpoins["0x00"] = Json::Value(Json::objectValue);
+ endpoins["0x00"]["default"] = Json::Value(Json::arrayValue);
+ endpoins["0x00"]["default"][0] =
+ Json::Value("http://ford.com/cloud/default");
+ module_config["notifications_per_minute_by_priority"] =
+ Json::Value(Json::objectValue);
+ module_config["notifications_per_minute_by_priority"]["emergency"] =
+ Json::Value(1);
+ module_config["notifications_per_minute_by_priority"]["navigation"] =
+ Json::Value(2);
+ module_config["notifications_per_minute_by_priority"]["VOICECOMM"] =
+ Json::Value(3);
+ module_config["notifications_per_minute_by_priority"]["communication"] =
+ Json::Value(4);
+ module_config["notifications_per_minute_by_priority"]["normal"] =
+ Json::Value(5);
+ module_config["notifications_per_minute_by_priority"]["none"] =
+ Json::Value(6);
+ module_config["vehicle_make"] = Json::Value("MakeT");
+ module_config["vehicle_model"] = Json::Value("ModelT");
+ module_config["vehicle_year"] = Json::Value("2014");
+ module_config["certificate"] = Json::Value("my_cert");
+
+ Json::Value& functional_groupings = policy_table["functional_groupings"];
+ functional_groupings["default"] = Json::Value(Json::objectValue);
+ Json::Value& default_group = functional_groupings["default"];
+ default_group["rpcs"] = Json::Value(Json::objectValue);
+ default_group["rpcs"]["Update"] = Json::Value(Json::objectValue);
+ default_group["rpcs"]["Update"]["hmi_levels"] =
+ Json::Value(Json::arrayValue);
+ default_group["rpcs"]["Update"]["hmi_levels"][0] = Json::Value("FULL");
+ default_group["rpcs"]["Update"]["parameters"] =
+ Json::Value(Json::arrayValue);
+ default_group["rpcs"]["Update"]["parameters"][0] = Json::Value("speed");
+
+ Json::Value& consumer_friendly_messages =
+ policy_table["consumer_friendly_messages"];
+ consumer_friendly_messages["version"] = Json::Value("1.2");
+ consumer_friendly_messages["messages"] = Json::Value(Json::objectValue);
+ consumer_friendly_messages["messages"]["MSG1"] =
+ Json::Value(Json::objectValue);
+ Json::Value& msg1 = consumer_friendly_messages["messages"]["MSG1"];
+ msg1["languages"] = Json::Value(Json::objectValue);
+ msg1["languages"]["en-us"] = Json::Value(Json::objectValue);
+ msg1["languages"]["en-us"]["tts"] = Json::Value("TTS message");
+ msg1["languages"]["en-us"]["label"] = Json::Value("LABEL message");
+ msg1["languages"]["en-us"]["line1"] = Json::Value("LINE1 message");
+ msg1["languages"]["en-us"]["line2"] = Json::Value("LINE2 message");
+ msg1["languages"]["en-us"]["textBody"] = Json::Value("TEXTBODY message");
+
+ Json::Value& app_policies = policy_table["app_policies"];
+ app_policies["default"] = Json::Value(Json::objectValue);
+ app_policies["default"]["priority"] = Json::Value("EMERGENCY");
+ app_policies["default"]["memory_kb"] = Json::Value(50);
+ app_policies["default"]["heart_beat_timeout_ms"] = Json::Value(100);
+ app_policies["default"]["groups"] = Json::Value(Json::arrayValue);
+ app_policies["default"]["groups"][0] = Json::Value("default");
+ app_policies["default"]["priority"] = Json::Value("EMERGENCY");
+ app_policies["default"]["is_revoked"] = Json::Value(true);
+ 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["pre_DataConsent"] = Json::Value(Json::objectValue);
+ app_policies["pre_DataConsent"]["memory_kb"] = Json::Value(40);
+ app_policies["pre_DataConsent"]["heart_beat_timeout_ms"] = Json::Value(90);
+ app_policies["pre_DataConsent"]["groups"] = Json::Value(Json::arrayValue);
+ app_policies["pre_DataConsent"]["groups"][0] = Json::Value("default");
+ app_policies["pre_DataConsent"]["priority"] = Json::Value("EMERGENCY");
+ app_policies["pre_DataConsent"]["default_hmi"] = Json::Value("FULL");
+ 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["1234"] = Json::Value(Json::objectValue);
+ app_policies["1234"]["memory_kb"] = Json::Value(150);
+ app_policies["1234"]["heart_beat_timeout_ms"] = Json::Value(200);
+ app_policies["1234"]["groups"] = Json::Value(Json::arrayValue);
+ app_policies["1234"]["groups"][0] = Json::Value("default");
+ app_policies["1234"]["priority"] = Json::Value("EMERGENCY");
+ app_policies["1234"]["default_hmi"] = Json::Value("FULL");
+ 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["device"] = Json::Value(Json::objectValue);
+ app_policies["device"]["groups"] = Json::Value(Json::arrayValue);
+ app_policies["device"]["groups"][0] = Json::Value("default");
+ app_policies["device"]["priority"] = Json::Value("EMERGENCY");
+ app_policies["device"]["is_revoked"] = Json::Value(true);
+ app_policies["device"]["default_hmi"] = Json::Value("FULL");
+ app_policies["device"]["keep_context"] = Json::Value(true);
+ app_policies["device"]["steal_focus"] = Json::Value(true);
+ }
::testing::AssertionResult IsValid(const policy_table::Table& table) {
- if (table.is_valid()) {
- return ::testing::AssertionSuccess();
- } else {
- ::rpc::ValidationReport report(" - table");
- table.ReportErrors(&report);
- return ::testing::AssertionFailure() << ::rpc::PrettyFormat(report);
+ if (table.is_valid()) {
+ return ::testing::AssertionSuccess();
+ } else {
+ ::rpc::ValidationReport report(" - table");
+ table.ReportErrors(&report);
+ return ::testing::AssertionFailure() << ::rpc::PrettyFormat(report);
+ }
}
-}
};
DBMS* SQLPTRepresentationTest::dbms = 0;
@@ -87,204 +199,343 @@ const std::string SQLPTRepresentationTest::kDatabaseName = "policy";
const std::string SQLPTRepresentationTest::kDatabaseName = "policy.sqlite";
#endif // __QNX__
-TEST_F(SQLPTRepresentationTest, CheckPermissionsAllowed) {
+TEST_F(SQLPTRepresentationTest, CheckPermissionsAllowed_SetValuesInAppGroupRpcFunctionalGroup_GetEqualParamsInCheckPermissionResult) {
+ //arrange
const char* query = "INSERT OR REPLACE INTO `application` (`id`, `memory_kb`,"
- " `heart_beat_timeout_ms`) VALUES ('12345', 5, 10); "
- "INSERT OR REPLACE INTO functional_group (`id`, `name`)"
- " VALUES (1, 'Base-4'); "
- "INSERT OR REPLACE INTO `app_group` (`application_id`,"
- " `functional_group_id`) VALUES ('12345', 1); "
- "INSERT OR REPLACE INTO `rpc` (`name`, `parameter`, `hmi_level_value`,"
- " `functional_group_id`) VALUES ('Update', 'gps', 'FULL', 1); "
- "INSERT OR REPLACE INTO `rpc` (`name`, `parameter`, `hmi_level_value`,"
- " `functional_group_id`) VALUES ('Update', 'speed', 'FULL', 1);";
+ " `heart_beat_timeout_ms`) VALUES ('12345', 5, 10); "
+ "INSERT OR REPLACE INTO functional_group (`id`, `name`)"
+ " VALUES (1, 'Base-4'); "
+ "INSERT OR REPLACE INTO `app_group` (`application_id`,"
+ " `functional_group_id`) VALUES ('12345', 1); "
+ "INSERT OR REPLACE INTO `rpc` (`name`, `parameter`, `hmi_level_value`,"
+ " `functional_group_id`) VALUES ('Update', 'gps', 'FULL', 1); "
+ "INSERT OR REPLACE INTO `rpc` (`name`, `parameter`, `hmi_level_value`,"
+ " `functional_group_id`) VALUES ('Update', 'speed', 'FULL', 1);";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query));
+ //Act
CheckPermissionResult ret;
reps->CheckPermissions("12345", "FULL", "Update", ret);
+
+ //assert
EXPECT_TRUE(ret.hmi_level_permitted == ::policy::kRpcAllowed);
ASSERT_EQ(2u, ret.list_of_allowed_params.size());
EXPECT_EQ("gps", ret.list_of_allowed_params[0]);
EXPECT_EQ("speed", ret.list_of_allowed_params[1]);
}
-TEST_F(SQLPTRepresentationTest, CheckPermissionsAllowedWithoutParameters) {
+TEST_F(SQLPTRepresentationTest, CheckPermissionsAllowedWithoutParameters_SetLimitedPermissions_ExpectEmptyListOfAllowedParams) {
+ //arrange
const char* query = "INSERT OR REPLACE INTO `application` (`id`, `memory_kb`,"
- " `heart_beat_timeout_ms`) VALUES ('12345', 5, 10); "
- "INSERT OR REPLACE INTO functional_group (`id`, `name`)"
- " VALUES (1, 'Base-4'); "
- "INSERT OR REPLACE INTO `app_group` (`application_id`,"
- " `functional_group_id`) VALUES ('12345', 1); "
- "DELETE FROM `rpc`; "
- "INSERT OR REPLACE INTO `rpc` (`name`, `hmi_level_value`,"
- " `functional_group_id`) VALUES ('Update', 'LIMITED', 1);";
+ " `heart_beat_timeout_ms`) VALUES ('12345', 5, 10); "
+ "INSERT OR REPLACE INTO functional_group (`id`, `name`)"
+ " VALUES (1, 'Base-4'); "
+ "INSERT OR REPLACE INTO `app_group` (`application_id`,"
+ " `functional_group_id`) VALUES ('12345', 1); "
+ "DELETE FROM `rpc`; "
+ "INSERT OR REPLACE INTO `rpc` (`name`, `hmi_level_value`,"
+ " `functional_group_id`) VALUES ('Update', 'LIMITED', 1);";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query));
+ //act
CheckPermissionResult ret;
reps->CheckPermissions("12345", "LIMITED", "Update", ret);
+
+ //assert
EXPECT_TRUE(ret.hmi_level_permitted == ::policy::kRpcAllowed);
EXPECT_TRUE(ret.list_of_allowed_params.empty());
}
-TEST_F(SQLPTRepresentationTest, CheckPermissionsDisallowed) {
+TEST_F(SQLPTRepresentationTest, CheckPermissionsDisallowedWithoutParameters_DeletedAppGroupAndSetFULLLevel_ExpectHmiLevelIsDissalowed) {
+
+ //arrange
const char* query = "DELETE FROM `app_group`";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query));
+ //act
CheckPermissionResult ret;
reps->CheckPermissions("12345", "FULL", "Update", ret);
+
+ //assert
EXPECT_EQ(::policy::kRpcDisallowed, ret.hmi_level_permitted);
EXPECT_TRUE(ret.list_of_allowed_params.empty());
}
-TEST_F(SQLPTRepresentationTest, IsPTPReloaded) {
+TEST_F(SQLPTRepresentationTest, PTPReloaded_UpdateModuleConfig_ReturnIsPTPreloadedTRUE) {
+
+ //arrange
const char* query = "UPDATE `module_config` SET `preloaded_pt` = 1";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query));
EXPECT_TRUE(reps->IsPTPreloaded());
}
-TEST_F(SQLPTRepresentationTest, GetUpdateUrls) {
+TEST_F(SQLPTRepresentationTest, GetUpdateUrls_DeleteAndInsertEndpoints_ExpectUpdateUrls) {
+
+ //arrange
const char* query_delete = "DELETE FROM `endpoint`; ";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_delete));
+
+ //act
EndpointUrls ret = reps->GetUpdateUrls(7);
+
+ //assert
EXPECT_TRUE(ret.empty());
+ //act
const char* query_insert =
- "INSERT INTO `endpoint` (`application_id`, `url`, `service`) "
- " VALUES ('12345', 'http://ford.com/cloud/1', 7);"
- "INSERT INTO `endpoint` (`application_id`, `url`, `service`) "
- " VALUES ('12345', 'http://ford.com/cloud/2', 7);";
+ "INSERT INTO `endpoint` (`application_id`, `url`, `service`) "
+ " VALUES ('12345', 'http://ford.com/cloud/1', 7);"
+ "INSERT INTO `endpoint` (`application_id`, `url`, `service`) "
+ " VALUES ('12345', 'http://ford.com/cloud/2', 7);";
+ //assert
ASSERT_TRUE(dbms->Exec(query_insert));
+ //act
ret = reps->GetUpdateUrls(7);
+
+ //assert
ASSERT_EQ(2u, ret.size());
EXPECT_EQ("http://ford.com/cloud/1", ret[0].url[0]);
EXPECT_EQ("http://ford.com/cloud/2", ret[1].url[0]);
+ //act
ret = reps->GetUpdateUrls(0);
+
+ //assert
EXPECT_TRUE(ret.empty());
}
-TEST_F(SQLPTRepresentationTest, IgnitionCyclesBeforeExchangeAndIncrement) {
+TEST_F(SQLPTRepresentationTest, IgnitionCyclesBeforeExchange_WithParametersOfQueryEqualZero) {
+
+ //arrange
const char* query_zeros = "UPDATE `module_meta` SET "
- " `ignition_cycles_since_last_exchange` = 0; "
- " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 0";
+ " `ignition_cycles_since_last_exchange` = 0; "
+ " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 0";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_zeros));
EXPECT_EQ(0, reps->IgnitionCyclesBeforeExchange());
+
+ //act
reps->IncrementIgnitionCycles();
+
+ //assert
EXPECT_EQ(0, reps->IgnitionCyclesBeforeExchange());
+}
+
+TEST_F(SQLPTRepresentationTest, IgnitionCyclesBeforeExchange_WithParametersOfQueryAreLessLimit) {
+
+ //arrange
const char* query_less_limit = "UPDATE `module_meta` SET "
- " `ignition_cycles_since_last_exchange` = 5; "
- " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 10";
+ " `ignition_cycles_since_last_exchange` = 5; "
+ " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 10";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_less_limit));
EXPECT_EQ(5, reps->IgnitionCyclesBeforeExchange());
+
+ //act
reps->IncrementIgnitionCycles();
+
+ //assert
EXPECT_EQ(4, reps->IgnitionCyclesBeforeExchange());
+}
+
+TEST_F(SQLPTRepresentationTest, IgnitionCyclesBeforeExchange_WithLimitCountOfParametersOfQuery) {
+
+ //arrange
const char* query_limit = "UPDATE `module_meta` SET "
- " `ignition_cycles_since_last_exchange` = 9; "
- " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 10";
+ " `ignition_cycles_since_last_exchange` = 9; "
+ " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 10";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_limit));
EXPECT_EQ(1, reps->IgnitionCyclesBeforeExchange());
+
+ //act
reps->IncrementIgnitionCycles();
+
+ //assert
EXPECT_EQ(0, reps->IgnitionCyclesBeforeExchange());
+}
+
+TEST_F(SQLPTRepresentationTest, IgnitionCyclesBeforeExchange_WithMoreLimitCountOfParametersOfQuery) {
+
+ //arrange
const char* query_more_limit = "UPDATE `module_meta` SET "
- " `ignition_cycles_since_last_exchange` = 12; "
- " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 10";
+ " `ignition_cycles_since_last_exchange` = 12; "
+ " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 10";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_more_limit));
EXPECT_EQ(0, reps->IgnitionCyclesBeforeExchange());
+}
+
+TEST_F(SQLPTRepresentationTest, IgnitionCyclesBeforeExchange_WithNegativeLimitOfParametersOfQuery) {
+
+ //arrange
const char* query_negative_limit = "UPDATE `module_meta` SET "
- " `ignition_cycles_since_last_exchange` = 3; "
- " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = -1";
+ " `ignition_cycles_since_last_exchange` = 3; "
+ " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = -1";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_negative_limit));
EXPECT_EQ(0, reps->IgnitionCyclesBeforeExchange());
+}
+
+TEST_F(SQLPTRepresentationTest, IgnitionCyclesBeforeExchange_WithNegativeLimitOfCurrentParameterOfQuery) {
+ //arrange
const char* query_negative_current = "UPDATE `module_meta` SET "
- " `ignition_cycles_since_last_exchange` = -1; "
- " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 2";
+ " `ignition_cycles_since_last_exchange` = -1; "
+ " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 2";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_negative_current));
EXPECT_EQ(0, reps->IgnitionCyclesBeforeExchange());
}
-TEST_F(SQLPTRepresentationTest, KilometersBeforeExchange) {
+TEST_F(SQLPTRepresentationTest, KilometersBeforeExchange_WithParametersOfQueryEqualZero) {
+
+ //arrange
const char* query_zeros = "UPDATE `module_meta` SET "
- " `pt_exchanged_at_odometer_x` = 0; "
- " UPDATE `module_config` SET `exchange_after_x_kilometers` = 0";
+ " `pt_exchanged_at_odometer_x` = 0; "
+ " UPDATE `module_config` SET `exchange_after_x_kilometers` = 0";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_zeros));
EXPECT_EQ(0, reps->KilometersBeforeExchange(0));
EXPECT_EQ(0, reps->KilometersBeforeExchange(-10));
EXPECT_EQ(0, reps->KilometersBeforeExchange(10));
+}
+
+TEST_F(SQLPTRepresentationTest, KilometersBeforeExchange_QueryWithNegativeLimit) {
+ //arrange
const char* query_negative_limit = "UPDATE `module_meta` SET "
- " `pt_exchanged_at_odometer_x` = 10; "
- " UPDATE `module_config` SET `exchange_after_x_kilometers` = -10";
+ " `pt_exchanged_at_odometer_x` = 10; "
+ " UPDATE `module_config` SET `exchange_after_x_kilometers` = -10";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_negative_limit));
EXPECT_EQ(0, reps->KilometersBeforeExchange(0));
EXPECT_EQ(0, reps->KilometersBeforeExchange(10));
+}
+
+TEST_F(SQLPTRepresentationTest, KilometersBeforeExchange_QueryWithNegativeCurrentLimit) {
+ //arrange
const char* query_negative_last = "UPDATE `module_meta` SET "
- " `pt_exchanged_at_odometer_x` = -10; "
- " UPDATE `module_config` SET `exchange_after_x_kilometers` = 20";
+ " `pt_exchanged_at_odometer_x` = -10; "
+ " UPDATE `module_config` SET `exchange_after_x_kilometers` = 20";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_negative_last));
EXPECT_EQ(0, reps->KilometersBeforeExchange(0));
EXPECT_EQ(0, reps->KilometersBeforeExchange(10));
+}
+TEST_F(SQLPTRepresentationTest, KilometersBeforeExchange_QueryWithLimitParameters) {
+
+ //arrange
const char* query_limit = "UPDATE `module_meta` SET "
- " `pt_exchanged_at_odometer_x` = 10; "
- " UPDATE `module_config` SET `exchange_after_x_kilometers` = 100";
+ " `pt_exchanged_at_odometer_x` = 10; "
+ " UPDATE `module_config` SET `exchange_after_x_kilometers` = 100";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_limit));
EXPECT_EQ(0, reps->KilometersBeforeExchange(120));
EXPECT_EQ(60, reps->KilometersBeforeExchange(50));
EXPECT_EQ(0, reps->KilometersBeforeExchange(5));
}
-TEST_F(SQLPTRepresentationTest, DaysBeforeExchange) {
+TEST_F(SQLPTRepresentationTest, DaysBeforeExchange_WithParametersOfQueryEqualZero) {
+
+ //arrange
const char* query_zeros = "UPDATE `module_meta` SET "
- " `pt_exchanged_x_days_after_epoch` = 0; "
- " UPDATE `module_config` SET `exchange_after_x_days` = 0";
+ " `pt_exchanged_x_days_after_epoch` = 0; "
+ " UPDATE `module_config` SET `exchange_after_x_days` = 0";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_zeros));
EXPECT_EQ(0, reps->DaysBeforeExchange(0));
EXPECT_EQ(0, reps->DaysBeforeExchange(-10));
EXPECT_EQ(0, reps->DaysBeforeExchange(10));
+}
+
+TEST_F(SQLPTRepresentationTest, DaysBeforeExchange_QueryWithNegativeLimit) {
+ //arrange
const char* query_negative_limit = "UPDATE `module_meta` SET "
- " `pt_exchanged_x_days_after_epoch` = 10; "
- " UPDATE `module_config` SET `exchange_after_x_days` = -10";
+ " `pt_exchanged_x_days_after_epoch` = 10; "
+ " UPDATE `module_config` SET `exchange_after_x_days` = -10";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_negative_limit));
EXPECT_EQ(0, reps->DaysBeforeExchange(0));
EXPECT_EQ(0, reps->DaysBeforeExchange(10));
+}
+
+TEST_F(SQLPTRepresentationTest, DaysBeforeExchange_QueryWithNegativeCurrentLimit) {
+ //arrange
const char* query_negative_last = "UPDATE `module_meta` SET "
- " `pt_exchanged_x_days_after_epoch` = -10; "
- " UPDATE `module_config` SET `exchange_after_x_days` = 20";
+ " `pt_exchanged_x_days_after_epoch` = -10; "
+ " UPDATE `module_config` SET `exchange_after_x_days` = 20";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_negative_last));
EXPECT_EQ(0, reps->DaysBeforeExchange(0));
EXPECT_EQ(0, reps->DaysBeforeExchange(10));
+}
+
+TEST_F(SQLPTRepresentationTest, DaysBeforeExchange_QueryWithLimitParameters) {
+ //arrange
const char* query_limit = "UPDATE `module_meta` SET "
- " `pt_exchanged_x_days_after_epoch` = 10; "
- " UPDATE `module_config` SET `exchange_after_x_days` = 100";
+ " `pt_exchanged_x_days_after_epoch` = 10; "
+ " UPDATE `module_config` SET `exchange_after_x_days` = 100";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_limit));
EXPECT_EQ(0, reps->DaysBeforeExchange(120));
EXPECT_EQ(60, reps->DaysBeforeExchange(50));
EXPECT_EQ(0, reps->DaysBeforeExchange(5));
}
-TEST_F(SQLPTRepresentationTest, SecondsBetweenRetries) {
- std::vector<int> seconds;
+TEST_F(SQLPTRepresentationTest, SecondsBetweenRetries_DeletedAndInsertedSecondsBetweenRetry_ExpectCountOfSecondsEqualInserted) {
+ //arrange
+ std::vector<int> seconds;
const char* query_delete = "DELETE FROM `seconds_between_retry`; ";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_delete));
ASSERT_TRUE(reps->SecondsBetweenRetries(&seconds));
EXPECT_EQ(0u, seconds.size());
+ //arrange
const char* query_insert =
- "INSERT INTO `seconds_between_retry` (`index`, `value`) "
- " VALUES (0, 10); "
- "INSERT INTO `seconds_between_retry` (`index`, `value`) "
- " VALUES (1, 20); ";
+ "INSERT INTO `seconds_between_retry` (`index`, `value`) "
+ " VALUES (0, 10); "
+ "INSERT INTO `seconds_between_retry` (`index`, `value`) "
+ " VALUES (1, 20); ";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query_insert));
ASSERT_TRUE(reps->SecondsBetweenRetries(&seconds));
ASSERT_EQ(2u, seconds.size());
@@ -292,98 +543,58 @@ TEST_F(SQLPTRepresentationTest, SecondsBetweenRetries) {
EXPECT_EQ(20, seconds[1]);
}
-TEST_F(SQLPTRepresentationTest, TimeoutResponse) {
+TEST_F(SQLPTRepresentationTest, TimeoutResponse_Set60Seconds_GetEqualTimeout) {
+
+ //arrange
const char* query =
- "UPDATE `module_config` SET `timeout_after_x_seconds` = 60";
+ "UPDATE `module_config` SET `timeout_after_x_seconds` = 60";
+
+ //assert
ASSERT_TRUE(dbms->Exec(query));
EXPECT_EQ(60, reps->TimeoutResponse());
}
-TEST_F(SQLPTRepresentationTest, SaveGenerateSnapshot) {
+TEST_F(SQLPTRepresentationTest,
+ GenerateSnapshot_SetPolicyTable_SnapshotIsPresent) {
+ // Arrange
Json::Value table(Json::objectValue);
- table["policy_table"] = Json::Value(Json::objectValue);
-
- Json::Value& policy_table = table["policy_table"];
- policy_table["module_meta"] = Json::Value(Json::objectValue);
- policy_table["module_config"] = Json::Value(Json::objectValue);
- policy_table["functional_groupings"] = Json::Value(Json::objectValue);
- policy_table["consumer_friendly_messages"] = Json::Value(Json::objectValue);
- policy_table["app_policies"] = Json::Value(Json::objectValue);
-
- Json::Value& module_config = policy_table["module_config"];
- module_config["preloaded_pt"] = Json::Value(true);
- module_config["exchange_after_x_ignition_cycles"] = Json::Value(10);
- module_config["exchange_after_x_kilometers"] = Json::Value(100);
- module_config["exchange_after_x_days"] = Json::Value(5);
- module_config["timeout_after_x_seconds"] = Json::Value(500);
- module_config["seconds_between_retries"] = Json::Value(Json::arrayValue);
- module_config["seconds_between_retries"][0] = Json::Value(10);
- module_config["seconds_between_retries"][1] = Json::Value(20);
- module_config["seconds_between_retries"][2] = Json::Value(30);
- module_config["endpoints"] = Json::Value(Json::objectValue);
- module_config["endpoints"]["0x00"] = Json::Value(Json::objectValue);
- module_config["endpoints"]["0x00"]["default"] = Json::Value(Json::arrayValue);
- module_config["endpoints"]["0x00"]["default"][0] = Json::Value(
- "http://ford.com/cloud/default");
- module_config["notifications_per_minute_by_priority"] = Json::Value(
- Json::objectValue);
- module_config["notifications_per_minute_by_priority"]["emergency"] =
- Json::Value(1);
- module_config["notifications_per_minute_by_priority"]["navigation"] =
- Json::Value(2);
- module_config["notifications_per_minute_by_priority"]["VOICECOMM"] =
- Json::Value(3);
- module_config["notifications_per_minute_by_priority"]["communication"] =
- Json::Value(4);
- module_config["notifications_per_minute_by_priority"]["normal"] = Json::Value(
- 5);
- module_config["notifications_per_minute_by_priority"]["none"] = Json::Value(
- 6);
- module_config["vehicle_make"] = Json::Value("MakeT");
- module_config["vehicle_model"] = Json::Value("ModelT");
- module_config["vehicle_year"] = Json::Value("2014");
-
- Json::Value& functional_groupings = policy_table["functional_groupings"];
- functional_groupings["default"] = Json::Value(Json::objectValue);
- Json::Value& default_group = functional_groupings["default"];
- default_group["rpcs"] = Json::Value(Json::objectValue);
- default_group["rpcs"]["Update"] = Json::Value(Json::objectValue);
- default_group["rpcs"]["Update"]["hmi_levels"] = Json::Value(Json::arrayValue);
- default_group["rpcs"]["Update"]["hmi_levels"][0] = Json::Value("FULL");
- default_group["rpcs"]["Update"]["parameters"] = Json::Value(Json::arrayValue);
- default_group["rpcs"]["Update"]["parameters"][0] = Json::Value("speed");
-
- Json::Value& consumer_friendly_messages =
- policy_table["consumer_friendly_messages"];
- consumer_friendly_messages["version"] = Json::Value("1.2");
- consumer_friendly_messages["messages"] = Json::Value(Json::objectValue);
- consumer_friendly_messages["messages"]["MSG1"] = Json::Value(Json::objectValue);
- Json::Value& msg1 = consumer_friendly_messages["messages"]["MSG1"];
- msg1["languages"] = Json::Value(Json::objectValue);
- msg1["languages"]["en-us"] = Json::Value(Json::objectValue);
-
- Json::Value& app_policies = policy_table["app_policies"];
- app_policies["default"] = Json::Value(Json::objectValue);
- app_policies["default"]["priority"] = Json::Value("EMERGENCY");
- app_policies["default"]["memory_kb"] = Json::Value(50);
- app_policies["default"]["heart_beat_timeout_ms"] = Json::Value(10);
- app_policies["default"]["groups"] = Json::Value(Json::arrayValue);
- app_policies["default"]["groups"][0] = Json::Value("default");
- app_policies["default"]["certificate"] = Json::Value("sign");
+ PolicyTableUpdatePrepare(table);
policy_table::Table update(&table);
update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+ // Assert
ASSERT_TRUE(IsValid(update));
ASSERT_TRUE(reps->Save(update));
+
+ // Act
utils::SharedPtr<policy_table::Table> snapshot = reps->GenerateSnapshot();
snapshot->SetPolicyTableType(rpc::policy_table_interface_base::PT_SNAPSHOT);
-
- consumer_friendly_messages.removeMember("messages");
- policy_table["device_data"] = Json::Value(Json::objectValue);
-
+ // Remove fields which must be absent in snapshot
+ table["policy_table"]["consumer_friendly_messages"].removeMember("messages");
+ table["policy_table"]["app_policies"]["1234"].removeMember("default_hmi");
+ table["policy_table"]["app_policies"]["1234"].removeMember("keep_context");
+ table["policy_table"]["app_policies"]["1234"].removeMember("steal_focus");
+ table["policy_table"]["app_policies"]["default"].removeMember("default_hmi");
+ table["policy_table"]["app_policies"]["default"].removeMember("keep_context");
+ table["policy_table"]["app_policies"]["default"].removeMember("steal_focus");
+ table["policy_table"]["app_policies"]["pre_DataConsent"].removeMember(
+ "default_hmi");
+ table["policy_table"]["app_policies"]["pre_DataConsent"].removeMember(
+ "keep_context");
+ table["policy_table"]["app_policies"]["pre_DataConsent"].removeMember(
+ "steal_focus");
+ table["policy_table"]["app_policies"]["device"].removeMember("default_hmi");
+ table["policy_table"]["app_policies"]["device"].removeMember("keep_context");
+ table["policy_table"]["app_policies"]["device"].removeMember("steal_focus");
+ table["policy_table"]["app_policies"]["device"].removeMember("groups");
+ table["policy_table"]["device_data"] = Json::Value(Json::objectValue);
+ table["policy_table"]["module_meta"] = Json::Value(Json::objectValue);
policy_table::Table expected(&table);
-
+ Json::StyledWriter writer;
+ // Checks
+ EXPECT_EQ(writer.write(expected.ToJsonValue()),
+ writer.write(snapshot->ToJsonValue()));
EXPECT_EQ(expected.ToJsonValue().toStyledString(),
snapshot->ToJsonValue().toStyledString());
}
diff --git a/src/components/policy/test/sqlite_wrapper/sql_database_test.cc b/src/components/policy/test/sqlite_wrapper/sql_database_test.cc
index 85d595a3d..3bb633b2b 100644
--- a/src/components/policy/test/sqlite_wrapper/sql_database_test.cc
+++ b/src/components/policy/test/sqlite_wrapper/sql_database_test.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Ford Motor Company
+/* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,7 +30,6 @@
*/
#include "gtest/gtest.h"
-
#include "sqlite_wrapper/sql_error.h"
#include "sqlite_wrapper/sql_database.h"
@@ -50,97 +49,180 @@ namespace dbms {
}
}
-TEST(SQLDatabaseTest, OpenCloseMemory) {
+TEST(SQLDatabaseTest, OpenCloseMemory_OpenAndCloseDB_ActsWithoutError) {
+
+ //arrange
SQLDatabase db;
bool ret = db.Open();
+
+ //assert
EXPECT_FALSE(IsError(db.LastError()));
ASSERT_TRUE(ret);
+ //act
db.Close();
+
+ //assert
EXPECT_FALSE(IsError(db.LastError()));
}
-TEST(SQLDatabaseTest, OpenCloseFile) {
+
+TEST(SQLDatabaseTest, OpenCloseFile_OpenAndCloseSpecifiedDB_ActsWithoutError) {
+
+ //arrange
SQLDatabase db("test-database");
bool ret = db.Open();
+
+ //assert
EXPECT_FALSE(IsError(db.LastError()));
ASSERT_TRUE(ret);
+ //act
db.Close();
+
+ //assert
EXPECT_FALSE(IsError(db.LastError()));
+
remove("test-database.sqlite");
}
-TEST(SQLDatabaseTest, DoubleOpen) {
+TEST(SQLDatabaseTest, OpenDBTwice_NoError) {
+
+ //arrange
SQLDatabase db;
bool ret = db.Open();
+
+ //assert
EXPECT_FALSE(IsError(db.LastError()));
ASSERT_TRUE(ret);
+
+ //act
ret = db.Open();
+
+ //assert
EXPECT_FALSE(IsError(db.LastError()));
ASSERT_TRUE(ret);
+
db.Close();
}
-TEST(SQLDatabaseTest, DoubleClose) {
+TEST(SQLDatabaseTest, CloseDBTwice_NoError) {
+
+ //arrange
SQLDatabase db;
bool ret = db.Open();
+
+ //assert
EXPECT_FALSE(IsError(db.LastError()));
ASSERT_TRUE(ret);
+ //act
db.Close();
+
+ //assert
EXPECT_FALSE(IsError(db.LastError()));
+
+ //act
db.Close();
+
+ //assert
EXPECT_FALSE(IsError(db.LastError()));
}
-TEST(SQLDatabaseTest, CloseWithoutOpen) {
+TEST(SQLDatabaseTest, Close_DBWasNotOpened_NoError) {
+
+ //act
SQLDatabase db;
db.Close();
+
+ //assert
EXPECT_FALSE(IsError(db.LastError()));
}
-TEST(SQLDatabaseTest, CommitTransaction) {
+TEST(SQLDatabaseTest, CommitTransaction_StartAndCommitTransaction_ExpectActsWithoutError) {
+
+ //arrange
SQLDatabase db;
+
+ //assert
ASSERT_TRUE(db.Open());
EXPECT_TRUE(db.BeginTransaction());
EXPECT_FALSE(IsError(db.LastError()));
EXPECT_TRUE(db.CommitTransaction());
EXPECT_FALSE(IsError(db.LastError()));
+
db.Close();
}
-TEST(SQLDatabaseTest, RollbackTransaction) {
+TEST(SQLDatabaseTest, RollbackTransaction_StartAndRollbackTransaction_ExpectActsWithoutError) {
+
+ //arrange
SQLDatabase db;
+
+ //assert
ASSERT_TRUE(db.Open());
EXPECT_TRUE(db.BeginTransaction());
EXPECT_FALSE(IsError(db.LastError()));
EXPECT_TRUE(db.RollbackTransaction());
EXPECT_FALSE(IsError(db.LastError()));
+
db.Close();
}
-TEST(SQLDatabaseTest, FailedCommitTransaction) {
+TEST(SQLDatabaseTest, FailedCommitTransaction_CommitTransactionWithoutBeginning_ExpectError) {
+
+ //arrange
SQLDatabase db;
+
+ //assert
ASSERT_TRUE(db.Open());
EXPECT_FALSE(db.CommitTransaction());
EXPECT_TRUE(IsError(db.LastError()));
+
db.Close();
}
-TEST(SQLDatabaseTest, FailedRollbackTransaction) {
+TEST(SQLDatabaseTest, FailedRollbackTransaction_RollbackTransactionWithoutBeginning_ExpectError) {
+
+ //arrange
SQLDatabase db;
+
+ //assert
ASSERT_TRUE(db.Open());
EXPECT_FALSE(db.RollbackTransaction());
EXPECT_TRUE(IsError(db.LastError()));
+
db.Close();
}
-TEST(SQLDatabaseTest, BadTransaction) {
+TEST(SQLDatabaseTest, BadTransaction_BeginTransitionWithoutOpenDB_ExpectError) {
+
+ //arrange
SQLDatabase db;
+
+ //assert
EXPECT_FALSE(db.BeginTransaction());
EXPECT_TRUE(IsError(db.LastError()));
}
+TEST(SQLDatabaseTest, IsReadWrite_FirstOpenDBIsRWSecondIsNot) {
+
+ //arrange
+ SQLDatabase db("test-database");
+
+ //assert
+ ASSERT_TRUE(db.Open());
+ EXPECT_TRUE(db.IsReadWrite());
+ db.Close();
+ chmod("test-database.sqlite", S_IRUSR);
+
+ //assert
+ ASSERT_TRUE(db.Open());
+ EXPECT_FALSE(db.IsReadWrite());
+
+ db.Close();
+ remove("test-database.sqlite");
+}
+
} // namespace dbms
} // namespace policy
} // namespace components
diff --git a/src/components/policy/test/sqlite_wrapper/sql_query_test.cc b/src/components/policy/test/sqlite_wrapper/sql_query_test.cc
index 73545630f..83a3bf00c 100644
--- a/src/components/policy/test/sqlite_wrapper/sql_query_test.cc
+++ b/src/components/policy/test/sqlite_wrapper/sql_query_test.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Ford Motor Company
+/* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -96,30 +96,44 @@ class SQLQueryTest : public ::testing::Test {
sqlite3* SQLQueryTest::conn = 0;
const std::string SQLQueryTest::kDatabaseName = "test-query";
+TEST_F(SQLQueryTest, Query_CreateQuery_QueryInDBEqualCreated) {
-TEST_F(SQLQueryTest, Query) {
+ //arrange
const std::string kSelect("SELECT * FROM testTable WHERE integerValue = ?");
-
SQLDatabase db(kDatabaseName);
+
+ //assert
ASSERT_TRUE(db.Open());
+ //act
SQLQuery query(&db);
query.Prepare(kSelect);
+
+ //assert
EXPECT_STREQ(kSelect.c_str(), query.query().c_str());
}
-TEST_F(SQLQueryTest, ExecString) {
+TEST_F(SQLQueryTest, ExecString_ExecuteQuery_ActWithoutError) {
+
+ //arrange
const std::string kInsert("INSERT INTO testTable"
" (integerValue, doubleValue, stringValue)"
" VALUES(2, 3.4, 'five-пять')");
SQLDatabase db(kDatabaseName);
+ //assert
ASSERT_TRUE(db.Open());
+
+ //act
SQLQuery query(&db);
+
+ //assert
EXPECT_TRUE(query.Exec(kInsert));
EXPECT_FALSE(IsError(query.LastError()));
}
-TEST_F(SQLQueryTest, Bind) {
+TEST_F(SQLQueryTest, Bind_BindSeveralQueries_ExpectExecutedQueriesWithoutErrors) {
+
+ //arrange
const std::string kInsert1("INSERT INTO testTable (integerValue) VALUES (?)");
const std::string kInsert2("INSERT INTO testTable (doubleValue) VALUES (?)");
const std::string kInsert3("INSERT INTO testTable (stringValue) VALUES (?)");
@@ -130,49 +144,69 @@ TEST_F(SQLQueryTest, Bind) {
const std::string kStringValue = "four";
SQLDatabase db(kDatabaseName);
+
+ //assert
ASSERT_TRUE(db.Open());
+ //act
SQLQuery query1(&db);
+
+ //assert
EXPECT_TRUE(query1.Prepare(kInsert1));
EXPECT_FALSE(IsError(query1.LastError()));
query1.Bind(0, kIntegerValue);
+
+ //assert
EXPECT_FALSE(IsError(query1.LastError()));
EXPECT_TRUE(query1.Exec());
EXPECT_TRUE(IsDone(query1.LastError()));
+ //act
SQLQuery query2(&db);
+ //assert
EXPECT_TRUE(query2.Prepare(kInsert2));
EXPECT_FALSE(IsError(query2.LastError()));
query2.Bind(0, kDoubleValue);
+ //assert
EXPECT_FALSE(IsError(query2.LastError()));
EXPECT_TRUE(query2.Exec());
EXPECT_TRUE(IsDone(query2.LastError()));
+ //act
SQLQuery query3(&db);
EXPECT_TRUE(query3.Prepare(kInsert3));
EXPECT_FALSE(IsError(query3.LastError()));
query3.Bind(0, kStringValue);
+ //assert
EXPECT_FALSE(IsError(query3.LastError()));
EXPECT_TRUE(query3.Exec());
EXPECT_TRUE(IsDone(query3.LastError()));
+ //act
SQLQuery query4(&db);
+ //assert
EXPECT_TRUE(query4.Prepare(kInsert4));
EXPECT_FALSE(IsError(query4.LastError()));
query4.Bind(0, kIntegerValue);
query4.Bind(1, kDoubleValue);
query4.Bind(2, kStringValue);
+ //assert
EXPECT_FALSE(IsError(query4.LastError()));
EXPECT_TRUE(query4.Exec());
EXPECT_TRUE(IsDone(query4.LastError()));
}
-TEST_F(SQLQueryTest, Value) {
+TEST_F(SQLQueryTest, SetValue_InsertValues_ExpectDBHasInsertedValues) {
+
+ //arrange
const char* insert = "INSERT INTO testTable "
"(integerValue, doubleValue, stringValue) "
"VALUES (1, 2.3, 'four');";
+
+ //assert
ASSERT_EQ(SQLITE_OK, sqlite3_exec(conn, insert, NULL, NULL, NULL));
+ //act
const std::string kSelect("SELECT integerValue, doubleValue, stringValue"
" FROM testTable");
const int kIntegerValue = 1;
@@ -180,9 +214,14 @@ TEST_F(SQLQueryTest, Value) {
const std::string kStringValue = "four";
SQLDatabase db(kDatabaseName);
+
+ //assert
ASSERT_TRUE(db.Open());
+ //act
SQLQuery query(&db);
+
+ //assert
EXPECT_TRUE(query.Prepare(kSelect));
EXPECT_FALSE(IsError(query.LastError()));
EXPECT_TRUE(query.Exec());
@@ -194,27 +233,40 @@ TEST_F(SQLQueryTest, Value) {
EXPECT_TRUE(IsDone(query.LastError()));
}
-TEST_F(SQLQueryTest, EmptySelect) {
+TEST_F(SQLQueryTest, EmptySelect_SelectValuesEqual0_ExecWithoutErrors) {
+
+ //arrange
const std::string kSelect("SELECT integerValue, doubleValue, stringValue"
" FROM testTable WHERE 0");
SQLDatabase db(kDatabaseName);
+
+ //assert
ASSERT_TRUE(db.Open());
+ //act
SQLQuery query(&db);
+
+ //assert
EXPECT_TRUE(query.Prepare(kSelect));
EXPECT_FALSE(IsError(query.LastError()));
EXPECT_TRUE(query.Exec());
EXPECT_TRUE(IsDone(query.LastError()));
}
-TEST_F(SQLQueryTest, NextAndBind) {
+TEST_F(SQLQueryTest, NextAndBind_InsertValuesAndBindQuery_ExecWithoutErrorsAndBindingQueryIsLast) {
+
+ //arrange
const char* insert = "INSERT INTO testTable "
"(integerValue, doubleValue, stringValue) "
"VALUES (1, 2.3, 'four');";
+
+ //assert
ASSERT_EQ(SQLITE_OK, sqlite3_exec(conn, insert, NULL, NULL, NULL));
const std::string kSelect("SELECT integerValue, doubleValue, stringValue"
" FROM testTable WHERE stringValue = ?");
+
+ //act
const int kIntegerValue = 1;
const double kDoubleValue = 2.3;
const std::string kStringValue = "four";
@@ -223,9 +275,13 @@ TEST_F(SQLQueryTest, NextAndBind) {
ASSERT_TRUE(db.Open());
SQLQuery query(&db);
+
+ //assert
ASSERT_TRUE(query.Prepare(kSelect));
EXPECT_FALSE(IsError(query.LastError()));
+ //act
query.Bind(0, kStringValue);
+ //assert
EXPECT_FALSE(IsError(query.LastError()));
EXPECT_TRUE(query.Exec());
ASSERT_TRUE(IsRow(query.LastError()));
@@ -236,23 +292,37 @@ TEST_F(SQLQueryTest, NextAndBind) {
EXPECT_TRUE(IsDone(query.LastError()));
}
-TEST_F(SQLQueryTest, LastInsertId) {
+TEST_F(SQLQueryTest, LastInsertId_InsertValuesAndBindQuery_GetExpectedId) {
+
+ //arrange
const char* create = "CREATE TABLE idTable ( "
"id INTEGER PRIMARY KEY AUTOINCREMENT,"
"value TEXT)";
+
+ //assert
ASSERT_EQ(SQLITE_OK, sqlite3_exec(conn, create, NULL, NULL, NULL));
+
const int64_t kExpectId = 1;
const std::string kValue("Test last id of insert row");
const std::string kInsert("INSERT INTO idTable (value) VALUES(?)");
+ //act
SQLDatabase db(kDatabaseName);
+
+ //assert
ASSERT_TRUE(db.Open());
+ //act
SQLQuery query(&db);
+
+ //assert
ASSERT_TRUE(query.Prepare(kInsert));
EXPECT_FALSE(IsError(query.LastError()));
+
+ //act
query.Bind(0, kValue);
+ //assert
EXPECT_FALSE(IsError(query.LastError()));
EXPECT_TRUE(query.Exec());
ASSERT_TRUE(IsDone(query.LastError()));
@@ -262,26 +332,37 @@ TEST_F(SQLQueryTest, LastInsertId) {
sqlite3_exec(conn, "DROP TABLE idTable", NULL, NULL, NULL));
}
-TEST_F(SQLQueryTest, BindNull) {
+TEST_F(SQLQueryTest, BindNull_BindWithoutValue_ActWithoutErrors) {
+
+ //arrange
const std::string kInsert("INSERT INTO testTable (`integerValue`)"
" VALUES (?)");
SQLDatabase db(kDatabaseName);
+ //assert
ASSERT_TRUE(db.Open());
+ //act
SQLQuery query(&db);
+
+ //assert
ASSERT_TRUE(query.Prepare(kInsert));
EXPECT_FALSE(IsError(query.LastError()));
query.Bind(0);
+ //assert
EXPECT_FALSE(IsError(query.LastError()));
EXPECT_TRUE(query.Exec());
ASSERT_TRUE(IsDone(query.LastError()));
}
-TEST_F(SQLQueryTest, DoublePrepare) {
+TEST_F(SQLQueryTest, DoublePrepare_TwicePrepareQuery_ActWithoutErrors) {
+
+ //arrange
SQLDatabase db(kDatabaseName);
+ //assert
ASSERT_TRUE(db.Open());
-
+ //act
SQLQuery query(&db);
+ //assert
EXPECT_TRUE(query.Prepare("SELECT * FROM testTable"));
EXPECT_FALSE(IsError(query.LastError()));
EXPECT_TRUE(query.Prepare("SELECT * FROM testTable"));
diff --git a/src/components/policy/test/usage_statistics_test.cc b/src/components/policy/test/usage_statistics_test.cc
index 1410c5811..be9d9ff81 100644
--- a/src/components/policy/test/usage_statistics_test.cc
+++ b/src/components/policy/test/usage_statistics_test.cc
@@ -39,107 +39,158 @@ using ::testing::InSequence;
namespace usage_statistics {
namespace test {
-TEST(UsageStatisticsTest, TestGlobalCounterIncrementsStatistics) {
+// TEST(A, B_C_D) { ... }
+// A - What you test
+// B - What you do
+// C - Input data
+// D - Expected result
+
+TEST(StatisticsManagerIncrementMethod1Arg, GlobalCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
+ //Arrange
MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
- EXPECT_CALL(*msm, Increment(SYNC_REBOOTS)).Times(1);
+ //Assert
+ EXPECT_CALL(*msm, Increment(SYNC_REBOOTS));
+
+ //Act
++reboots_counter;
}
-TEST(UsageStatisticsTest, TestGlobalCounterIncrementsStatisticsTwice) {
+TEST(StatisticsManagerIncrementMethod1Arg, GlobalCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) {
+ //Arrange
MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
+ //Assert
EXPECT_CALL(*msm, Increment(SYNC_REBOOTS)).Times(2);
+
+ //Act
++reboots_counter;
++reboots_counter;
}
-TEST(UsageStatisticsTest, TestAppCounterIncrementsStatistics) {
+TEST(StatisticsManagerIncrementMethod2Args, AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
+ //Arrange
MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
- EXPECT_CALL(*msm, Increment("HelloApp", USER_SELECTIONS)).Times(1);
+ //Assert
+ EXPECT_CALL(*msm, Increment("HelloApp", USER_SELECTIONS));
+
+ //Act
++user_selections_counter;
}
-TEST(UsageStatisticsTest, TestAppCounterIncrementsStatisticsTwice) {
+TEST(StatisticsManagerIncrementMethod2Args, AppCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) {
+ //Arrange
MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
+ //Assert
EXPECT_CALL(*msm, Increment("HelloApp", USER_SELECTIONS)).Times(2);
+
+ //Act
++user_selections_counter;
++user_selections_counter;
}
-
-TEST(UsageStatisticsTest, TestAppInfoUpdates) {
+//---
+TEST(StatisticsManagerSetMethod, AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) {
+ //Arrange
MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
- EXPECT_CALL(*msm, Set("HelloApp", LANGUAGE_GUI, "Klingon")).Times(1);
+ //Assert
+ EXPECT_CALL(*msm, Set("HelloApp", LANGUAGE_GUI, "Klingon"));
+
+ //Act
gui_language_info.Update("Klingon");
}
-TEST(UsageStatisticsTest, TestAppInfoUpdatesTwice) {
+TEST(StatisticsManagerSetMethod, AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) {
+ //Arrange
MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
- InSequence s;
- EXPECT_CALL(*msm, Set("HelloApp", LANGUAGE_GUI, "Klingon")).Times(1);
- EXPECT_CALL(*msm, Set("HelloApp", LANGUAGE_GUI, "UA")).Times(1);
+ //Assert
+ EXPECT_CALL(*msm, Set("HelloApp", LANGUAGE_GUI, "Klingon"));
+ EXPECT_CALL(*msm, Set("HelloApp", LANGUAGE_GUI, "UA"));
+
+ //Act
gui_language_info.Update("Klingon");
gui_language_info.Update("UA");
}
-TEST(UsageStatisticsTest, TestAppStopwatchAutoStopsAndAddsZero) {
+
+TEST(StatisticsManagerAddMethod, DISABLED_AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) {
+ //Arrange
MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
- AppStopwatch hmi_full_stopwatch(msm, "HelloApp");
+ const std::uint32_t time_out = 1;
+ AppStopwatch hmi_full_stopwatch(msm, "HelloApp", time_out);
- EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, 0)).Times(1);
+ //Assert
+ EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, 0));
+ //Act
hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
}
-TEST(UsageStatisticsTest, TestAppStopwatchAddsZero) {
+TEST(StatisticsManagerAddMethod, DISABLED_AppStopwatchStartMethod_Call_StatisticsManagerAddMethodCALLED) {
+ //Arrange
+
MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
- AppStopwatch hmi_full_stopwatch(msm, "HelloApp");
+ const std::uint32_t time_out = 1;
+ AppStopwatch hmi_full_stopwatch(msm, "HelloApp", time_out);
- InSequence s;
- EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, 0)).Times(1);
- EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_BACKGROUND, 0)).Times(1);
- EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, 0)).Times(1);
+ //Assert
+ EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, 0));
+ //Act
hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
- hmi_full_stopwatch.Switch(SECONDS_HMI_BACKGROUND);
+ sleep(2);
+}
+
+TEST(StatisticsManagerAddMethod, DISABLED_AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCALLED) {
+ //Arrange
+ MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ AppStopwatch hmi_full_stopwatch(msm, "HelloApp");
+ hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
+
+ //Assert
+ EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, 0)).Times(2); // Once in stop(), once in destructor
+
+ //Act
hmi_full_stopwatch.Switch(SECONDS_HMI_FULL);
- hmi_full_stopwatch.Stop();
}
-TEST(UsageStatisticsTest, TestAppStopwatchAutoStopsInASecond) {
+TEST(StatisticsManagerAddMethod, DISABLED_AppStopwatchStartMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) {
+ //Arrange
MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
AppStopwatch hmi_full_stopwatch(msm, "HelloApp");
- EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, 1)).Times(1);
+ //Assert
+ EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, 1));
+ //Act
hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
sleep(1);
}
-TEST(UsageStatisticsTest, TestAppStopwatchStopsInTwoSeconds) {
+
+TEST(StatisticsManagerAddMethod, DISABLED_AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) {
+ //Arrange
MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
- AppStopwatch hmi_full_stopwatch(msm, "HelloApp");
+ const std::uint32_t time_out = 1;
+ AppStopwatch hmi_full_stopwatch(msm, "HelloApp", time_out);
- EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_NONE, 0)).Times(1);
- EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, 1)).Times(1);
- EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_BACKGROUND, 1)).Times(1);
+ //Assert
+ EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_NONE, 0));
+ EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_BACKGROUND, 1));
+ //Act
hmi_full_stopwatch.Start(SECONDS_HMI_NONE);
- hmi_full_stopwatch.Switch(SECONDS_HMI_FULL);
- sleep(1);
hmi_full_stopwatch.Switch(SECONDS_HMI_BACKGROUND);
- sleep(1);
+ sleep(2);
}
-
} // namespace test
} // namespace usage_statistics
diff --git a/src/components/protocol/CMakeLists.txt b/src/components/protocol/CMakeLists.txt
index 2459bbc49..8524ff4f4 100644
--- a/src/components/protocol/CMakeLists.txt
+++ b/src/components/protocol/CMakeLists.txt
@@ -1,13 +1,44 @@
+# 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_directories(
./include
${APR_INCLUDE_DIRECTORY}
)
set(SOURCES
- ./src/raw_message.cc
- ./src/service_type.cc
- ./src/message_priority.cc
- ./src/rpc_type.cc
+ ${COMPONENTS_DIR}/protocol/src/raw_message.cc
+ ${COMPONENTS_DIR}/protocol/src/service_type.cc
+ ${COMPONENTS_DIR}/protocol/src/message_priority.cc
+ ${COMPONENTS_DIR}/protocol/src/rpc_type.cc
)
add_library(ProtocolLibrary ${SOURCES})
diff --git a/src/components/protocol/src/raw_message.cc b/src/components/protocol/src/raw_message.cc
index 348eb1619..7b1b8b087 100644
--- a/src/components/protocol/src/raw_message.cc
+++ b/src/components/protocol/src/raw_message.cc
@@ -46,7 +46,7 @@ RawMessage::RawMessage(uint32_t connection_key, uint32_t protocol_version,
service_type_(ServiceTypeFromByte(type)),
payload_size_(payload_size),
waiting_(false) {
- if (data_sz > 0) {
+ if (data_param && data_sz > 0) {
data_ = new uint8_t[data_sz];
memcpy(data_, data_param, sizeof(*data_) * data_sz);
}
diff --git a/src/components/protocol_handler/CMakeLists.txt b/src/components/protocol_handler/CMakeLists.txt
index 5ccfa3bb3..10a18c48b 100644
--- a/src/components/protocol_handler/CMakeLists.txt
+++ b/src/components/protocol_handler/CMakeLists.txt
@@ -1,15 +1,48 @@
+# 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_directories(
- ./include
- ../utils/include/
- ../connection_handler/include/
- ../config_profile/include/
+ include
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/protocol_handler/include/
+ ${COMPONENTS_DIR}/connection_handler/include/
+ ${COMPONENTS_DIR}/config_profile/include/
${LOG4CXX_INCLUDE_DIRECTORY}
)
set(SOURCES
- ./src/protocol_handler_impl.cc
- ./src/protocol_packet.cc
- ./src/protocol_payload.cc
+ ${COMPONENTS_DIR}/protocol_handler/src/incoming_data_handler.cc
+ ${COMPONENTS_DIR}/protocol_handler/src/protocol_handler_impl.cc
+ ${COMPONENTS_DIR}/protocol_handler/src/protocol_packet.cc
+ ${COMPONENTS_DIR}/protocol_handler/src/protocol_payload.cc
)
set(LIBRARIES
@@ -17,5 +50,15 @@ set(LIBRARIES
Utils
)
+get_property(dirs DIRECTORY "" PROPERTY LIBRARIES)
+foreach(dir ${dirs})
+ message(STATUS "libraries='${dir}'")
+endforeach()
+
+
add_library(ProtocolHandler ${SOURCES})
target_link_libraries(ProtocolHandler ${LIBRARIES})
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h b/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h
index dc753e57d..bd64db906 100644
--- a/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h
+++ b/src/components/protocol_handler/include/protocol_handler/incoming_data_handler.h
@@ -36,7 +36,7 @@
#include <map>
#include <vector>
#include "utils/macro.h"
-#include "protocol_packet.h"
+#include "protocol_handler/protocol_packet.h"
#include "transport_manager/common.h"
namespace protocol_handler {
@@ -53,16 +53,21 @@ class IncomingDataHandler {
* @brief Setting additional validator for checking malformed packets
* \param validator pointer
*/
- void set_validator(const ProtocolPacket::ProtocolHeaderValidator* const validator);
+ void set_validator(const ProtocolPacket::ProtocolHeaderValidator *const validator);
/**
- * @brief Contecat TM messages to ford frames and validate ford header data
+ * @brief Concatenate TM messages to ford frames and validate ford header data
* \param TM messages for converting to frames
* \param result of convertion
- * - RESULT_FAIL - packet serialization or validation error occurs
+ * \param malformed_occurrence count of malformed messages occurrence
* - RESULT_OK - no error ocures
+ * - RESULT_MALFORMED_OCCURS - messages concatenated,
+ * but malformed message occurs
+ * - RESULT_FAIL - packet serialization or validation error occurs
* \return list of complete, correct packets
*/
- std::list<ProtocolFramePtr> ProcessData(const RawMessage& tm_message, RESULT_CODE* result);
+ std::list<ProtocolFramePtr> ProcessData(const RawMessage &tm_message,
+ RESULT_CODE *result,
+ size_t *malformed_occurrence);
/**
* @brief Add connection for data handling and verification
*/
@@ -78,10 +83,11 @@ class IncomingDataHandler {
/**
* @brief Returns size of frame to be formed from raw bytes.
*/
- static uint32_t GetPacketSize(const ProtocolPacket::ProtocolHeader& header);
+ static uint32_t GetPacketSize(const ProtocolPacket::ProtocolHeader &header);
/**
* @brief Try to create frame from incoming data
* \param incommung_data raw stream
+ * \param malformed_occurrence count of malformed messages occurrence
* \param out_frames list for read frames
*
* \return operation RESULT_CODE
@@ -89,14 +95,16 @@ class IncomingDataHandler {
* - RESULT_OK - one or more frames successfully created
* - RESULT_FAIL - packet serialization or validation error occurs
*/
- RESULT_CODE CreateFrame(std::vector<uint8_t>& incoming_data,
- std::list<ProtocolFramePtr>& out_frames,
+ RESULT_CODE CreateFrame(std::vector<uint8_t> &incoming_data,
+ std::list<ProtocolFramePtr> &out_frames,
+ size_t &malformed_occurrence,
const transport_manager::ConnectionUID connection_id);
- typedef std::map<transport_manager::ConnectionUID, std::vector<uint8_t> > ConnectionsDataMap;
+ typedef std::map<transport_manager::ConnectionUID, std::vector<uint8_t> >
+ ConnectionsDataMap;
ConnectionsDataMap connections_data_;
ProtocolPacket::ProtocolHeader header_;
- const ProtocolPacket::ProtocolHeaderValidator * validator_;
+ const ProtocolPacket::ProtocolHeaderValidator *validator_;
DISALLOW_COPY_AND_ASSIGN(IncomingDataHandler);
};
} // namespace protocol_handler
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 3732e23a4..bff972ede 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
@@ -36,20 +36,23 @@
#include <map>
#include <memory>
#include <set>
+#include <list>
#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 "protocol_handler/protocol_handler.h"
#include "protocol_handler/protocol_packet.h"
#include "protocol_handler/session_observer.h"
#include "protocol_handler/protocol_observer.h"
+#include "protocol_handler/incoming_data_handler.h"
#include "transport_manager/common.h"
#include "transport_manager/transport_manager.h"
#include "transport_manager/transport_manager_listener_empty.h"
#ifdef TIME_TESTER
-#include "time_metric_observer.h"
+#include "protocol_handler/time_metric_observer.h"
#endif // TIME_TESTER
#ifdef ENABLE_SECURITY
@@ -69,11 +72,6 @@ class MessagesToMobileAppHandler;
using transport_manager::TransportManagerListenerEmpty;
-/**
- * @brief Type definition for variable that hold shared pointer to raw message.
- */
-typedef utils::SharedPtr<protocol_handler::ProtocolPacket> ProtocolFramePtr;
-
typedef std::multimap<int32_t, RawMessagePtr> MessagesOverNaviMap;
typedef std::set<ProtocolObserver*> ProtocolObservers;
typedef transport_manager::ConnectionUID ConnectionID;
@@ -92,7 +90,8 @@ struct RawFordMessageFromMobile: public ProtocolFramePtr {
// PrioritizedQueue requires this method to decide which priority to assign
size_t PriorityOrder() const {
return MessagePriority::FromServiceType(
- ServiceTypeFromByte(get()->service_type())).OrderingValue(); }
+ ServiceTypeFromByte(get()->service_type())).OrderingValue();
+ }
};
struct RawFordMessageToMobile: public ProtocolFramePtr {
@@ -102,15 +101,16 @@ struct RawFordMessageToMobile: public ProtocolFramePtr {
// PrioritizedQueue requires this method to decide which priority to assign
size_t PriorityOrder() const {
return MessagePriority::FromServiceType(
- ServiceTypeFromByte(get()->service_type())).OrderingValue(); }
+ ServiceTypeFromByte(get()->service_type())).OrderingValue();
+ }
// Signals whether connection to mobile must be closed after processing this message
bool is_final;
};
// Short type names for prioritized message queues
-typedef threads::MessageLoopThread<
+typedef threads::MessageLoopThread <
utils::PrioritizedQueue<RawFordMessageFromMobile> > FromMobileQueue;
-typedef threads::MessageLoopThread<
+typedef threads::MessageLoopThread <
utils::PrioritizedQueue<RawFordMessageToMobile> > ToMobileQueue;
} // namespace impl
@@ -123,7 +123,7 @@ typedef threads::MessageLoopThread<
* about activities around sessions.
*/
class ProtocolHandlerImpl
- : public ProtocolHandler,
+ : public ProtocolHandler,
public TransportManagerListenerEmpty,
public impl::FromMobileQueue::Handler,
public impl::ToMobileQueue::Handler {
@@ -131,10 +131,21 @@ class ProtocolHandlerImpl
/**
* \brief Constructor
* \param transportManager Pointer to Transport layer handler for
+ * \param message_frequency_time used as time for flood filtering
+ * \param message_frequency_count used as maximum value of messages
+ * per message_frequency_time period
+ * \param malformed_message_filtering used for malformed filtering enabling
+ * \param malformed_message_frequency_time used as time for malformed flood filtering
+ * \param malformed_message_frequency_count used as maximum value of malformed
+ * messages per message_frequency_time period
* message exchange.
*/
explicit ProtocolHandlerImpl(
- transport_manager::TransportManager *transport_manager_param);
+ transport_manager::TransportManager *transport_manager_param,
+ size_t message_frequency_time, size_t message_frequency_count,
+ bool malformed_message_filtering,
+ size_t malformed_message_frequency_time,
+ size_t malformed_message_frequency_count);
/**
* \brief Destructor
@@ -171,6 +182,11 @@ class ProtocolHandlerImpl
#endif // ENABLE_SECURITY
/**
+ * \brief Stop all handling activity
+ */
+ void Stop();
+
+ /**
* \brief Method for sending message to Mobile Application
* \param message Message with params to be sent to Mobile App
*/
@@ -179,7 +195,7 @@ class ProtocolHandlerImpl
/**
* \brief Sends number of processed frames in case of binary nav streaming
- * \param connection_key Id of connection over which message is to be sent
+ * \param connection_key Unique key used by other components as session identifier
* \param number_of_frames Number of frames processed by
* streaming server and displayed to user.
*/
@@ -207,6 +223,10 @@ class ProtocolHandlerImpl
*/
void SendEndSession(int32_t connection_id, uint8_t session_id);
+ void SendEndService(int32_t connection_id,
+ uint8_t session_id,
+ uint8_t service_type);
+
// TODO(Ezamakhov): move Ack/Nack as interface for StartSessionHandler
/**
* \brief Sends acknowledgement of starting session to mobile application
@@ -251,7 +271,7 @@ class ProtocolHandlerImpl
* mobile app for using when ending session.
* \param service_type Type of session: RPC or BULK Data. RPC by default
*/
- void SendEndSessionAck(ConnectionID connection_id ,
+ void SendEndSessionAck(ConnectionID connection_id,
uint8_t session_id,
uint8_t protocol_version,
uint8_t service_type);
@@ -264,12 +284,15 @@ class ProtocolHandlerImpl
* \param protocol_version Version of protocol used for communication
* \param service_type Type of session: RPC or BULK Data. RPC by default
*/
- void SendEndSessionNAck(ConnectionID connection_id ,
+ void SendEndSessionNAck(ConnectionID connection_id,
uint32_t session_id,
uint8_t protocol_version,
uint8_t service_type);
private:
+ void SendEndServicePrivate(int32_t connection_id, uint8_t session_id,
+ uint8_t service_type);
+
/*
* Prepare and send heartbeat acknowledge message
*/
@@ -283,7 +306,7 @@ class ProtocolHandlerImpl
* @param message Received message
**/
virtual void OnTMMessageReceived(
- const RawMessagePtr message);
+ const RawMessagePtr message);
/**
* @brief Notifies about error on receiving message from TM.
@@ -291,7 +314,7 @@ class ProtocolHandlerImpl
* @param error Occurred error
**/
virtual void OnTMMessageReceiveFailed(
- const transport_manager::DataReceiveError &error);
+ const transport_manager::DataReceiveError &error);
/**
* @brief Notifies about successfully sending message.
@@ -307,15 +330,15 @@ class ProtocolHandlerImpl
* @param message Message during sending which error occurred.
**/
virtual void OnTMMessageSendFailed(
- const transport_manager::DataSendError &error,
- const RawMessagePtr message);
+ const transport_manager::DataSendError &error,
+ const RawMessagePtr message);
virtual void OnConnectionEstablished(
- const transport_manager::DeviceInfo &device_info,
- const transport_manager::ConnectionUID &connection_id);
+ const transport_manager::DeviceInfo &device_info,
+ const transport_manager::ConnectionUID &connection_id);
virtual void OnConnectionClosed(
- const transport_manager::ConnectionUID &connection_id);
+ const transport_manager::ConnectionUID &connection_id);
/**
* @brief Notifies subscribers about message
@@ -336,11 +359,11 @@ class ProtocolHandlerImpl
* \param is_final_message if is_final_message = true - it is last message
* \return \saRESULT_CODE Status of operation
*/
- RESULT_CODE SendSingleFrameMessage(ConnectionID connection_id,
+ RESULT_CODE SendSingleFrameMessage(const ConnectionID connection_id,
const uint8_t session_id,
- uint32_t protocol_version,
+ const uint32_t protocol_version,
const uint8_t service_type,
- size_t data_size,
+ const size_t data_size,
const uint8_t *data,
const bool is_final_message);
@@ -357,13 +380,13 @@ class ProtocolHandlerImpl
* \param is_final_message if is_final_message = true - it is last message
* \return \saRESULT_CODE Status of operation
*/
- RESULT_CODE SendMultiFrameMessage(ConnectionID connection_id,
+ RESULT_CODE SendMultiFrameMessage(const ConnectionID connection_id,
const uint8_t session_id,
- uint32_t protocol_version,
+ const uint8_t protocol_version,
const uint8_t service_type,
const size_t data_size,
const uint8_t *data,
- const size_t max_data_size,
+ const size_t max_frame_size,
const bool is_final_message);
/**
@@ -381,8 +404,8 @@ class ProtocolHandlerImpl
* \return \saRESULT_CODE Status of operation
*/
RESULT_CODE HandleMessage(
- ConnectionID connection_id ,
- const ProtocolFramePtr packet);
+ ConnectionID connection_id,
+ const ProtocolFramePtr packet);
/**
* \brief Handles message received in single frame.
@@ -392,8 +415,8 @@ class ProtocolHandlerImpl
* \return \saRESULT_CODE Status of operation
*/
RESULT_CODE HandleSingleFrameMessage(
- ConnectionID connection_id ,
- const ProtocolFramePtr packet);
+ ConnectionID connection_id,
+ const ProtocolFramePtr packet);
/**
* \brief Handles message received in multiple frames. Collects all frames
* of message.
@@ -403,8 +426,8 @@ class ProtocolHandlerImpl
* \return \saRESULT_CODE Status of operation
*/
RESULT_CODE HandleMultiFrameMessage(
- ConnectionID connection_id ,
- const ProtocolFramePtr packet);
+ ConnectionID connection_id,
+ const ProtocolFramePtr packet);
/**
* \brief Handles message received in single frame.
@@ -414,27 +437,20 @@ class ProtocolHandlerImpl
* \return \saRESULT_CODE Status of operation
*/
RESULT_CODE HandleControlMessage(
- ConnectionID connection_id ,
- const ProtocolFramePtr packet);
+ ConnectionID connection_id,
+ const ProtocolFramePtr packet);
RESULT_CODE HandleControlMessageEndSession(
- ConnectionID connection_id ,
- const ProtocolPacket &packet);
+ ConnectionID connection_id,
+ const ProtocolPacket &packet);
RESULT_CODE HandleControlMessageStartSession(
- ConnectionID connection_id ,
- const ProtocolPacket &packet);
+ ConnectionID connection_id,
+ const ProtocolPacket &packet);
RESULT_CODE HandleControlMessageHeartBeat(
- ConnectionID connection_id ,
- const ProtocolPacket &packet);
-
- /**
- * \brief Sends Mobile Navi Ack message
- */
- RESULT_CODE SendMobileNaviAck(
- ConnectionID connection_id ,
- int32_t connection_key);
+ ConnectionID connection_id,
+ const ProtocolPacket &packet);
// threads::MessageLoopThread<*>::Handler implementations
// CALLED ON raw_ford_messages_from_mobile_ thread!
@@ -450,6 +466,12 @@ class ProtocolHandlerImpl
RESULT_CODE EncryptFrame(ProtocolFramePtr packet);
RESULT_CODE DecryptFrame(ProtocolFramePtr packet);
#endif // ENABLE_SECURITY
+
+ bool TrackMessage(const uint32_t &connection_key);
+
+ bool TrackMalformedMessage(const uint32_t &connection_key,
+ const size_t count);
+
private:
/**
*\brief Pointer on instance of class implementing IProtocolObserver
@@ -474,7 +496,7 @@ class ProtocolHandlerImpl
std::map<int32_t, ProtocolFramePtr> incomplete_multi_frame_messages_;
/**
- * \brief Map of messages (frames) recieved over mobile nave session
+ * \brief Map of messages (frames) received over mobile nave session
* for map streaming.
*/
MessagesOverNaviMap message_over_navi_session_;
@@ -487,10 +509,16 @@ class ProtocolHandlerImpl
/**
*\brief Counter of messages sent in each session.
+ * Used ad unique message identifier
*/
std::map<uint8_t, uint32_t> message_counters_;
/**
+ *\brief Counter of messages sent in each session.
+ */
+ std::map<ConnectionID, uint32_t> malformed_message_counters_;
+
+ /**
*\brief map for session last message.
*/
std::map<uint8_t, uint32_t> sessions_last_message_id_;
@@ -500,9 +528,17 @@ class ProtocolHandlerImpl
*/
std::list<uint32_t> ready_to_close_connections_;
-
- class IncomingDataHandler;
- std::auto_ptr<IncomingDataHandler> incoming_data_handler_;
+ ProtocolPacket::ProtocolHeaderValidator protocol_header_validator_;
+ IncomingDataHandler incoming_data_handler_;
+ // Use uint32_t as application identifier
+ utils::MessageMeter<uint32_t> message_meter_;
+ size_t message_max_frequency_;
+ size_t message_frequency_time_;
+ bool malformed_message_filtering_;
+ // Use uint32_t as connection identifier
+ utils::MessageMeter<uint32_t> malformed_message_meter_;
+ size_t malformed_message_max_frequency_;
+ size_t malformed_message_frequency_time_;
#ifdef ENABLE_SECURITY
security_manager::SecurityManager *security_manager_;
@@ -520,5 +556,4 @@ class ProtocolHandlerImpl
#endif // TIME_TESTER
};
} // namespace protocol_handler
-
#endif // SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_IMPL_H_
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 2e3d39fd4..0b4b253a8 100644
--- a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
@@ -35,67 +35,45 @@
#include "utils/macro.h"
#include "protocol/common.h"
-#include "protocol/common.h"
+#include "transport_manager/common.h"
/**
*\namespace protocol_handlerHandler
*\brief Namespace for SmartDeviceLink ProtocolHandler related functionality.
*/
namespace protocol_handler {
+
+typedef transport_manager::ConnectionUID ConnectionID;
/**
* \class ProtocolPacket
* \brief Class for forming/parsing protocol headers of the message and
* handling multiple frames of the message.
*/
class ProtocolPacket {
- private:
+ public:
/**
* \struct ProtocolData
* \brief Used for storing message and its size.
*/
struct ProtocolData {
- ProtocolData()
- : data(0), totalDataBytes(0x00) {
- }
+ ProtocolData();
+ ~ProtocolData();
uint8_t *data;
uint32_t totalDataBytes;
};
/**
- * \struct ProtocolHeader
+ * \class ProtocolHeader
* \brief Used for storing protocol header of a message.
*/
- struct ProtocolHeader {
- /**
- * \brief Constructor
- */
- ProtocolHeader()
- : version(0x00),
- protection_flag(PROTECTION_OFF),
- frameType(0x00),
- serviceType(0x00),
- frameData(0x00),
- sessionId(0x00),
- dataSize(0x00),
- messageId(0x00) {
- }
- /**
- * \brief Constructor
- */
+ class ProtocolHeader {
+ public:
+ ProtocolHeader();
ProtocolHeader(uint8_t version, bool protection,
uint8_t frameType,
uint8_t serviceType,
uint8_t frameData, uint8_t sessionID,
- uint32_t dataSize, uint32_t messageID)
- : version(version),
- protection_flag(protection),
- frameType(frameType),
- serviceType(serviceType),
- frameData(frameData),
- sessionId(sessionID),
- dataSize(dataSize),
- messageId(messageID) {
- }
+ uint32_t dataSize, uint32_t messageID);
uint8_t version;
bool protection_flag;
uint8_t frameType;
@@ -104,9 +82,28 @@ class ProtocolPacket {
uint8_t sessionId;
uint32_t dataSize;
uint32_t messageId;
+ void deserialize(const uint8_t *message, const size_t messageSize);
+ };
+ /**
+ * \class ProtocolHeaderValidator
+ * \brief Used for ProtocolHeader validation
+ */
+ class ProtocolHeaderValidator {
+ public:
+ ProtocolHeaderValidator();
+ /**
+ * \brief Setter/getter maximum payload size of packets
+ */
+ void set_max_payload_size(const size_t max_payload_size);
+ size_t max_payload_size() const;
+ /**
+ * \brief Check ProtocolHeader according to protocol requiements
+ */
+ RESULT_CODE validate(const ProtocolHeader& header) const;
+ private:
+ size_t max_payload_size_;
};
- public:
/**
* \brief Default constructor
*/
@@ -115,14 +112,9 @@ class ProtocolPacket {
/**
* \brief Constructor
*
- * \param connectionKey Identifier of connection within wich message
- * is transferred
* \param connection_id - Connection Identifier
- * \param data Message string
- * \param dataSize Message size
*/
- ProtocolPacket(uint8_t connection_id, uint8_t *data,
- uint32_t dataSize);
+ explicit ProtocolPacket(ConnectionID connection_id);
/**
* \brief Constructor
@@ -137,18 +129,12 @@ class ProtocolPacket {
* \param dataSize Size of message string
* \param messageID ID of message or hash code - only for second protocol
* \param data Message string if provided
- * \param packet_id - ID for multiframe messages
*/
- ProtocolPacket(uint8_t connection_id,
+ ProtocolPacket(ConnectionID connection_id,
uint8_t version, bool protection, uint8_t frameType,
uint8_t serviceType, uint8_t frameData,
uint8_t sessionId, uint32_t dataSize,
- uint32_t messageID, const uint8_t *data = 0,
- uint32_t packet_id = 0);
- /**
- * \brief Destructor
- */
- ~ProtocolPacket();
+ uint32_t messageID, const uint8_t *data = 0);
/*Serialization*/
/**
@@ -171,14 +157,10 @@ class ProtocolPacket {
*/
size_t packet_size() const;
- /**
- * \brief Getter of message ID
- * \return uint32_t message ID
- */
- uint32_t packet_id() const;
-
/*End of Serialization*/
+ bool operator==(const protocol_handler::ProtocolPacket& other) const;
+
/*Deserialization*/
/**
@@ -189,7 +171,7 @@ class ProtocolPacket {
* \return \saRESULT_CODE Status of serialization
*/
RESULT_CODE deserializePacket(const uint8_t *message,
- uint32_t messageSize);
+ const size_t messageSize);
/**
* \brief Getter of protocol version.
@@ -285,22 +267,16 @@ class ProtocolPacket {
uint32_t payload_size_;
/**
- *\brief Offset for multiframe messages
- */
- uint32_t data_offset_;
-
- /**
- *\brief ID for multiframe messages
- */
- uint32_t packet_id_;
-
- /**
* \brief Connection Identifier
* Obtained from connection_handler
*/
- uint8_t connection_id_;
+ ConnectionID connection_id_;
DISALLOW_COPY_AND_ASSIGN(ProtocolPacket);
};
} // namespace protocol_handler
+/**
+ * @brief Type definition for variable that hold shared pointer to protocolol packet
+ */
+typedef utils::SharedPtr<protocol_handler::ProtocolPacket> ProtocolFramePtr;
#endif // SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PACKET_H_
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_payload.h b/src/components/protocol_handler/include/protocol_handler/protocol_payload.h
index 6fda9bdd9..861d29d4d 100644
--- a/src/components/protocol_handler/include/protocol_handler/protocol_payload.h
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_payload.h
@@ -49,10 +49,10 @@ namespace protocol_handler {
struct ProtocolPayloadHeaderV2 {
ProtocolPayloadHeaderV2()
: rpc_type(kRpcTypeReserved),
- rpc_function_id(0), corellation_id(0), json_size(0) {}
+ rpc_function_id(0), correlation_id(0), json_size(0) {}
RpcType rpc_type;
uint32_t rpc_function_id;
- uint32_t corellation_id;
+ uint32_t correlation_id;
uint32_t json_size;
};
diff --git a/src/components/protocol_handler/src/incoming_data_handler.cc b/src/components/protocol_handler/src/incoming_data_handler.cc
index 0baab6d80..45dc4babf 100644
--- a/src/components/protocol_handler/src/incoming_data_handler.cc
+++ b/src/components/protocol_handler/src/incoming_data_handler.cc
@@ -41,23 +41,27 @@ IncomingDataHandler::IncomingDataHandler()
: header_(), validator_(NULL) {}
void IncomingDataHandler::set_validator(
- const ProtocolPacket::ProtocolHeaderValidator* const validator) {
+ const ProtocolPacket::ProtocolHeaderValidator *const validator) {
validator_ = validator;
}
-static const size_t MIN_HEADER_SIZE = std::min(PROTOCOL_HEADER_V1_SIZE, PROTOCOL_HEADER_V2_SIZE);
+static const size_t MIN_HEADER_SIZE = std::min(PROTOCOL_HEADER_V1_SIZE,
+ PROTOCOL_HEADER_V2_SIZE);
-std::list<ProtocolFramePtr> IncomingDataHandler::ProcessData(const RawMessage& tm_message,
- RESULT_CODE* result) {
+std::list<ProtocolFramePtr> IncomingDataHandler::ProcessData(
+ const RawMessage &tm_message,
+ RESULT_CODE *result,
+ size_t *malformed_occurrence) {
LOG4CXX_AUTO_TRACE(logger_);
- const transport_manager::ConnectionUID connection_id = tm_message.connection_key();
- const uint8_t* data = tm_message.data();
+ DCHECK(result);
+ DCHECK(malformed_occurrence);
+ const transport_manager::ConnectionUID connection_id =
+ tm_message.connection_key();
+ const uint8_t *data = tm_message.data();
const size_t tm_message_size = tm_message.data_size();
if (tm_message_size == 0 || data == NULL) {
LOG4CXX_WARN(logger_, "Wrong raw message " << tm_message_size << " bytes");
- if (result) {
- *result = RESULT_FAIL;
- }
+ *result = RESULT_FAIL;
return std::list<ProtocolFramePtr>();
}
LOG4CXX_DEBUG(logger_, "Processing incoming data of size "
@@ -65,38 +69,32 @@ std::list<ProtocolFramePtr> IncomingDataHandler::ProcessData(const RawMessage& t
ConnectionsDataMap::iterator it = connections_data_.find(connection_id);
if (connections_data_.end() == it) {
LOG4CXX_WARN(logger_, "ProcessData requested for unknown connection");
- if (result) {
- *result = RESULT_FAIL;
- }
+ *result = RESULT_FAIL;
return std::list<ProtocolFramePtr>();
}
- std::vector<uint8_t>& connection_data = it->second;
+ std::vector<uint8_t> &connection_data = it->second;
connection_data.insert(connection_data.end(), data, data + tm_message_size);
LOG4CXX_DEBUG(logger_, "Total data size for connection "
<< connection_id << " is " << connection_data.size());
std::list<ProtocolFramePtr> out_frames;
- while (connection_data.size() >= MIN_HEADER_SIZE) {
- const RESULT_CODE frame_creation_result =
- CreateFrame(connection_data, out_frames, connection_id);
-
- if (RESULT_DEFERRED == frame_creation_result) {
- LOG4CXX_DEBUG(logger_, "Wait next portion of data");
- break;
+ *malformed_occurrence = 0;
+ *result = CreateFrame(connection_data, out_frames, *malformed_occurrence, connection_id);
+ LOG4CXX_DEBUG(logger_, "New data size for connection " << connection_id
+ << " is " << connection_data.size());
+ if (!out_frames.empty()) {
+ LOG4CXX_DEBUG(logger_, "Created and passed " << out_frames.size() <<
+ " packets");
+ } else {
+ if (RESULT_DEFERRED == *result) {
+ LOG4CXX_DEBUG(logger_,
+ "No packets have been created. Waiting next portion of data.");
+ } else {
+ LOG4CXX_WARN(logger_, "No packets have been created.");
}
- if (RESULT_OK != frame_creation_result) {
- LOG4CXX_WARN(logger_, "Packet could not be parsed from data stream");
- // TODO(EZamakhov): add to malformed messages counter
- connection_data.clear();
- if (result) {
- *result = frame_creation_result;
- }
- return out_frames;
- }
- LOG4CXX_DEBUG(logger_,
- "Packet created and passed, new data size for connection "
- << connection_id << " is " << connection_data.size());
}
- if (result) {
+ if (*malformed_occurrence > 0u) {
+ *result = RESULT_MALFORMED_OCCURS;
+ } else {
*result = RESULT_OK;
}
return out_frames;
@@ -104,22 +102,25 @@ std::list<ProtocolFramePtr> IncomingDataHandler::ProcessData(const RawMessage& t
void IncomingDataHandler::AddConnection(
const transport_manager::ConnectionUID connection_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
// Add empty list of session to new connection
connections_data_[connection_id] = ConnectionsDataMap::mapped_type();
}
void IncomingDataHandler::RemoveConnection(
const transport_manager::ConnectionUID connection_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
connections_data_.erase(connection_id);
}
uint32_t IncomingDataHandler::GetPacketSize(
- const ProtocolPacket::ProtocolHeader& header) {
+ const ProtocolPacket::ProtocolHeader &header) {
switch (header.version) {
case PROTOCOL_VERSION_1:
return header.dataSize + PROTOCOL_HEADER_V1_SIZE;
case PROTOCOL_VERSION_2:
case PROTOCOL_VERSION_3:
+ case PROTOCOL_VERSION_4:
return header.dataSize + PROTOCOL_HEADER_V2_SIZE;
default:
LOG4CXX_WARN(logger_, "Unknown version");
@@ -128,38 +129,62 @@ uint32_t IncomingDataHandler::GetPacketSize(
return 0u;
}
-RESULT_CODE IncomingDataHandler::CreateFrame(std::vector<uint8_t>& incoming_data,
- std::list<ProtocolFramePtr>& out_frames,
- const transport_manager::ConnectionUID connection_id) {
+RESULT_CODE IncomingDataHandler::CreateFrame(
+ std::vector<uint8_t> &incoming_data,
+ std::list<ProtocolFramePtr> &out_frames,
+ size_t &malformed_occurrence,
+ const transport_manager::ConnectionUID connection_id) {
LOG4CXX_AUTO_TRACE(logger_);
- if (incoming_data.size() >= MIN_HEADER_SIZE) {
- header_.deserialize(incoming_data.data(), incoming_data.size());
+ bool correct_frame_occurs = true;
+ std::vector<uint8_t>::iterator data_it = incoming_data.begin();
+ size_t data_size = incoming_data.size();
+ while (data_size >= MIN_HEADER_SIZE) {
+ header_.deserialize(&*data_it, data_size);
const RESULT_CODE validate_result =
- validator_ ? validator_->validate(header_) : RESULT_OK;
+ validator_ ? validator_->validate(header_) : RESULT_OK;
+
if (validate_result != RESULT_OK) {
- LOG4CXX_WARN(logger_, "Packet validation failed with error " << validate_result);
- return validate_result;
+ LOG4CXX_WARN(logger_, "Packet validation failed");
+ if(correct_frame_occurs) {
+ ++malformed_occurrence;
+ }
+ correct_frame_occurs = false;
+ ++data_it;
+ --data_size;
+ LOG4CXX_DEBUG(logger_, "Moved to the next byte " << std::hex
+ << static_cast<const void *>(&*data_it));
+ continue;
}
- LOG4CXX_DEBUG(logger_, "Packet size " << header_.dataSize);
+ LOG4CXX_DEBUG(logger_, "Payload size " << header_.dataSize);
const uint32_t packet_size = GetPacketSize(header_);
if (packet_size <= 0) {
LOG4CXX_WARN(logger_, "Null packet size");
- return RESULT_FAIL;
+ ++data_it;
+ --data_size;
+ LOG4CXX_DEBUG(logger_, "Moved to the next byte " << std::hex
+ << static_cast<const void *>(&*data_it));
+ continue;
}
- if (incoming_data.size() < packet_size) {
+ if (data_size < packet_size) {
LOG4CXX_DEBUG(logger_, "Packet data is not available yet");
+ incoming_data.erase(incoming_data.begin(), data_it);
return RESULT_DEFERRED;
}
ProtocolFramePtr frame(new protocol_handler::ProtocolPacket(connection_id));
const RESULT_CODE deserialize_result =
- frame->deserializePacket(&incoming_data[0], packet_size);
+ frame->deserializePacket(&*data_it, packet_size);
if (deserialize_result != RESULT_OK) {
- LOG4CXX_WARN(logger_, "Packet deserialization failed with error " << deserialize_result);
- return deserialize_result;
+ LOG4CXX_WARN(logger_, "Packet deserialization failed");
+ incoming_data.erase(incoming_data.begin(), data_it);
+ return RESULT_FAIL;
}
out_frames.push_back(frame);
- incoming_data.erase(incoming_data.begin(), incoming_data.begin() + packet_size);
+ correct_frame_occurs = true;
+
+ data_it += packet_size;
+ data_size -= packet_size;
}
+ incoming_data.erase(incoming_data.begin(), data_it);
return RESULT_OK;
}
} // namespace protocol_handler
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index 454287595..3289c6b4d 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -37,6 +37,7 @@
#include "connection_handler/connection_handler_impl.h"
#include "config_profile/profile.h"
#include "utils/byte_order.h"
+#include "protocol/common.h"
#ifdef ENABLE_SECURITY
#include "security_manager/ssl_context.h"
@@ -54,108 +55,28 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "ProtocolHandler")
std::string ConvertPacketDataToString(const uint8_t *data,
const size_t data_size);
-const size_t kStackSize = 32768;
-
-class ProtocolHandlerImpl::IncomingDataHandler {
- public:
- IncomingDataHandler() : connections_data_() {}
-
- bool ProcessData(const RawMessagePtr tm_message,
- std::vector<ProtocolFramePtr> *out_frames) {
- DCHECK(tm_message);
- DCHECK(out_frames != NULL);
- const ConnectionID connection_id = tm_message->connection_key();
- const uint8_t *data = tm_message->data();
- const size_t size = tm_message->data_size();
- DCHECK(size > 0); DCHECK(data != NULL);
- LOG4CXX_TRACE(logger_, "Start of processing incoming data of size "
- << size << " for connection " << connection_id);
- const uint32_t kBytesForSizeDetection = 8;
- ConnectionsData::iterator it = connections_data_.find(connection_id);
- if (connections_data_.end() == it) {
- LOG4CXX_ERROR(logger_, "ProcessData requested for unknown connection");
- return false;
- }
- std::vector<uint8_t> &connection_data = it->second;
- connection_data.insert(connection_data.end(), data, data + size);
-
- LOG4CXX_TRACE(logger_, "Total data size for connection "
- << connection_id << " is "
- << connection_data.size());
- while (connection_data.size() >= kBytesForSizeDetection) {
- const uint32_t packet_size = GetPacketSize(&connection_data[0]);
- if (0 == packet_size) {
- LOG4CXX_ERROR(logger_, "Failed to get packet size");
- return false;
- }
- LOG4CXX_TRACE(logger_, "Packet size " << packet_size);
- if (connection_data.size() >= packet_size) {
- ProtocolFramePtr frame(new protocol_handler::ProtocolPacket(
- connection_id, &connection_data[0], packet_size));
- out_frames->push_back(frame);
- connection_data.erase(connection_data.begin(),
- connection_data.begin() + packet_size);
- LOG4CXX_TRACE(logger_,
- "Packet created and passed, new data size for connection "
- << connection_id << " is " << connection_data.size());
- } else {
- LOG4CXX_TRACE(logger_, "Packet data is not available yet");
- return true;
- }
- }
- return true;
- }
-
- void AddConnection(ConnectionID connection_id) {
- // Add empty list of session to new connection
- connections_data_[connection_id] = std::vector<uint8_t>();
- }
+/**
+ * @brief Function returns supported SDL Protocol Version,
+ */
+uint8_t SupportedSDLProtocolVersion();
- void RemoveConnection(ConnectionID connection_id) {
- connections_data_.erase(connection_id);
- }
- private:
- /**
- * @brief Returns size of frame to be formed from raw bytes.
- * expects first bytes of message which will be treated as frame header.
- */
- uint32_t GetPacketSize(unsigned char *received_bytes) {
- DCHECK(received_bytes != NULL);
- unsigned char offset = sizeof(uint32_t);
- unsigned char version = received_bytes[0] >> 4u;
- uint32_t frame_body_size = received_bytes[offset++] << 24u;
- frame_body_size |= received_bytes[offset++] << 16u;
- frame_body_size |= received_bytes[offset++] << 8u;
- frame_body_size |= received_bytes[offset++];
-
- uint32_t required_size = frame_body_size;
- switch (version) {
- case PROTOCOL_VERSION_1:
- required_size += PROTOCOL_HEADER_V1_SIZE;
- break;
- case PROTOCOL_VERSION_3:
- case PROTOCOL_VERSION_2:
- required_size += PROTOCOL_HEADER_V2_SIZE;
- break;
- default:
- LOG4CXX_ERROR(logger_, "Unknown protocol version.");
- return 0;
- }
- return required_size;
- }
-
- typedef std::map<ConnectionID, std::vector<uint8_t> > ConnectionsData;
- ConnectionsData connections_data_;
-};
+const size_t kStackSize = 32768;
ProtocolHandlerImpl::ProtocolHandlerImpl(
- transport_manager::TransportManager *transport_manager_param)
+ transport_manager::TransportManager *transport_manager_param,
+ size_t message_frequency_time, size_t message_frequency_count,
+ bool malformed_message_filtering,
+ size_t malformed_message_frequency_time, size_t malformed_message_frequency_count)
: protocol_observers_(),
session_observer_(0),
transport_manager_(transport_manager_param),
kPeriodForNaviAck(5),
- incoming_data_handler_(new IncomingDataHandler),
+ message_max_frequency_(message_frequency_count),
+ message_frequency_time_(message_frequency_time),
+ malformed_message_filtering_(malformed_message_filtering),
+ malformed_message_max_frequency_(malformed_message_frequency_count),
+ malformed_message_frequency_time_(malformed_message_frequency_time),
#ifdef ENABLE_SECURITY
security_manager_(NULL),
#endif // ENABLE_SECURITY
@@ -168,9 +89,32 @@ ProtocolHandlerImpl::ProtocolHandlerImpl(
#endif // TIME_TESTER
{
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
+ protocol_header_validator_.set_max_payload_size(profile::Profile::instance()->maximum_payload_size());
+ incoming_data_handler_.set_validator(&protocol_header_validator_);
+
+ if (message_frequency_time_ > 0u &&
+ message_max_frequency_ > 0u) {
+ message_meter_.set_time_range(message_frequency_time_);
+ LOG4CXX_DEBUG(logger_, "Frequency meter is enabled ( " << message_max_frequency_
+ << " per " << message_frequency_time_ << " mSecond)");
+ } else {
+ LOG4CXX_WARN(logger_, "Frequency meter is disabled");
+ }
- LOG4CXX_TRACE_EXIT(logger_);
+ if (malformed_message_filtering_) {
+ if(malformed_message_frequency_time_ > 0u &&
+ malformed_message_max_frequency_ > 0u) {
+ malformed_message_meter_.set_time_range(malformed_message_frequency_time_);
+ LOG4CXX_DEBUG(logger_, "Malformed frequency meter is enabled ( " << malformed_message_max_frequency_
+ << " per " << malformed_message_frequency_time_ << " mSecond)");
+ } else {
+ LOG4CXX_WARN(logger_, "Malformed frequency meter is disabled");
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Malformed message filtering is disabled."
+ << "Connection will be close on first malformed message detection");
+ }
}
ProtocolHandlerImpl::~ProtocolHandlerImpl() {
@@ -191,15 +135,13 @@ void ProtocolHandlerImpl::AddProtocolObserver(ProtocolObserver *observer) {
}
void ProtocolHandlerImpl::RemoveProtocolObserver(ProtocolObserver* observer) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
if (!observer) {
LOG4CXX_ERROR(logger_, "Invalid (NULL) pointer to IProtocolObserver.");
- LOG4CXX_TRACE_EXIT(logger_);
return;
}
sync_primitives::AutoLock lock(protocol_observers_lock_);
protocol_observers_.erase(observer);
- LOG4CXX_TRACE_EXIT(logger_);
}
void ProtocolHandlerImpl::set_session_observer(SessionObserver *observer) {
@@ -233,17 +175,9 @@ void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id,
uint32_t hash_id,
uint8_t service_type,
bool protection) {
- LOG4CXX_TRACE_ENTER(logger_);
-
- uint8_t protocolVersion;
+ LOG4CXX_AUTO_TRACE(logger_);
- if (0 == profile::Profile::instance()->heart_beat_timeout()) {
- protocolVersion = PROTOCOL_VERSION_2;
- LOG4CXX_INFO(logger_, "Heart beat timeout == 0 => SET PROTOCOL_VERSION_2");
- } else {
- protocolVersion = PROTOCOL_VERSION_3;
- LOG4CXX_INFO(logger_, "Heart beat timeout != 0 => SET PROTOCOL_VERSION_3");
- }
+ uint8_t protocolVersion = SupportedSDLProtocolVersion();
ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
protocolVersion, protection, FRAME_TYPE_CONTROL,
@@ -255,19 +189,18 @@ void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id,
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, false));
- LOG4CXX_INFO(logger_,
+ LOG4CXX_DEBUG(logger_,
"SendStartSessionAck() for connection " << connection_id
<< " for service_type " << static_cast<int32_t>(service_type)
<< " session_id " << static_cast<int32_t>(session_id)
<< " protection " << (protection ? "ON" : "OFF"));
- LOG4CXX_TRACE_EXIT(logger_);
}
void ProtocolHandlerImpl::SendStartSessionNAck(ConnectionID connection_id,
uint8_t session_id,
uint8_t protocol_version,
uint8_t service_type) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
protocol_version, PROTECTION_OFF, FRAME_TYPE_CONTROL,
@@ -277,18 +210,17 @@ void ProtocolHandlerImpl::SendStartSessionNAck(ConnectionID connection_id,
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, false));
- LOG4CXX_INFO(logger_,
+ LOG4CXX_DEBUG(logger_,
"SendStartSessionNAck() for connection " << connection_id
<< " for service_type " << static_cast<int32_t>(service_type)
<< " session_id " << static_cast<int32_t>(session_id));
- LOG4CXX_TRACE_EXIT(logger_);
}
void ProtocolHandlerImpl::SendEndSessionNAck(ConnectionID connection_id,
uint32_t session_id,
uint8_t protocol_version,
uint8_t service_type) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
protocol_version, PROTECTION_OFF, FRAME_TYPE_CONTROL,
@@ -298,17 +230,16 @@ void ProtocolHandlerImpl::SendEndSessionNAck(ConnectionID connection_id,
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, false));
- LOG4CXX_INFO(logger_, "SendEndSessionNAck() for connection " << connection_id
+ LOG4CXX_DEBUG(logger_, "SendEndSessionNAck() for connection " << connection_id
<< " for service_type " << static_cast<int32_t>(service_type)
<< " session_id " << static_cast<int32_t>(session_id));
- LOG4CXX_TRACE_EXIT(logger_);
}
void ProtocolHandlerImpl::SendEndSessionAck(ConnectionID connection_id,
uint8_t session_id,
uint8_t protocol_version,
uint8_t service_type) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
protocol_version, PROTECTION_OFF, FRAME_TYPE_CONTROL,
@@ -318,61 +249,84 @@ void ProtocolHandlerImpl::SendEndSessionAck(ConnectionID connection_id,
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, false));
- LOG4CXX_INFO(logger_,
+ LOG4CXX_DEBUG(logger_,
"SendEndSessionAck() for connection " << connection_id
<< " for service_type " << static_cast<int32_t>(service_type)
<< " session_id " << static_cast<int32_t>(session_id));
- LOG4CXX_TRACE_EXIT(logger_);
}
-void ProtocolHandlerImpl::SendEndSession(int32_t connection_id,
- uint8_t session_id) {
- LOG4CXX_TRACE_ENTER(logger_);
+void ProtocolHandlerImpl::SendEndServicePrivate(int32_t connection_id,
+ uint8_t session_id,
+ uint8_t service_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
- ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
- PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
- SERVICE_TYPE_RPC, FRAME_DATA_END_SERVICE, session_id, 0,
+ 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, FRAME_DATA_END_SERVICE, session_id, 0,
message_counters_[session_id]++));
- raw_ford_messages_to_mobile_.PostMessage(
+ raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, false));
+ LOG4CXX_DEBUG(logger_, "SendEndSession() for connection " << connection_id
+ << " for service_type " << service_type
+ << " session_id " << static_cast<int32_t>(session_id));
+ } else {
+ LOG4CXX_WARN(logger_, "SendEndSession is failed connection or session does not exist");
+ }
+}
- LOG4CXX_INFO(logger_, "SendEndSession() for connection " << connection_id
- << " for service_type " << static_cast<int32_t>(SERVICE_TYPE_RPC)
- << " session_id " << static_cast<int32_t>(session_id));
- LOG4CXX_TRACE_EXIT(logger_);
+void ProtocolHandlerImpl::SendEndSession(int32_t connection_id,
+ uint8_t session_id) {
+ SendEndServicePrivate(connection_id, session_id, SERVICE_TYPE_RPC);
+}
+
+void ProtocolHandlerImpl::SendEndService(int32_t connection_id,
+ uint8_t session_id,
+ uint8_t service_type) {
+ SendEndServicePrivate(connection_id, session_id, service_type);
}
RESULT_CODE ProtocolHandlerImpl::SendHeartBeatAck(ConnectionID connection_id,
uint8_t session_id,
uint32_t message_id) {
- LOG4CXX_TRACE_ENTER(logger_);
-
- ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
- PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
- SERVICE_TYPE_CONTROL, FRAME_DATA_HEART_BEAT_ACK, session_id,
- 0u, message_id));
-
- raw_ford_messages_to_mobile_.PostMessage(
- impl::RawFordMessageToMobile(ptr, false));
-
- LOG4CXX_TRACE_EXIT(logger_);
- return RESULT_OK;
+ 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_HEART_BEAT_ACK, session_id,
+ 0u, message_id));
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+ return RESULT_OK;
+ }
+ LOG4CXX_WARN(logger_, "SendHeartBeatAck is failed connection or session does not exist");
+ return RESULT_FAIL;
}
void ProtocolHandlerImpl::SendHeartBeat(int32_t connection_id,
uint8_t session_id) {
- LOG4CXX_TRACE_ENTER(logger_);
-
- ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
- PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
- SERVICE_TYPE_CONTROL, FRAME_DATA_HEART_BEAT, session_id,
- 0u, message_counters_[session_id]++));
-
- raw_ford_messages_to_mobile_.PostMessage(
- impl::RawFordMessageToMobile(ptr, false));
+ 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_HEART_BEAT, session_id,
+ 0u, message_counters_[session_id]++));
- LOG4CXX_TRACE_EXIT(logger_);
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+ LOG4CXX_DEBUG(logger_, "SendHeartBeat finished successfully");
+ } else {
+ LOG4CXX_WARN(logger_, "SendHeartBeat is failed connection or session does not exist");
+ }
}
void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
@@ -380,15 +334,13 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
#ifdef TIME_TESTER
const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
#endif // TIME_TESTER
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
if (!message) {
LOG4CXX_ERROR(logger_,
"Invalid message for sending to mobile app is received.");
- LOG4CXX_TRACE_EXIT(logger_);
return;
}
-
if (!session_observer_) {
LOG4CXX_ERROR(
logger_,
@@ -406,24 +358,35 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
metric_observer_->StartMessageProcess(message_id, start_time);
}
#endif // TIME_TESTER
-
- const uint32_t header_size = (PROTOCOL_VERSION_1 == message->protocol_version())
- ? PROTOCOL_HEADER_V1_SIZE : PROTOCOL_HEADER_V2_SIZE;
- uint32_t maxDataSize = MAXIMUM_FRAME_DATA_SIZE - header_size;
+ const size_t max_frame_size =
+ profile::Profile::instance()->maximum_payload_size();
+ size_t frame_size = MAXIMUM_FRAME_DATA_V2_SIZE;
+ switch (message->protocol_version()) {
+ case PROTOCOL_VERSION_3:
+ case PROTOCOL_VERSION_4:
+ frame_size = max_frame_size > MAXIMUM_FRAME_DATA_V2_SIZE ?
+ max_frame_size : MAXIMUM_FRAME_DATA_V2_SIZE;
+ break;
+ default:
+ break;
+ }
#ifdef ENABLE_SECURITY
const security_manager::SSLContext *ssl_context = session_observer_->
GetSSLContext(message->connection_key(), message->service_type());
if (ssl_context && ssl_context->IsInitCompleted()) {
- maxDataSize = ssl_context->get_max_block_size(maxDataSize);
- DCHECK(maxDataSize);
+ const size_t max_block_size = ssl_context->get_max_block_size(frame_size);
+ DCHECK(max_block_size > 0);
+ if (max_block_size > 0) {
+ frame_size = max_block_size;
+ LOG4CXX_DEBUG(logger_, "Security set new optimal packet size " << frame_size);
+ } else {
+ LOG4CXX_ERROR(logger_, "Security could not return max block size, use the origin one");
+ }
}
- LOG4CXX_DEBUG(logger_, "Optimal packet size is " << maxDataSize);
+ LOG4CXX_DEBUG(logger_, "Optimal packet size is " << frame_size);
#endif // ENABLE_SECURITY
- DCHECK(MAXIMUM_FRAME_DATA_SIZE > maxDataSize);
-
-
- if (message->data_size() <= maxDataSize) {
+ if (message->data_size() <= frame_size) {
RESULT_CODE result = SendSingleFrameMessage(connection_handle, sessionID,
message->protocol_version(),
message->service_type(),
@@ -435,16 +398,16 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
"ProtocolHandler failed to send single frame message.");
}
} else {
- LOG4CXX_INFO_EXT(
+ LOG4CXX_DEBUG(
logger_,
- "Message will be sent in multiple frames; max size is " << maxDataSize);
+ "Message will be sent in multiple frames; max frame size is " << frame_size);
RESULT_CODE result = SendMultiFrameMessage(connection_handle, sessionID,
message->protocol_version(),
message->service_type(),
message->data_size(),
message->data(),
- maxDataSize, final_message);
+ frame_size, final_message);
if (result != RESULT_OK) {
LOG4CXX_ERROR(logger_,
"ProtocolHandler failed to send multiframe messages.");
@@ -460,35 +423,49 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
metric_observer_->EndMessageProcess(metric);
}
#endif
- LOG4CXX_TRACE_EXIT(logger_);
}
void ProtocolHandlerImpl::OnTMMessageReceived(const RawMessagePtr tm_message) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
- if (tm_message) {
- LOG4CXX_INFO(logger_,
- "Received data from TM with connection id " << tm_message->connection_key() <<
- " msg data_size " << tm_message->data_size());
- } else {
+ if (!tm_message) {
LOG4CXX_ERROR(
logger_,
"Invalid incoming message received in"
<< " ProtocolHandler from Transport Manager.");
- LOG4CXX_TRACE_EXIT(logger_);
return;
}
- std::vector<ProtocolFramePtr> protocol_frames;
- const bool ok =
- incoming_data_handler_->ProcessData(tm_message, &protocol_frames);
- if (!ok) {
- LOG4CXX_ERROR(logger_,
- "Incoming data processing failed. Terminating connection.");
- transport_manager_->DisconnectForce(tm_message->connection_key());
+ const uint32_t connection_key = tm_message->connection_key();
+ LOG4CXX_DEBUG(logger_,
+ "Received data from TM with connection id " << connection_key <<
+ " msg data_size " << tm_message->data_size());
+
+ RESULT_CODE result;
+ size_t malformed_occurs = false;
+ const std::list<ProtocolFramePtr> protocol_frames =
+ incoming_data_handler_.ProcessData(*tm_message, &result, &malformed_occurs);
+ LOG4CXX_DEBUG(logger_, "Proccessed " << protocol_frames.size() << "frames");
+ if (result != RESULT_OK) {
+ if (result == RESULT_MALFORMED_OCCURS) {
+ LOG4CXX_WARN(logger_, "Malformed message occurs, connection id "
+ << connection_key);
+ if (!malformed_message_filtering_) {
+ LOG4CXX_DEBUG(logger_, "Malformed message filterign disabled");
+ if (session_observer_) {
+ session_observer_->OnMalformedMessageCallback(connection_key);
+ }
+ // For tracking only malformed occurrence check outpute
+ } else if(!protocol_frames.empty()) {
+ TrackMalformedMessage(connection_key, malformed_occurs);
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "Incoming data processing failed.");
+ transport_manager_->DisconnectForce(connection_key);
+ }
}
- for (std::vector<ProtocolFramePtr>::const_iterator it =
+ for (std::list<ProtocolFramePtr>::const_iterator it =
protocol_frames.begin(); it != protocol_frames.end(); ++it) {
#ifdef TIME_TESTER
const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
@@ -510,7 +487,6 @@ void ProtocolHandlerImpl::OnTMMessageReceived(const RawMessagePtr tm_message) {
raw_ford_messages_from_mobile_.PostMessage(msg);
}
- LOG4CXX_TRACE_EXIT(logger_);
}
void ProtocolHandlerImpl::OnTMMessageReceiveFailed(
@@ -520,6 +496,7 @@ void ProtocolHandlerImpl::OnTMMessageReceiveFailed(
}
void ProtocolHandlerImpl::NotifySubscribers(const RawMessagePtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(protocol_observers_lock_);
for (ProtocolObservers::iterator it = protocol_observers_.begin();
protocol_observers_.end() != it; ++it) {
@@ -532,9 +509,6 @@ void ProtocolHandlerImpl::OnTMMessageSend(const RawMessagePtr message) {
uint32_t connection_handle = 0;
uint8_t sessionID = 0;
- const ProtocolPacket sent_message(message->connection_key(),
- message->data(),
- message->data_size());
session_observer_->PairFromKey(message->connection_key(),
&connection_handle,
@@ -550,6 +524,13 @@ void ProtocolHandlerImpl::OnTMMessageSend(const RawMessagePtr message) {
return;
}
+ ProtocolPacket sent_message(message->connection_key());
+ const RESULT_CODE result = sent_message.deserializePacket(message->data(),
+ message->data_size());
+ if (result != RESULT_OK) {
+ LOG4CXX_ERROR(logger_, "Error while message deserialization.");
+ return;
+ }
std::map<uint8_t, uint32_t>::iterator it =
sessions_last_message_id_.find(sent_message.session_id());
@@ -582,19 +563,20 @@ void ProtocolHandlerImpl::OnTMMessageSendFailed(
void ProtocolHandlerImpl::OnConnectionEstablished(
const transport_manager::DeviceInfo &device_info,
const transport_manager::ConnectionUID &connection_id) {
- incoming_data_handler_->AddConnection(connection_id);
+ incoming_data_handler_.AddConnection(connection_id);
}
void ProtocolHandlerImpl::OnConnectionClosed(
const transport_manager::ConnectionUID &connection_id) {
- incoming_data_handler_->RemoveConnection(connection_id);
+ incoming_data_handler_.RemoveConnection(connection_id);
+ message_meter_.ClearIdentifiers();
+ malformed_message_meter_.ClearIdentifiers();
}
RESULT_CODE ProtocolHandlerImpl::SendFrame(const ProtocolFramePtr packet) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
if (!packet) {
LOG4CXX_ERROR(logger_, "Failed to send empty packet.");
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_FAIL;
}
#ifdef ENABLE_SECURITY
@@ -602,12 +584,11 @@ RESULT_CODE ProtocolHandlerImpl::SendFrame(const ProtocolFramePtr packet) {
const RESULT_CODE result = EncryptFrame(packet);
if (result != RESULT_OK) {
LOG4CXX_WARN(logger_, "Error frame encryption. Frame droped.");
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_FAIL;
}
#endif // ENABLE_SECURITY
- LOG4CXX_INFO_EXT(logger_, "Packet to be sent: " <<
+ LOG4CXX_DEBUG(logger_, "Packet to be sent: " <<
ConvertPacketDataToString(packet->data(), packet->data_size()) <<
" of size: " << packet->data_size());
const RawMessagePtr message_to_send = packet->serializePacket();
@@ -615,32 +596,28 @@ RESULT_CODE ProtocolHandlerImpl::SendFrame(const ProtocolFramePtr packet) {
LOG4CXX_ERROR(logger_, "Serialization error");
return RESULT_FAIL;
};
- LOG4CXX_INFO(logger_,
+ LOG4CXX_DEBUG(logger_,
"Message to send with connection id " <<
static_cast<int>(packet->connection_id()));
if (!transport_manager_) {
LOG4CXX_WARN(logger_, "No Transport Manager found.");
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_FAIL;
}
if (transport_manager::E_SUCCESS !=
transport_manager_->SendMessageToDevice(message_to_send)) {
LOG4CXX_WARN(logger_, "Can't send message to device");
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_FAIL;
};
-
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_OK;
}
RESULT_CODE ProtocolHandlerImpl::SendSingleFrameMessage(
- ConnectionID connection_id, const uint8_t session_id,
- uint32_t protocol_version, const uint8_t service_type,
- size_t data_size, const uint8_t *data,
+ const ConnectionID connection_id, const uint8_t session_id,
+ const uint32_t protocol_version, const uint8_t service_type,
+ const size_t data_size, const uint8_t *data,
const bool is_final_message) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
protocol_version, PROTECTION_OFF, FRAME_TYPE_SINGLE, service_type, FRAME_DATA_SINGLE,
@@ -648,37 +625,35 @@ RESULT_CODE ProtocolHandlerImpl::SendSingleFrameMessage(
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, is_final_message));
-
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_OK;
}
RESULT_CODE ProtocolHandlerImpl::SendMultiFrameMessage(
- ConnectionID connection_id, const uint8_t session_id,
- uint32_t protocol_version, const uint8_t service_type,
+ const ConnectionID connection_id, const uint8_t session_id,
+ const uint8_t protocol_version, const uint8_t service_type,
const size_t data_size, const uint8_t *data,
- const size_t maxdata_size, const bool is_final_message) {
- LOG4CXX_TRACE_ENTER(logger_);
+ const size_t max_frame_size, const bool is_final_message) {
+ LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_INFO_EXT(
- logger_, " data size " << data_size << " maxdata_size " << maxdata_size);
+ LOG4CXX_DEBUG(
+ logger_, " data size " << data_size << " max_frame_size " << max_frame_size);
// remainder of last frame
- const size_t lastframe_remainder = data_size % maxdata_size;
+ const size_t lastframe_remainder = data_size % max_frame_size;
// size of last frame (full fill or not)
const size_t lastframe_size =
- lastframe_remainder > 0 ? lastframe_remainder : maxdata_size;
+ lastframe_remainder > 0 ? lastframe_remainder : max_frame_size;
- const size_t frames_count = data_size / maxdata_size +
+ const size_t frames_count = data_size / max_frame_size +
// add last frame if not empty
(lastframe_remainder > 0 ? 1 : 0);
- LOG4CXX_INFO_EXT(
+ LOG4CXX_DEBUG(
logger_,
"Data " << data_size << " bytes in " << frames_count <<
" frames with last frame size " << lastframe_size);
- DCHECK(maxdata_size >= FIRST_FRAME_DATA_SIZE);
+ DCHECK(max_frame_size >= FIRST_FRAME_DATA_SIZE);
DCHECK(FIRST_FRAME_DATA_SIZE >= 8);
uint8_t out_data[FIRST_FRAME_DATA_SIZE];
out_data[0] = data_size >> 24;
@@ -691,7 +666,7 @@ RESULT_CODE ProtocolHandlerImpl::SendMultiFrameMessage(
out_data[6] = frames_count >> 8;
out_data[7] = frames_count;
- // TODO(EZamakhov): investigate message_id for CONSECUTIVE frames
+ // TODO(EZamakhov): investigate message_id for CONSECUTIVE frames - APPLINK-9531
const uint8_t message_id = message_counters_[session_id]++;
const ProtocolFramePtr firstPacket(
new protocol_handler::ProtocolPacket(
@@ -701,11 +676,11 @@ RESULT_CODE ProtocolHandlerImpl::SendMultiFrameMessage(
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(firstPacket, false));
- LOG4CXX_INFO_EXT(logger_, "First frame is sent.");
+ LOG4CXX_DEBUG(logger_, "First frame is sent.");
for (uint32_t i = 0; i < frames_count; ++i) {
const bool is_last_frame = (i == (frames_count - 1));
- const size_t frame_size = is_last_frame ? lastframe_size : maxdata_size;
+ const size_t frame_size = is_last_frame ? lastframe_size : max_frame_size;
const uint8_t data_type =
is_last_frame
? FRAME_DATA_LAST_CONSECUTIVE
@@ -715,48 +690,43 @@ RESULT_CODE ProtocolHandlerImpl::SendMultiFrameMessage(
const ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
protocol_version, PROTECTION_OFF, FRAME_TYPE_CONSECUTIVE,
service_type, data_type, session_id, frame_size, message_id,
- data + maxdata_size * i));
+ data + max_frame_size * i));
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, is_final_packet));
+ LOG4CXX_DEBUG(logger_, '#' << i << " frame is sent.");
}
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_OK;
}
RESULT_CODE ProtocolHandlerImpl::HandleMessage(ConnectionID connection_id,
const ProtocolFramePtr packet) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
switch (packet->frame_type()) {
case FRAME_TYPE_CONTROL:
LOG4CXX_TRACE(logger_, "handleMessage() - case FRAME_TYPE_CONTROL");
- LOG4CXX_TRACE_EXIT(logger_);
return HandleControlMessage(connection_id, packet);
case FRAME_TYPE_SINGLE:
- LOG4CXX_TRACE_EXIT(logger_);
+ LOG4CXX_TRACE(logger_, "handleMessage() - case FRAME_TYPE_SINGLE");
return HandleSingleFrameMessage(connection_id, packet);
case FRAME_TYPE_FIRST:
case FRAME_TYPE_CONSECUTIVE:
- LOG4CXX_TRACE(logger_, "handleMessage() - case FRAME_TYPE_CONSECUTIVE");
- LOG4CXX_TRACE_EXIT(logger_);
+ LOG4CXX_TRACE(logger_, "handleMessage() - case FRAME_TYPE_FIRST or FRAME_TYPE_CONSECUTIVE");
return HandleMultiFrameMessage(connection_id, packet);
default: {
LOG4CXX_WARN(logger_, "handleMessage() - case unknown frame type"
<< packet->frame_type());
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_FAIL;
}
}
-
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_OK;
}
RESULT_CODE ProtocolHandlerImpl::HandleSingleFrameMessage(
ConnectionID connection_id, const ProtocolFramePtr packet) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_INFO(logger_,
+ LOG4CXX_DEBUG(logger_,
"FRAME_TYPE_SINGLE message of size " << packet->data_size() << "; message "
<< ConvertPacketDataToString(packet->data(), packet->data_size()));
@@ -764,7 +734,6 @@ RESULT_CODE ProtocolHandlerImpl::HandleSingleFrameMessage(
LOG4CXX_ERROR(logger_,
"Cannot handle message from Transport"
<< " Manager: ISessionObserver doesn't exist.");
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_FAIL;
}
@@ -779,7 +748,6 @@ RESULT_CODE ProtocolHandlerImpl::HandleSingleFrameMessage(
packet->service_type(),
packet->payload_size()));
if (!rawMessage) {
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_FAIL;
}
#ifdef TIME_TESTER
@@ -795,32 +763,30 @@ RESULT_CODE ProtocolHandlerImpl::HandleSingleFrameMessage(
// TODO(EZamakhov): check service in session
NotifySubscribers(rawMessage);
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_OK;
}
RESULT_CODE ProtocolHandlerImpl::HandleMultiFrameMessage(
ConnectionID connection_id, const ProtocolFramePtr packet) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
if (!session_observer_) {
LOG4CXX_ERROR(logger_, "No ISessionObserver set.");
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_FAIL;
}
const uint32_t key = session_observer_->KeyFromPair(connection_id,
packet->session_id());
- LOG4CXX_INFO_EXT(
+ LOG4CXX_DEBUG(
logger_,
"Packet " << packet << "; session id " << static_cast<int32_t>(key));
if (packet->frame_type() == FRAME_TYPE_FIRST) {
- LOG4CXX_INFO(logger_, "handleMultiFrameMessage() - FRAME_TYPE_FIRST "
+ LOG4CXX_DEBUG(logger_, "handleMultiFrameMessage() - FRAME_TYPE_FIRST "
<< packet->data_size());
incomplete_multi_frame_messages_[key] = packet;
} else {
- LOG4CXX_INFO(logger_, "handleMultiFrameMessage() - Consecutive frame");
+ LOG4CXX_DEBUG(logger_, "handleMultiFrameMessage() - Consecutive frame");
std::map<int32_t, ProtocolFramePtr>::iterator it =
incomplete_multi_frame_messages_.find(key);
@@ -828,8 +794,6 @@ RESULT_CODE ProtocolHandlerImpl::HandleMultiFrameMessage(
if (it == incomplete_multi_frame_messages_.end()) {
LOG4CXX_ERROR(
logger_, "Frame of multiframe message for non-existing session id");
-
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_FAIL;
}
@@ -837,13 +801,11 @@ RESULT_CODE ProtocolHandlerImpl::HandleMultiFrameMessage(
!= RESULT_OK) {
LOG4CXX_ERROR(logger_,
"Failed to append frame for multiframe message.");
-
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_FAIL;
}
if (packet->frame_data() == FRAME_DATA_LAST_CONSECUTIVE) {
- LOG4CXX_INFO(
+ LOG4CXX_DEBUG(
logger_,
"Last frame of multiframe message size " << packet->data_size()
<< "; connection key " << key);
@@ -853,8 +815,6 @@ RESULT_CODE ProtocolHandlerImpl::HandleMultiFrameMessage(
LOG4CXX_ERROR(
logger_,
"Cannot handle multiframe message: no IProtocolObserver is set.");
-
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_FAIL;
}
}
@@ -871,14 +831,13 @@ RESULT_CODE ProtocolHandlerImpl::HandleMultiFrameMessage(
completePacket->service_type(),
completePacket->payload_size()));
- LOG4CXX_INFO(logger_,
+ LOG4CXX_DEBUG(logger_,
"total_data_bytes " << completePacket->total_data_bytes() <<
" packet_size " << completePacket->packet_size() <<
" data size " << completePacket->data_size() <<
" payload_size " << completePacket->payload_size());
if (!rawMessage) {
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_FAIL;
}
@@ -896,18 +855,15 @@ RESULT_CODE ProtocolHandlerImpl::HandleMultiFrameMessage(
incomplete_multi_frame_messages_.erase(it);
}
}
-
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_OK;
}
RESULT_CODE ProtocolHandlerImpl::HandleControlMessage(
ConnectionID connection_id, const ProtocolFramePtr packet) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
if (!session_observer_) {
LOG4CXX_ERROR(logger_, "ISessionObserver is not set.");
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_FAIL;
}
@@ -919,7 +875,6 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessage(
case FRAME_DATA_HEART_BEAT: {
LOG4CXX_DEBUG(logger_,
"Received heart beat for connection " << connection_id);
- LOG4CXX_TRACE_EXIT(logger_);
return HandleControlMessageHeartBeat(connection_id, *(packet.get()));
}
case FRAME_DATA_HEART_BEAT_ACK: {
@@ -931,7 +886,6 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessage(
LOG4CXX_WARN(logger_,
"Control message of type " << static_cast<int>(packet->frame_data())
<< " ignored");
- LOG4CXX_TRACE_EXIT(logger_);
return RESULT_OK;
}
return RESULT_OK;
@@ -954,8 +908,7 @@ uint32_t get_hash_id(const ProtocolPacket &packet) {
RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession(
ConnectionID connection_id, const ProtocolPacket &packet) {
- LOG4CXX_INFO(logger_,
- "ProtocolHandlerImpl::HandleControlMessageEndSession()");
+ LOG4CXX_AUTO_TRACE(logger_);
const uint8_t current_session_id = packet.session_id();
const uint32_t hash_id = get_hash_id(packet);
@@ -970,7 +923,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession(
packet.protocol_version(), service_type);
message_counters_.erase(current_session_id);
} else {
- LOG4CXX_INFO_EXT(
+ LOG4CXX_WARN(
logger_,
"Refused to end session " << static_cast<int>(service_type) << " type.");
SendEndSessionNAck(connection_id, current_session_id, packet.protocol_version(),
@@ -1034,6 +987,7 @@ class StartSessionHandler : public security_manager::SecurityManagerListener {
delete this;
return true;
}
+
private:
const uint32_t connection_key_;
ProtocolHandlerImpl *protocol_handler_;
@@ -1050,7 +1004,7 @@ class StartSessionHandler : public security_manager::SecurityManagerListener {
RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
ConnectionID connection_id, const ProtocolPacket &packet) {
- LOG4CXX_TRACE(logger_,
+ LOG4CXX_DEBUG(logger_,
"Protocol version: " <<
static_cast<int>(packet.protocol_version()));
const ServiceType service_type = ServiceTypeFromByte(packet.service_type());
@@ -1125,53 +1079,117 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat(
ConnectionID connection_id, const ProtocolPacket &packet) {
- LOG4CXX_INFO(
+ LOG4CXX_DEBUG(
logger_,
"Sending heart beat acknowledgment for connection " << connection_id);
- if (session_observer_->IsHeartBeatSupported(
- connection_id, packet.session_id())) {
+ uint8_t protocol_version;
+ if (session_observer_->ProtocolVersionUsed(
+ connection_id, packet.session_id(), protocol_version)) {
// TODO(EZamakhov): investigate message_id for HeartBeatAck
- return SendHeartBeatAck(connection_id, packet.session_id(),
- packet.message_id());
+ if (PROTOCOL_VERSION_3 == protocol_version ||
+ PROTOCOL_VERSION_4 == protocol_version) {
+ return SendHeartBeatAck(connection_id, packet.session_id(),
+ packet.message_id());
+ }
+ else {
+ LOG4CXX_WARN(logger_, "HeartBeat is not supported");
+ return RESULT_HEARTBEAT_IS_NOT_SUPPORTED;
+ }
+
+ } else {
+ LOG4CXX_WARN(logger_, "SendHeartBeatAck is failed connection or session does not exist");
+ return RESULT_FAIL;
}
- LOG4CXX_WARN(logger_, "HeartBeat is not supported");
- return RESULT_HEARTBEAT_IS_NOT_SUPPORTED;
+}
+
+bool ProtocolHandlerImpl::TrackMessage(const uint32_t& connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (message_frequency_time_ > 0u &&
+ message_max_frequency_ > 0u) {
+ const size_t message_frequency = message_meter_.TrackMessage(connection_key);
+ LOG4CXX_DEBUG(logger_, "Frequency of " << connection_key << " is " << message_frequency);
+ if (message_frequency > message_max_frequency_) {
+ LOG4CXX_WARN(logger_, "Frequency of " << connection_key << " is marked as high.");
+ if (session_observer_) {
+ session_observer_->OnApplicationFloodCallBack(connection_key);
+ }
+ message_meter_.RemoveIdentifier(connection_key);
+ return true;
+ }
+ }
+ return false;
+}
+
+bool ProtocolHandlerImpl::TrackMalformedMessage(const uint32_t &connection_key,
+ const size_t count) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (malformed_message_frequency_time_ > 0u &&
+ malformed_message_max_frequency_ > 0u) {
+ const size_t malformed_message_frequency =
+ malformed_message_meter_.TrackMessages(connection_key, count);
+ LOG4CXX_DEBUG(logger_, "Malformed frequency of " << connection_key
+ << " is " << malformed_message_frequency);
+ if (!malformed_message_filtering_ ||
+ malformed_message_frequency > malformed_message_max_frequency_) {
+ LOG4CXX_WARN(logger_, "Malformed frequency of " << connection_key
+ << " is marked as high.");
+ if (session_observer_) {
+ session_observer_->OnMalformedMessageCallback(connection_key);
+ }
+ malformed_message_meter_.RemoveIdentifier(connection_key);
+ return true;
+ }
+ }
+ return false;
}
void ProtocolHandlerImpl::Handle(
const impl::RawFordMessageFromMobile message) {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
if (NULL == session_observer_) {
LOG4CXX_WARN(logger_, "Session Observer is NULL");
return;
}
+
+ switch (message->service_type()) {
+ case kMobileNav:
+ case kAudio:
+ break;
+ default: {
+ const uint32_t connection_key = session_observer_->KeyFromPair(
+ message->connection_id(), message->session_id());
+ if (TrackMessage(connection_key)) {
+ return;
+ }
+ }
+ break;
+ }
+
connection_handler::ConnectionHandlerImpl *connection_handler =
connection_handler::ConnectionHandlerImpl::instance();
- LOG4CXX_INFO(logger_, "Message : " << message.get());
- LOG4CXX_INFO(logger_, "session_observer_: " <<session_observer_);
- uint8_t c_id = message->connection_id();
- uint32_t m_id = message->session_id();
+ LOG4CXX_DEBUG(logger_, "Message : " << message.get());
+ const uint8_t c_id = message->connection_id();
+ const uint32_t m_id = message->session_id();
if (session_observer_->IsHeartBeatSupported(c_id, m_id)) {
- connection_handler->KeepConnectionAlive(message->connection_id(),
- message->session_id());
+ connection_handler->KeepConnectionAlive(c_id, m_id);
}
+ // TODO(EZamakhov): remove dublication of IncomingDataHandler logic
if (((0 != message->data()) && (0 != message->data_size())) ||
FRAME_TYPE_CONTROL == message->frame_type() ||
FRAME_TYPE_FIRST == message->frame_type()) {
- LOG4CXX_INFO_EXT(logger_, "Packet: dataSize " << message->data_size());
+ LOG4CXX_DEBUG(logger_, "Packet: dataSize " << message->data_size());
HandleMessage(message->connection_id(), message);
} else {
LOG4CXX_WARN(logger_,
"handleMessagesFromMobileApp() - incorrect or NULL data");
}
- LOG4CXX_TRACE_EXIT(logger_);
}
void ProtocolHandlerImpl::Handle(const impl::RawFordMessageToMobile message) {
- LOG4CXX_INFO_EXT(
+ LOG4CXX_DEBUG(
logger_,
"Message to mobile app: connection id " <<
static_cast<int>(message->connection_id()) << ";"
@@ -1187,8 +1205,14 @@ void ProtocolHandlerImpl::Handle(const impl::RawFordMessageToMobile message) {
SendFrame(message);
}
+void ProtocolHandlerImpl::Stop() {
+ raw_ford_messages_from_mobile_.Shutdown();
+ raw_ford_messages_to_mobile_.Shutdown();
+}
+
#ifdef ENABLE_SECURITY
-void ProtocolHandlerImpl::set_security_manager(security_manager::SecurityManager* security_manager) {
+void ProtocolHandlerImpl::set_security_manager(
+ security_manager::SecurityManager* security_manager) {
if (!security_manager) {
LOG4CXX_ERROR(logger_, "Invalid (NULL) pointer to SecurityManager.");
return;
@@ -1236,7 +1260,6 @@ RESULT_CODE ProtocolHandlerImpl::EncryptFrame(ProtocolFramePtr packet) {
<< out_data_size << " bytes");
DCHECK(out_data);
DCHECK(out_data_size);
- DCHECK(out_data_size <= MAXIMUM_FRAME_DATA_SIZE);
packet->set_protection_flag(true);
packet->set_data(out_data, out_data_size);
return RESULT_OK;
@@ -1294,25 +1317,33 @@ RESULT_CODE ProtocolHandlerImpl::DecryptFrame(ProtocolFramePtr packet) {
void ProtocolHandlerImpl::SendFramesNumber(uint32_t connection_key,
int32_t number_of_frames) {
- LOG4CXX_INFO(logger_,
+ LOG4CXX_DEBUG(logger_,
"SendFramesNumber MobileNaviAck for session " << connection_key);
// TODO(EZamakhov): add protocol version check - to avoid send for PROTOCOL_VERSION_1
transport_manager::ConnectionUID connection_id = 0;
uint8_t session_id = 0;
session_observer_->PairFromKey(connection_key, &connection_id, &session_id);
- ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
- PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
- SERVICE_TYPE_NAVI, FRAME_DATA_SERVICE_DATA_ACK,
- session_id, 0, message_counters_[session_id]++));
-
- // Flow control data shall be 4 bytes according Ford Protocol
- DCHECK(sizeof(number_of_frames) == 4);
- number_of_frames = LE_TO_BE32(number_of_frames);
- ptr->set_data(reinterpret_cast<const uint8_t*>(&number_of_frames),
- sizeof(number_of_frames));
- raw_ford_messages_to_mobile_.PostMessage(
- impl::RawFordMessageToMobile(ptr, false));
+ 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_NAVI, FRAME_DATA_SERVICE_DATA_ACK,
+ session_id, 0, message_counters_[session_id]++));
+
+ // Flow control data shall be 4 bytes according Ford Protocol
+ DCHECK(sizeof(number_of_frames) == 4);
+ number_of_frames = LE_TO_BE32(number_of_frames);
+ ptr->set_data(reinterpret_cast<const uint8_t*>(&number_of_frames),
+ sizeof(number_of_frames));
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+ LOG4CXX_DEBUG(logger_, "SendFramesNumber finished successfully");
+ } else {
+ LOG4CXX_WARN(logger_, "SendFramesNumber is failed connection or session does not exist");
+ }
+
}
#ifdef TIME_TESTER
@@ -1335,6 +1366,22 @@ std::string ConvertPacketDataToString(const uint8_t *data,
break;
}
}
- return is_printable_array ? std::string(text) : std::string("is raw data");
+ return is_printable_array ? std::string(text, data_size) : std::string("is raw data");
+}
+
+uint8_t SupportedSDLProtocolVersion() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ bool heart_beat_support =
+ (0 != profile::Profile::instance()->heart_beat_timeout());
+ bool sdl4_support = profile::Profile::instance()->enable_protocol_4();
+
+ if (sdl4_support) {
+ return PROTOCOL_VERSION_4;
+ }
+ if (heart_beat_support) {
+ return PROTOCOL_VERSION_3;
+ }
+ return PROTOCOL_VERSION_2;
}
} // namespace protocol_handler
diff --git a/src/components/protocol_handler/src/protocol_packet.cc b/src/components/protocol_handler/src/protocol_packet.cc
index 19c73127c..a31678ec6 100644
--- a/src/components/protocol_handler/src/protocol_packet.cc
+++ b/src/components/protocol_handler/src/protocol_packet.cc
@@ -33,55 +33,220 @@
#include <stdint.h>
#include <memory.h>
#include <new>
+#include <cstring>
+#include <limits>
+
+#include "protocol/common.h"
#include "protocol_handler/protocol_packet.h"
#include "utils/macro.h"
+#include "utils/byte_order.h"
namespace protocol_handler {
+ProtocolPacket::ProtocolData::ProtocolData()
+ : data(NULL), totalDataBytes(0u) { }
+
+ProtocolPacket::ProtocolData::~ProtocolData() {
+ delete[] data;
+}
+
+ProtocolPacket::ProtocolHeader::ProtocolHeader()
+ : version(0x00),
+ protection_flag(PROTECTION_OFF),
+ frameType(0x00),
+ serviceType(0x00),
+ frameData(0x00),
+ sessionId(0x00),
+ dataSize(0x00),
+ messageId(0x00) {
+}
+
+ProtocolPacket::ProtocolHeader::ProtocolHeader(
+ uint8_t version, bool protection, uint8_t frameType, uint8_t serviceType,
+ uint8_t frameData, uint8_t sessionID, uint32_t dataSize, uint32_t messageID)
+ : version(version),
+ protection_flag(protection),
+ frameType(frameType),
+ serviceType(serviceType),
+ frameData(frameData),
+ sessionId(sessionID),
+ dataSize(dataSize),
+ messageId(messageID) {
+}
+
+inline uint32_t read_be_uint32(const uint8_t* const data) {
+ // Int value read byte per byte
+ // reintercast for non-4 byte address alignment lead to UB on arm platform
+ uint32_t value = data[3];
+ value += (data[2] << 8);
+ value += (data[1] << 16);
+ value += (data[0] << 24);
+ return value;
+}
+
+void ProtocolPacket::ProtocolHeader::deserialize(
+ const uint8_t* message, const size_t messageSize) {
+ if (messageSize < PROTOCOL_HEADER_V1_SIZE) {
+ return;
+ }
+ // first 4 bits
+ version = message[0] >> 4u;
+ // 5th bit
+ protection_flag = message[0] & 0x08u;
+ // 6-8 bits
+ frameType = message[0] & 0x07u;
+
+ serviceType = message[1];
+ frameData = message[2];
+ sessionId = message[3];
+
+ // FIXME(EZamakhov): usage for FirstFrame message
+ dataSize = read_be_uint32(message + 4);
+ switch (version) {
+ case PROTOCOL_VERSION_2:
+ case PROTOCOL_VERSION_3:
+ case PROTOCOL_VERSION_4:{
+ if (messageSize < PROTOCOL_HEADER_V2_SIZE) {
+ return;
+ }
+ messageId = read_be_uint32(message + 8);
+ }
+ break;
+ default:
+ messageId = 0;
+ break;
+ }
+}
+
+ProtocolPacket::ProtocolHeaderValidator::ProtocolHeaderValidator()
+ : max_payload_size_(std::numeric_limits<size_t>::max()) {
+}
+
+void ProtocolPacket::ProtocolHeaderValidator::set_max_payload_size(
+ const size_t max_payload_size) {
+ max_payload_size_ = max_payload_size;
+}
+
+size_t ProtocolPacket::ProtocolHeaderValidator::max_payload_size() const {
+ return max_payload_size_;
+}
+
+RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
+ const ProtocolHeader& header) const {
+ // expected payload size will be calculated depending
+ // on used protocol version
+ size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE;
+ // Protocol version shall be from 1 to 4
+ switch (header.version) {
+ case PROTOCOL_VERSION_1:
+ case PROTOCOL_VERSION_2:
+ break;
+ case PROTOCOL_VERSION_3:
+ case PROTOCOL_VERSION_4:
+ payload_size = max_payload_size_ > MAXIMUM_FRAME_DATA_V2_SIZE ?
+ max_payload_size_ : MAXIMUM_FRAME_DATA_V2_SIZE;
+ break;
+ default:
+ return RESULT_FAIL;
+ }
+ // ServiceType shall be equal 0x0 (Control), 0x07 (RPC), 0x0A (PCM), 0x0B (Video), 0x0F (Bulk)
+ if (ServiceTypeFromByte(header.serviceType) == kInvalidServiceType) {
+ return RESULT_FAIL;
+ }
+ // 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 Single and First frames Frame info value shall be equal 0x00
+ switch (header.frameType) {
+ case FRAME_TYPE_CONTROL : {
+ switch (header.frameData) {
+ case FRAME_DATA_HEART_BEAT:
+ case FRAME_DATA_START_SERVICE:
+ case FRAME_DATA_START_SERVICE_ACK:
+ case FRAME_DATA_START_SERVICE_NACK:
+ case FRAME_DATA_END_SERVICE:
+ case FRAME_DATA_END_SERVICE_ACK:
+ case FRAME_DATA_END_SERVICE_NACK:
+ case FRAME_DATA_SERVICE_DATA_ACK:
+ case FRAME_DATA_HEART_BEAT_ACK:
+ break;
+ default:
+ return RESULT_FAIL;
+ }
+ break;
+ }
+ case FRAME_TYPE_SINGLE:
+ if (header.frameData != FRAME_DATA_SINGLE) {
+ return RESULT_FAIL;
+ }
+ break;
+ case FRAME_TYPE_FIRST:
+ if (header.frameData != FRAME_DATA_FIRST) {
+ return RESULT_FAIL;
+ }
+ break;
+ case FRAME_TYPE_CONSECUTIVE:
+ // Could have any FrameInfo value
+ break;
+ default:
+ // All other Frame type is invalid
+ return RESULT_FAIL;
+ }
+ // For Control frames Data Size value shall be less than MTU header
+ // For Single and Consecutive Data Size value shall be greater than 0x00
+ // and shall be less than payload size
+ if (header.dataSize > payload_size) {
+ return RESULT_FAIL;
+ }
+ switch (header.frameType) {
+ case FRAME_TYPE_SINGLE:
+ case FRAME_TYPE_CONSECUTIVE:
+ if (header.dataSize <= 0) {
+ return RESULT_FAIL;
+ }
+ break;
+ default:
+ break;
+ }
+ // Message ID be equal or greater than 0x01 (not actual for 1 protocol version and Control frames)
+ if (FRAME_TYPE_CONTROL != header.frameType && PROTOCOL_VERSION_1 != header.version
+ && header.messageId <= 0) {
+ // Message ID shall be greater than 0x00, but not implemented in SPT
+ // TODO(EZamakhov): return on fix on mobile side - APPLINK-9990
+ return RESULT_FAIL;
+ }
+ return RESULT_OK;
+}
+
ProtocolPacket::ProtocolPacket()
- : payload_size_(0),
- packet_id_(0),
- connection_id_(0) {
+ : payload_size_(0), connection_id_(0) {
}
-ProtocolPacket::ProtocolPacket(uint8_t connection_id,
+ProtocolPacket::ProtocolPacket(ConnectionID connection_id,
uint8_t version, bool protection,
uint8_t frameType,
uint8_t serviceType,
uint8_t frameData, uint8_t sessionID,
uint32_t dataSize, uint32_t messageID,
- const uint8_t *data,
- uint32_t packet_id)
+ const uint8_t *data)
: packet_header_(version, protection, frameType, serviceType,
frameData, sessionID, dataSize, messageID),
+ packet_data_(),
payload_size_(0),
- packet_id_(packet_id),
connection_id_(connection_id) {
set_data(data, dataSize);
- DCHECK(MAXIMUM_FRAME_DATA_SIZE >= dataSize);
}
-ProtocolPacket::ProtocolPacket(uint8_t connection_id, uint8_t *data_param,
- uint32_t data_size)
- : payload_size_(0),
- packet_id_(0),
+ProtocolPacket::ProtocolPacket(ConnectionID connection_id)
+ : packet_header_(),
+ packet_data_(),
+ payload_size_(0),
connection_id_(connection_id) {
- RESULT_CODE result = deserializePacket(data_param, data_size);
- if (result != RESULT_OK) {
- //NOTREACHED();
- }
-}
-
-ProtocolPacket::~ProtocolPacket() {
- delete[] packet_data_.data;
}
// Serialization
RawMessagePtr ProtocolPacket::serializePacket() const {
- uint8_t *packet = new (std::nothrow) uint8_t[MAXIMUM_FRAME_DATA_SIZE];
- if (!packet) {
- return RawMessagePtr();
- }
+ // TODO(EZamakhov): Move header serialization to ProtocolHeader
// version is low byte
const uint8_t version_byte = packet_header_.version << 4;
// protection is first bit of second byte
@@ -89,30 +254,35 @@ RawMessagePtr ProtocolPacket::serializePacket() const {
// frame type is last 3 bits of second byte
const uint8_t frame_type_byte = packet_header_.frameType & 0x07;
+ uint8_t header[PROTOCOL_HEADER_V2_SIZE];
uint8_t offset = 0;
- packet[offset++] = version_byte | protection_byte | frame_type_byte;
- packet[offset++] = packet_header_.serviceType;
- packet[offset++] = packet_header_.frameData;
- packet[offset++] = packet_header_.sessionId;
+ header[offset++] = version_byte | protection_byte | frame_type_byte;
+ header[offset++] = packet_header_.serviceType;
+ header[offset++] = packet_header_.frameData;
+ header[offset++] = packet_header_.sessionId;
- packet[offset++] = packet_header_.dataSize >> 24;
- packet[offset++] = packet_header_.dataSize >> 16;
- packet[offset++] = packet_header_.dataSize >> 8;
- packet[offset++] = packet_header_.dataSize;
+ header[offset++] = packet_header_.dataSize >> 24;
+ header[offset++] = packet_header_.dataSize >> 16;
+ header[offset++] = packet_header_.dataSize >> 8;
+ header[offset++] = packet_header_.dataSize;
if (packet_header_.version != PROTOCOL_VERSION_1) {
- packet[offset++] = packet_header_.messageId >> 24;
- packet[offset++] = packet_header_.messageId >> 16;
- packet[offset++] = packet_header_.messageId >> 8;
- packet[offset++] = packet_header_.messageId;
- }
+ header[offset++] = packet_header_.messageId >> 24;
+ header[offset++] = packet_header_.messageId >> 16;
+ header[offset++] = packet_header_.messageId >> 8;
+ header[offset++] = packet_header_.messageId;
+ };
+
+ size_t total_packet_size = offset + (packet_data_.data ? packet_data_.totalDataBytes : 0);
- DCHECK((offset + packet_data_.totalDataBytes) <= MAXIMUM_FRAME_DATA_SIZE);
+ uint8_t *packet = new (std::nothrow) uint8_t[total_packet_size];
+ if (!packet) {
+ return RawMessagePtr();
+ }
- size_t total_packet_size = offset;
- if (packet_data_.data) {
+ memcpy(packet, header, offset);
+ if (packet_data_.data && packet_data_.totalDataBytes) {
memcpy(packet + offset, packet_data_.data, packet_data_.totalDataBytes);
- total_packet_size += packet_data_.totalDataBytes;
}
const RawMessagePtr out_message(
@@ -124,14 +294,10 @@ RawMessagePtr ProtocolPacket::serializePacket() const {
return out_message;
}
-uint32_t ProtocolPacket::packet_id() const {
- return packet_id_;
-}
-
RESULT_CODE ProtocolPacket::appendData(uint8_t *chunkData,
uint32_t chunkDataSize) {
if (payload_size_ + chunkDataSize <= packet_data_.totalDataBytes) {
- if (chunkData) {
+ if (chunkData && chunkDataSize > 0) {
if (packet_data_.data) {
memcpy(packet_data_.data + payload_size_, chunkData, chunkDataSize);
payload_size_ += chunkDataSize;
@@ -147,39 +313,36 @@ size_t ProtocolPacket::packet_size() const {
return packet_header_.dataSize;
}
-RESULT_CODE ProtocolPacket::deserializePacket(const uint8_t *message,
- uint32_t messageSize) {
- uint8_t offset = 0;
- uint8_t firstByte = message[offset];
- offset++;
-
- packet_header_.version = firstByte >> 4u;
-
- if (firstByte & 0x08u) {
- packet_header_.protection_flag = true;
- } else {
- packet_header_.protection_flag = false;
+bool ProtocolPacket::operator==(const ProtocolPacket& other) const {
+ if (connection_id_ == other.connection_id_ &&
+ packet_header_.version == other.packet_header_.version &&
+ packet_header_.protection_flag == other.packet_header_.protection_flag &&
+ packet_header_.frameType == other.packet_header_.frameType &&
+ packet_header_.serviceType == other.packet_header_.serviceType &&
+ packet_header_.frameData == other.packet_header_.frameData &&
+ packet_header_.sessionId == other.packet_header_.sessionId &&
+ packet_header_.dataSize == other.packet_header_.dataSize &&
+ packet_header_.messageId == other.packet_header_.messageId &&
+ packet_data_.totalDataBytes == other.packet_data_.totalDataBytes) {
+ if (other.packet_data_.totalDataBytes == 0) {
+ return true;
+ }
+ // Compare payload data
+ if (packet_data_.data && other.packet_data_.data &&
+ 0 == memcmp(packet_data_.data, other.packet_data_.data,
+ packet_data_.totalDataBytes)) {
+ return true;
+ }
}
+ return false;
+}
- packet_header_.frameType = firstByte & 0x07u;
-
- packet_header_.serviceType = message[offset++];
- packet_header_.frameData = message[offset++];
- packet_header_.sessionId = message[offset++];
-
- packet_header_.dataSize = message[offset++] << 24u;
- packet_header_.dataSize |= message[offset++] << 16u;
- packet_header_.dataSize |= message[offset++] << 8u;
- packet_header_.dataSize |= message[offset++];
-
- if (packet_header_.version != PROTOCOL_VERSION_1) {
- packet_header_.messageId = message[offset++] << 24u;
- packet_header_.messageId |= message[offset++] << 16u;
- packet_header_.messageId |= message[offset++] << 8u;
- packet_header_.messageId |= message[offset++];
- } else {
- packet_header_.messageId = 0u;
- }
+RESULT_CODE ProtocolPacket::deserializePacket(
+ const uint8_t *message, const size_t messageSize) {
+ packet_header_.deserialize(message, messageSize);
+ const uint8_t offset =
+ packet_header_.version == PROTOCOL_VERSION_1 ? PROTOCOL_HEADER_V1_SIZE
+ : PROTOCOL_HEADER_V2_SIZE;
packet_data_.totalDataBytes = packet_header_.dataSize;
@@ -189,15 +352,14 @@ RESULT_CODE ProtocolPacket::deserializePacket(const uint8_t *message,
dataPayloadSize = messageSize - offset;
}
- uint8_t *data = 0;
+ uint8_t *data = NULL;
if (dataPayloadSize) {
data = new (std::nothrow) uint8_t[dataPayloadSize];
- if (data) {
- memcpy(data, message + offset, dataPayloadSize);
- payload_size_ = dataPayloadSize;
- } else {
+ if (!data) {
return RESULT_FAIL;
}
+ memcpy(data, message + offset, dataPayloadSize);
+ payload_size_ = dataPayloadSize;
}
if (packet_header_.frameType == FRAME_TYPE_FIRST) {
@@ -212,9 +374,7 @@ RESULT_CODE ProtocolPacket::deserializePacket(const uint8_t *message,
return RESULT_FAIL;
}
} else {
- if (packet_data_.data) {
- delete[] packet_data_.data;
- }
+ delete[] packet_data_.data;
packet_data_.data = data;
}
@@ -265,8 +425,7 @@ void ProtocolPacket::set_total_data_bytes(size_t dataBytes) {
if (dataBytes) {
delete[] packet_data_.data;
packet_data_.data = new (std::nothrow) uint8_t[dataBytes];
- packet_data_.totalDataBytes =
- packet_data_.data ? dataBytes : 0;
+ packet_data_.totalDataBytes = packet_data_.data ? dataBytes : 0u;
}
}
@@ -280,7 +439,7 @@ void ProtocolPacket::set_data(
memcpy(packet_data_.data, new_data, packet_data_.totalDataBytes);
} else {
// TODO(EZamakhov): add log info about memory problem
- packet_header_.dataSize = packet_data_.totalDataBytes = 0;
+ packet_header_.dataSize = packet_data_.totalDataBytes = 0u;
}
}
}
diff --git a/src/components/protocol_handler/src/protocol_payload.cc b/src/components/protocol_handler/src/protocol_payload.cc
index acc6825b3..9fb77c81e 100644
--- a/src/components/protocol_handler/src/protocol_payload.cc
+++ b/src/components/protocol_handler/src/protocol_payload.cc
@@ -40,11 +40,11 @@ namespace {
// Protocol header field sizes
static const size_t kRpcTypeBits = 4;
static const size_t kRpcFunctionIdBits = 32 - kRpcTypeBits;
-static const size_t kCorellationIdBits = 32;
+static const size_t kCorrelationIdBits = 32;
static const size_t kJsonSizeBits = 32;
static const size_t PayloadHeaderBits = kRpcTypeBits +
kRpcFunctionIdBits +
- kCorellationIdBits +
+ kCorrelationIdBits +
kJsonSizeBits;
}
@@ -52,7 +52,7 @@ namespace protocol_handler {
void Extract(utils::BitStream *bs, ProtocolPayloadHeaderV2 *headerv2) {
DCHECK(bs && headerv2);
- if (*bs) {
+ if (headerv2 && bs && *bs) {
uint8_t rpc_type;
utils::Extract(bs, &rpc_type, kRpcTypeBits);
headerv2->rpc_type = RpcTypeFromByte(rpc_type);
@@ -61,7 +61,7 @@ void Extract(utils::BitStream *bs, ProtocolPayloadHeaderV2 *headerv2) {
return;
}
utils::Extract(bs, &headerv2->rpc_function_id, kRpcFunctionIdBits);
- utils::Extract(bs, &headerv2->corellation_id); // kCorellationIdBits
+ utils::Extract(bs, &headerv2->correlation_id); // kCorrelationIdBits
utils::Extract(bs, &headerv2->json_size); // kJsonSizeBits
}
}
@@ -69,12 +69,11 @@ void Extract(utils::BitStream *bs, ProtocolPayloadHeaderV2 *headerv2) {
void Extract(utils::BitStream *bs, ProtocolPayloadV2 *payload,
size_t payload_size) {
DCHECK(bs && payload);
- if (*bs) {
+ if (payload && bs && *bs) {
Extract(bs, &payload->header);
utils::Extract(bs, &payload->json, payload->header.json_size);
size_t data_size = payload_size - payload->header.json_size -
PayloadHeaderBits / CHAR_BIT;
- DCHECK(data_size < payload_size);
utils::Extract(bs, &payload->data, data_size);
}
}
@@ -83,8 +82,8 @@ std::ostream &operator<<(std::ostream &os,
const ProtocolPayloadHeaderV2 &payload_header) {
return os << "(ProtocolPayloadHeaderV2" << " rpc_type: "
<< payload_header.rpc_type << ", rpc_function_id: "
- << payload_header.rpc_function_id << ", corellation_id: "
- << payload_header.corellation_id << ", json_size: "
+ << payload_header.rpc_function_id << ", correlation_id: "
+ << payload_header.correlation_id << ", json_size: "
<< payload_header.json_size << ")";
}
diff --git a/src/components/protocol_handler/test/CMakeLists.txt b/src/components/protocol_handler/test/CMakeLists.txt
new file mode 100644
index 000000000..935ae5c47
--- /dev/null
+++ b/src/components/protocol_handler/test/CMakeLists.txt
@@ -0,0 +1,59 @@
+# 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.
+
+if(BUILD_TESTS)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/protocol_handler/include
+ ${COMPONENTS_DIR}/protocol_handler/test/include
+ ${COMPONENTS_DIR}/include/protocol
+)
+
+set(LIBRARIES
+ gmock
+ ProtocolHandler
+ connectionHandler
+ Utils
+ ConfigProfile
+ ProtocolLibrary
+)
+
+set(SOURCES
+ incoming_data_handler_test.cc
+ protocol_header_validator_test.cc
+ #protocol_handler_tm_test.cc
+ protocol_packet_test.cc
+ protocol_payload_test.cc
+)
+
+create_test("protocol_handler_test" "${SOURCES}" "${LIBRARIES}")
+
+endif()
diff --git a/src/components/protocol_handler/test/include/control_message_matcher.h b/src/components/protocol_handler/test/include/control_message_matcher.h
new file mode 100644
index 000000000..9239d0847
--- /dev/null
+++ b/src/components/protocol_handler/test/include/control_message_matcher.h
@@ -0,0 +1,144 @@
+/*
+ * 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 TEST_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_CONTROL_MESSAGE_MATCHER_H_
+#define TEST_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_CONTROL_MESSAGE_MATCHER_H_
+
+#include <gmock/gmock.h>
+#include <string>
+#include <vector>
+#include "protocol/raw_message.h"
+#include "protocol_handler/protocol_packet.h"
+
+namespace test {
+namespace components {
+namespace protocol_handler_test {
+/*
+ * Matcher for checking RawMessage with ControlMessage
+ * Check error id
+ */
+
+MATCHER_P2(ControlMessage, ExpectedFrameData, ExpectedEncryption,
+ (std::string(ExpectedEncryption ? "Protected" : "Unprotected")
+ + " control message ")) {
+ // Nack shall be always with flag protected off
+ DCHECK(ExpectedFrameData != 0x03 /*FRAME_DATA_START_SERVICE_NACK*/ ||
+ !ExpectedEncryption);
+ const ::protocol_handler::RawMessagePtr message = arg;
+ ::protocol_handler::ProtocolPacket packet(message->connection_key());
+ const protocol_handler::RESULT_CODE result =
+ packet.deserializePacket(message->data(), message->data_size());
+ if (result != protocol_handler::RESULT_OK) {
+ *result_listener << "Error while message deserialization.";
+ return false;
+ }
+ if (::protocol_handler::FRAME_TYPE_CONTROL != packet.frame_type()) {
+ *result_listener << "Is not control message";
+ return false;
+ }
+ if (ExpectedFrameData != packet.frame_data()) {
+ *result_listener << "Control message with data 0x"
+ << std::hex << static_cast<int>(packet.frame_data())
+ << ", not 0x"
+ << std::hex << static_cast<int>(ExpectedFrameData);
+ return false;
+ }
+ if (ExpectedEncryption != packet.protection_flag()) {
+ *result_listener << "Control message is " <<
+ (ExpectedEncryption ? "" : "not ") << "protected";
+ return false;
+ }
+ return true;
+}
+
+
+
+MATCHER_P4(ControlMessage, ExpectedFrameData, ExpectedEncryption,
+ ConnectionKey, VectorMatcher,
+ (std::string(ExpectedEncryption ? "Protected" : "Unprotected")
+ + " control message ")) {
+ // Nack shall be always with flag protected off
+ DCHECK(ExpectedFrameData != 0x03 /*FRAME_DATA_START_SERVICE_NACK*/ ||
+ !ExpectedEncryption);
+
+ const ::protocol_handler::RawMessagePtr message = arg;
+ ::protocol_handler::ProtocolPacket packet(message->connection_key());
+ const protocol_handler::RESULT_CODE result =
+ packet.deserializePacket(message->data(), message->data_size());
+ if (result != protocol_handler::RESULT_OK) {
+ *result_listener << "Error while message deserialization.";
+ return false;
+ }
+
+ if (::protocol_handler::FRAME_TYPE_CONTROL != packet.frame_type()) {
+ *result_listener << "Is not control message";
+ return false;
+ }
+ if (ExpectedFrameData != packet.frame_data()) {
+ *result_listener << "Control message with data 0x"
+ << std::hex << static_cast<int>(packet.frame_data())
+ << ", not 0x"
+ << std::hex << static_cast<int>(ExpectedFrameData);
+ return false;
+ }
+ if (ExpectedEncryption != packet.protection_flag()) {
+ *result_listener << "Control message is " <<
+ (ExpectedEncryption ? "" : "not ") << "protected";
+ return false;
+ }
+ if (ConnectionKey != message->connection_key()) {
+ *result_listener << "Message for connection_id " << message->connection_key() <<
+ ", expected for connection_id " << ConnectionKey;
+ return false;
+ }
+ std::vector<uint8_t> data_vector;
+ if (packet.data() && packet.data_size()) {
+ data_vector.assign(packet.data(), packet.data() + packet.data_size());
+ }
+ ::testing::Matcher<std::vector<uint8_t> > m = VectorMatcher;
+ if (!m.Matches(data_vector)) {
+ *result_listener << "Message with " << data_vector.size()
+ << " byte data : 0x";
+ for (size_t i = 0u; i < data_vector.size(); ++i) {
+ *result_listener << std::hex << static_cast<int>(data_vector[i]);
+ }
+ return false;
+ }
+ return true;
+}
+
+
+
+
+} // namespace protocol_handler_test
+} // namespace components
+} // namespace test
+#endif // TEST_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_CONTROL_MESSAGE_MATCHER_H_
diff --git a/src/components/protocol_handler/test/include/protocol_handler_mock.h b/src/components/protocol_handler/test/include/protocol_handler_mock.h
new file mode 100644
index 000000000..41b7c491a
--- /dev/null
+++ b/src/components/protocol_handler/test/include/protocol_handler_mock.h
@@ -0,0 +1,234 @@
+/*
+ * 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_PROTOCOL_HANDLER_TEST_INCLUDE_PROTOCOL_HANDLER_MOCK_H_
+#define SRC_COMPONENTS_PROTOCOL_HANDLER_TEST_INCLUDE_PROTOCOL_HANDLER_MOCK_H_
+
+#include <gmock/gmock.h>
+#include "transport_manager/transport_manager.h"
+#include "protocol_handler/session_observer.h"
+#include "protocol_handler/protocol_packet.h"
+
+namespace test {
+namespace components {
+namespace protocol_handler_test {
+
+using namespace protocol_handler;
+using namespace transport_manager;
+
+/*
+ * MOCK implementation of ::protocol_handler::ProtocolObserver interface
+ */
+
+class ProtocolHandlerMock : public protocol_handler::ProtocolHandler {
+ public:
+ MOCK_METHOD2(SendMessageToMobileApp,
+ void(const ::protocol_handler::RawMessagePtr message,
+ bool final_message));
+ MOCK_METHOD1(AddProtocolObserver,
+ void(::protocol_handler::ProtocolObserver *observer));
+ MOCK_METHOD1(RemoveProtocolObserver,
+ void(::protocol_handler::ProtocolObserver *observer));
+ MOCK_METHOD2(SendFramesNumber,
+ 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, uint8_t session_id, uint8_t service_type));
+};
+
+/*
+ * MOCK implementation of transport_manager::TransportManager interface
+ */
+class TransportManagerMock : public TransportManager {
+ public:
+ MOCK_METHOD0(Init,
+ int());
+ MOCK_METHOD0(SearchDevices,
+ int());
+ MOCK_METHOD1(ConnectDevice,
+ int(const DeviceHandle&));
+ MOCK_METHOD1(DisconnectDevice,
+ int(const DeviceHandle&));
+ MOCK_METHOD1(Disconnect,
+ int(const ConnectionUID &));
+ MOCK_METHOD1(DisconnectForce,
+ int(const ConnectionUID &));
+ MOCK_METHOD1(SendMessageToDevice,
+ int(const ::protocol_handler::RawMessagePtr));
+ MOCK_METHOD1(ReceiveEventFromDevice,
+ int(const TransportAdapterEvent&));
+ MOCK_METHOD1(AddTransportAdapter,
+ int(transport_adapter::TransportAdapter *));
+ MOCK_METHOD1(AddEventListener,
+ int(TransportManagerListener *));
+ MOCK_METHOD0(Stop,
+ int());
+ MOCK_METHOD1(RemoveDevice,
+ int(const DeviceHandle& ));
+ MOCK_CONST_METHOD1(Visibility,
+ int(const bool &));
+ MOCK_METHOD0(Reinit,
+ int());
+};
+
+/*
+ * MOCK implementation of protocol_handler::SessionObserver interface
+ */
+class SessionObserverMock : public protocol_handler::SessionObserver {
+ public:
+#ifdef ENABLE_SECURITY
+ MOCK_METHOD2(SetSSLContext,
+ int (const uint32_t& key,
+ security_manager::SSLContext* context));
+ MOCK_METHOD2(GetSSLContext,
+ security_manager::SSLContext* (
+ const uint32_t& key,
+ const protocol_handler::ServiceType& service_type));
+#endif // ENABLE_SECURITY
+ MOCK_METHOD2(SetProtectionFlag,
+ void(
+ const uint32_t& key,
+ const protocol_handler::ServiceType& service_type));
+ MOCK_METHOD5(OnSessionStartedCallback,
+ uint32_t(
+ 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));
+ MOCK_METHOD4(OnSessionEndedCallback,
+ uint32_t(
+ const transport_manager::ConnectionUID& connection_handle,
+ const uint8_t sessionId,
+ const uint32_t& hashCode,
+ const protocol_handler::ServiceType& service_type));
+ MOCK_METHOD1(OnApplicationFloodCallBack,
+ void(const uint32_t&));
+ MOCK_METHOD1(OnMalformedMessageCallback,
+ void(const uint32_t&));
+ MOCK_METHOD2(KeyFromPair,
+ uint32_t(
+ transport_manager::ConnectionUID connection_handle,
+ uint8_t sessionId));
+ MOCK_METHOD3(PairFromKey,
+ void(
+ uint32_t key,
+ transport_manager::ConnectionUID* connection_handle,
+ uint8_t* sessionId));
+ MOCK_METHOD4(GetDataOnSessionKey,
+ int32_t(uint32_t key,
+ uint32_t* app_id,
+ std::list<int32_t>* sessions_list,
+ uint32_t* device_id));
+ MOCK_METHOD5(GetDataOnDeviceID,
+ int32_t(
+ uint32_t device_handle,
+ std::string *device_name,
+ std::list<uint32_t> *applications_list,
+ std::string *mac_address,
+ std::string *connection_type));
+ MOCK_METHOD2(IsHeartBeatSupported,
+ bool( transport_manager::ConnectionUID connection_handle,
+ uint8_t session_id));
+ MOCK_METHOD3(ProtocolVersionUsed,
+ bool( uint32_t connection_id,
+ uint8_t session_id, uint8_t& protocol_version));
+ MOCK_CONST_METHOD1(GetHandshakeContext,
+ security_manager::SSLContext::HandshakeContext (const uint32_t key) );
+};
+
+#ifdef ENABLE_SECURITY
+/*
+ * MOCK implementation of security_manager::SecurityManager
+ */
+class SecurityManagerMock : public security_manager::SecurityManager {
+ public:
+ MOCK_METHOD1(AddListener,
+ void(security_manager::SecurityManagerListener *));
+ MOCK_METHOD1(CreateSSLContext,
+ security_manager::SSLContext*(const uint32_t &));
+ MOCK_METHOD1(StartHandshake,
+ void(uint32_t));
+ MOCK_METHOD4(SendInternalError,
+ void(const uint32_t ,
+ const uint8_t&,
+ const std::string&,
+ const uint32_t ));
+
+ MOCK_METHOD1(set_session_observer,
+ void(::protocol_handler::SessionObserver *));
+ MOCK_METHOD1(set_protocol_handler,
+ void(::protocol_handler::ProtocolHandler *));
+ MOCK_METHOD1(set_crypto_manager,
+ void(::security_manager::CryptoManager *));
+ MOCK_METHOD1(RemoveListener,
+ void(::security_manager::SecurityManagerListener *));
+ // protocol_handler::ProtocolObserver part
+ MOCK_METHOD1(OnMessageReceived,
+ void(const ::protocol_handler::RawMessagePtr));
+ MOCK_METHOD1(OnMobileMessageSent,
+ void(const ::protocol_handler::RawMessagePtr));
+};
+
+class SSLContextMock : public security_manager::SSLContext {
+ public:
+ MOCK_CONST_METHOD0(mode, int ());
+ MOCK_METHOD2(StartHandshake,
+ security_manager::SSLContext::HandshakeResult (
+ const uint8_t** const, size_t*));
+ MOCK_METHOD4(DoHandshakeStep,
+ security_manager::SSLContext::HandshakeResult (
+ const uint8_t* const, size_t,
+ const uint8_t** const, size_t*));
+ MOCK_METHOD4(Encrypt,
+ bool (const uint8_t* const, size_t,
+ const uint8_t** const, size_t*));
+ MOCK_METHOD4(Decrypt,
+ bool (const uint8_t* const, size_t,
+ const uint8_t** const, size_t*));
+ MOCK_CONST_METHOD1(get_max_block_size, size_t (size_t));
+ MOCK_CONST_METHOD0(IsInitCompleted, bool());
+ MOCK_CONST_METHOD0(IsHandshakePending, bool());
+ MOCK_CONST_METHOD0(LastError,
+ std::string());
+ MOCK_METHOD0(ResetConnection,
+ void());
+ MOCK_METHOD1(SetHandshakeContext, void (const HandshakeContext& hsh_ctx));
+};
+#endif // ENABLE_SECURITY
+}
+ // namespace test
+} // namespace components
+} // namespace protocol_handler_test
+#endif // SRC_COMPONENTS_PROTOCOL_HANDLER_TEST_INCLUDE_PROTOCOL_HANDLER_MOCK_H_
+
diff --git a/src/components/protocol_handler/test/include/protocol_observer_mock.h b/src/components/protocol_handler/test/include/protocol_observer_mock.h
new file mode 100644
index 000000000..c415e66e4
--- /dev/null
+++ b/src/components/protocol_handler/test/include/protocol_observer_mock.h
@@ -0,0 +1,57 @@
+/*
+ * 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_PROTOCOL_HANDLER_TEST_INCLUDE_PROTOCOL_OBSERVER_MOCK_H_
+#define SRC_COMPONENTS_PROTOCOL_HANDLER_TEST_INCLUDE_PROTOCOL_OBSERVER_MOCK_H_
+
+#include <gmock/gmock.h>
+#include <string>
+#include "protocol_handler/protocol_observer.h"
+
+namespace test {
+namespace components {
+namespace protocol_handler_test {
+
+/*
+ * MOCK implementation of ::protocol_handler::ProtocolObserver interface
+ */
+class ProtocolObserverMock : public ::protocol_handler::ProtocolObserver {
+ public:
+ MOCK_METHOD1(OnMessageReceived,
+ void(const ::protocol_handler::RawMessagePtr));
+ MOCK_METHOD1(OnMobileMessageSent,
+ void(const ::protocol_handler::RawMessagePtr));
+};
+} // namespace protocol_handler_test
+} // namespace components
+} // namespace test
+#endif //SRC_COMPONENTS_PROTOCOL_HANDLER_TEST_INCLUDE_PROTOCOL_OBSERVER_MOCK_H_
diff --git a/src/components/protocol_handler/test/include/session_observer_mock.h b/src/components/protocol_handler/test/include/session_observer_mock.h
new file mode 100644
index 000000000..383ebaa16
--- /dev/null
+++ b/src/components/protocol_handler/test/include/session_observer_mock.h
@@ -0,0 +1,112 @@
+/*
+ * 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 TEST_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_SESSION_OBSERVER_MOCK_H_
+#define TEST_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_SESSION_OBSERVER_MOCK_H_
+
+#include <gmock/gmock.h>
+#include <string>
+#include <list>
+#include "protocol_handler/session_observer.h"
+
+namespace test {
+namespace components {
+namespace protocol_handler_test {
+/*
+ * MOCK implementation of ::protocol_handler::SessionObserver interface
+ */
+class SessionObserverMock: public ::protocol_handler::SessionObserver {
+ public:
+ MOCK_METHOD5(OnSessionStartedCallback,
+ uint32_t(
+ 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));
+ MOCK_METHOD4(OnSessionEndedCallback,
+ uint32_t(
+ const transport_manager::ConnectionUID &connection_handle,
+ const uint8_t sessionId,
+ const uint32_t &hashCode,
+ const ::protocol_handler::ServiceType &service_type));
+ MOCK_METHOD1(OnApplicationFloodCallBack,
+ void(const uint32_t&));
+ MOCK_METHOD1(OnMalformedMessageCallback,
+ void(const uint32_t&));
+ MOCK_METHOD2(KeyFromPair,
+ uint32_t(
+ transport_manager::ConnectionUID connection_handle,
+ uint8_t sessionId));
+ MOCK_METHOD3(PairFromKey,
+ void(
+ uint32_t key,
+ transport_manager::ConnectionUID *connection_handle,
+ uint8_t *sessionId));
+ MOCK_METHOD4(GetDataOnSessionKey,
+ int32_t(uint32_t key,
+ uint32_t *app_id,
+ std::list<int32_t> *sessions_list,
+ uint32_t *device_id));
+ MOCK_METHOD5(GetDataOnDeviceID,
+ int32_t(
+ uint32_t device_handle,
+ std::string *device_name,
+ std::list<uint32_t> *applications_list,
+ std::string *mac_address,
+ std::string *connection_type));
+ MOCK_METHOD2(IsHeartBeatSupported,
+ bool(transport_manager::ConnectionUID connection_handle,
+ uint8_t session_id));
+ MOCK_METHOD3(ProtocolVersionUsed,
+ bool ( uint32_t connection_id,
+ uint8_t session_id, uint8_t& protocol_version));
+#ifdef ENABLE_SECURITY
+ MOCK_METHOD2(SetSSLContext,
+ int(const uint32_t &key,
+ ::security_manager::SSLContext *context));
+ MOCK_METHOD2(GetSSLContext,
+ ::security_manager::SSLContext * (
+ const uint32_t &key,
+ const ::protocol_handler::ServiceType &service_type));
+ MOCK_METHOD2(SetProtectionFlag,
+ void(
+ const uint32_t &key,
+ const ::protocol_handler::ServiceType &service_type));
+ MOCK_CONST_METHOD1(GetHandshakeContext,
+ security_manager::SSLContext::HandshakeContext (const uint32_t key) );
+
+#endif // ENABLE_SECURITY
+};
+} // namespace protocol_handler_test
+} // namespace components
+} // namespace test
+#endif // TEST_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_SESSION_OBSERVER_MOCK_H_
diff --git a/src/components/protocol_handler/test/incoming_data_handler_test.cc b/src/components/protocol_handler/test/incoming_data_handler_test.cc
new file mode 100644
index 000000000..e45b11f7a
--- /dev/null
+++ b/src/components/protocol_handler/test/incoming_data_handler_test.cc
@@ -0,0 +1,798 @@
+/*
+ * 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 <vector>
+#include <list>
+
+#include "utils/macro.h"
+#include "protocol_handler/incoming_data_handler.h"
+
+namespace test {
+namespace components {
+namespace protocol_handler_test {
+using namespace protocol_handler;
+
+class IncomingDataHandlerTest : public ::testing::Test {
+ protected:
+ void SetUp() OVERRIDE {
+ data_handler.set_validator(&header_validator);
+ uid1 = 0x1234560;
+ data_handler.AddConnection(uid1);
+ uid2 = 0x1234561;
+ data_handler.AddConnection(uid2);
+ uid_unknown = 0xFEFEFE;
+ EXPECT_NE(uid1, uid_unknown);
+ EXPECT_NE(uid2, uid_unknown);
+ some_data_size = 4;
+ some_data2_size = 512;
+ some_data = new uint8_t[some_data_size];
+ some_data2 = new uint8_t[some_data2_size];
+ protov1_message_id = 0x0;
+ some_message_id = 0xABCDEF0;
+ some_session_id = 0xFEDCBA0;
+ payload_bigger_mtu.resize(MAXIMUM_FRAME_DATA_V2_SIZE + 1);
+ }
+ void TearDown() OVERRIDE {
+ delete[] some_data;
+ delete[] some_data2;
+ }
+ void ProcessData(transport_manager::ConnectionUID uid, const uint8_t *const data,
+ const uint32_t data_size ) {
+ actual_frames = data_handler.ProcessData(RawMessage(uid, 0, data, data_size),
+ &result_code, &malformed_occurs);
+ }
+
+ void AppendPacketToTMData(const ProtocolPacket& packet) {
+ const RawMessagePtr msg = packet.serializePacket();
+ EXPECT_TRUE(msg.valid());
+ EXPECT_GT(msg->data_size(), 0u);
+ tm_data.insert(tm_data.end(), msg->data(), msg->data() + msg->data_size());
+ }
+ void ProcessPacket(const ProtocolPacket& packet) {
+ AppendPacketToTMData(packet);
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+ tm_data.clear();
+ }
+
+ protocol_handler::ProtocolPacket::ProtocolHeaderValidator header_validator;
+ protocol_handler::IncomingDataHandler data_handler;
+ transport_manager::ConnectionUID uid1, uid2, uid_unknown;
+ typedef std::list<ProtocolFramePtr> FrameList;
+ FrameList actual_frames;
+ RESULT_CODE result_code;
+ size_t malformed_occurs;
+ uint8_t* some_data, *some_data2;
+ size_t some_data_size, some_data2_size;
+ uint32_t protov1_message_id;
+ uint32_t some_message_id;
+ uint32_t some_session_id;
+ std::vector<uint8_t> tm_data;
+ std::vector<uint8_t> payload_bigger_mtu;
+};
+
+TEST_F(IncomingDataHandlerTest, NullData) {
+ ProcessData(uid1, NULL, 0);
+ EXPECT_EQ(RESULT_FAIL, result_code);
+ EXPECT_TRUE(actual_frames.empty());
+
+ ProcessData(uid2, NULL, 1);
+ EXPECT_EQ(RESULT_FAIL, result_code);
+ EXPECT_TRUE(actual_frames.empty());
+
+ uint8_t invalide_data[] = {0, 1, 2, 3, 4};
+ ProcessData(uid_unknown, invalide_data, 0);
+ EXPECT_EQ(RESULT_FAIL, result_code);
+ EXPECT_TRUE(actual_frames.empty());
+}
+
+TEST_F(IncomingDataHandlerTest, DataForUnknownConnection) {
+ size_t malformed_count = 0;
+ actual_frames = data_handler.ProcessData(RawMessage(uid_unknown, 0, NULL, 0),
+ &result_code, &malformed_count);
+ EXPECT_EQ(RESULT_FAIL, result_code);
+ EXPECT_EQ(malformed_count, 0u);
+ EXPECT_TRUE(actual_frames.empty());
+
+ AppendPacketToTMData(ProtocolPacket());
+ actual_frames = data_handler.ProcessData(RawMessage(uid_unknown, 0, tm_data.data(), tm_data.size()),
+ &result_code, &malformed_count);
+ EXPECT_EQ(RESULT_FAIL, result_code);
+ EXPECT_EQ(malformed_count, 0u);
+ EXPECT_TRUE(actual_frames.empty());
+}
+
+TEST_F(IncomingDataHandlerTest, Heartbeat_per_byte) {
+ const ProtocolPacket hb_packet(uid1, PROTOCOL_VERSION_1, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ kControl, FRAME_DATA_HEART_BEAT, some_session_id, 0u,
+ protov1_message_id, NULL);
+ const size_t hb_count = 100;
+ for (size_t i = 0; i < hb_count; ++i) {
+ AppendPacketToTMData(hb_packet);
+ // Send per 1 byte (except last byte)
+ for (size_t i = 0; i < tm_data.size() - 1; ++i) {
+ ProcessData(uid1, &tm_data[i] , 1);
+ EXPECT_EQ(RESULT_OK, result_code);
+ EXPECT_EQ(malformed_occurs, 0u);
+ EXPECT_TRUE(actual_frames.empty());
+ }
+ ProcessData(uid1, &*(tm_data.end()-1), 1);
+ EXPECT_EQ(RESULT_OK, result_code);
+ EXPECT_EQ(malformed_occurs, 0u);
+ EXPECT_EQ(1u, actual_frames.size());
+ EXPECT_EQ(hb_packet, **actual_frames.begin());
+ tm_data.clear();
+ }
+}
+
+TEST_F(IncomingDataHandlerTest, Heartbeat_pack) {
+ const ProtocolPacket hb_packet(uid1, PROTOCOL_VERSION_2, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ kControl, FRAME_DATA_HEART_BEAT, some_session_id, 0u,
+ some_message_id, NULL);
+ const size_t hb_count = 100;
+ for (size_t i = 0u; i < hb_count; ++i) {
+ AppendPacketToTMData(hb_packet);
+ }
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+ EXPECT_EQ(RESULT_OK, result_code);
+ EXPECT_EQ(malformed_occurs, 0u);
+ EXPECT_EQ(hb_count, actual_frames.size());
+ for (FrameList::iterator it = actual_frames.begin(); it != actual_frames.end(); ++it) {
+ EXPECT_EQ(hb_packet, **it);
+ }
+}
+
+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));
+ // 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));
+ // 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));
+ // 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));
+ for (FrameList::iterator it = mobile_packets.begin(); it != mobile_packets.end(); ++it) {
+ AppendPacketToTMData(**it);
+ }
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+ EXPECT_EQ(RESULT_OK, result_code);
+ EXPECT_EQ(malformed_occurs, 0u);
+ EXPECT_EQ(mobile_packets.size(), actual_frames.size());
+ FrameList::iterator it_exp = mobile_packets.begin();
+ for (FrameList::const_iterator it = actual_frames.begin(); it != actual_frames.end();
+ ++it, ++it_exp) {
+ // TODO(EZamakhov): investigate valgrind warning (unitialized value)
+ EXPECT_EQ(**it, **it_exp)
+ << "Element number " << std::distance(mobile_packets.begin(), it_exp);
+ }
+}
+
+// TODO(EZamakhov): add validator abstraction and replace next test with check only return frames
+
+// Protocol version shall be from 1 to 3
+TEST_F(IncomingDataHandlerTest, DISABLED_MalformedPacket_Version) {
+ FrameList malformed_packets;
+ std::vector<uint8_t> malformed_versions;
+ malformed_versions.push_back(0);
+ for (uint8_t version = PROTOCOL_VERSION_3 + 1; version <= PROTOCOL_VERSION_MAX; ++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));
+ }
+
+ // We count malformed only first time when it occurs after correct message
+ FrameList::iterator it = malformed_packets.begin();
+ ProcessPacket(**it);
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(0u, actual_frames.size());
+ ++it;
+
+ // All next data will be one large malformed message which we've already counted
+ for (; it != malformed_packets.end(); ++it) {
+ ProcessPacket(**it);
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code)
+ << "Malformed version " << static_cast<int>((*it)->protocol_version());
+ // Stream of malformed messages is a one occurrence
+ EXPECT_EQ(0u, malformed_occurs);
+ // All malformed messages shall be ignored
+ EXPECT_EQ(0u, actual_frames.size());
+ }
+}
+
+// ServiceType shall be equal 0x0 (Control), 0x07 (RPC), 0x0A (PCM), 0x0B (Video), 0x0F (Bulk)
+TEST_F(IncomingDataHandlerTest, DISABLED_MalformedPacket_ServiceType) {
+ FrameList malformed_packets;
+ std::vector<uint8_t> malformed_serv_types;
+ for (uint8_t service_type = kControl + 1; service_type < kRpc; ++service_type) {
+ malformed_serv_types.push_back(service_type);
+ }
+ malformed_serv_types.push_back(0x08);
+ malformed_serv_types.push_back(0x09);
+ malformed_serv_types.push_back(0x0C);
+ 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));
+ }
+
+ // We count malformed only first time when it occurs after correct message
+ FrameList::iterator it = malformed_packets.begin();
+ ProcessPacket(**it);
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(0u, actual_frames.size());
+ ++it;
+
+ // All next data will be one large malformed message which we've already counted
+ for (; it != malformed_packets.end(); ++it) {
+ ProcessPacket(**it);
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code)
+ << "Malformed service type " << static_cast<int>((*it)->service_type());
+ // Stream of malformed messages is a one occurrence
+ EXPECT_EQ(0u, malformed_occurs);
+ // All malformed messages shall be ignored
+ EXPECT_EQ(0u, actual_frames.size());
+ }
+}
+
+// Frame type shall be 0x00 (Control), 0x01 (Single), 0x02 (First), 0x03 (Consecutive)
+TEST_F(IncomingDataHandlerTest, DISABLED_MalformedPacket_FrameType) {
+ FrameList malformed_packets;
+ std::vector<uint8_t> malformed_frame_types;
+ for (uint8_t frame_type = FRAME_TYPE_CONSECUTIVE + 1;
+ frame_type <= FRAME_TYPE_MAX_VALUE; ++frame_type) {
+ 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));
+ }
+
+ // We count malformed only first time when it occurs after correct message
+ FrameList::iterator it = malformed_packets.begin();
+ ProcessPacket(**it);
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(0u, actual_frames.size());
+ ++it;
+
+ // All next data will be one large malformed message which we've already counted
+ for (; it != malformed_packets.end(); ++it) {
+ ProcessPacket(**it);
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code)
+ << "Malformed frame type " << static_cast<int>((*it)->service_type());
+ // Stream of malformed messages is a one occurrence
+ EXPECT_EQ(0u, malformed_occurs);
+ // All malformed messages shall be ignored
+ EXPECT_EQ(0u, actual_frames.size());
+ }
+}
+
+// For Control frames Frame info value shall be from 0x00 to 0x06 or 0xFE(Data Ack), 0xFF(HB Ack)
+TEST_F(IncomingDataHandlerTest, DISABLED_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; ++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));
+ }
+
+ // We count malformed only first time when it occurs after correct message
+ FrameList::iterator it = malformed_packets.begin();
+ ProcessPacket(**it);
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(0u, actual_frames.size());
+ ++it;
+
+ // All next data will be one large malformed message which we've already counted
+ for (; it != malformed_packets.end(); ++it) {
+ ProcessPacket(**it);
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code)
+ << "Malformed frame type " << static_cast<int>((*it)->service_type());
+ // Stream of malformed messages is a one occurrence
+ EXPECT_EQ(0u, malformed_occurs);
+ // All malformed messages shall be ignored
+ EXPECT_EQ(0u, actual_frames.size());
+ }
+}
+
+// For Single and First frames Frame info value shall be equal 0x00
+TEST_F(IncomingDataHandlerTest, DISABLED_MalformedPacket_SingleFrame) {
+ FrameList malformed_packets;
+ std::vector<uint8_t> malformed_frame_data;
+ for (uint8_t frame_type = FRAME_DATA_SINGLE + 1;
+ frame_type < FRAME_DATA_MAX_VALUE; ++frame_type) {
+ malformed_frame_data.push_back(frame_type);
+ }
+ 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));
+ }
+
+ // We count malformed only first time when it occurs after correct message
+ FrameList::iterator it = malformed_packets.begin();
+ ProcessPacket(**it);
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(0u, actual_frames.size());
+ ++it;
+
+ // All next data will be one large malformed message which we've already counted
+ for (; it != malformed_packets.end(); ++it) {
+ ProcessPacket(**it);
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code)
+ << "Malformed frame type " << static_cast<int>((*it)->service_type());
+ // Stream of malformed messages is a one occurrence
+ EXPECT_EQ(0u, malformed_occurs);
+ // All malformed messages shall be ignored
+ EXPECT_EQ(0u, actual_frames.size());
+ }
+}
+
+// For Single and First frames Frame info value shall be equal 0x00
+TEST_F(IncomingDataHandlerTest, DISABLED_MalformedPacket_FirstFrame) {
+ FrameList malformed_packets;
+ std::vector<uint8_t> malformed_frame_data;
+ for (uint8_t frame_type = FRAME_DATA_FIRST + 1;
+ frame_type < FRAME_DATA_MAX_VALUE; ++frame_type) {
+ malformed_frame_data.push_back(frame_type);
+ }
+ 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));
+ }
+
+ // We count malformed only first time when it occurs after correct message
+ FrameList::iterator it = malformed_packets.begin();
+ ProcessPacket(**it);
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(0u, actual_frames.size());
+ ++it;
+
+ // All next data will be one large malformed message which we've already counted
+ for (; it != malformed_packets.end(); ++it) {
+ ProcessPacket(**it);
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code)
+ << "Malformed frame type " << static_cast<int>((*it)->service_type());
+ // Stream of malformed messages is a one occurrence
+ EXPECT_EQ(0u, malformed_occurs);
+ // All malformed messages shall be ignored
+ EXPECT_EQ(0u, actual_frames.size());
+ }
+}
+
+// For Single and First frames Frame info value shall be equal 0x00
+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));
+ 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));
+ 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));
+ 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));
+ 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));
+ 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));
+ 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));
+ AppendPacketToTMData(*mobile_packets.back());
+
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(mobile_packets.size(), actual_frames.size());
+ // Stream has 6 unexpected bytes
+ EXPECT_EQ(malformed_occurs, 6u);
+
+ FrameList::iterator it_exp = mobile_packets.begin();
+ for (FrameList::const_iterator it = actual_frames.begin(); it != actual_frames.end();
+ ++it, ++it_exp) {
+ // TODO(EZamakhov): investigate valgrind warning (unitialized value)
+ EXPECT_EQ(**it, **it_exp)
+ << "Element number " << std::distance(mobile_packets.begin(), it_exp);
+ }
+}
+
+// For Single and First frames Frame info value shall be equal 0x00
+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));
+ 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));
+ AppendPacketToTMData(*mobile_packets.back());
+
+ // Malformed packet 1
+ const uint8_t malformed_version = PROTOCOL_VERSION_MAX;
+ const ProtocolPacket malformed_packet1(
+ uid1, malformed_version, PROTECTION_ON, FRAME_TYPE_SINGLE,
+ kMobileNav, FRAME_DATA_SINGLE, ++some_session_id, some_data_size,
+ ++some_message_id, some_data);
+ 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));
+ AppendPacketToTMData(*mobile_packets.back());
+
+ // Malformed packet 2
+ const uint8_t malformed_type = FRAME_TYPE_MAX_VALUE;
+ ProtocolPacket malformed_packet2(
+ uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, malformed_type,
+ kRpc, FRAME_DATA_HEART_BEAT, some_session_id, some_data_size,
+ protov1_message_id, some_data);
+ 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));
+ AppendPacketToTMData(*mobile_packets.back());
+
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(malformed_occurs, 2u);
+ EXPECT_EQ(mobile_packets.size(), actual_frames.size());
+ FrameList::iterator it_exp = mobile_packets.begin();
+ for (FrameList::const_iterator it = actual_frames.begin(); it != actual_frames.end();
+ ++it, ++it_exp) {
+ // TODO(EZamakhov): investigate valgrind warning (unitialized value)
+ EXPECT_EQ(**it, **it_exp)
+ << "Element number " << std::distance(mobile_packets.begin(), it_exp);
+ }
+}
+
+TEST_F(IncomingDataHandlerTest, OnePortionOfData_CorrectAndMalformed_OneMalformedCounted) {
+ // Arrange
+ ProtocolPacket correct_hb_packet_(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ kControl, FRAME_DATA_HEART_BEAT, some_session_id, 0u,
+ some_message_id);
+ AppendPacketToTMData(correct_hb_packet_);
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+
+ // Act
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+
+ // Assert
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(1u, actual_frames.size());
+}
+
+TEST_F(IncomingDataHandlerTest, FirstPortionOfData_MalformedAndCorrect_OneMalformedCounted) {
+ // Arrange
+ ProtocolPacket correct_hb_packet_(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ kControl, FRAME_DATA_HEART_BEAT, some_session_id, 0u,
+ some_message_id);
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+ AppendPacketToTMData(correct_hb_packet_);
+
+ // Act
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+
+ // Assert
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(1u, actual_frames.size());
+}
+
+TEST_F(IncomingDataHandlerTest, OnePortionOfData_CorrectMalformedCorrect_OneMalformedCounted) {
+ // Arrange
+ ProtocolPacket correct_hb_packet_(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ kControl, FRAME_DATA_HEART_BEAT, some_session_id, 0u,
+ some_message_id);
+ AppendPacketToTMData(correct_hb_packet_);
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+ AppendPacketToTMData(correct_hb_packet_);
+
+ // Act
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+
+ // Assert
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(2u, actual_frames.size());
+}
+
+TEST_F(IncomingDataHandlerTest, OnePortionOfData_CorrectMalformedCorrectMalformed_TwoMalformedCounted) {
+ // Arrange
+ ProtocolPacket correct_hb_packet_(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ kControl, FRAME_DATA_HEART_BEAT, some_session_id, 0u,
+ some_message_id);
+ AppendPacketToTMData(correct_hb_packet_);
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+ AppendPacketToTMData(correct_hb_packet_);
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+
+ // Act
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+
+ // Assert
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(2u, malformed_occurs);
+ EXPECT_EQ(2u, actual_frames.size());
+}
+
+TEST_F(IncomingDataHandlerTest, OnePortionOfData_MalformedCorrectMalformedCorrect_TwoMalformedCounted) {
+ // Arrange
+ ProtocolPacket correct_hb_packet_(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ kControl, FRAME_DATA_HEART_BEAT, some_session_id, 0u,
+ some_message_id);
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+ AppendPacketToTMData(correct_hb_packet_);
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+ AppendPacketToTMData(correct_hb_packet_);
+
+ // Act
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+
+ // Assert
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(2u, malformed_occurs);
+ EXPECT_EQ(2u, actual_frames.size());
+}
+
+TEST_F(IncomingDataHandlerTest, DISABLED_TwoPortionsOfData_CorrectMalformedANDCorrectMalformed_TwoMalformedCounted) {
+ // Arrange
+ ProtocolPacket correct_hb_packet_(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ kControl, FRAME_DATA_HEART_BEAT, some_session_id, 0u,
+ some_message_id);
+ AppendPacketToTMData(correct_hb_packet_);
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+
+ // Act
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+
+ // Assert
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(1u, actual_frames.size());
+
+ // Arrange
+ tm_data.clear();
+ AppendPacketToTMData(correct_hb_packet_);
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+
+ // Act
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+
+ // Assert
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(1u, actual_frames.size());
+}
+
+TEST_F(IncomingDataHandlerTest, DISABLED_TwoPortionsOfData_CorrectMalformedANDMalformedCorrect_OneMalformedCounted) {
+ // Arrange
+ ProtocolPacket correct_hb_packet_(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ kControl, FRAME_DATA_HEART_BEAT, some_session_id, 0u,
+ some_message_id);
+ AppendPacketToTMData(correct_hb_packet_);
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+
+ // Act
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+
+ // Assert
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(1u, actual_frames.size());
+
+ // Arrange
+ tm_data.clear();
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+ AppendPacketToTMData(correct_hb_packet_);
+
+ // Act
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+
+ // Assert
+ EXPECT_EQ(RESULT_OK, result_code);
+ EXPECT_EQ(0u, malformed_occurs);
+ EXPECT_EQ(1u, actual_frames.size());
+}
+
+TEST_F(IncomingDataHandlerTest, TwoPortionsOfData_MalformedCorrectANDMalformedCorrect_TwoMalformedCounted) {
+ // Arrange
+ ProtocolPacket correct_hb_packet_(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ kControl, FRAME_DATA_HEART_BEAT, some_session_id, 0u,
+ some_message_id);
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+ AppendPacketToTMData(correct_hb_packet_);
+
+ // Act
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+
+ // Assert
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(1u, actual_frames.size());
+
+ // Arrange
+ tm_data.clear();
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+ AppendPacketToTMData(correct_hb_packet_);
+
+ // Act
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+
+ // Assert
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(1u, actual_frames.size());
+}
+
+TEST_F(IncomingDataHandlerTest, TwoPortionsOfData_MalformedCorrectANDCorrectMalformed_TwoMalformedCounted) {
+ // Arrange
+ ProtocolPacket correct_hb_packet_(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ kControl, FRAME_DATA_HEART_BEAT, some_session_id, 0u,
+ some_message_id);
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+ AppendPacketToTMData(correct_hb_packet_);
+
+ // Act
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+
+ // Assert
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(1u, actual_frames.size());
+
+ // Arrange
+ tm_data.clear();
+ AppendPacketToTMData(correct_hb_packet_);
+ tm_data.insert(tm_data.end(), 12, 0xFF); // 12 bytes of malformed data
+
+ // Act
+ ProcessData(uid1, &tm_data[0], tm_data.size());
+
+ // Assert
+ EXPECT_EQ(RESULT_MALFORMED_OCCURS, result_code);
+ EXPECT_EQ(1u, malformed_occurs);
+ EXPECT_EQ(1u, actual_frames.size());
+}
+
+// TODO(EZamakhov): add tests for handling 2+ connection data
+
+} // namespace protocol_handler_test
+} // namespace components
+} // namespace test
diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
new file mode 100644
index 000000000..4ef070c52
--- /dev/null
+++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
@@ -0,0 +1,936 @@
+/*
+ * 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 <string>
+#include "protocol_handler/protocol_handler_impl.h"
+#include "protocol/common.h"
+#include "control_message_matcher.h"
+#include "protocol_handler_mock.h"
+#include "protocol_observer_mock.h"
+
+
+namespace test {
+namespace components {
+namespace protocol_handler_test {
+
+// id passed as NULL for new session establishing
+#define NEW_SESSION_ID 0u
+#define SESSION_START_REJECT 0u
+
+using namespace ::protocol_handler;
+using namespace ::transport_manager;
+// For TM states
+using ::transport_manager::TransportManagerListener;
+using ::testing::Return;
+using ::testing::ReturnNull;
+using ::testing::AnyOf;
+using ::testing::Ge;
+using ::testing::Le;
+using ::testing::_;
+using ::testing::Invoke;
+
+class ProtocolHandlerImplTest : public ::testing::Test {
+ protected:
+ void InitProtocolHandlerImpl(
+ const size_t period_msec, const size_t max_messages,
+ bool malformed_message_filtering = false,
+ const size_t malformd_period_msec = 0u,
+ const size_t malformd_max_messages = 0u) {
+ protocol_handler_impl.reset(
+ new ProtocolHandlerImpl(&transport_manager_mock,
+ period_msec, max_messages,
+ malformed_message_filtering,
+ malformd_period_msec, malformd_max_messages));
+ protocol_handler_impl->set_session_observer(&session_observer_mock);
+ tm_listener = protocol_handler_impl.get();
+ }
+ void SetUp() OVERRIDE {
+ InitProtocolHandlerImpl(0u, 0u);
+ connection_id = 0xAu;
+ session_id = 0xFFu;
+ connection_key = 0xFF00AAu;
+ message_id = 0xABCDEFu;
+ some_data.resize(256, 0xAB);
+
+ // expect ConnectionHandler support methods call (conversion, check heartbeat)
+ EXPECT_CALL(session_observer_mock,
+ KeyFromPair(connection_id, _)).
+ //return some connection_key
+ WillRepeatedly(Return(connection_key));
+ EXPECT_CALL(session_observer_mock,
+ IsHeartBeatSupported(connection_id, _)).
+ //return false to avoid call KeepConnectionAlive
+ WillRepeatedly(Return(false));
+ }
+
+ void TearDown() OVERRIDE {
+ // Wait call methods in thread
+ testing::Mock::AsyncVerifyAndClearExpectations(10000);
+ }
+
+ // Emulate connection establish
+ void AddConnection() {
+ tm_listener->OnConnectionEstablished(
+ DeviceInfo(DeviceHandle(1u), std::string("mac"), std::string("name"),
+ std::string("BTMAC")),
+ connection_id);
+ }
+ void AddSession() {
+ AddConnection();
+ const ServiceType start_service = kRpc;
+#ifdef ENABLE_SECURITY
+ // For enabled protection callback shall use protection ON
+ const bool callback_protection_flag = PROTECTION_ON;
+#else
+ // For disabled protection callback shall ignore protection income flad and use protection OFF
+ const bool callback_protection_flag = PROTECTION_OFF;
+#endif // ENABLE_SECURITY
+ // expect ConnectionHandler check
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service,
+ callback_protection_flag, _)).
+ //return sessions start success
+ WillOnce(Return(session_id));
+
+ // expect send Ack with PROTECTION_OFF (on no Security Manager)
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_OFF)))
+ .WillOnce(Return(E_SUCCESS));
+
+ SendControlMessage(PROTECTION_ON, start_service, NEW_SESSION_ID,
+ FRAME_DATA_START_SERVICE);
+ }
+
+#ifdef ENABLE_SECURITY
+ // Emulate security manager initilization establish
+ void AddSecurityManager() {
+ protocol_handler_impl->set_security_manager(&security_manager_mock);
+ }
+#endif // ENABLE_SECURITY
+ void SendTMMessage(uint8_t connection_id, uint8_t version, bool protection,
+ uint8_t frameType, uint8_t serviceType, uint8_t frameData,
+ uint8_t sessionId, uint32_t dataSize, uint32_t messageID,
+ const uint8_t *data = 0) {
+ // Create packet
+ const ProtocolPacket packet(connection_id, version, protection, frameType,
+ serviceType, frameData, sessionId, dataSize,
+ messageID, data);
+ // Emulate resive packet from transoprt manager
+ tm_listener->OnTMMessageReceived(packet.serializePacket());
+ }
+ void SendControlMessage(bool protection, uint8_t service_type,
+ uint8_t sessionId, uint32_t frame_data,
+ uint32_t dataSize = 0u, const uint8_t *data = NULL) {
+ SendTMMessage(connection_id, PROTOCOL_VERSION_3, protection,
+ FRAME_TYPE_CONTROL, service_type, frame_data, sessionId,
+ dataSize, message_id, data);
+ }
+
+ ::utils::SharedPtr<ProtocolHandlerImpl> protocol_handler_impl;
+ TransportManagerListener* tm_listener;
+ // Uniq connection
+ ::transport_manager::ConnectionUID connection_id;
+ // id of established session
+ uint8_t session_id;
+ // uniq id as connection_id and session_id in one
+ uint32_t connection_key;
+ uint32_t message_id;
+ std::vector<uint8_t> some_data;
+ // Strict mocks (same as all methods EXPECT_CALL().Times(0))
+ testing::StrictMock<protocol_handler_test::TransportManagerMock> transport_manager_mock;
+ testing::StrictMock<protocol_handler_test::SessionObserverMock> session_observer_mock;
+#ifdef ENABLE_SECURITY
+ testing::NiceMock<protocol_handler_test::SecurityManagerMock> security_manager_mock;
+ testing::NiceMock<protocol_handler_test::SSLContextMock> ssl_context_mock;
+#endif // ENABLE_SECURITY
+};
+
+#ifdef ENABLE_SECURITY
+class OnHandshakeDoneFunctor {
+public:
+ OnHandshakeDoneFunctor(const uint32_t connection_key,
+ security_manager::SSLContext::HandshakeResult error)
+ : connection_key(connection_key), result(error) {}
+ void operator()(security_manager::SecurityManagerListener * listener) const {
+ listener->OnHandshakeDone(connection_key, result);
+ }
+private:
+ const uint32_t connection_key;
+ const security_manager::SSLContext::HandshakeResult result;
+};
+#endif // ENABLE_SECURITY
+
+/*
+ * ProtocolHandler shall skip empty message
+ */
+TEST_F(ProtocolHandlerImplTest, RecieveEmptyRawMessage) {
+ tm_listener->OnTMMessageReceived(RawMessagePtr());
+}
+/*
+ * ProtocolHandler shall disconnect on no connection
+ */
+TEST_F(ProtocolHandlerImplTest, RecieveOnUnknownConnection) {
+ EXPECT_CALL(transport_manager_mock, DisconnectForce(connection_id)).
+ WillOnce(Return(E_SUCCESS));
+
+ SendTMMessage(connection_id, PROTOCOL_VERSION_3, PROTECTION_OFF,
+ FRAME_TYPE_CONTROL, kRpc, FRAME_DATA_START_SERVICE,
+ NEW_SESSION_ID, 0, message_id);
+}
+/*
+ * ProtocolHandler shall send NAck on session_observer rejection
+ * Check protection flag OFF for all services from kControl to kBulk
+ */
+TEST_F(ProtocolHandlerImplTest, StartSession_Unprotected_SessionObserverReject) {
+ const int call_times = 5;
+ AddConnection();
+ // expect ConnectionHandler check
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(
+ connection_id, NEW_SESSION_ID, AnyOf(kControl, kRpc, kAudio,
+ kMobileNav, kBulk), PROTECTION_OFF, _)).Times(call_times).
+ //return sessions start rejection
+ WillRepeatedly(Return(SESSION_START_REJECT));
+
+ // expect send NAck
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_NACK, PROTECTION_OFF)))
+ .Times(call_times).WillRepeatedly(Return(E_SUCCESS));
+
+ SendControlMessage(PROTECTION_OFF, kControl, NEW_SESSION_ID,
+ FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_OFF, kRpc, NEW_SESSION_ID,
+ FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_OFF, kAudio, NEW_SESSION_ID,
+ FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_OFF, kMobileNav, NEW_SESSION_ID,
+ FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_OFF, kBulk, NEW_SESSION_ID,
+ FRAME_DATA_START_SERVICE);
+}
+/*
+ * ProtocolHandler shall send NAck on session_observer rejection
+ * Emulate getting PROTECTION_ON and check protection flag OFF in NAck
+ * For ENABLE_SECURITY=OFF session_observer shall be called with protection flag OFF
+ */
+TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
+ const int call_times = 5;
+ AddConnection();
+#ifdef ENABLE_SECURITY
+ // For enabled protection callback shall use protection ON
+ const bool callback_protection_flag = PROTECTION_ON;
+#else
+ // For disabled protection callback shall ignore protection income flad and use protection OFF
+ const bool callback_protection_flag = PROTECTION_OFF;
+#endif // ENABLE_SECURITY
+ // expect ConnectionHandler check
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(
+ connection_id, NEW_SESSION_ID, AnyOf(kControl, kRpc, kAudio,
+ kMobileNav, kBulk), callback_protection_flag, _)).Times(
+ call_times).
+ //return sessions start rejection
+ WillRepeatedly(Return(SESSION_START_REJECT));
+
+ // expect send NAck with encryption OFF
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_NACK, PROTECTION_OFF)))
+ .Times(call_times).WillRepeatedly(Return(E_SUCCESS));
+
+ SendControlMessage(PROTECTION_ON, kControl, NEW_SESSION_ID,
+ FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_ON, kRpc, NEW_SESSION_ID,
+ FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_ON, kAudio, NEW_SESSION_ID,
+ FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_ON, kMobileNav, NEW_SESSION_ID,
+ FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_ON, kBulk, NEW_SESSION_ID,
+ FRAME_DATA_START_SERVICE);
+}
+/*
+ * ProtocolHandler shall send Ack on session_observer accept
+ * Check protection flag OFF
+ */
+TEST_F(ProtocolHandlerImplTest, StartSession_Unprotected_SessionObserverAccept) {
+ AddConnection();
+ const ServiceType start_service = kRpc;
+ // expect ConnectionHandler check
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _))
+ .
+ //return sessions start success
+ WillOnce(Return(session_id));
+
+ // expect send Ack
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_OFF)))
+ .WillOnce(Return(E_SUCCESS));
+
+ SendControlMessage(PROTECTION_OFF, start_service, NEW_SESSION_ID,
+ FRAME_DATA_START_SERVICE);
+}
+/*
+ * ProtocolHandler shall send Ack on session_observer accept
+ * Emulate getting PROTECTION_ON and check protection flag OFF in Ack
+ * For ENABLE_SECURITY=OFF session_observer shall be called with protection flag OFF
+ */
+TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverAccept) {
+ AddSession();
+}
+// 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) {
+ AddSession();
+ const ServiceType service = kRpc;
+
+ // expect ConnectionHandler check
+ EXPECT_CALL(session_observer_mock,
+ OnSessionEndedCallback(connection_id, session_id, _, service)).
+ // reject session start
+ WillOnce(Return(SESSION_START_REJECT));
+
+ // expect send NAck
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_END_SERVICE_NACK, PROTECTION_OFF)))
+ .WillOnce(Return(E_SUCCESS));
+
+ SendControlMessage(PROTECTION_OFF, service, session_id,
+ FRAME_DATA_END_SERVICE);
+}
+/*
+ * ProtocolHandler shall send NAck on wrong hash code
+ */
+TEST_F(ProtocolHandlerImplTest, EndSession_Success) {
+ AddSession();
+ const ServiceType service = kRpc;
+
+ // expect ConnectionHandler check
+ EXPECT_CALL(session_observer_mock,
+ OnSessionEndedCallback(connection_id, session_id, _, service)).
+ // return sessions start success
+ WillOnce(Return(connection_key));
+
+ // expect send Ack
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_END_SERVICE_ACK, PROTECTION_OFF)))
+ .WillOnce(Return(E_SUCCESS));
+
+ SendControlMessage(PROTECTION_OFF, service, session_id,
+ FRAME_DATA_END_SERVICE);
+}
+
+#ifdef ENABLE_SECURITY
+/*
+ * ProtocolHandler shall not call Security logics with Protocol version 1
+ * Check session_observer with PROTECTION_OFF and Ack with PROTECTION_OFF
+ */
+TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) {
+ AddConnection();
+ // Add security manager
+ AddSecurityManager();
+ const ServiceType start_service = kRpc;
+ // expect ConnectionHandler check
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _)).
+ //return sessions start success
+ WillOnce(Return(session_id));
+
+ // expect send Ack with PROTECTION_OFF (on no Security Manager)
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_OFF))).
+ WillOnce(Return(E_SUCCESS));
+
+ SendTMMessage(connection_id, PROTOCOL_VERSION_1, PROTECTION_ON, FRAME_TYPE_CONTROL,
+ start_service, FRAME_DATA_START_SERVICE, NEW_SESSION_ID, 0, message_id);
+}
+/*
+ * ProtocolHandler shall not call Security logics on start session with PROTECTION_OFF
+ */
+TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) {
+ AddConnection();
+ // Add security manager
+ AddSecurityManager();
+ const ServiceType start_service = kRpc;
+ // expect ConnectionHandler check
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _)).
+ //return sessions start success
+ WillOnce(Return(session_id));
+
+ // expect send Ack with PROTECTION_OFF (on no Security Manager)
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_OFF))).
+ WillOnce(Return(E_SUCCESS));
+
+ SendControlMessage(PROTECTION_OFF, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+}
+/*
+ * ProtocolHandler shall send Ack with PROTECTION_OFF on fail SLL creation
+ */
+TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) {
+ AddConnection();
+ AddSecurityManager();
+ const ServiceType start_service = kRpc;
+ // expect ConnectionHandler check
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)).
+ //return sessions start success
+ WillOnce(Return(session_id));
+
+ // expect start protection for unprotected session
+ EXPECT_CALL(security_manager_mock,
+ CreateSSLContext(connection_key)).
+ //return fail protection
+ WillOnce(ReturnNull());
+
+ // expect send Ack with PROTECTION_OFF (on fail SLL creation)
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_OFF))).
+ WillOnce(Return(E_SUCCESS));
+
+ SendControlMessage(PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+}
+/*
+ * ProtocolHandler shall send Ack with PROTECTION_ON on already established and initialized SLLContext
+ */
+TEST_F(ProtocolHandlerImplTest,SecurityEnable_StartSessionProtected_SSLInitialized) {
+ AddConnection();
+ AddSecurityManager();
+ const ServiceType start_service = kRpc;
+ // expect ConnectionHandler check
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)).
+ //return sessions start success
+ WillOnce(Return(session_id));
+
+ // call new SSLContext creation
+ EXPECT_CALL(security_manager_mock,
+ CreateSSLContext(connection_key)).
+ //return new SSLContext
+ WillOnce(Return(&ssl_context_mock));
+
+ // initilization check
+ EXPECT_CALL(ssl_context_mock,
+ IsInitCompleted()).
+ //emulate SSL is initilized
+ WillOnce(Return(true));
+
+ // Expect service protection enable
+ EXPECT_CALL(session_observer_mock,
+ SetProtectionFlag(connection_key, start_service));
+
+ // expect send Ack with PROTECTION_ON (on SSL is initilized)
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_ON))).
+ WillOnce(Return(E_SUCCESS));
+
+ SendControlMessage(PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+}
+/*
+ * ProtocolHandler shall send Ack with PROTECTION_OFF on session handshhake fail
+ */
+TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_HandshakeFail) {
+ AddConnection();
+ AddSecurityManager();
+ const ServiceType start_service = kRpc;
+ // expect ConnectionHandler check
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)).
+ //return sessions start success
+ WillOnce(Return(session_id));
+
+ // call new SSLContext creation
+ EXPECT_CALL(security_manager_mock,
+ CreateSSLContext(connection_key)).
+ //return new SSLContext
+ WillOnce(Return(&ssl_context_mock));
+
+ // initilization check
+ EXPECT_CALL(ssl_context_mock,
+ IsInitCompleted()).
+ //emulate SSL is not initilized
+ WillOnce(Return(false));
+
+ // Pending handshake check
+ EXPECT_CALL(ssl_context_mock,
+ IsHandshakePending()).
+ //emulate is pending
+ WillOnce(Return(true));
+
+ // 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_Fail)));
+
+ // Listener check SSLContext
+ EXPECT_CALL(session_observer_mock,
+ GetSSLContext(connection_key, start_service)).
+ // emulate protection for service is not enabled
+ WillOnce(ReturnNull());
+
+ // expect send Ack with PROTECTION_OFF (on fail handshake)
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_OFF))).
+ WillOnce(Return(E_SUCCESS));
+
+ SendControlMessage(PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+}
+/*
+ * ProtocolHandler shall send Ack with PROTECTION_ON on session handshhake success
+ */
+TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_HandshakeSuccess) {
+ AddConnection();
+ AddSecurityManager();
+ const ServiceType start_service = kRpc;
+ // expect ConnectionHandler check
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)).
+ //return sessions start success
+ WillOnce(Return(session_id));
+
+ // call new SSLContext creation
+ EXPECT_CALL(security_manager_mock,
+ CreateSSLContext(connection_key)).
+ //return new SSLContext
+ WillOnce(Return(&ssl_context_mock));
+
+ // initilization check
+ EXPECT_CALL(ssl_context_mock,
+ IsInitCompleted()).
+ //emulate SSL is not initilized
+ WillOnce(Return(false));
+
+ // Pending handshake check
+ EXPECT_CALL(ssl_context_mock,
+ IsHandshakePending()).
+ //emulate is pending
+ WillOnce(Return(true));
+
+ // 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)));
+
+ // Listener check SSLContext
+ EXPECT_CALL(session_observer_mock,
+ GetSSLContext(connection_key, start_service)).
+ // emulate protection for service is not enabled
+ WillOnce(ReturnNull());
+
+ // Expect service protection enable
+ EXPECT_CALL(session_observer_mock,
+ SetProtectionFlag(connection_key, start_service));
+
+ // expect send Ack with PROTECTION_OFF (on fail handshake)
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_ON))).
+ WillOnce(Return(E_SUCCESS));
+
+ SendControlMessage(PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+}
+/*
+ * ProtocolHandler shall send Ack with PROTECTION_ON on session handshhake success
+ */
+TEST_F(ProtocolHandlerImplTest,
+ SecurityEnable_StartSessionProtected_HandshakeSuccess_ServiceProtectedBefore) {
+ AddConnection();
+ AddSecurityManager();
+ const ServiceType start_service = kRpc;
+ // expect ConnectionHandler check
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)).
+ //return sessions start success
+ WillOnce(Return(session_id));
+
+ // call new SSLContext creation
+ EXPECT_CALL(security_manager_mock,
+ CreateSSLContext(connection_key)).
+ //return new SSLContext
+ WillOnce(Return(&ssl_context_mock));
+
+ // initilization check
+ EXPECT_CALL(ssl_context_mock,
+ IsInitCompleted()).
+ //emulate SSL is not initilized
+ WillOnce(Return(false));
+
+ // Pending handshake check
+ EXPECT_CALL(ssl_context_mock,
+ IsHandshakePending()).
+ //emulate is pending
+ WillOnce(Return(true));
+
+ // 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)));
+
+ // Listener check SSLContext
+ EXPECT_CALL(session_observer_mock,
+ GetSSLContext(connection_key, start_service)).
+ // emulate protection for service is not enabled
+ WillOnce(ReturnNull());
+
+ // Expect service protection enable
+ EXPECT_CALL(session_observer_mock,
+ SetProtectionFlag(connection_key, start_service));
+
+ // expect send Ack with PROTECTION_OFF (on fail handshake)
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_ON))).
+ WillOnce(Return(E_SUCCESS));
+
+ SendControlMessage(PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+}
+/*
+ * ProtocolHandler shall send Ack with PROTECTION_ON on session handshhake success
+ */
+TEST_F(ProtocolHandlerImplTest,
+ SecurityEnable_StartSessionProtected_HandshakeSuccess_SSLIsNotPending) {
+ AddConnection();
+ AddSecurityManager();
+ const ServiceType start_service = kRpc;
+ // expect ConnectionHandler check
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)).
+ //return sessions start success
+ WillOnce(Return(session_id));
+
+ // call new SSLContext creation
+ EXPECT_CALL(security_manager_mock,
+ CreateSSLContext(connection_key)).
+ //return new SSLContext
+ WillOnce(Return(&ssl_context_mock));
+
+ // initilization check
+ EXPECT_CALL(ssl_context_mock,
+ IsInitCompleted()).
+ //emulate SSL is not initilized
+ WillOnce(Return(false));
+
+ // Pending handshake check
+ EXPECT_CALL(ssl_context_mock,
+ IsHandshakePending()).
+ //emulate is pending
+ WillOnce(Return(false));
+
+ // Wait restart handshake operation
+ EXPECT_CALL(security_manager_mock,
+ StartHandshake(connection_key));
+
+ // 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)));
+
+ // Listener check SSLContext
+ EXPECT_CALL(session_observer_mock,
+ GetSSLContext(connection_key, start_service)).
+ // emulate protection for service is not enabled
+ WillOnce(ReturnNull());
+
+ // Expect service protection enable
+ EXPECT_CALL(session_observer_mock,
+ SetProtectionFlag(connection_key, start_service));
+
+ // expect send Ack with PROTECTION_OFF (on fail handshake)
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_ON))).
+ WillOnce(Return(E_SUCCESS));
+
+ SendControlMessage(PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+}
+#endif // ENABLE_SECURITY
+
+TEST_F(ProtocolHandlerImplTest,
+ FloodVerification) {
+ const size_t period_msec = 10000;
+ const size_t max_messages = 1000;
+ InitProtocolHandlerImpl(period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect flood notification to CH
+ EXPECT_CALL(session_observer_mock,
+ OnApplicationFloodCallBack(connection_key)).
+ Times(1);
+
+ for (size_t i = 0; i < max_messages + 1; ++i) {
+ SendTMMessage(connection_id, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ }
+}
+TEST_F(ProtocolHandlerImplTest,
+ FloodVerification_ThresholdValue) {
+ const size_t period_msec = 10000;
+ const size_t max_messages = 1000;
+ InitProtocolHandlerImpl(period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect NO flood notification to CH
+ for (size_t i = 0; i < max_messages - 1; ++i) {
+ SendTMMessage(connection_id, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ }
+}
+TEST_F(ProtocolHandlerImplTest,
+ FloodVerification_VideoFrameSkip) {
+ const size_t period_msec = 10000;
+ const size_t max_messages = 1000;
+ InitProtocolHandlerImpl(period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect NO flood notification to CH on video data streaming
+ for (size_t i = 0; i < max_messages + 1; ++i) {
+ SendTMMessage(connection_id, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kMobileNav, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ }
+}
+TEST_F(ProtocolHandlerImplTest,
+ FloodVerification_AudioFrameSkip) {
+ const size_t period_msec = 10000;
+ const size_t max_messages = 1000;
+ InitProtocolHandlerImpl(period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect NO flood notification to CH on video data streaming
+ for (size_t i = 0; i < max_messages + 1; ++i) {
+ SendTMMessage(connection_id, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kAudio, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ }
+}
+TEST_F(ProtocolHandlerImplTest,
+ FloodVerificationDisable) {
+ const size_t period_msec = 0;
+ const size_t max_messages = 0;
+ InitProtocolHandlerImpl(period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect NO flood notification to session observer
+ for (size_t i = 0; i < max_messages + 1; ++i) {
+ SendTMMessage(connection_id, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ }
+}
+
+
+TEST_F(ProtocolHandlerImplTest,
+ MalformedVerificationDisable) {
+ const size_t period_msec = 10000;
+ const size_t max_messages = 100;
+ InitProtocolHandlerImpl(0u, 0u, false, period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect malformed notification to CH
+ EXPECT_CALL(session_observer_mock,
+ OnMalformedMessageCallback(connection_id)).
+ Times(max_messages);
+
+ const uint8_t malformed_version = PROTOCOL_VERSION_MAX;
+ for (size_t i = 0; i < max_messages; ++i) {
+ SendTMMessage(connection_id, malformed_version, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ }
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ MalformedLimitVerification) {
+ const size_t period_msec = 10000;
+ const size_t max_messages = 100;
+ InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect malformed notification to CH
+ EXPECT_CALL(session_observer_mock,
+ OnMalformedMessageCallback(connection_id)).
+ Times(1);
+
+ // Sending malformed packets
+ const uint8_t malformed_version = PROTOCOL_VERSION_MAX;
+ for (size_t i = 0; i < max_messages * 2; ++i) {
+ // Malformed message
+ SendTMMessage(connection_id, malformed_version, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ // Common message
+ SendTMMessage(connection_id, PROTOCOL_VERSION_1, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ }
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ MalformedLimitVerification_MalformedStock) {
+ const size_t period_msec = 10000;
+ const size_t max_messages = 100;
+ InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect malformed notification to CH
+ EXPECT_CALL(session_observer_mock,
+ OnMalformedMessageCallback(connection_id)).
+ Times(1);
+
+ // Sending malformed packets
+ const uint8_t malformed_version = PROTOCOL_VERSION_MAX;
+ const uint8_t malformed_frame_type = FRAME_TYPE_MAX_VALUE;
+ const uint8_t malformed_service_type = kInvalidServiceType;
+ for (size_t i = 0; i < max_messages * 2; ++i) {
+ // Malformed message 1
+ SendTMMessage(connection_id, malformed_version, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ // Malformed message 2
+ SendTMMessage(connection_id, PROTOCOL_VERSION_1, PROTECTION_OFF, malformed_frame_type,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ // Malformed message 3
+ SendTMMessage(connection_id, PROTOCOL_VERSION_1, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ malformed_service_type, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+
+ // Common message
+ SendTMMessage(connection_id, PROTOCOL_VERSION_1, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ }
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ MalformedLimitVerification_MalformedOnly) {
+ const size_t period_msec = 10000;
+ const size_t max_messages = 100;
+ InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect NO malformed notification to CH
+ EXPECT_CALL(session_observer_mock,
+ OnMalformedMessageCallback(connection_id)).
+ Times(0);
+
+ // Sending malformed packets
+ const uint8_t malformed_version = PROTOCOL_VERSION_MAX;
+ const uint8_t malformed_frame_type = FRAME_TYPE_MAX_VALUE;
+ const uint8_t malformed_service_type = kInvalidServiceType;
+ for (size_t i = 0; i < max_messages * 2; ++i) {
+ // Malformed message 1
+ SendTMMessage(connection_id, malformed_version, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ // Malformed message 2
+ SendTMMessage(connection_id, PROTOCOL_VERSION_1, PROTECTION_OFF, malformed_frame_type,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ // Malformed message 3
+ SendTMMessage(connection_id, PROTOCOL_VERSION_1, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ malformed_service_type, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+
+ // No common message
+ }
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ MalformedLimitVerification_NullTimePeriod) {
+ const size_t period_msec = 0;
+ const size_t max_messages = 1000;
+ InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect no malformed notification to CH
+ EXPECT_CALL(session_observer_mock,
+ OnMalformedMessageCallback(connection_id)).
+ Times(0);
+
+ // Sending malformed packets
+ const uint8_t malformed_version = PROTOCOL_VERSION_MAX;
+ for (size_t i = 0; i < max_messages + 1; ++i) {
+ SendTMMessage(connection_id, malformed_version, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ }
+}
+TEST_F(ProtocolHandlerImplTest,
+ MalformedLimitVerification_NullCount) {
+ const size_t period_msec = 10000;
+ const size_t max_messages = 0;
+ InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect no malformed notification to CH
+ EXPECT_CALL(session_observer_mock,
+ OnMalformedMessageCallback(connection_id)).
+ Times(0);
+
+ // Sending malformed packets
+ const uint8_t malformed_version = PROTOCOL_VERSION_MAX;
+ for (size_t i = 0; i < max_messages + 1; ++i) {
+ SendTMMessage(connection_id, malformed_version, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_data.size(), message_id, &some_data[0]);
+ }
+}
+
+} // namespace test
+} // namespace components
+} // namespace protocol_handler_test
diff --git a/src/components/protocol_handler/test/protocol_header_validator_test.cc b/src/components/protocol_handler/test/protocol_header_validator_test.cc
new file mode 100644
index 000000000..0f38ae98a
--- /dev/null
+++ b/src/components/protocol_handler/test/protocol_header_validator_test.cc
@@ -0,0 +1,297 @@
+/*
+ * 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 <vector>
+#include <list>
+
+#include "utils/macro.h"
+#include "protocol_handler/protocol_packet.h"
+
+namespace {
+ const size_t MAXIMUM_FRAME_DATA_V3_SIZE = 131072;
+}
+
+namespace test {
+namespace components {
+namespace protocol_handler_test {
+using namespace ::protocol_handler;
+
+class ProtocolHeaderValidatorTest : public ::testing::Test {
+ protected:
+ void SetUp() OVERRIDE {
+ some_message_id = 0xABCDEF0;
+ some_session_id = 0xFEDCBA0;
+ }
+ ProtocolPacket::ProtocolHeaderValidator header_validator;
+ uint32_t some_message_id;
+ uint32_t some_session_id;
+};
+
+// Protocol version shall be from 1 to 3
+TEST_F(ProtocolHeaderValidatorTest, MaxPayloadSizeSetGet) {
+ EXPECT_EQ(std::numeric_limits<size_t>::max(),
+ header_validator.max_payload_size());
+ for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_payload_size(value);
+ EXPECT_EQ(value, header_validator.max_payload_size());
+ }
+}
+
+// Protocol version shall be from 1 to 3
+TEST_F(ProtocolHeaderValidatorTest, Malformed_Version) {
+ std::vector<uint8_t> malformed_versions;
+ malformed_versions.push_back(0);
+ for (uint8_t version = PROTOCOL_VERSION_4 + 1; version <= PROTOCOL_VERSION_MAX; ++version) {
+ malformed_versions.push_back(version);
+ }
+
+ for (size_t i = 0; i < malformed_versions.size(); ++i) {
+ const ProtocolPacket::ProtocolHeader malformed_message_header(
+ malformed_versions[i], PROTECTION_OFF, FRAME_TYPE_CONTROL, kControl,
+ FRAME_DATA_HEART_BEAT, some_session_id, 0u, some_message_id);
+ EXPECT_EQ(RESULT_FAIL, header_validator.validate(malformed_message_header))
+ << "Malformed version " << malformed_message_header.version;
+
+ }
+}
+
+// ServiceType shall be equal 0x0 (Control), 0x07 (RPC), 0x0A (PCM), 0x0B (Video), 0x0F (Bulk)
+TEST_F(ProtocolHeaderValidatorTest, Malformed_ServiceType) {
+ std::vector<uint8_t> malformed_serv_types;
+ for (uint8_t service_type = kControl + 1; service_type < kRpc; ++service_type) {
+ malformed_serv_types.push_back(service_type);
+ }
+ malformed_serv_types.push_back(0x08);
+ malformed_serv_types.push_back(0x09);
+ malformed_serv_types.push_back(0x0C);
+ malformed_serv_types.push_back(0x0D);
+ malformed_serv_types.push_back(0x0E);
+
+ for (size_t i = 0; i < malformed_serv_types.size(); ++i) {
+ const ProtocolPacket::ProtocolHeader malformed_message_header(
+ PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL, malformed_serv_types[i],
+ FRAME_DATA_HEART_BEAT, some_session_id, 0u, some_message_id);
+ EXPECT_EQ(RESULT_FAIL, header_validator.validate(malformed_message_header))
+ << "Malformed service type " << malformed_message_header.serviceType;
+ }
+}
+
+// Frame type shall be 0x00 (Control), 0x01 (Single), 0x02 (First), 0x03 (Consecutive)
+TEST_F(ProtocolHeaderValidatorTest, Malformed_FrameType) {
+ std::vector<uint8_t> malformed_frame_types;
+ for (uint8_t frame_type = FRAME_TYPE_CONSECUTIVE + 1;
+ frame_type <= FRAME_TYPE_MAX_VALUE; ++frame_type) {
+ malformed_frame_types.push_back(frame_type);
+ }
+ for (size_t i = 0; i < malformed_frame_types.size(); ++i) {
+ const ProtocolPacket::ProtocolHeader malformed_message_header(
+ PROTOCOL_VERSION_3, PROTECTION_OFF, malformed_frame_types[i],
+ kControl, FRAME_DATA_HEART_BEAT, some_session_id, 0u, some_message_id);
+ EXPECT_EQ(RESULT_FAIL, header_validator.validate(malformed_message_header))
+ << "Malformed frame type " << malformed_message_header.frameType;
+ }
+}
+
+// For Control frames Frame info value shall be from 0x00 to 0x06 or 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; ++frame_type) {
+ malformed_frame_data.push_back(frame_type);
+ }
+ for (size_t i = 0; i < malformed_frame_data.size(); ++i) {
+ const ProtocolPacket::ProtocolHeader malformed_message_header(
+ PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL, kControl,
+ malformed_frame_data[i], some_session_id, 0u, some_message_id);
+ EXPECT_EQ(RESULT_FAIL, header_validator.validate(malformed_message_header))
+ << "Malformed Control frame with data " << malformed_message_header.frameData;
+ }
+}
+// For Single and First frames Frame info value shall be equal 0x00
+TEST_F(ProtocolHeaderValidatorTest, Malformed_SingleFrame) {
+ std::vector<uint8_t> malformed_frame_data;
+ for (uint8_t frame_type = FRAME_DATA_SINGLE + 1;
+ frame_type < FRAME_DATA_MAX_VALUE; ++frame_type) {
+ malformed_frame_data.push_back(frame_type);
+ }
+ malformed_frame_data.push_back(FRAME_DATA_MAX_VALUE);
+ for (size_t i = 0; i < malformed_frame_data.size(); ++i) {
+ const ProtocolPacket::ProtocolHeader malformed_message_header(
+ PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_SINGLE, kControl,
+ malformed_frame_data[i], some_session_id, 0u, some_message_id);
+ EXPECT_EQ(RESULT_FAIL, header_validator.validate(malformed_message_header))
+ << "Malformed Single frame with data " << malformed_message_header.frameData;
+ // All malformed messages shall be ignored
+ }
+}
+
+// For Single and First frames Frame info value shall be equal 0x00
+TEST_F(ProtocolHeaderValidatorTest, Malformed_FirstFrame) {
+ std::vector<uint8_t> malformed_frame_data;
+ for (uint8_t frame_type = FRAME_DATA_FIRST + 1;
+ frame_type < FRAME_DATA_MAX_VALUE; ++frame_type) {
+ malformed_frame_data.push_back(frame_type);
+ }
+ malformed_frame_data.push_back(FRAME_DATA_MAX_VALUE);
+ for (size_t i = 0; i < malformed_frame_data.size(); ++i) {
+ const ProtocolPacket::ProtocolHeader malformed_message_header(
+ PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_SINGLE, kControl,
+ malformed_frame_data[i], some_session_id, 0u, some_message_id);
+ EXPECT_EQ(RESULT_FAIL, header_validator.validate(malformed_message_header))
+ << "Malformed First frame with data " << malformed_message_header.frameData;
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, Malformed_ControlFrame_EmptyPayload) {
+ const size_t payload_size = 0u;
+ const ProtocolPacket::ProtocolHeader control_message_header(
+ PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_CONTROL, kControl,
+ FRAME_DATA_HEART_BEAT, some_session_id, payload_size, some_message_id);
+ const ProtocolPacket::ProtocolHeader single_message_header(
+ PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_SINGLE, kControl,
+ FRAME_DATA_SINGLE, some_session_id, payload_size, some_message_id);
+ const ProtocolPacket::ProtocolHeader consecutive_message_header(
+ PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_CONSECUTIVE, kControl,
+ FRAME_DATA_LAST_CONSECUTIVE, some_session_id, payload_size, some_message_id);
+
+ for (size_t max_payload_size = 0; max_payload_size < MAXIMUM_FRAME_DATA_V3_SIZE * 2;
+ ++max_payload_size) {
+ header_validator.set_max_payload_size(MAXIMUM_FRAME_DATA_V3_SIZE + max_payload_size);
+
+ // For Control frames Data Size value could be zero
+ EXPECT_EQ(RESULT_OK, header_validator.validate(control_message_header));
+ // For Control frames Data Size value could be zero
+ EXPECT_EQ(RESULT_FAIL, header_validator.validate(single_message_header));
+ EXPECT_EQ(RESULT_FAIL, header_validator.validate(consecutive_message_header));
+ }
+}
+
+// For Control frames Data Size value should be less than MTU header
+TEST_F(ProtocolHeaderValidatorTest, Malformed_Payload_V2) {
+ const size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE;
+ const ProtocolPacket::ProtocolHeader control_message_header(
+ PROTOCOL_VERSION_2, PROTECTION_ON, FRAME_TYPE_CONTROL, kControl,
+ FRAME_DATA_HEART_BEAT, some_session_id, payload_size, some_message_id);
+ const ProtocolPacket::ProtocolHeader single_message_header(
+ PROTOCOL_VERSION_2, PROTECTION_ON, FRAME_TYPE_SINGLE, kControl,
+ FRAME_DATA_SINGLE, some_session_id, payload_size, some_message_id);
+ const ProtocolPacket::ProtocolHeader consecutive_message_header(
+ PROTOCOL_VERSION_2, PROTECTION_ON, FRAME_TYPE_CONSECUTIVE, kControl,
+ FRAME_DATA_LAST_CONSECUTIVE, some_session_id, payload_size, some_message_id);
+
+ for (size_t max_payload_size = 0;
+ max_payload_size < MAXIMUM_FRAME_DATA_V3_SIZE * 2;
+ ++max_payload_size) {
+ header_validator.set_max_payload_size(max_payload_size);
+ EXPECT_EQ(RESULT_OK, header_validator.validate(control_message_header));
+ EXPECT_EQ(RESULT_OK, header_validator.validate(single_message_header));
+ EXPECT_EQ(RESULT_OK, header_validator.validate(consecutive_message_header));
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, Malformed_Payload_V3) {
+ const size_t payload_size = MAXIMUM_FRAME_DATA_V3_SIZE;
+ const ProtocolPacket::ProtocolHeader control_message_header(
+ PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_CONTROL, kControl,
+ FRAME_DATA_HEART_BEAT, some_session_id, payload_size, some_message_id);
+ const ProtocolPacket::ProtocolHeader single_message_header(
+ PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_SINGLE, kControl,
+ FRAME_DATA_SINGLE, some_session_id, payload_size, some_message_id);
+ const ProtocolPacket::ProtocolHeader consecutive_message_header(
+ PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_CONSECUTIVE, kControl,
+ FRAME_DATA_LAST_CONSECUTIVE, some_session_id, payload_size, some_message_id);
+
+ for (size_t max_payload_size = 0;
+ max_payload_size < MAXIMUM_FRAME_DATA_V3_SIZE;
+ ++max_payload_size) {
+ header_validator.set_max_payload_size(max_payload_size);
+ EXPECT_EQ(RESULT_FAIL, header_validator.validate(control_message_header));
+ EXPECT_EQ(RESULT_FAIL, header_validator.validate(single_message_header));
+ EXPECT_EQ(RESULT_FAIL, header_validator.validate(consecutive_message_header));
+ }
+
+ for (size_t max_payload_size = MAXIMUM_FRAME_DATA_V3_SIZE;
+ max_payload_size < MAXIMUM_FRAME_DATA_V3_SIZE * 2;
+ ++max_payload_size) {
+ header_validator.set_max_payload_size(max_payload_size);
+ EXPECT_EQ(RESULT_OK, header_validator.validate(control_message_header));
+ EXPECT_EQ(RESULT_OK, header_validator.validate(single_message_header));
+ EXPECT_EQ(RESULT_OK, header_validator.validate(consecutive_message_header));
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, Malformed_Payload_V3_with_V2_size) {
+ const size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE;
+ const ProtocolPacket::ProtocolHeader control_message_header(
+ PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_CONTROL, kControl,
+ FRAME_DATA_HEART_BEAT, some_session_id, payload_size, some_message_id);
+ const ProtocolPacket::ProtocolHeader single_message_header(
+ PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_SINGLE, kControl,
+ FRAME_DATA_SINGLE, some_session_id, payload_size, some_message_id);
+ const ProtocolPacket::ProtocolHeader consecutive_message_header(
+ PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_CONSECUTIVE, kControl,
+ FRAME_DATA_LAST_CONSECUTIVE, some_session_id, payload_size, some_message_id);
+
+ for (size_t max_payload_size = 0;
+ max_payload_size < MAXIMUM_FRAME_DATA_V3_SIZE * 2;
+ ++max_payload_size) {
+ header_validator.set_max_payload_size(max_payload_size);
+ EXPECT_EQ(RESULT_OK, header_validator.validate(control_message_header));
+ EXPECT_EQ(RESULT_OK, header_validator.validate(single_message_header));
+ EXPECT_EQ(RESULT_OK, header_validator.validate(consecutive_message_header));
+ }
+}
+
+// Message ID be equal or greater than 0x01
+TEST_F(ProtocolHeaderValidatorTest, Malformed_MessageID) {
+ const uint32_t malformed_message_id = 0x0u;
+ ProtocolPacket::ProtocolHeader message_header(
+ PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_FIRST, kControl,
+ FRAME_DATA_HEART_BEAT, some_session_id, 0u, malformed_message_id);
+
+ message_header.frameType = FRAME_TYPE_FIRST;
+ message_header.version = PROTOCOL_VERSION_1;
+ EXPECT_EQ(RESULT_OK, header_validator.validate(message_header));
+
+ message_header.version = PROTOCOL_VERSION_2;
+ EXPECT_EQ(RESULT_FAIL, header_validator.validate(message_header));
+ message_header.version = PROTOCOL_VERSION_3;
+ EXPECT_EQ(RESULT_FAIL, header_validator.validate(message_header));
+
+ message_header.frameType = FRAME_TYPE_CONTROL;
+ EXPECT_EQ(RESULT_OK, header_validator.validate(message_header));
+}
+
+} // namespace protocol_handler_test
+} // namespace components
+} // namespace test
diff --git a/src/components/protocol_handler/test/protocol_packet_test.cc b/src/components/protocol_handler/test/protocol_packet_test.cc
new file mode 100644
index 000000000..66fbe6f0a
--- /dev/null
+++ b/src/components/protocol_handler/test/protocol_packet_test.cc
@@ -0,0 +1,201 @@
+/*
+ * 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 <vector>
+#include <list>
+
+#include "utils/macro.h"
+#include "protocol_handler/protocol_packet.h"
+
+namespace test {
+namespace components {
+namespace protocol_handler_test {
+using namespace ::protocol_handler;
+
+class ProtocolPacketTest : public ::testing::Test {
+ protected:
+ void SetUp() OVERRIDE {
+ some_message_id = 0xABCDEF0;
+ some_session_id = 0xFEDCBA0;
+ some_connection_id = 10;
+ }
+ uint32_t some_message_id;
+ uint32_t some_session_id;
+ ConnectionID some_connection_id;
+};
+
+TEST_F(ProtocolPacketTest, SerializePacketWithDiffVersions) {
+ RawMessagePtr res;
+ uint8_t version = PROTOCOL_VERSION_1;
+ for (; version <= PROTOCOL_VERSION_MAX; ++version) {
+ ProtocolPacket prot_packet(
+ some_connection_id, version, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ kControl, FRAME_DATA_HEART_BEAT, some_session_id, 0u, some_message_id);
+ res = prot_packet.serializePacket();
+ EXPECT_EQ(res->protocol_version(), version);
+ EXPECT_EQ(res->service_type(), kControl);
+ EXPECT_EQ(res->connection_key(), some_connection_id);
+ if (res->protocol_version() == PROTOCOL_VERSION_1) {
+ EXPECT_EQ(res->data_size(), 8u);
+ } else {
+ EXPECT_EQ(res->data_size(), 12u);
+ }
+ }
+}
+
+// ServiceType should be equal 0x0 (Control), 0x07 (RPC), 0x0A (PCM), 0x0B
+// (Video), 0x0F (Bulk)
+TEST_F(ProtocolPacketTest, SerializePacketWithDiffServiceType) {
+ std::vector<uint8_t> serv_types;
+ serv_types.push_back(0x0);
+ serv_types.push_back(0x07);
+ serv_types.push_back(0x0A);
+ serv_types.push_back(0x0B);
+ serv_types.push_back(0x0F);
+
+ RawMessagePtr res;
+ for (size_t i = 0; i < serv_types.size(); ++i) {
+ ProtocolPacket prot_packet(some_connection_id, PROTOCOL_VERSION_3,
+ PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ serv_types[i], FRAME_DATA_HEART_BEAT,
+ some_session_id, 0u, some_message_id);
+ res = prot_packet.serializePacket();
+ EXPECT_EQ(PROTOCOL_VERSION_3, res->protocol_version());
+ EXPECT_EQ(serv_types[i], res->service_type());
+ EXPECT_EQ(12u, res->data_size());
+ }
+}
+
+TEST_F(ProtocolPacketTest, SerializePacketWithWrongServiceType) {
+ std::vector<uint8_t> serv_types;
+ for (uint8_t service_type = kControl + 1; service_type < kRpc;
+ ++service_type) {
+ serv_types.push_back(service_type);
+ }
+ serv_types.push_back(0x08);
+ serv_types.push_back(0x09);
+ serv_types.push_back(0x0C);
+ serv_types.push_back(0x0D);
+ serv_types.push_back(0x0E);
+
+ RawMessagePtr res;
+ for (size_t i = 0; i < serv_types.size(); ++i) {
+ ProtocolPacket prot_packet(some_connection_id, PROTOCOL_VERSION_3,
+ PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ serv_types[i], FRAME_DATA_HEART_BEAT,
+ some_session_id, 0u, some_message_id);
+ res = prot_packet.serializePacket();
+ EXPECT_EQ(PROTOCOL_VERSION_3, res->protocol_version());
+ EXPECT_EQ(kInvalidServiceType, res->service_type());
+ }
+}
+
+TEST_F(ProtocolPacketTest, SetPacketWithDiffFrameType) {
+ RawMessagePtr res;
+ uint8_t frame_type;
+ for (frame_type = FRAME_TYPE_CONTROL + 1; frame_type <= FRAME_TYPE_MAX_VALUE;
+ ++frame_type) {
+ ProtocolPacket prot_packet(
+ some_connection_id, PROTOCOL_VERSION_3, PROTECTION_OFF, frame_type,
+ kControl, FRAME_DATA_HEART_BEAT, some_session_id, 0u, some_message_id);
+ res = prot_packet.serializePacket();
+ EXPECT_EQ(PROTOCOL_VERSION_3, res->protocol_version());
+ EXPECT_EQ(kControl, res->service_type());
+ EXPECT_EQ(frame_type, prot_packet.frame_type());
+ }
+}
+
+TEST_F(ProtocolPacketTest, AppendDataToEmptyPacket) {
+ // Set version, serviceType, frameData, sessionId
+ uint8_t session_id = 1u;
+ uint8_t some_data[] = {0x0, 0x07, 0x02, session_id};
+ ProtocolPacket protocol_packet;
+ RESULT_CODE res = protocol_packet.appendData(some_data, sizeof(some_data));
+ EXPECT_EQ(RESULT_FAIL, res);
+}
+
+TEST_F(ProtocolPacketTest, SetTotalDataBytes) {
+ uint8_t new_data_size = 10u;
+ ProtocolPacket protocol_packet;
+ protocol_packet.set_total_data_bytes(new_data_size);
+
+ EXPECT_EQ(new_data_size, protocol_packet.total_data_bytes());
+}
+
+TEST_F(ProtocolPacketTest, AppendDataToPacketWithNonZeroSize) {
+ // Set version, serviceType, frameData, sessionId
+ uint8_t session_id = 1u;
+ uint8_t some_data[] = {0x0, 0x07, FRAME_TYPE_CONTROL, session_id};
+ ProtocolPacket protocol_packet;
+ protocol_packet.set_total_data_bytes(sizeof(some_data) + 1);
+ RESULT_CODE res = protocol_packet.appendData(some_data, sizeof(some_data));
+ EXPECT_EQ(RESULT_OK, res);
+
+ EXPECT_EQ(0x0, protocol_packet.data()[0]);
+ EXPECT_EQ(0x07, protocol_packet.data()[1]);
+ EXPECT_EQ(FRAME_TYPE_CONTROL, protocol_packet.data()[2]);
+ EXPECT_EQ(session_id, protocol_packet.data()[3]);
+}
+
+TEST_F(ProtocolPacketTest, SetData) {
+ uint8_t session_id = 1u;
+ uint8_t some_data[] = {0x0, 0x07, FRAME_TYPE_CONTROL, session_id};
+ ProtocolPacket protocol_packet;
+ protocol_packet.set_data(some_data, sizeof(some_data));
+
+ EXPECT_EQ(0x0, protocol_packet.data()[0]);
+ EXPECT_EQ(0x07, protocol_packet.data()[1]);
+ EXPECT_EQ(FRAME_TYPE_CONTROL, protocol_packet.data()[2]);
+ EXPECT_EQ(session_id, protocol_packet.data()[3]);
+}
+
+TEST_F(ProtocolPacketTest, DeserializeZeroPacket) {
+ uint8_t message[] = {};
+ ProtocolPacket protocol_packet;
+ RESULT_CODE res = protocol_packet.deserializePacket(message, 0);
+ EXPECT_EQ(RESULT_OK, res);
+}
+
+TEST_F(ProtocolPacketTest, DeserializeNonZeroPacket) {
+ // Set header, serviceType, frameData, sessionId
+ uint8_t session_id = 1u;
+ uint8_t some_message[] = {0x21, 0x07, 0x02, session_id};
+ ProtocolPacket protocol_packet;
+ RESULT_CODE res =
+ protocol_packet.deserializePacket(some_message, PROTOCOL_HEADER_V2_SIZE);
+ EXPECT_EQ(RESULT_OK, res);
+}
+
+} // namespace protocol_handler_test
+} // namespace components
+} // namespace test
diff --git a/src/components/protocol_handler/test/protocol_payload_test.cc b/src/components/protocol_handler/test/protocol_payload_test.cc
new file mode 100644
index 000000000..3b973e106
--- /dev/null
+++ b/src/components/protocol_handler/test/protocol_payload_test.cc
@@ -0,0 +1,270 @@
+/*
+ * 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 <vector>
+
+#include "utils/macro.h"
+#include "utils/bitstream.h"
+#include "protocol_handler/protocol_payload.h"
+#include "protocol/common.h"
+
+namespace test {
+namespace components {
+namespace protocol_handler_test {
+using namespace ::protocol_handler;
+using ::utils::BitStream;
+
+void prepare_data(uint8_t* data_for_sending, ProtocolPayloadV2& message) {
+ uint8_t rpc_type_flag = message.header.rpc_type;
+ uint8_t offset = 0;
+
+ uint32_t function_id = message.header.rpc_function_id;
+ data_for_sending[offset++] = ((rpc_type_flag << 4) & 0xF0) | (function_id >> 24);
+ data_for_sending[offset++] = function_id >> 16;
+ data_for_sending[offset++] = function_id >> 8;
+ data_for_sending[offset++] = function_id;
+
+ uint32_t correlationId = message.header.correlation_id;
+ data_for_sending[offset++] = correlationId >> 24;
+ data_for_sending[offset++] = correlationId >> 16;
+ data_for_sending[offset++] = correlationId >> 8;
+ data_for_sending[offset++] = correlationId;
+
+ uint32_t jsonSize = message.header.json_size;
+ data_for_sending[offset++] = jsonSize >> 24;
+ data_for_sending[offset++] = jsonSize >> 16;
+ data_for_sending[offset++] = jsonSize >> 8;
+ data_for_sending[offset++] = jsonSize;
+
+ if (message.json.length() != 0) {
+ memcpy(data_for_sending + offset, message.json.c_str(),
+ message.json.size());
+ }
+
+ if (message.data.size() != 0) {
+ uint8_t* current_pointer = data_for_sending + offset + message.json.length();
+ u_int32_t binarySize = message.data.size();
+ for (uint32_t i = 0; i < binarySize; ++i) {
+ current_pointer[i] = message.data[i];
+ }
+ }
+}
+
+TEST(ProtocolPayloadTest, ExtractProtocolWithOnlyHeader) {
+ ProtocolPayloadV2 prot_payload_test;
+
+ prot_payload_test.header.correlation_id = 1;
+ prot_payload_test.header.rpc_function_id = 2;
+ prot_payload_test.header.json_size = 0;
+ prot_payload_test.header.rpc_type = kRpcTypeRequest;
+
+ const size_t data_for_sending_size = PROTOCOL_HEADER_V2_SIZE;
+ uint8_t* data_for_sending = new uint8_t[data_for_sending_size];
+
+ prepare_data(data_for_sending, prot_payload_test);
+
+ BitStream bs(data_for_sending, data_for_sending_size);
+
+ ProtocolPayloadV2 prot_payload;
+ Extract(&bs, &prot_payload, data_for_sending_size);
+
+ EXPECT_TRUE(bs.IsGood());
+
+ EXPECT_EQ(prot_payload_test.header.correlation_id,
+ prot_payload.header.correlation_id);
+ EXPECT_EQ(prot_payload_test.header.json_size, prot_payload.header.json_size);
+ EXPECT_EQ(prot_payload_test.header.rpc_function_id,
+ prot_payload.header.rpc_function_id);
+ EXPECT_EQ(prot_payload_test.header.rpc_type, prot_payload.header.rpc_type);
+ delete[] data_for_sending;
+}
+
+TEST(ProtocolPayloadTest, ExtractCorrectProtocolWithDataWithoutJSON) {
+ ProtocolPayloadV2 prot_payload_test;
+
+ prot_payload_test.header.correlation_id = 1;
+ prot_payload_test.header.rpc_function_id = 2;
+ prot_payload_test.header.json_size = 0;
+ prot_payload_test.header.rpc_type = kRpcTypeNotification;
+ prot_payload_test.data = {1, 2, 3};
+
+ const size_t data_for_sending_size = PROTOCOL_HEADER_V2_SIZE +
+ prot_payload_test.data.size() +
+ prot_payload_test.json.length();
+ uint8_t* data_for_sending = new uint8_t[data_for_sending_size];
+
+ prepare_data(data_for_sending, prot_payload_test);
+
+ BitStream bs(data_for_sending, data_for_sending_size);
+
+ ProtocolPayloadV2 prot_payload;
+ Extract(&bs, &prot_payload, data_for_sending_size);
+
+ EXPECT_TRUE(bs.IsGood());
+
+ EXPECT_EQ(prot_payload_test.header.correlation_id,
+ prot_payload.header.correlation_id);
+ EXPECT_EQ(prot_payload_test.header.json_size, prot_payload.header.json_size);
+ EXPECT_EQ(prot_payload_test.header.rpc_function_id,
+ prot_payload.header.rpc_function_id);
+ EXPECT_EQ(prot_payload_test.header.rpc_type, prot_payload.header.rpc_type);
+ EXPECT_EQ(prot_payload_test.data.size(), prot_payload.data.size());
+ EXPECT_EQ(prot_payload_test.data[0], prot_payload.data[0]);
+ EXPECT_EQ(prot_payload_test.data[1], prot_payload.data[1]);
+ EXPECT_EQ(prot_payload_test.data[2], prot_payload.data[2]);
+
+ delete[] data_for_sending;
+}
+
+TEST(ProtocolPayloadTest, ExtractCorrectProtocolWithoutDataWithJSON) {
+ ProtocolPayloadV2 prot_payload_test;
+
+ prot_payload_test.header.correlation_id = 1;
+ prot_payload_test.header.rpc_function_id = 2;
+
+ prot_payload_test.header.rpc_type = kRpcTypeResponse;
+
+ std::string expect_output_json_string =
+ "{\n \" : {\n \"name\" : \"\",\n\"parameters\" : \"\"\n}\n}\n";
+
+ prot_payload_test.json = expect_output_json_string;
+ prot_payload_test.header.json_size = prot_payload_test.json.length();
+
+ const size_t data_for_sending_size = PROTOCOL_HEADER_V2_SIZE +
+ prot_payload_test.data.size() +
+ prot_payload_test.json.length();
+ uint8_t *data_for_sending = new uint8_t[data_for_sending_size];
+ prepare_data(data_for_sending, prot_payload_test);
+
+ BitStream bs(data_for_sending, data_for_sending_size);
+ ProtocolPayloadV2 prot_payload;
+ Extract(&bs, &prot_payload, data_for_sending_size);
+
+ EXPECT_TRUE(bs.IsGood());
+
+ EXPECT_EQ(prot_payload_test.header.correlation_id,
+ prot_payload.header.correlation_id);
+ EXPECT_EQ(prot_payload_test.header.json_size, prot_payload.header.json_size);
+ EXPECT_EQ(prot_payload_test.header.rpc_function_id,
+ prot_payload.header.rpc_function_id);
+ EXPECT_EQ(prot_payload_test.header.rpc_type, prot_payload.header.rpc_type);
+ EXPECT_EQ(prot_payload_test.json.length(), prot_payload.json.length());
+ EXPECT_EQ(prot_payload_test.json, prot_payload.json);
+ delete[] data_for_sending;
+}
+
+TEST(ProtocolPayloadTest, ExtractCorrectProtocolWithDataWithJSON) {
+ ProtocolPayloadV2 prot_payload_test;
+
+ prot_payload_test.header.correlation_id = 1;
+ prot_payload_test.header.rpc_function_id = 2;
+ prot_payload_test.header.rpc_type = kRpcTypeRequest;
+ prot_payload_test.data = {1, 2, 3};
+
+ std::string expect_output_json_string =
+ "{\n \" : {\n \"name\" : \"\",\n\"parameters\" : \"\"\n}\n}\n";
+
+ prot_payload_test.json = expect_output_json_string;
+ prot_payload_test.header.json_size = prot_payload_test.json.length();
+
+ const size_t data_for_sending_size = PROTOCOL_HEADER_V2_SIZE +
+ prot_payload_test.data.size() +
+ prot_payload_test.json.length();
+ uint8_t* data_for_sending = new uint8_t[data_for_sending_size];
+ prepare_data(data_for_sending, prot_payload_test);
+
+ BitStream bs(data_for_sending, data_for_sending_size);
+ ProtocolPayloadV2 prot_payload;
+ Extract(&bs, &prot_payload, data_for_sending_size);
+
+ EXPECT_TRUE(bs.IsGood());
+
+ EXPECT_EQ(prot_payload_test.header.correlation_id,
+ prot_payload.header.correlation_id);
+ EXPECT_EQ(prot_payload_test.header.json_size, prot_payload.header.json_size);
+ EXPECT_EQ(prot_payload_test.header.rpc_function_id,
+ prot_payload.header.rpc_function_id);
+ EXPECT_EQ(prot_payload_test.header.rpc_type, prot_payload.header.rpc_type);
+ EXPECT_EQ(prot_payload_test.json.length(), prot_payload.json.length());
+ EXPECT_EQ(prot_payload_test.json, prot_payload.json);
+ EXPECT_EQ(prot_payload_test.data.size(), prot_payload.data.size());
+ EXPECT_EQ(prot_payload_test.data[0], prot_payload.data[0]);
+ EXPECT_EQ(prot_payload_test.data[1], prot_payload.data[1]);
+ EXPECT_EQ(prot_payload_test.data[2], prot_payload.data[2]);
+
+ delete[] data_for_sending;
+}
+
+TEST(ProtocolPayloadTest, ExtractProtocolWithJSONWithDataWithWrongPayloadSize) {
+ ProtocolPayloadV2 prot_payload_test;
+
+ prot_payload_test.header.correlation_id = 1;
+ prot_payload_test.header.rpc_function_id = 2;
+
+ prot_payload_test.header.rpc_type = kRpcTypeResponse;
+ prot_payload_test.data = {1, 2, 3};
+
+ std::string expect_output_json_string =
+ "{\n \" : {\n \"name\" : \"\",\n\"parameters\" : \"\"\n}\n}\n";
+
+ prot_payload_test.json = expect_output_json_string;
+ prot_payload_test.header.json_size = prot_payload_test.json.length();
+
+ const size_t data_for_sending_size =
+ PROTOCOL_HEADER_V2_SIZE + prot_payload_test.json.length();
+ uint8_t* data_for_sending = new uint8_t[data_for_sending_size];
+ prepare_data(data_for_sending, prot_payload_test);
+
+ BitStream bs(data_for_sending, data_for_sending_size);
+ ProtocolPayloadV2 prot_payload;
+
+ // Try extract with payload size less than size of data
+ Extract(&bs, &prot_payload, PROTOCOL_HEADER_V2_SIZE);
+
+ EXPECT_TRUE(bs.IsBad());
+
+ EXPECT_EQ(prot_payload_test.header.correlation_id,
+ prot_payload.header.correlation_id);
+ EXPECT_EQ(prot_payload_test.header.json_size, prot_payload.header.json_size);
+ EXPECT_EQ(prot_payload_test.header.rpc_function_id,
+ prot_payload.header.rpc_function_id);
+ EXPECT_EQ(prot_payload_test.header.rpc_type, prot_payload.header.rpc_type);
+ EXPECT_EQ(prot_payload_test.json.length(), prot_payload.json.length());
+ EXPECT_EQ(prot_payload_test.json, prot_payload.json);
+ EXPECT_EQ(0u, prot_payload.data.size());
+ delete[] data_for_sending;
+}
+
+} // namespace protocol_handler_test
+} // namespace components
+} // namespace test
diff --git a/src/components/qt_hmi/CMakeLists.txt b/src/components/qt_hmi/CMakeLists.txt
index e77a1e23b..ee30f2b46 100644
--- a/src/components/qt_hmi/CMakeLists.txt
+++ b/src/components/qt_hmi/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2013, Ford Motor Company
+# Copyright (c) 2014, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -36,3 +36,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
else ()
add_subdirectory(./qml_model_qt5)
endif ()
+
+if(HMI STREQUAL "qt" AND BUILD_TESTS)
+ add_subdirectory(test)
+endif() \ No newline at end of file
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h b/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h
index baf67f247..bd6c50f54 100644
--- a/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h
@@ -6,7 +6,7 @@
handled here.
It is recommended not to modify this file, since newer versions of Qt Creator
may offer an updated version of it.
-*/
+ */
#ifndef QTQUICK2APPLICATIONVIEWER_H
#define QTQUICK2APPLICATIONVIEWER_H
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml
index 0f3cfd714..b1b7f7179 100644
--- a/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml
+++ b/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml
@@ -49,7 +49,7 @@ OvalButton {
highlighted: button ? button.isHighlighted : false
onPressed: {
actionOrder = SoftButton.Action.doOnClicked
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONDOWN, button.softButtonID)
+ sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONDOWN, button.softButtonID, appId)
}
onReleased: {
@@ -67,11 +67,11 @@ OvalButton {
}
}
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONUP, button.softButtonID)
+ sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONUP, button.softButtonID, appId)
}
onClicked: {
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.SHORT, button.softButtonID);
+ sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.SHORT, button.softButtonID, appId);
switch (button.systemAction) {
case Common.SystemAction.DEFAULT_ACTION:
defaultAction();
@@ -87,7 +87,7 @@ OvalButton {
onPressAndHold: {
actionOrder = SoftButton.Action.doOnReleased; // action should be triggered on release
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.LONG, button.softButtonID);
+ sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.LONG, button.softButtonID, appId);
}
onButtonChanged: {
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml
index d89747c3c..659b7842c 100644
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml
+++ b/src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml
@@ -203,6 +203,7 @@ Item {
"updateMode": Internal.MediaClockUpdateMode.MCU_COUNTUP,
"runningMode": Internal.MediaClockRunningMode.MCR_STOPPED,
"magic": Internal.stringToHmsTime(fieldSubstrings[Common.TextFieldName.mediaClock]),
+ "startTime": Internal.stringToHmsTime(fieldSubstrings[Common.TextFieldName.mediaClock]),
"startTimeForProgress": -1
}
}
@@ -339,7 +340,11 @@ Item {
break
}
newStartTime = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- newEndTime = endTime ? Internal.hmsTime(endTime.hours, endTime.minutes, endTime.seconds) : -1
+ newEndTime = endTime ? Internal.hmsTime(endTime.hours,
+ endTime.minutes,
+ endTime.seconds)
+ : dataContainer.currentApplication.mediaClock.upperTimeLimit
+
newUpdateMode = Internal.MediaClockUpdateMode.MCU_COUNTUP
newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
newStartTimeForProgress = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
@@ -353,7 +358,7 @@ Item {
break
}
newStartTime = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- newEndTime = endTime ? Internal.hmsTime(endTime.hours, endTime.minutes, endTime.seconds) : -1
+ newEndTime = endTime ? Internal.hmsTime(endTime.hours, endTime.minutes, endTime.seconds) : 0
newUpdateMode = Internal.MediaClockUpdateMode.MCU_COUNTDOWN
newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
newStartTimeForProgress = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
@@ -372,7 +377,7 @@ Item {
newEndTime = app.mediaClock.endTime
newRunningMode = Internal.MediaClockRunningMode.MCR_STOPPED
newUpdateMode = app.mediaClock.updateMode
- newStartTimeForProgress = app.mediaClock.startTime
+ newStartTimeForProgress = app.mediaClock.startTimeForProgress
resultCode = Common.Result.SUCCESS
break
@@ -387,7 +392,7 @@ Item {
newStartTime = app.mediaClock.startTime
newEndTime = app.mediaClock.endTime
newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
- newStartTimeForProgress = app.mediaClock.startTime
+ newStartTimeForProgress = app.mediaClock.startTimeForProgress
newUpdateMode = app.mediaClock.updateMode
resultCode = Common.Result.SUCCESS
break
@@ -631,7 +636,7 @@ Item {
}
}
- function performAudioPassThru (audioPassThruDisplayTexts, timeout, appID) {
+ function performAudioPassThru (appID, audioPassThruDisplayTexts, timeout) {
var displayTextsLog = "";
if (audioPassThruDisplayTexts) {
for (var i = 0; i < audioPassThruDisplayTexts.length; i++) {
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml
index 8a426197e..8158b3271 100644
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml
+++ b/src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml
@@ -34,7 +34,6 @@
import QtQuick 2.0
import "Common.js" as Common
-
Item {
function isReady() {
console.log("Message Received - {method: 'VR.IsReady'}")
@@ -43,7 +42,7 @@ Item {
}
}
- function addCommand(cmdID, vrCommands, appID) {
+ function addCommand(cmdID, vrCommands, type, grammarID, appID) {
var vrCommandsLog = "";
if (vrCommands) {
for (var i = 0; i < vrCommands.length; i++) {
@@ -53,14 +52,29 @@ Item {
console.log("Message Received - {method: 'VR.AddCommand', params:{ " +
"vrCommands: [" + vrCommandsLog + "], " +
"cmdID: " + cmdID + ", " +
- "appID: " + appID +
+ "appID: " + appID + ", " +
+ "type: " + type + ", " +
+ "grammarID: " + grammarID +
"}}")
for (var i = 0; i < vrCommands.length; ++i) {
- dataContainer.vrCommands.append({
+ if (type === Common.VRCommandType.Command) {
+ dataContainer.vrCommands.append({
cmdID: cmdID,
command: vrCommands[i],
appID: appID === undefined ? 0 : appID,
+ type: type,
+ grammarID: grammarID,
});
+ }
+ else {
+ dataContainer.choicesVrCommands.append({
+ cmdID: cmdID,
+ command: vrCommands[i],
+ appID: appID === undefined ? 0 : appID,
+ type: type,
+ grammarID: grammarID,
+ });
+ }
}
console.log("exit")
}
@@ -111,4 +125,46 @@ Item {
dataContainer.changeRegistrationTTSVR(language, appID);
console.debug("exit");
}
+ function ttsChunksToString(ttsChunks){
+ return ttsChunks.map(function(str) { return str.text }).join('\n')
+ }
+ function performInteraction(helpPrompt, initialPrompt, timeoutPrompt, timeout, grammarID) {
+ console.debug("enter");
+ var helpttsChunksLog = "",
+ initialttsChunkLog = "",
+ timeoutttsChunkLog = "",
+ grammarIDLog ="";
+
+ if (helpPrompt) {
+ for (var i = 0; i < helpPrompt.length; i++) {
+ helpttsChunksLog += "{type: " + helpPrompt[i].type + ", " +
+ "text: '" + helpPrompt[i].text + "'}, ";
+ }
+ }
+ if (initialPrompt) {
+ for (var i = 0; i < initialPrompt.length; i++) {
+ initialttsChunkLog += "{type: " + initialPrompt[i].type + ", " +
+ "text: '" + initialPrompt[i].text + "'}, ";
+ }
+ }
+ if (timeoutPrompt) {
+ for (var i = 0; i < timeoutPrompt.length; i++) {
+ timeoutttsChunkLog += "{type: " + timeoutPrompt[i].type + ", " +
+ "text: '" + timeoutPrompt[i].text + "'}, ";
+ }
+ }
+ console.log("Message Received - {method: 'TTS.PerformInteraction', params:{ " +
+ "helpPrompt: [" + helpttsChunksLog + "], " +
+ "initialPrompt: [" + initialttsChunkLog + "], " +
+ "timeoutPrompt: [" + timeoutttsChunkLog + "], " +
+ "timeout: " + timeout +
+ "}}")
+
+ ttsPopUp.performInteraction(ttsChunksToString(helpPrompt),
+ ttsChunksToString(initialPrompt),
+ ttsChunksToString(timeoutPrompt),
+ timeout)
+ interactionPopup.grammarID = grammarID
+ console.debug("exit");
+ }
}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml b/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml
index 659a8eabd..e3785bdf1 100644
--- a/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml
+++ b/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml
@@ -442,7 +442,8 @@ QtObject {
property ListModel deviceList: ListModel { }
property ListModel applicationList: ListModel { }
property ListModel stashedApplicationsList: ListModel { }
- property ListModel vrCommands: ListModel {}
+ property ListModel vrCommands: ListModel { }
+ property ListModel choicesVrCommands: ListModel { }
function reset () {
console.log("dataContainer reset enter");
diff --git a/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml b/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml
index cae82c36f..3712ca4c3 100644
--- a/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml
+++ b/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml
@@ -73,28 +73,22 @@ QtObject {
function onTimer () {
switch (updateMode) {
case Internal.MediaClockUpdateMode.MCU_COUNTUP:
- if (endTime !== -1) {
- if (startTime < endTime) {
- startTime++
- } else {
- timer.stop()
- runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- console.debug("count Up timer stopped")
- }
+ console.debug("count up")
+ if (startTime < endTime) {
+ startTime++
} else {
- if (startTime < upperTimeLimit) {
- startTime++
- } else {
- startTime = 0
- }
+ timer.stop()
+ runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
+ console.debug("count Up timer stopped")
}
break
case Internal.MediaClockUpdateMode.MCU_COUNTDOWN:
console.debug("count down")
- if (--startTime === 0) {
+ if (startTime > endTime) {
+ startTime--
+ } else {
timer.stop()
runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- startTime = endTime = -1
console.debug("count Down timer stopped")
}
break
@@ -112,13 +106,12 @@ QtObject {
function onProgress () {
if (startTime === -1) {
progress = 0
- } else {
- if (updateMode === Internal.MediaClockUpdateMode.MCU_COUNTUP) {
- progress = (endTime !== -1) ? (startTime / endTime) : (startTime / upperTimeLimit)
- } else {
- progress = (endTime !== -1) ? ( (startTime - endTime) / (startTimeForProgress - endTime) )
- : (startTime / startTimeForProgress)
- }
+ }
+ else if (endTime != -1 && endTime === startTimeForProgress) {
+ progress = 1
+ }
+ else {
+ progress = (startTime - startTimeForProgress) / (endTime - startTimeForProgress)
}
}
}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml
index 782fd76c1..a6fc4d710 100644
--- a/src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml
+++ b/src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml
@@ -46,6 +46,7 @@ ContextPopup {
property int appID
property int interactionLayout
property var async
+ property var grammarID
property bool performInteractionIsActiveNow
Text {
@@ -84,13 +85,15 @@ ContextPopup {
}
}
- function performInteraction(initialText, choiceSet, vrHelpTitle, vrHelp, timeout, interactionLayout, appID) {
+ function performInteraction(initialTextArg, choiceSet, vrHelpTitle, vrHelp, timeout, interactionLayout, appID) {
console.debug("enter")
var app = dataContainer.getApplication(appID)
var dataToUpdate = {}
performInteractionIsActiveNow = true
- initialText.text = initialText.fieldText
+ if (initialTextArg !== undefined){
+ initialText.text = initialTextArg.fieldText
+ }
this.timeout = timeout
this.appID = appID
@@ -123,6 +126,8 @@ ContextPopup {
async = new Async.AsyncCall()
if (piPopUp.choiceSet.count !== 0) {
activate()
+ }else if (grammarID) {
+ vrActivate()
}
console.debug("exit")
return async
@@ -132,9 +137,21 @@ ContextPopup {
console.debug("enter")
timer.interval = timeout
timer.start()
+ if (grammarID) {
+ vrPopUp.sortModelforPerformInteraction()
+ }
show()
console.debug("exit")
}
+ function vrActivate () {
+ console.debug("enter")
+ timer.interval = timeout
+ timer.start()
+ vrPopUp.sortModelforPerformInteraction()
+ vrPopUp.show()
+ vrHelpPopup.show()
+ console.debug("exit")
+ }
function complete (reason, data) {
console.debug("enter")
@@ -150,6 +167,7 @@ ContextPopup {
break
}
timer.stop()
+ grammarID = ""
hide()
performInteractionIsActiveNow = false
console.debug("exit")
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml
index 33f82013b..d16015ec5 100644
--- a/src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml
+++ b/src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml
@@ -42,6 +42,7 @@ PopUp {
width: Constants.ttsPopUpWidth
padding: Constants.ttsPopUpPadding
property var async
+ property string helpPromptstr
ScrollView {
anchors.fill: parent
@@ -50,6 +51,7 @@ PopUp {
anchors.fill: parent
color: Constants.popUpBorderColor
font.pixelSize: Constants.ttsFontSize
+ text:""
}
}
@@ -63,12 +65,16 @@ PopUp {
Timer {
id: ttsPerformInteractionTimer
interval: Constants.ttsSpeakTime
- onTriggered: activate(message)
+ onTriggered:
+ if(interactionPopup.performInteractionIsActiveNow)
+ activate(message)
property var message: undefined
}
]
function performInteraction(helpPrompt, initialPrompt, timeoutPrompt, timeout) {
+ console.debug("Activate TTS popup:", "message");
+ helpPromptstr = helpPrompt
activate(initialPrompt);
if (timeout * 2 - Constants.ttsSpeakTime > 0) {
ttsPerformInteractionTimer.message = timeoutPrompt;
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml
index 2acf4f065..ed33e5ca8 100644
--- a/src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml
+++ b/src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml
@@ -57,22 +57,47 @@ PopUp {
anchors.right: parent.right
source: "../res/controlButtons/vrImage.png"
}
+ OvalButton{
+ id:helpButton
+ anchors.rightMargin: Constants.popupMargin
+ anchors.leftMargin: Constants.popupMargin
+ anchors.top: voice.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ text: "Help"
+ onClicked:{
+ if (interactionPopup.performInteractionIsActiveNow)
+ ttsPopUp.activate(ttsPopUp.helpPromptstr)
+ if (dataContainer.activeVR) {
+ vrPopUp.complete();
+ vrHelpPopup.hide()
+ }
+ }
+ }
ScrollableListView {
anchors.bottomMargin: Constants.popupMargin
anchors.rightMargin: Constants.popupMargin
anchors.leftMargin: Constants.popupMargin
- anchors.top: voice.bottom
+ anchors.top: helpButton.bottom
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.left: parent.left
- model: dataContainer.vrCommands
+ model: if (interactionPopup.grammarID) {
+ dataContainer.choicesVrCommands
+ }
+ else {
+ dataContainer.vrCommands
+ }
delegate: OvalButton {
width: parent.width
text: command
+ visible: visibleButtons(grammarID,type)
onClicked: {
+ if (interactionPopup.performInteractionIsActiveNow && type === Common.VRCommandType.Choice)
+ interactionPopup.complete(Common.Result.SUCCESS, {"choiceID": cmdID})
sdlVR.onCommand(cmdID, appID === 0 ? undefined : appID);
if (dataContainer.activeVR) {
vrPopUp.complete();
@@ -93,4 +118,41 @@ PopUp {
sdlVR.stopped();
hide();
}
+
+ function sortModelforPerformInteraction() {
+ var n,
+ i,
+ j;
+ for (n = 0; n < dataContainer.choicesVrCommands.count; n++) {
+ for (i = n + 1; i < dataContainer.choicesVrCommands.count; i++) {
+ if (dataContainer.choicesVrCommands.get(n).type === Common.VRCommandType.Command &&
+ dataContainer.choicesVrCommands.get(i).type === Common.VRCommandType.Choice) {
+ dataContainer.choicesVrCommands.move(i, n, 1);
+ n = 0;
+ }
+ }
+ }
+ for (j = interactionPopup.grammarID.length; j > 0; j--) {
+ for (n = 0; n < dataContainer.choicesVrCommands.count &&
+ dataContainer.choicesVrCommands.get(n).type === Common.VRCommandType.Choice; n++) {
+ for (i = n + 1; i < dataContainer.choicesVrCommands.count &&
+ dataContainer.choicesVrCommands.get(i).type === Common.VRCommandType.Choice; i++) {
+ if (dataContainer.choicesVrCommands.get(n).grammarID !== interactionPopup.grammarID[j-1]
+ && dataContainer.choicesVrCommands.get(i).grammarID === interactionPopup.grammarID[j-1]) {
+ dataContainer.choicesVrCommands.move(i, n, 1);
+ n = 0;
+ }
+ }
+ }
+ }
+ }
+
+ function visibleButtons(grammarID, type) {
+ if (interactionPopup.grammarID) {
+ return interactionPopup.grammarID.indexOf(grammarID) !== -1
+ }
+ else {
+ return type === Common.VRCommandType.Command
+ }
+ }
}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml
index 8f3a0a17b..e249a5eb7 100644
--- a/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml
+++ b/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml
@@ -94,6 +94,7 @@ GeneralView {
case Internal.MenuItemType.MI_NODE:
sdlUI.onCommand(model.id, dataContainer.currentApplication.appId)
contentLoader.back()
+ dataContainer.currentApplication.currentSubMenu = dataContainer.currentApplication.options
break;
case Internal.MenuItemType.MI_SUBMENU:
case Internal.MenuItemType.MI_PARENT:
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml b/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml
index 895ebbf87..0dcb7a3b3 100644
--- a/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml
+++ b/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml
@@ -94,6 +94,10 @@ GeneralView {
dataContainer.scrollableMessageModel.result = Common.Result.ABORTED
contentLoader.back()
}
+ onStealFocus: {
+ dataContainer.scrollableMessageModel.result = Common.Result.SUCCESS
+ contentLoader.back()
+ }
}
}
}
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc
index abfe71239..d026f4bbb 100644
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file dbus_controller.cpp
* \brief DbusController class.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h
index 45b6a4e7f..ecda59867 100644
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file dbus_controller.h
* \brief DbusController class header file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc
index c264a42a8..0f41a28e7 100644
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file dbus_plugin.cpp
* \brief DbusPlugin class source file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h
index 4d145d09b..ef2a92595 100644
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file dbus_plugin.h
* \brief DbusPlugin class header file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc b/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc
index bd9e6efea..8b6cfd57d 100644
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file hmiproxy.cpp
* \brief HmiProxy class source file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h
index 7fa0e49bf..886d52315 100644
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file hmiproxy.h
* \brief HmiProxy class header file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h
index 6f2b54fc5..5224da7f5 100644
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h
index 79dfdd183..b9360c3eb 100644
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file optional_argument.h
* \brief OptionalArgument struct header file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h
index 6148da71f..eb9b93929 100644
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file qml_dbus_common.h
* \brief Contain utilities for DBus plugin.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h
index cbad38ed5..4eff83bd5 100644
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h
@@ -1,4 +1,4 @@
-/**
+/*
* @file qt_version.h
* @brief Defines for check Qt version.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc b/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc
index a1ae3402c..b60f5226c 100644
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h
index 675b6d069..0d0e279b8 100644
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc b/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc
index 42e2e4f37..bcde90930 100644
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file attributed_mouse_event.cpp
* \brief AttributedMouseEvent class source file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h b/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h
index b058e28f2..2d2babc29 100644
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file attributed_mouse_event.h
* \brief AttributedMouseEvent class header file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc b/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc
index 9f4f3b611..bf63c12cb 100644
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file hmi_hwbuttons.cpp
* \brief HmiHWButtons class source file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h b/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h
index ee5fa5302..cf8f0b5f4 100644
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file hmi_hwbuttons.h
* \brief HmiHWButtons class header file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc b/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc
index aee3afbbd..0d144ff84 100644
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file masked_container.cpp
* \brief MaskedContainer class source file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h b/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h
index 30e145aa3..0048bdda2 100644
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file masked_container.h
* \brief MaskedContainer class header file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h b/src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h
index 6a277e386..fb2751504 100644
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h
@@ -1,4 +1,4 @@
-/**
+/*
* @file qt_version.h
* @brief Defines for check Qt version.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc
index 19eec3665..da863e2e2 100644
--- a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc
+++ b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc
@@ -1,4 +1,4 @@
-/**
+/*
* @file log4cxx_plugin.cpp
* @brief Log4cxxPlugin class header file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h
index 00e136cf7..fc82352f0 100644
--- a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h
+++ b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h
@@ -1,4 +1,4 @@
-/**
+/*
* @file log4cxx_plugin.h
* @brief Log4cxxPlugin class header file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc
index e231124fe..f51db76b9 100644
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc
+++ b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc
@@ -1,4 +1,4 @@
-/**
+/*
* @file named_pipe_notifier.cc
* @brief NamedPipeNotifier class implementation file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h
index 14bacd9b6..993bb3cb3 100644
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h
+++ b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file named_pipe_notifier.h
* \brief NamedPipeNotifier class header file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc
index a423434c1..8aa2b4cf7 100644
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc
+++ b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file named_pipe_notifier_plugin.cc
* \brief NamedPipeNotifierPlugin class implementation file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h
index 36513aa93..6c64d531a 100644
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h
+++ b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file named_pipe_notifier_plugin.h
* \brief NamedPipeNotifierPlugin class header file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h
index 42b4bcb9d..91533346c 100644
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h
+++ b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h
@@ -1,4 +1,4 @@
-/**
+/*
* @file qt_version.h
* @brief Defines for check Qt version.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/qt_hmi/test/CMakeLists.txt b/src/components/qt_hmi/test/CMakeLists.txt
new file mode 100644
index 000000000..b0c48a434
--- /dev/null
+++ b/src/components/qt_hmi/test/CMakeLists.txt
@@ -0,0 +1,70 @@
+# 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.
+
+
+if(BUILD_TESTS)
+
+cmake_minimum_required(VERSION 2.8.11)
+
+set(QT_HMI_TESTS_LIST
+ ${COMPONENTS_DIR}/qt_hmi/test/src/tst_AddCommand.qml
+ ${COMPONENTS_DIR}/qt_hmi/test/src/tst_AddSubMenu.qml
+ ${COMPONENTS_DIR}/qt_hmi/test/src/tst_DeleteCommand.qml
+ ${COMPONENTS_DIR}/qt_hmi/test/src/tst_ScrollableMessage.qml
+ ${COMPONENTS_DIR}/qt_hmi/test/src/tst_SetMediaClockTimer.qml
+ ${COMPONENTS_DIR}/qt_hmi/test/src/tst_Show.qml
+ ${COMPONENTS_DIR}/qt_hmi/test/src/tst_Slider.qml
+ ${COMPONENTS_DIR}/qt_hmi/test/readme.txt
+)
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+set(CONFIG
+ warn_on
+ qmltestcase
+)
+
+set(SOURCES
+ qt_hmi_test.cc
+)
+
+set(target qt_hmi_test)
+
+create_test("qt_hmi_test" "${SOURCES}" "")
+qt5_use_modules(${target} Core Qml Quick QuickTest)
+
+foreach( file_i ${QT_HMI_TESTS_LIST})
+ file(COPY ${file_i} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+endforeach( file_i )
+
+endif() \ No newline at end of file
diff --git a/src/components/qt_hmi/test/qt_hmi_test.cc b/src/components/qt_hmi/test/qt_hmi_test.cc
new file mode 100644
index 000000000..0241549ca
--- /dev/null
+++ b/src/components/qt_hmi/test/qt_hmi_test.cc
@@ -0,0 +1,33 @@
+/*
+ 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 <QtQuickTest/quicktest.h>
+QUICK_TEST_MAIN(QtHMI)
diff --git a/src/components/qt_hmi/test/readme.txt b/src/components/qt_hmi/test/readme.txt
new file mode 100644
index 000000000..e169a4eb8
--- /dev/null
+++ b/src/components/qt_hmi/test/readme.txt
@@ -0,0 +1,14 @@
+A few comments on test writting for QML Unit Testing
+
+- set TestCase inside Item - this allows to send Mouse and keyboard events to controls
+- content of QML is reachable directly from tests. It is necessary to add getters into
+ source QML file to handle internal items
+- test execution order is alfabetical. If you need manage this order use numbers in test function names
+- all functions that starts with "test_" prefix is treated as test case
+- all files that starts with "tst_" prefix will be executed as test set
+- for async testing use timer
+- each system's entity that changes during RPC must be tested
+- test incoming arguments is not necessary as it will be verified by Qt abstraction layer
+- run test with following command:
+ "./qt_hmi_test -import ../git push qml_model_qt5/"
+
diff --git a/src/components/qt_hmi/test/src/tst_AddCommand.qml b/src/components/qt_hmi/test/src/tst_AddCommand.qml
new file mode 100644
index 000000000..e71fb66b1
--- /dev/null
+++ b/src/components/qt_hmi/test/src/tst_AddCommand.qml
@@ -0,0 +1,320 @@
+/**
+ * @file tst_AddSubMenu.qml
+ * @brief Test Case for OptionsView.
+ * 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.
+ */
+
+import QtTest 1.0
+import QtQuick 2.0
+import QtMultimedia 5.0
+import com.ford.sdl.hmi.dbus_adapter 1.0
+import com.ford.sdl.hmi.hw_buttons 1.0
+import com.ford.sdl.hmi.log4cxx 1.0
+import "../qml_model_qt5/controls"
+import "../qml_model_qt5/views"
+import "../qml_model_qt5/hmi_api" as HmiApi
+import "../qml_model_qt5/models"
+import "../qml_model_qt5/popups"
+import "../qml_model_qt5/hmi_api/Common.js" as Common
+import "../qml_model_qt5/models/Constants.js" as Constants
+import "../qml_model_qt5/models/Internal.js" as Internal
+
+Item {
+ width : mainWindowLoader.width
+ height: mainWindowLoader.height
+
+ Loader {
+ id: mainWindowLoader
+ asynchronous : false
+ }
+
+ TestCase {
+ name: "AddCommand"
+ when: windowShown
+ property var dataContainer
+ property var sdlUIProxy
+ property var contentLoader
+ property var messageModel
+
+ function createView(appID) {
+ mainWindowLoader.source = "../qml_model_qt5/MainWindow.qml"
+ var mainWindowObject = mainWindowLoader.item
+ sdlUIProxy = mainWindowObject.getUIProxy()
+ dataContainer = mainWindowObject.getDataStorage()
+ dataContainer.addApplication({appName:"TestAppName", appId:appID})
+ }
+
+ function destroyView() {
+ mainWindowLoader.source = ""
+ }
+
+ /*
+ * Test Cases
+ */
+
+ function test_01_addCommand_Command_Positive() {
+ console.debug("enter")
+
+ var initData = {
+ cmdID: 1,
+ cmdIcon: {
+ value: "123.jpg",
+ imageType: "DYNAMIC"
+ },
+ menuParams: {
+ position: 500,
+ menuName: "Command positive"
+ },
+ appID: 1
+ }
+
+ createView(initData.appID)
+ sdlUIProxy.addCommand(initData)
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.get(0).id, initData.cmdID, "Command id")
+ compare(app.options.get(0).position, initData.menuParams.position, "Command position")
+ compare(app.options.get(0).name, initData.menuParams.menuName, "Command name")
+ compare(app.options.get(0).icon.value, initData.cmdIcon.value, "Image path")
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ function test_02_addCommand_Without_Position() {
+ console.debug("enter")
+ var initData = {
+ appID: 1,
+ Commands: []
+ }
+ initData.Commands.push({
+ cmdID:1,
+ comIcon: {
+ value: "123.jpg",
+ imageType: "DYNAMIC"
+ },
+ menuParams: {
+ menuName: "Command 1"
+ },
+ appID: 1
+ })
+ initData.Commands.push({
+ cmdID:2,
+ cmdIcon: {
+ value: "345.jpg",
+ imageType: "DYNAMIC"
+ },
+ menuParams: {
+ position: 500,
+ menuName: "Command 1"
+ },
+ appID: 1
+ })
+ createView(initData.appID)
+ sdlUIProxy.addCommand(initData.Commands[0])
+ sdlUIProxy.addCommand(initData.Commands[1])
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.get(1).id, initData.Commands[0].cmdID, "Command id")
+ compare(app.options.get(1).name, initData.Commands[0].menuParams.menuName, "Command name")
+ compare(app.options.get(0).id, initData.Commands[1].cmdID, "Command id")
+ compare(app.options.get(0).name, initData.Commands[1].menuParams.menuName, "Command name")
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ function test_03_1010_addCommands() {
+ console.debug("enter")
+ var initData = {
+ appID: 1,
+ Commands: []
+ }
+
+ for (var i = 0; i < 1010; i++) {
+ initData.Commands.push({
+ cmdID: i,
+ cmdIcon: {
+ value: "",
+ imageType: ""
+ },
+ menuParams: {
+ position: i,
+ menuName: "Command " + i
+ },
+ appID: 1
+ })
+ }
+
+ createView(initData.appID)
+ for (var i = 0; i < initData.Commands.length; i++) {
+ sdlUIProxy.addCommand(initData.Commands[i])
+ }
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.count, 1000, "Command count")
+
+ for (var i = 0; i < 1000; i++) {
+ compare(app.options.get(i).id, initData.Commands[i].cmdID, "Command id")
+ compare(app.options.get(i).position, initData.Commands[i].menuParams.position, "Command position")
+ compare(app.options.get(i).name, initData.Commands[i].menuParams.menuName, "Command name")
+ }
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ function test_04_Command_Upper_Bound() {
+ console.debug("enter")
+ var initData = {
+ cmdID: 2000000000,
+ cmdIcon: {
+ value: "00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890aAaaaaaaaaaaaaaa",
+ imageType: ""
+ },
+ menuParams: {
+ position: 100000,
+ menuName: "00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890aAaaaaaaaaaaaaaa"
+ },
+ appID: 1
+ }
+
+ createView(initData.appID)
+ sdlUIProxy.addCommand(initData)
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.get(0).id, initData.cmdID, "Command id")
+ compare(app.options.get(0).position, initData.menuParams.position, "Command position")
+ compare(app.options.get(0).name.length, initData.menuParams.menuName.length, "Command name")
+ compare(app.options.get(0).icon.value.length, initData.cmdIcon.value.length, "Image path")
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ function test_05_addCommand_Lower_Bound() {
+ console.debug("enter")
+ var initData = {
+ cmdID: 0,
+ cmdIcon: {
+ value: "",
+ imageType: ""
+ },
+ menuParams: {
+ position: 0,
+ menuName: "0",
+ parentID: 0
+ },
+ appID: 0
+ }
+
+ createView(initData.appID)
+ sdlUIProxy.addCommand(initData)
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.get(0).id, initData.cmdID, "Command id")
+ compare(app.options.get(0).position, initData.menuParams.position, "Command position")
+ compare(app.options.get(0).name, initData.menuParams.menuName, "Command name")
+ compare(app.options.get(0).icon.value, initData.cmdIcon.value, "Image path")
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ function test_06_addCommand_With_Fake_Parameter() {
+ console.debug("enter")
+ var initData = {
+ cmdID: 1,
+ cmdIcon: {
+ value: "345.jpg",
+ imageType: "DYNAMIC"
+ },
+ menuParams: {
+ menuName: "Command fake param",
+ position: 1,
+ fakeParam: "fakeParam"
+ },
+ appID: 1
+ }
+
+ createView(initData.appID)
+ sdlUIProxy.addCommand(initData)
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.get(0).id, initData.cmdID, "Command id")
+ compare(app.options.get(0).position, initData.menuParams.position, "Command position")
+ compare(app.options.get(0).name, initData.menuParams.menuName, "Command name")
+ compare(app.options.get(0).icon.value, initData.cmdIcon.value, "Image path")
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ function test_07_addCommand_No_Menu_Params() {
+ console.debug("enter")
+
+ var initData = {
+ appID: 1,
+ Commands:[]
+ }
+
+ var n = 10;
+ initData.Commands.push({
+ cmdID: 123,
+ menuParams: {},
+ appID: 1
+ })
+ for (var i = 0; i < n; i++) {
+ initData.Commands.push({
+ cmdID: i,
+ menuParams: {
+ position: i,
+ menuName: "Command " + i
+ },
+ appID: 1
+ })
+ }
+
+ createView(initData.appID)
+ for (var i = 0; i < initData.Commands.length; i++) {
+ sdlUIProxy.addCommand(initData.Commands[i])
+ }
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.count, initData.Commands.length, "Command count")
+ compare(app.options.get(n).id, initData.Commands[0].cmdID, "Command 11 id")
+ compare(app.options.get(0).id, initData.Commands[1].cmdID, "Command 12 id")
+
+ destroyView()
+ console.debug("exit")
+ }
+ }
+}
diff --git a/src/components/qt_hmi/test/src/tst_AddSubMenu.qml b/src/components/qt_hmi/test/src/tst_AddSubMenu.qml
new file mode 100644
index 000000000..7f9477cab
--- /dev/null
+++ b/src/components/qt_hmi/test/src/tst_AddSubMenu.qml
@@ -0,0 +1,328 @@
+/**
+ * @file tst_AddSubMenu.qml
+ * @brief Test Case for OptionsView.
+ * 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.
+ */
+
+
+import QtTest 1.0
+import QtQuick 2.0
+import QtMultimedia 5.0
+import com.ford.sdl.hmi.dbus_adapter 1.0
+import com.ford.sdl.hmi.hw_buttons 1.0
+import com.ford.sdl.hmi.log4cxx 1.0
+import "../qml_model_qt5/controls"
+import "../qml_model_qt5/views"
+import "../qml_model_qt5/hmi_api" as HmiApi
+import "../qml_model_qt5/models"
+import "../qml_model_qt5/popups"
+import "../qml_model_qt5/hmi_api/Common.js" as Common
+import "../qml_model_qt5/models/Constants.js" as Constants
+import "../qml_model_qt5/models/Internal.js" as Internal
+
+Item {
+ width : mainWindowLoader.width
+ height: mainWindowLoader.height
+
+ Loader {
+ id: mainWindowLoader
+ asynchronous : false
+ }
+
+ TestCase {
+ name: "AddSubMenu"
+ when: windowShown
+ property var dataContainer
+ property var sdlUIProxy
+ property var contentLoader
+ property var messageModel
+
+ //initialization for each test
+ function createMessageView(appID) {
+ mainWindowLoader.source = ""
+ mainWindowLoader.source = "../qml_model_qt5/MainWindow.qml"
+ var mainWindowObject = mainWindowLoader.item
+ if(!mainWindowObject)
+ qtest_fail("mainWindowObject is undefined");
+ var mainScreen = mainWindowObject.getMainScreen()
+ mainScreen.visible = true
+ var warningInfo = mainWindowObject.getWarningInfo()
+ warningInfo.visible = false
+ contentLoader = mainWindowObject.getContentLoader()
+ contentLoader.asynchronous = false
+ sdlUIProxy = mainWindowObject.getUIProxy()
+ dataContainer = mainWindowObject.getDataStorage()
+ dataContainer.addApplication({appName:"TestAppName", appId:appID})
+ }
+
+ //cleanup for each test
+ function destroyView() {
+ //Clear Loader with MainWindow, which delete own models and views
+ mainWindowLoader.source = ""
+ }
+
+ /*
+ * Test Cases
+ */
+
+ //Positive case and in boundary conditions
+ function test_01_addSubMenu() {
+ console.debug("enter")
+ var initData = {
+ menuID: 1000,
+ menuParams: {
+ position: 500,
+ menuName: "SubMenu positive"
+ },
+ appID: 1
+ }
+
+ createMessageView(initData.appID)
+ sdlUIProxy.addSubMenu(initData)
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.get(0).id, initData.menuID, "SubMenu id")
+ compare(app.options.get(0).position, initData.menuParams.position, "SubMenu position")
+ compare(app.options.get(0).name, initData.menuParams.menuName, "SubMenu name")
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ // Only mandatory - without Position
+ function test_02_addSubMenu_WithoutPosition() {
+ console.debug("enter")
+ var initData = {
+ menuID: 1001,
+ menuParams: {
+ menuName: "SubMenu mandatory only"
+ },
+ appID: 1
+ }
+
+ createMessageView(initData.appID)
+ sdlUIProxy.addSubMenu(initData)
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.get(0).id, initData.menuID, "SubMenu id")
+ //How to verify if value was not set?
+ //compare(app.options.get(0).position, initData.menuParams.position, "SubMenu position")
+ compare(app.options.get(0).name, initData.menuParams.menuName, "SubMenu name")
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ //Create AddSubMenu and check data
+ function test_03_1000_SubMenu() {
+ console.debug("enter")
+ var initData = {
+ appID: 1,
+ subMenus: []
+ }
+
+ for (var i = 0; i < 1010; i++) {
+
+ initData.subMenus.push({
+ menuID: i,
+ menuParams: {
+ position: i,
+ menuName: "Submenu" + i
+ },
+ appID: 1
+ })
+ }
+
+ createMessageView(initData.appID)
+ for (var i = 0; i < initData.subMenus.length; i++) {
+ sdlUIProxy.addSubMenu(initData.subMenus[i])
+ }
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.count, 1000, "SubMenus count")
+
+ for (var i = 0; i < 1000; i++) {
+ compare(app.options.get(i).id, initData.subMenus[i].menuID, "SubMenu id")
+ compare(app.options.get(i).position, initData.subMenus[i].menuParams.position, "SubMenu position")
+ compare(app.options.get(i).name, initData.subMenus[i].menuParams.menuName, "SubMenu name")
+ }
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ //Create AddSubMenu and check data
+ function test_04_addSubMenu_UpperBound() {
+ console.debug("enter")
+ var initData = {
+ menuID: 2000000000,
+ menuParams: {
+ position: 1000,
+ menuName: "00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890aAaaaaaaaaaaaaaa"
+ },
+ appID: 1
+ }
+
+ createMessageView(initData.appID)
+ sdlUIProxy.addSubMenu(initData)
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.get(0).id, initData.menuID, "SubMenu id")
+ compare(app.options.get(0).position, initData.menuParams.position, "SubMenu position")
+ compare(app.options.get(0).name.length, 500, "SubMenu name")
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ //Create AddSubMenu and check data
+ function test_05_addSubMenu_LowerBound() {
+ console.debug("enter")
+ var initData = {
+ menuID: 0,
+ menuParams: {
+ position: 0,
+ menuName: "0"
+ },
+ appID: 1
+ }
+
+ createMessageView(initData.appID)
+ sdlUIProxy.addSubMenu(initData)
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.get(0).id, initData.menuID, "SubMenu id")
+ compare(app.options.get(0).position, initData.menuParams.position, "SubMenu position")
+ compare(app.options.get(0).name.length, 1, "SubMenu name")
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ // With fake parameter
+ function test_06_addSubMenu_With_Fake_Parameter() {
+ console.debug("enter")
+ var initData = {
+ menuID: 1001,
+ menuParams: {
+ menuName: "SubMenu fake param",
+ position: 1,
+ fakeParam: "fakeParam"
+ },
+ appID: 1
+ }
+
+ createMessageView(initData.appID)
+ sdlUIProxy.addSubMenu(initData)
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.get(0).id, initData.menuID, "SubMenu id")
+ compare(app.options.get(0).position, initData.menuParams.position, "SubMenu position")
+ compare(app.options.get(0).name, initData.menuParams.menuName, "SubMenu name")
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ // With fake parameter
+ function test_07_addSubMenu_menuIDOutLowerBound() {
+ console.debug("enter")
+ var initData = {
+ menuID: -1,
+ menuParams: {
+ menuName: "100",
+ position: 1,
+ },
+ appID: 1
+ }
+
+ createMessageView(initData.appID)
+ sdlUIProxy.addSubMenu(initData)
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.count, 0, "SubMenus count")
+
+ compare(app.options.get(1), !undefined, "SubMenu duplicated")
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ // With fake parameter
+ function test_08_addSubMenu_menuIDOutUpperBound() {
+ console.debug("enter")
+ var initData = {
+ menuID: 2000000001,
+ menuParams: {
+ menuName: "100",
+ position: 1,
+ },
+ appID: 1
+ }
+
+ createMessageView(initData.appID)
+ sdlUIProxy.addSubMenu(initData)
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.count, 0, "SubMenus count")
+
+ compare(app.options.get(1), !undefined, "SubMenu duplicated")
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ // With fake parameter
+ function test_09_addSubMenu_duplicatedSubMenus() {
+ console.debug("enter")
+ var initData = {
+ menuID: 2000000001,
+ menuParams: {
+ menuName: "100",
+ position: 1,
+ },
+ appID: 1
+ }
+
+ createMessageView(initData.appID)
+ sdlUIProxy.addSubMenu(initData)
+ sdlUIProxy.addSubMenu(initData)
+ var app = dataContainer.getApplication(initData.appID)
+
+ compare(app.options.count, 1, "SubMenus count")
+
+ compare(app.options.get(1), undefined, "SubMenu duplicated")
+
+ destroyView()
+ console.debug("exit")
+ }
+ }
+}
diff --git a/src/components/qt_hmi/test/src/tst_DeleteCommand.qml b/src/components/qt_hmi/test/src/tst_DeleteCommand.qml
new file mode 100644
index 000000000..bf28be028
--- /dev/null
+++ b/src/components/qt_hmi/test/src/tst_DeleteCommand.qml
@@ -0,0 +1,210 @@
+/**
+ * @file tst_ScrollableMessage.qml
+ * @brief Test Case for ScrollableMessageView.
+ * 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.
+ */
+
+import QtTest 1.0
+import QtQuick 2.0
+import QtMultimedia 5.0
+import com.ford.sdl.hmi.dbus_adapter 1.0
+import com.ford.sdl.hmi.hw_buttons 1.0
+import com.ford.sdl.hmi.log4cxx 1.0
+import "../qml_model_qt5/controls"
+import "../qml_model_qt5/views"
+import "../qml_model_qt5/hmi_api" as HmiApi
+import "../qml_model_qt5/models"
+import "../qml_model_qt5/popups"
+import "../qml_model_qt5/hmi_api/Common.js" as Common
+import "../qml_model_qt5/models/Constants.js" as Constants
+import "../qml_model_qt5/models/Internal.js" as Internal
+
+Item
+{
+ width : mainWindowLoader.width
+ height: mainWindowLoader.height
+
+ Loader
+ {
+ id: mainWindowLoader
+ asynchronous : false
+ }
+
+ TestCase
+ {
+ name: "DeleteCommand"
+ when: windowShown
+ property var dataContainer
+ property var sdlUIProxy
+ property var contentLoader
+ property var messageModel
+
+
+ //initialization for each test
+ function createMessageView(appID)
+ {
+ mainWindowLoader.source = ""
+ mainWindowLoader.source = "../qml_model_qt5/MainWindow.qml"
+ var mainWindowObject = mainWindowLoader.item
+ if(!mainWindowObject)
+ qtest_fail("mainWindowObject is undefined");
+ var mainScreen = mainWindowObject.getMainScreen()
+ mainScreen.visible = true
+ var warningInfo = mainWindowObject.getWarningInfo()
+ warningInfo.visible = false
+ contentLoader = mainWindowObject.getContentLoader()
+ contentLoader.asynchronous = false
+ sdlUIProxy = mainWindowObject.getUIProxy()
+ dataContainer = mainWindowObject.getDataStorage()
+ dataContainer.addApplication({appName:"TestAppName", appId:appID})
+ }
+
+ //cleanup for each test
+ function destroyView()
+ {
+ //Clear Loader with MainWindow, which delete own models and views
+ mainWindowLoader.source = ""
+ }
+
+ /*
+ * Test Cases
+ */
+
+ function test_01_deleteCommand()
+ {
+ console.debug("enter")
+ var initData = {
+ cmdID: 1,
+ menuParams:
+ {
+ menuName:"",
+ },
+ cmdIcon:"",
+ appID: 1
+ }
+ var initData2 = {
+ cmdID: 2,
+ menuParams:
+ {
+ menuName:"",
+ },
+ cmdIcon:"",
+ appID: 1
+ }
+
+ createMessageView(initData.appID)
+ var app = dataContainer.getApplication(initData.appID)
+ var MenuCount = app.options.count
+ app.options.append(
+ { id: initData.cmdID,
+ name: initData.menuParams.menuName,
+ type: Internal.MenuItemType.MI_NODE,
+ position: Constants.positionOfElementWithoutPosition,
+ icon: initData.cmdIcon ? cmdIcon : {},
+ subMenu: []
+ }
+ )
+
+ compare(app.options.count, MenuCount+1, "Command into menu not added")
+ sdlUIProxy.deleteCommand(initData2)
+
+ var a = 0
+ for(var i = 0;((a === 0) && ( i < app.options.count)); i++)
+ {
+ if (app.options.get(i).id===initData2.menuID)
+ {
+ a = 1
+ }
+ }
+ compare (a, 0, "Command in menu isn't removed")
+
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ function test_02_deleteCommand() {
+ console.debug("enter")
+ var initData = {
+ menuID: 1000,
+ menuParams: {
+ position: 1,
+ menuName: "SubMenu"
+ },
+ appID: 1
+ }
+
+ var initData2 = {
+ cmdID: 1,
+ menuParams: {
+ menuName:"",
+ },
+ cmdIcon:"",
+ appID: 1
+ }
+
+ createMessageView(initData.appID)
+ var app = dataContainer.getApplication(initData.appID)
+ var MenuCount = app.options.count
+ app.options.append ({
+ "id": initData.menuID,
+ "name": initData.menuParams.menuName,
+ "position": initData.menuParams.position,
+ "type": Internal.MenuItemType.MI_SUBMENU,
+ "icon": undefined,
+ "subMenu":[{
+ "id":initData2.cmdID,
+ "name": initData2.menuParams.menuName,
+ "position": Constants.positionOfElementWithoutPosition,
+ "type": Internal.MenuItemType.MI_PARENT,
+ "icon": {
+ "imageType": Common.ImageType.DYNAMIC,
+ "value": "../res/nav/turnArrow.png"
+ },
+
+ "subMenu": []
+ }]
+ })
+
+ compare(app.options.count, MenuCount+1, "SubMenu into added")
+ var SubMenuCount = app.options.get(0).subMenu.count
+ compare( SubMenuCount, 1, "Command is not added into SubMenu")
+
+ sdlUIProxy.deleteCommand(initData2)
+
+ compare(app.options.count , MenuCount+1, "Menu is changed")
+ compare(app.options.get(0).subMenu.count, SubMenuCount-1, "Command into SubMenu is not removed")
+
+ destroyView()
+ console.debug("exit")
+ }
+ }
+}
diff --git a/src/components/qt_hmi/test/src/tst_ScrollableMessage.qml b/src/components/qt_hmi/test/src/tst_ScrollableMessage.qml
new file mode 100644
index 000000000..abf3105b1
--- /dev/null
+++ b/src/components/qt_hmi/test/src/tst_ScrollableMessage.qml
@@ -0,0 +1,421 @@
+/**
+ * @file tst_ScrollableMessage.qml
+ * @brief Test Case for ScrollableMessageView.
+ * 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.
+ */
+
+
+import QtTest 1.0
+import QtQuick 2.0
+import QtMultimedia 5.0
+import com.ford.sdl.hmi.dbus_adapter 1.0
+import com.ford.sdl.hmi.hw_buttons 1.0
+import com.ford.sdl.hmi.log4cxx 1.0
+import "../qml_model_qt5/controls"
+import "../qml_model_qt5/views"
+import "../qml_model_qt5/hmi_api" as HmiApi
+import "../qml_model_qt5/models"
+import "../qml_model_qt5/popups"
+import "../qml_model_qt5/hmi_api/Common.js" as Common
+import "../qml_model_qt5/models/Constants.js" as Constants
+import "../qml_model_qt5/models/Internal.js" as Internal
+
+Item {
+ width : mainWindowLoader.width
+ height: mainWindowLoader.height
+
+ Loader {
+ id: mainWindowLoader
+ asynchronous : false
+ }
+
+ TestCase {
+ name: "ScrollableMessageView"
+ when: windowShown
+ property var dataContainer
+ property var sdlUIProxy
+ property var contentLoader
+ property var messageModel
+ property var messageView
+ property var timer
+
+ property var softButtonsListExample : [
+ {softButtonID:0, isHighlighted:true, systemAction:Common.SystemAction.DEFAULT_ACTION,
+ type:Common.SoftButtonType.SBT_TEXT, text:"Default Action"},
+ {softButtonID:1, isHighlighted:false, systemAction:Common.SystemAction.STEAL_FOCUS,
+ type:Common.SoftButtonType.SBT_IMAGE, text:"Steal Focus"},
+ {softButtonID:2, isHighlighted:false, systemAction:Common.SystemAction.KEEP_CONTEXT,
+ type:Common.SoftButtonType.SBT_BOTH, text:"Keep context"}]
+
+ //initialization for each test
+ function createMessageView(appID) {
+ mainWindowLoader.source = ""
+ mainWindowLoader.source = "../qml_model_qt5/MainWindow.qml"
+ var mainWindowObject = mainWindowLoader.item
+ if(!mainWindowObject)
+ qtest_fail("mainWindowObject is undefined");
+ var mainScreen = mainWindowObject.getMainScreen()
+ mainScreen.visible = true
+ var warningInfo = mainWindowObject.getWarningInfo()
+ warningInfo.visible = false
+ contentLoader = mainWindowObject.getContentLoader()
+ contentLoader.asynchronous = false
+ sdlUIProxy = mainWindowObject.getUIProxy()
+ dataContainer = mainWindowObject.getDataStorage()
+ dataContainer.addApplication({appName:"TestAppName", appId:appID})
+ }
+
+ //get messageModel and messageView after call @scrollableMessage
+ function getMessageViewModel() {
+ messageModel = dataContainer.scrollableMessageModel
+ if(!messageModel)
+ qtest_fail("messageModel is undefined");
+ messageView = contentLoader.item
+ if(!messageView)
+ qtest_fail("messageView is undefined");
+ }
+
+ //cleanup for each test
+ function destroyView() {
+ //Clear Loader with MainWindow, which delete own models and views
+ mainWindowLoader.source = ""
+ }
+
+ //return button from messageView by ommon.SystemAction
+ function findButtonByAction(systemAction){
+ var listViewItems = messageView.getSoftButtonsListView()
+ for (var i = 0, len = listViewItems.count; i < len; i++) {
+ //get SoftButton by setting current item (ListView has no getter)
+ listViewItems.currentIndex = i
+ var buttonItem = listViewItems.currentItem
+ if (buttonItem.button.systemAction === systemAction) {
+ return buttonItem
+ }
+ }
+ }
+
+ /*
+ * Test Cases
+ */
+
+ //Create ScrollableMessageView and check data
+ function test_01_create() {
+ console.debug("enter")
+ var initData = {appID:1, timeout:2000,
+ messageText:{fieldText:"Simple ScrollableMessage text"},
+ softButtons:softButtonsListExample}
+ createMessageView(initData.appID)
+
+ var result = sdlUIProxy.scrollableMessage(initData)
+ getMessageViewModel()
+
+ verify(result.__errno === undefined, "ScrollableMessage return error state")
+ timer = messageView.getTimer()
+ if(!timer)
+ qtest_fail("timer is undefined");
+ //check button equals to init data
+ compare(messageModel.softButtons.count, initData.softButtons.length, "wrong buttons count created")
+ for (var i = 0, len = messageModel.softButtons.count; i < len; i++) {
+ var act = messageModel.softButtons.get(i)
+ var exp = initData.softButtons[i]
+ compare(act.softButtonID, exp.softButtonID, "wrong softButtonID in button")
+ compare(act.isHighlighted, exp.isHighlighted, "wrong isHighlighted in button")
+ compare(act.systemAction, exp.systemAction, "wrong systemAction in button")
+ compare(act.text, exp.text, "wrong text in button")
+ }
+ //check model data equals to init data
+ compare(messageModel.running, true, "ScrollableMessage didn't start")
+ compare(messageModel.longMessageText, initData.messageText.fieldText, "wrong messageText")
+ compare(messageModel.appId, initData.appID, "wrong application ID")
+ compare(messageModel.timeout, initData.timeout, "wrong timeout")
+ verify(messageModel.async !== undefined, "async in undefined")
+ destroyView()
+ console.debug("exit")
+ }
+
+ //Create ScrollableMessageView with empty data
+ function test_02_emptyInit() {
+ console.debug("enter")
+ var initData = {appID:1, timeout:0, messageText:{fieldText:""}, softButtons:[]}
+ createMessageView(initData.appID)
+
+ var result = sdlUIProxy.scrollableMessage(initData)
+ getMessageViewModel()
+
+ verify(result.__errno === undefined, "ScrollableMessage return error state")
+ //NOTE: don't check timer - it has been triggered immediately (timeout is 0)
+ //MessageView call @complete immediately
+ compare(messageModel.running, false, "ScrollableMessage didn't stop")
+ compare(messageModel.softButtons.count, initData.softButtons.length, "wrong buttons count")
+ compare(messageModel.longMessageText, initData.messageText.fieldText, "wrong messageText")
+ compare(messageModel.timeout, initData.timeout, "wrong timeout")
+ destroyView()
+ console.debug("exit")
+ }
+
+ //call @scrollableMessage twice (after first view has closed)
+ function test_03_doubleCreate() {
+ console.debug("enter")
+ var initData = {appID:1, timeout:0, messageText:{fieldText:"Simple text"},
+ softButtons:softButtonsListExample}
+ var initData2 = {appID:1, timeout:10000, messageText:{fieldText:"Simple text 2"},
+ softButtons:[]}
+ createMessageView(initData.appID)
+
+ //create view
+ var actualResult = sdlUIProxy.scrollableMessage(initData)
+ getMessageViewModel()
+
+ //create new view
+ var actualResult2 = sdlUIProxy.scrollableMessage(initData2)
+ getMessageViewModel()
+
+ verify(actualResult.__errno === undefined, "ScrollableMessage return error state")
+ verify(actualResult2.__errno === undefined, "ScrollableMessage return error state")
+ compare(messageModel.running, true, "ScrollableMessage didn't start")
+ compare(messageModel.longMessageText, initData2.messageText.fieldText, "wrong messageText")
+ compare(messageModel.timeout, initData2.timeout, "wrong timeout")
+ compare(messageModel.appId, initData2.appID, "wrong application ID")
+ verify(messageModel.async !== undefined, "async in undefined")
+ destroyView()
+ console.debug("exit")
+ }
+
+ //call @scrollableMessage twice (before first view is closed)
+ function test_04_doubleCreateError() {
+ console.debug("enter")
+ var initData = {appID:1, timeout:20000, messageText:{fieldText:"Simple text"},
+ softButtons:softButtonsListExample}
+ var initData2 = {appID:1, timeout:10000, messageText:{fieldText:"Simple text 2"},
+ softButtons:[]}
+ createMessageView(initData.appID)
+
+ //create view
+ var actualResult = sdlUIProxy.scrollableMessage(initData)
+ getMessageViewModel()
+ var firstView = messageView;
+
+ //create new view
+ var actualResult2 = sdlUIProxy.scrollableMessage(initData2)
+ getMessageViewModel()
+ verify(actualResult.__errno === undefined, "ScrollableMessage return error state")
+ verify(actualResult2.__errno !== undefined, "ScrollableMessage don't return error state")
+ compare(messageModel.running, true, "ScrollableMessage didn't start")
+ compare(messageView, firstView, "creating new view insteed stay first")
+ compare(messageModel.longMessageText, initData.messageText.fieldText, "wrong messageText")
+ compare(messageModel.timeout, initData.timeout, "wrong timeout")
+ compare(messageModel.appId, initData.appID, "wrong application ID")
+ verify(messageModel.async !== undefined, "async in undefined")
+ destroyView()
+ console.debug("exit")
+ }
+
+ //call @scrollableMessage and check close
+ function test_05_ClickBackButton() {
+ console.debug("enter")
+ var initData = {appID:1, timeout:20000,
+ messageText:{fieldText:"Simple ScrollableMessage text"},
+ softButtons:softButtonsListExample}
+ createMessageView(initData.appID)
+
+ var result = sdlUIProxy.scrollableMessage(initData)
+ getMessageViewModel()
+
+ compare(messageModel.running, true, "ScrollableMessage didn't start")
+ verify(result.__errno === undefined, "ScrollableMessage return error state")
+ //look for back button
+ var backButton = messageView.getBackButton()
+ verify(backButton !== undefined, "Not created back button")
+ //wait rendering for correct click position
+ waitForRendering(mainWindowLoader)
+ //Press back button
+ mouseClick(backButton, backButton.width/2, backButton.height/2,
+ Qt.LeftButton, Qt.NoModifier, 0)
+ //check that MessageView (in contentLoader) is unloaded and deleted
+ var isLoaded = (contentLoader.source.toString().indexOf("ScrollableMessageView.qml") > 0)
+ verify(!isLoaded, "MessageView should be unloaded")
+ //wait for delete messageView by GC
+ wait(0);
+ verify(messageView === null, "MessageView should be deleted")
+ destroyView()
+ console.debug("exit")
+ }
+ //call @scrollableMessage and check close
+ function test_06_ClickDefaultAction() {
+ console.debug("enter")
+ var initData = {appID:1, timeout:20000,
+ messageText:{fieldText:"Simple ScrollableMessage text"},
+ softButtons:softButtonsListExample}
+ createMessageView(initData.appID)
+
+ var result = sdlUIProxy.scrollableMessage(initData)
+ getMessageViewModel()
+
+ compare(messageModel.running, true, "ScrollableMessage didn't start")
+ verify(result.__errno === undefined, "ScrollableMessage return error state")
+ //look for DEFAULT_ACTION button
+ var defaultActionButton = findButtonByAction(Common.SystemAction.DEFAULT_ACTION)
+ verify(defaultActionButton !== undefined, "Not created button with DEFAULT_ACTION")
+ //wait rendering for correct click position
+ waitForRendering(mainWindowLoader)
+ //Press default button
+ mouseClick(defaultActionButton, defaultActionButton.width/2, defaultActionButton.height/2,
+ Qt.LeftButton, Qt.NoModifier, 0)
+ //check that MessageView (in contentLoader) is unloaded and deleted
+ var isLoaded = (contentLoader.source.toString().indexOf("ScrollableMessageView.qml") > 0)
+ verify(!isLoaded, "MessageView should be unloaded")
+ //wait for delete messageView by GC
+ wait(0);
+ verify(messageView === null, "MessageView should be deleted")
+ destroyView()
+ console.debug("exit")
+ }
+
+ //call @scrollableMessage and check restart timer
+ function test_07_ClickStealFocus() {
+ console.debug("enter")
+ var initData = {appID:1, timeout:20000, messageText:{fieldText:"Simple ScrollableMessage text"},
+ softButtons:softButtonsListExample}
+ createMessageView(initData.appID)
+
+ var result = sdlUIProxy.scrollableMessage(initData)
+ getMessageViewModel()
+
+ //check
+ compare(messageModel.running, true, "ScrollableMessage didn't start")
+ verify(result.__errno === undefined, "ScrollableMessage return error state")
+ //look for STEAL_FOCUS button
+ var stealFocusButton = findButtonByAction(Common.SystemAction.STEAL_FOCUS)
+ verify(stealFocusButton !== undefined, "Not created button with STEAL_FOCUS")
+ //wait rendering for correct buttons size for correct click position
+ waitForRendering(mainWindowLoader)
+ mouseClick(stealFocusButton, stealFocusButton.width/2, stealFocusButton.height/2,
+ Qt.LeftButton, Qt.NoModifier, 0)
+ //check that MediaView loaded in loade
+ var viewQMlFileName = dataContainer.currentApplication.isMediaApplication ?
+ "SDLPlayerView.qml" : "SDLNonMediaView.qml"
+ var isLoaded = (contentLoader.source.toString().indexOf(viewQMlFileName) > 0)
+ verify(isLoaded, "SDLPlayerView/SDLNonMediaView should be loaded")
+ destroyView()
+ console.debug("exit")
+ }
+
+ //call @scrollableMessage and check restart timer
+ function test_08_ClickKeepContex() {
+ console.debug("enter")
+ var initData = {appID:1, timeout:20000, messageText:{fieldText:"Simple ScrollableMessage text"},
+ softButtons:softButtonsListExample}
+ createMessageView(initData.appID)
+
+ var result = sdlUIProxy.scrollableMessage(initData)
+ getMessageViewModel()
+
+ //check
+ compare(messageModel.running, true, "ScrollableMessage didn't start")
+ verify(result.__errno === undefined, "ScrollableMessage return error state")
+ //look for KEEP_CONTEXT button
+ var keepContexButton = findButtonByAction(Common.SystemAction.KEEP_CONTEXT)
+ verify(keepContexButton !== undefined, "Not created button with KEEP_CONTEXT")
+ //wait rendering for correct click position
+ waitForRendering(mainWindowLoader)
+ //Press button
+ mouseClick(keepContexButton, keepContexButton.width/2, keepContexButton.height/2,
+ Qt.LeftButton, Qt.NoModifier, 0)
+ //check that MessageView is still unloaded loaded
+ var isLoaded = (contentLoader.source.toString().indexOf("ScrollableMessageView.qml") > 0)
+ verify(isLoaded, "MessageView should be loaded")
+ //verify restarted timer
+ timer = messageView.getTimer()
+ verify(timer.running === true, "Timer is not restarted by KEEP_CONTEXT button")
+ destroyView()
+ console.debug("exit")
+ }
+
+ //add long text to model and check scrollBar visibility
+ function test_09_ScrollBarShown() {
+ console.debug("enter")
+ //generate string with (10!) lines
+ var longText = "It is very long text!\n"
+ for(var i = 1; i < 10; ++i)
+ longText += longText
+ var initData = {appID:1, timeout:20000, messageText:{fieldText:longText}, softButtons:[]}
+ createMessageView(initData.appID)
+
+ var result = sdlUIProxy.scrollableMessage(initData)
+ getMessageViewModel()
+
+ //check
+ compare(messageModel.running, true, "ScrollableMessage didn't start")
+ verify(result.__errno === undefined, "ScrollableMessage return error state")
+
+ //wait rendering
+ waitForRendering(mainWindowLoader)
+ var scrollBar = messageView.getScrollbar()
+ verify(scrollBar.visible === true, "ScrollBar is not shown for long text")
+
+ destroyView()
+ console.debug("exit")
+ }
+
+ //compare text width with and without buttons at top of SrollableMessage
+ function test_10_MessageTextHeight() {
+ console.debug("enter")
+ var initData = {appID:1, timeout:500, messageText:{fieldText:"Simple text"}, softButtons:[]}
+ createMessageView(initData.appID)
+
+ var result = sdlUIProxy.scrollableMessage(initData)
+ getMessageViewModel()
+
+ //check
+ compare(messageModel.running, true, "ScrollableMessage didn't start")
+ verify(result.__errno === undefined, "ScrollableMessage return error state")
+
+ var textAreaHeight = messageView.getTextArea().height
+ wait(initData.timeout)
+
+ var initData2 = {appID:1, timeout:20000, messageText:{fieldText:"Simple text"},
+ softButtons:softButtonsListExample}
+ createMessageView(initData.appID)
+
+ var result2 = sdlUIProxy.scrollableMessage(initData2)
+ getMessageViewModel()
+
+ //wait rendering
+ waitForRendering(mainWindowLoader)
+ var textAreaHeight2 = messageView.getTextArea().height
+ console.debug("messageTextH", textAreaHeight, textAreaHeight2)
+ verify(textAreaHeight2 <= textAreaHeight, "Height of text area shoud be less with buttons")
+
+ destroyView()
+ console.debug("exit")
+ }
+ }
+}
diff --git a/src/components/qt_hmi/test/src/tst_SetMediaClockTimer.qml b/src/components/qt_hmi/test/src/tst_SetMediaClockTimer.qml
new file mode 100644
index 000000000..212cdfc14
--- /dev/null
+++ b/src/components/qt_hmi/test/src/tst_SetMediaClockTimer.qml
@@ -0,0 +1,292 @@
+/**
+ * @file tst_Slider.qml
+ * @brief Test Case for Slider.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtTest 1.0
+import QtQuick 2.0
+import QtMultimedia 5.0
+import com.ford.sdl.hmi.dbus_adapter 1.0
+import com.ford.sdl.hmi.hw_buttons 1.0
+import com.ford.sdl.hmi.log4cxx 1.0
+import "../qml_model_qt5/controls"
+import "../qml_model_qt5/views"
+import "../qml_model_qt5/hmi_api" as HmiApi
+import "../qml_model_qt5/models"
+import "../qml_model_qt5/popups"
+import "../qml_model_qt5/hmi_api/Common.js" as Common
+import "../qml_model_qt5/models/Constants.js" as Constants
+import "../qml_model_qt5/models/Internal.js" as Internal
+
+Item {
+ id:item123
+ TestCase {
+ name: "time"
+ property var mainWindowComponent : Qt.createComponent("../qml_model_qt5/MainWindow.qml")
+ property var mainObject
+ property var sdlUI
+ property var dataContainer
+
+ function createTime() {
+ mainObject = mainWindowComponent.createObject(parent)
+ sdlUI = mainObject.getUIProxy()
+ dataContainer = mainObject.getDataStorage()
+ }
+
+ function destroyTime() {
+ mainObject.destroy()
+ }
+
+ //No end time, works like a timer
+ function test_01_noEndTimeInCountUp() {
+ console.debug("enter")
+
+ var initData = {startTime:{hours: 4, minutes: 0, seconds: 0}, endTime:undefined , updateMode: 0, appID: 1}
+
+ var expectedResult = {endTimeResult:-1, resultCode : Common.Result.SUCCESS}
+
+ createTime()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
+
+ var actualResult = sdlUI.setMediaClockTimer(initData)
+
+ try {
+ compare(dataContainer.getApplication(initData.appID).mediaClock.endTime, expectedResult.endTimeResult, "time position")
+ compare(actualResult.__retCode, expectedResult.resultCode, "result code")
+ } catch (e) {}
+
+ destroyTime()
+ console.debug("exit")
+ }
+
+ //No start time. Function process error
+ function test_02_noStartTime() {
+ console.debug("enter")
+
+ var initData = {startTime:undefined, endTime:{hours: 4, minutes: 0, seconds: 0} , updateMode: 1, appID: 1}
+ var expectedResult = {resultCode : Common.Result.INVALID_DATA}
+
+ createTime()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
+
+ var actualResult = sdlUI.setMediaClockTimer(initData)
+
+ try {
+ compare(actualResult.__retCode, expectedResult.resultCode, "result code")
+ } catch (e) {}
+
+ destroyTime()
+ console.debug("exit")
+ }
+
+ //Receive "pause", when onready paused
+ function test_03_pauseAfterPause() {
+ console.debug("enter")
+
+ var initData = {startTime:{hours: 4, minutes: 0, seconds: 0}, endTime:{hours: 12, minutes: 00, seconds: 00}, updateMode: 0, appID: 1}
+ var expectedResult = {resultCode : Common.Result.IGNORED}
+
+ createTime()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
+
+ sdlUI.setMediaClockTimer(initData)
+
+ initData.updateMode=2
+ sdlUI.setMediaClockTimer(initData)
+
+ var actualResult = sdlUI.setMediaClockTimer(initData)
+
+ try {
+ compare(actualResult.__retCode, expectedResult.resultCode, "result code")
+ } catch (e) {}
+
+ destroyTime()
+ console.debug("exit")
+ }
+
+ //Receive "RESUME" after "CLEAR"
+ function test_04_resumeAfterClear() {
+ console.debug("enter")
+
+ var initData = {startTime:{hours: 10, minutes: 0, seconds: 0},endTime:{ }, updateMode:0, appID:1}
+
+ var expectedResult = {resultCode : Common.Result.IGNORED}
+
+ createTime()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
+
+ sdlUI.setMediaClockTimer(initData)
+
+ initData.updateMode=4
+ sdlUI.setMediaClockTimer(initData)
+
+ initData.updateMode=3
+ sdlUI.setMediaClockTimer(initData)
+
+ var actualResult = sdlUI.setMediaClockTimer(initData)
+ try {
+ compare(actualResult.__retCode, expectedResult.resultCode, "result code")
+ } catch (e) {}
+
+ destroyTime()
+ console.debug("exit")
+ }
+
+ function test_05_resumeAfterEnd() {
+ console.debug("enter")
+
+ var initData = {startTime:{hours: 0, minutes: 12, seconds: 33},endTime:{hours: 0, minutes: 12, seconds: 33}, updateMode:0, appID:1}
+
+ var expectedResult = {resultCode : Common.Result.IGNORED}
+
+ createTime()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
+
+ sdlUI.setMediaClockTimer(initData)
+
+ dataContainer.setApplicationProperties(initData.appID, {
+ "mediaClock": {
+ "updateMode": 0,
+ "runningMode": 1,
+ "startTime": initData.StartTime,
+ "endTime": initData.EndTime,
+ "startTimeForProgress": 753
+ }
+ })
+ initData.updateMode=3
+ var actualResult = sdlUI.setMediaClockTimer(initData)
+
+ try {
+ compare(actualResult.__retCode, expectedResult.resultCode, "result code")
+ } catch (e) {}
+
+ destroyTime()
+ console.debug("exit")
+ }
+
+ //Launch "COUNTUP" twice
+ function test_06_twoCountUp() {
+ console.debug("enter")
+
+ var initData1 = {startTime:{hours: 4, minutes: 0, seconds: 0}, endTime:{hours: 12, minutes: 00, seconds: 00}, updateMode: 0, appID: 1}
+ var initData2 = {startTime:{hours: 5, minutes: 0, seconds: 0}, endTime:{hours: 18, minutes: 00, seconds: 00}, updateMode: 0, appID: 1}
+ var expectedResult = {startTime:18000, endTime: 64800, updateMode: 0, resultCode : Common.Result.SUCCESS}
+
+ createTime()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData1.appID})
+
+ sdlUI.setMediaClockTimer(initData1)
+
+ var actualResult = sdlUI.setMediaClockTimer(initData2)
+
+ try {
+ compare(dataContainer.getApplication(initData1.appID).mediaClock.startTime, expectedResult.startTime, "startTime")
+ compare(dataContainer.getApplication(initData1.appID).mediaClock.endTime, expectedResult.endTime, "endTime")
+ compare(dataContainer.getApplication(initData1.appID).mediaClock.updateMode, expectedResult.updateMode, "updateMode")
+ compare(actualResult.__retCode, expectedResult.resultCode, "result code")
+ } catch (e) {}
+
+ destroyTime()
+ console.debug("exit")
+ }
+
+ //Get "RESUME", when clock is paused
+ function test_07_resumeAfterResume() {
+ console.debug("enter")
+
+ var initData = {startTime:{hours: 4, minutes: 0, seconds: 0}, endTime:{hours: 12, minutes: 00, seconds: 00}, updateMode: 0, appID: 1}
+ var expectedResult = {resultCode : Common.Result.IGNORED}
+
+ createTime()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
+
+ sdlUI.setMediaClockTimer(initData)
+
+ initData.updateMode=3
+ var actualResult = sdlUI.setMediaClockTimer(initData)
+
+ try {
+ compare(actualResult.__retCode, expectedResult.resultCode, "result code")
+ } catch (e) {}
+
+ destroyTime()
+ console.debug("exit")
+ }
+
+
+ function test_08_countDownAfterCountUp() {
+ console.debug("enter")
+
+ var initData1 = {startTime:{hours: 4, minutes: 0, seconds: 0}, endTime:{hours: 12, minutes: 00, seconds: 00}, updateMode: 0, appID: 1}
+ var initData2 = {startTime:{hours: 18, minutes: 0, seconds: 0}, endTime:{hours: 5, minutes: 00, seconds: 00}, updateMode: 1, appID: 1}
+ var expectedResult = {startTime:64800, endTime: 18000, updateMode: 1, resultCode : Common.Result.SUCCESS}
+
+ createTime()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData1.appID})
+
+ sdlUI.setMediaClockTimer(initData1)
+
+ var actualResult = sdlUI.setMediaClockTimer(initData2)
+
+ try {
+ compare(dataContainer.getApplication(initData1.appID).mediaClock.startTime, expectedResult.startTime, "startTime")
+ compare(dataContainer.getApplication(initData1.appID).mediaClock.endTime, expectedResult.endTime, "endTime")
+ compare(dataContainer.getApplication(initData1.appID).mediaClock.updateMode, expectedResult.updateMode, "updateMode")
+ compare(actualResult.__retCode, expectedResult.resultCode, "result code")
+ } catch (e) {}
+
+ destroyTime()
+ console.debug("exit")
+ }
+
+ function test_09_noEndTimeInCountDown() {
+ console.debug("enter")
+
+ var initData = {startTime:{hours: 4, minutes: 0, seconds: 0}, endTime:undefined, updateMode: 0, appID: 1}
+
+ var expectedResult = {startTimeForProgress:14400, resultCode : Common.Result.SUCCESS}
+
+ createTime()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
+
+ var actualResult = sdlUI.setMediaClockTimer(initData)
+
+ try {
+ compare(dataContainer.getApplication(initData.appID).mediaClock.startTimeForProgress, expectedResult.startTimeForProgress, "time position")
+ compare(actualResult.__retCode, expectedResult.resultCode, "result code")
+ } catch (e) {}
+
+ destroyTime()
+ console.debug("exit")
+ }
+ }
+}
diff --git a/src/components/qt_hmi/test/src/tst_Show.qml b/src/components/qt_hmi/test/src/tst_Show.qml
new file mode 100644
index 000000000..cce2e7de4
--- /dev/null
+++ b/src/components/qt_hmi/test/src/tst_Show.qml
@@ -0,0 +1,363 @@
+/**
+ * @file tst_Slider.qml
+ * @brief Test Case for Slider.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtTest 1.0
+import QtQuick 2.0
+import QtMultimedia 5.0
+import com.ford.sdl.hmi.dbus_adapter 1.0
+import com.ford.sdl.hmi.hw_buttons 1.0
+import com.ford.sdl.hmi.log4cxx 1.0
+import "../qml_model_qt5/controls"
+import "../qml_model_qt5/views"
+import "../qml_model_qt5/hmi_api" as HmiApi
+import "../qml_model_qt5/models"
+import "../qml_model_qt5/popups"
+import "../qml_model_qt5/hmi_api/Common.js" as Common
+import "../qml_model_qt5/models/Constants.js" as Constants
+import "../qml_model_qt5/models/Internal.js" as Internal
+
+Item {
+ width : mainWindowLoader.width
+ height: mainWindowLoader.height
+ Loader {
+ id: mainWindowLoader
+ asynchronous : false
+ }
+
+ TestCase {
+ name: "Show"
+ when: windowShown
+ property var mainWindowComponent : Qt.createComponent("../qml_model_qt5/MainWindow.qml")
+ property var mainObject
+ property var sldUI
+ property var dataContainer
+ property var contentLoader
+
+ property var softButtonsListExample : [
+ {softButtonID:0, isHighlighted:true, systemAction:Common.SystemAction.DEFAULT_ACTION,
+ type:Common.SoftButtonType.SBT_TEXT, text:"Default Action"},
+ {softButtonID:1, isHighlighted:false, systemAction:Common.SystemAction.STEAL_FOCUS,
+ type:Common.SoftButtonType.SBT_IMAGE, text:"Steal Focus"},
+ {softButtonID:2, isHighlighted:false, systemAction:Common.SystemAction.KEEP_CONTEXT,
+ type:Common.SoftButtonType.SBT_BOTH, text:"Keep context"}]
+
+
+ //initialization for each test
+ function createShow(appID) {
+ mainWindowLoader.source = ""
+ mainWindowLoader.source = "../../../../src/components/qt_hmi/qml_model_qt5/MainWindow.qml"
+ var mainWindowObject = mainWindowLoader.item
+ if(!mainWindowObject)
+ qtest_fail("mainWindowObject is undefined");
+ var mainScreen = mainWindowObject.getMainScreen()
+ mainScreen.visible = true
+ var warningInfo = mainWindowObject.getWarningInfo()
+ warningInfo.visible = false
+ contentLoader = mainWindowObject.getContentLoader()
+ contentLoader.asynchronous = false
+ sldUI = mainWindowObject.getUIProxy()
+ dataContainer = mainWindowObject.getDataStorage()
+ dataContainer.addApplication({appName:"TestAppName", appId:appID})
+ }
+
+
+
+ //cleanup for each test
+ function destroyShow() {
+ //Clear Loader with MainWindow, which delete own models and views
+ mainWindowLoader.source = ""
+ }
+
+
+ //Fill up all fields, check save process to dataContainer
+ function test_01_create() {
+ console.debug("enter")
+ var initData = {
+ appID:1,
+ showStrings:[
+ {fieldName:Common.TextFieldName.mainField1 ,fieldText:"showString1"},
+ {fieldName:Common.TextFieldName.mainField2,fieldText:"showString2"},
+ {fieldName:Common.TextFieldName.mainField3,fieldText:"showString3"},
+ {fieldName:Common.TextFieldName.mainField4,fieldText:"showString4"},
+ {fieldName:Common.TextFieldName.mediaTrack,fieldText:"mediaTrack"},
+ {fieldName:Common.TextFieldName.statusBar,fieldText:"StatusBar"},
+ {fieldName:Common.TextFieldName.mediaClock,fieldText:"12:34"}
+ ],
+ softButtons:softButtonsListExample,
+ alignment:2,
+ graphic:{value:"/home/user/applink/bin/SPTAlice9675308/action.png",imageType: "DYNAMIC"},
+ secondaryGraphic:{value:"/home/user/applink/bin/SPTAlice9675308/action.png",imageType: "DYNAMIC"},
+ customPresets:["GEN0","GEN1","GEN2","GEN3"]
+ }
+
+ createShow(1)
+ var app = dataContainer.getApplication(initData.appID)
+ sldUI.show (initData)
+
+ try {
+
+ compare(app.hmiUIText.mainField1 , initData.showStrings[0].fieldText, "mainField1")
+ compare(app.hmiUIText.mainField2 , initData.showStrings[1].fieldText, "mainField2")
+ compare(app.hmiUIText.mainField3 , initData.showStrings[2].fieldText, "mainField3")
+ compare(app.hmiUIText.mainField4 , initData.showStrings[3].fieldText, "mainField4")
+ compare(app.hmiUIText.mediaTrack , initData.showStrings[4].fieldText, "mediaTrack")
+ compare(app.hmiUIText.statusBar , initData.showStrings[5].fieldText, "StatusBar" )
+ compare(app.hmiUIText.mediaClock , initData.showStrings[6].fieldText, "mediaClock")
+ var a;
+ if(app.hmiUITextAlignment === 1) a=0;
+ if(app.hmiUITextAlignment === 2) a=1;
+ if(app.hmiUITextAlignment === 4) a=2;
+ compare(initData.alignment, a, "Alignment")
+ compare(app.hmiUIText.image, initData.graphic.value, "image")
+ compare(app.hmiUIText.secondaryImage, initData.secondaryGraphic.value, "secdondImage")
+ compare(app.softButtons.count, initData.softButtons.length, "wrong buttons count created")
+ for (var i = 0, len = app.softButtons.count; i < len; i++)
+ {
+ var act = app.softButtons.get(i)
+ var exp = initData.softButtons[i]
+ compare(act.softButtonID, exp.softButtonID, "wrong softButtonID in button")
+ compare(act.isHighlighted, exp.isHighlighted, "wrong isHighlighted in button")
+ compare(act.systemAction, exp.systemAction, "wrong systemAction in button")
+ compare(act.text, exp.text, "wrong text in button")
+ }
+ compare(app.customPresets.count, initData.customPresets.length, "wrong buttons count created")
+ for (var j = 0, len2 = app.customPresets.count; j < len; j++)
+ {
+ var act2 = app.customPresets.get(j)
+ var exp2 = initData.customPresets[j]
+ compare(act2.text, exp2, "wrong text in button")
+ }
+ }
+ catch (e) {}
+ destroyShow()
+ console.debug("exit")
+ }
+ //All fields are empty
+ function test_02_emptyInit()
+ {
+ console.debug("enter")
+ var initData = {
+ appID:1,
+ showStrings:[
+ {fieldName:Common.TextFieldName.mainField1 ,fieldText:""},
+ {fieldName:Common.TextFieldName.mainField2,fieldText:""},
+ {fieldName:Common.TextFieldName.mainField3,fieldText:""},
+ {fieldName:Common.TextFieldName.mainField4,fieldText:""},
+ {fieldName:Common.TextFieldName.mediaTrack,fieldText:""},
+ {fieldName:Common.TextFieldName.statusBar,fieldText:""},
+ {fieldName:Common.TextFieldName.mediaClock,fieldText:""}
+ ],
+ softButtons:[],
+ alignment:0,
+ graphic:{value:"",imageType: "DYNAMIC"},
+ secondaryGraphic:{value:"",imageType: "DYNAMIC"},
+ customPresets:[]
+ }
+
+ createShow(1)
+ var app = dataContainer.getApplication(initData.appID)
+ sldUI.show (initData)
+
+ try {
+
+ compare(app.hmiUIText.mainField1 , initData.showStrings[0].fieldText, "mainField1")
+ compare(app.hmiUIText.mainField2 , initData.showStrings[1].fieldText, "mainField2")
+ compare(app.hmiUIText.mainField3 , initData.showStrings[2].fieldText, "mainField3")
+ compare(app.hmiUIText.mainField4 , initData.showStrings[3].fieldText, "mainField4")
+ compare(app.hmiUIText.mediaTrack , initData.showStrings[4].fieldText, "mediaTrack")
+ compare(app.hmiUIText.statusBar , initData.showStrings[5].fieldText, "StatusBar" )
+ compare(app.hmiUIText.mediaClock , initData.showStrings[6].fieldText, "mediaClock")
+ var a;
+ if(app.hmiUITextAlignment === 1) a=0;
+ if(app.hmiUITextAlignment === 2) a=1;
+ if(app.hmiUITextAlignment === 4) a=2;
+ compare(initData.alignment, a, "Alignment")
+ compare(app.hmiUIText.image, initData.graphic.value, "image")
+ compare(app.hmiUIText.secondaryImage, initData.secondaryGraphic.value, "secdondImage")
+ compare(app.softButtons.count, initData.softButtons.length, "wrong buttons count created")
+ for (var i = 0, len = app.softButtons.count; i < len; i++)
+ {
+ var act = app.softButtons.get(i)
+ var exp = initData.softButtons[i]
+ compare(act.softButtonID, exp.softButtonID, "wrong softButtonID in button")
+ compare(act.isHighlighted, exp.isHighlighted, "wrong isHighlighted in button")
+ compare(act.systemAction, exp.systemAction, "wrong systemAction in button")
+ compare(act.text, exp.text, "wrong text in button")
+ }
+ compare(app.customPresets.count, initData.customPresets.length, "wrong buttons count created")
+ for (var j = 0, len2 = app.customPresets.count; j < len; j++)
+ {
+ var act2 = app.customPresets.get(j)
+ var exp2 = initData.customPresets[j]
+ compare(act2.text, exp2, "wrong text in button")
+ }
+ }
+ catch (e) {}
+ destroyShow()
+ console.debug("exit")
+ }
+
+ //Mandatory fields only
+ function test_03_create_mandatory_only() {
+ console.debug("enter")
+ var initData = {
+ appID:1,
+ showStrings:[
+ {fieldName:Common.TextFieldName.mainField1 ,fieldText:"showString1"},
+ {fieldName:Common.TextFieldName.mainField2,fieldText:"showString2"},
+ {fieldName:Common.TextFieldName.mainField3,fieldText:"showString3"},
+ {fieldName:Common.TextFieldName.mainField4,fieldText:"showString4"},
+ {fieldName:Common.TextFieldName.mediaTrack,fieldText:"mediaTrack"},
+ {fieldName:Common.TextFieldName.statusBar,fieldText:"StatusBar"},
+ {fieldName:Common.TextFieldName.mediaClock,fieldText:"12:34"}
+ ]
+ }
+
+ createShow(1)
+ var app = dataContainer.getApplication(initData.appID)
+ sldUI.show (initData)
+
+ try {
+
+ compare(app.hmiUIText.mainField1 , initData.showStrings[0].fieldText, "mainField1")
+ compare(app.hmiUIText.mainField2 , initData.showStrings[1].fieldText, "mainField2")
+ compare(app.hmiUIText.mainField3 , initData.showStrings[2].fieldText, "mainField3")
+ compare(app.hmiUIText.mainField4 , initData.showStrings[3].fieldText, "mainField4")
+ compare(app.hmiUIText.mediaTrack , initData.showStrings[4].fieldText, "mediaTrack")
+ compare(app.hmiUIText.statusBar , initData.showStrings[5].fieldText, "StatusBar" )
+ compare(app.hmiUIText.mediaClock , initData.showStrings[6].fieldText, "mediaClock")
+
+ }
+ catch (e) {}
+ destroyShow()
+ console.debug("exit")
+ }
+ //Field with extra param
+ function test_04_fake_param() {
+ console.debug("enter")
+ var initData = {
+ appID:1,
+ showStrings:[
+ {fieldName:Common.TextFieldName.mainField1 ,fieldText:"showString1"},
+ {fieldName:Common.TextFieldName.mainField2,fieldText:"showString2"},
+ {fieldName:Common.TextFieldName.mainField3,fieldText:"showString3"},
+ {fieldName:Common.TextFieldName.mainField4,fieldText:"showString4"},
+ {fieldName:Common.TextFieldName.mediaTrack,fieldText:"mediaTrack"},
+ {fieldName:Common.TextFieldName.statusBar,fieldText:"StatusBar",fakeParam:"FakeParam"},
+ {fieldName:Common.TextFieldName.mediaClock,fieldText:"12:34"}
+ ]
+ }
+
+ createShow(1)
+ var app = dataContainer.getApplication(initData.appID)
+ sldUI.show (initData)
+
+ try {
+
+ compare(app.hmiUIText.mainField1 , initData.showStrings[0].fieldText, "mainField1")
+ compare(app.hmiUIText.mainField2 , initData.showStrings[1].fieldText, "mainField2")
+ compare(app.hmiUIText.mainField3 , initData.showStrings[2].fieldText, "mainField3")
+ compare(app.hmiUIText.mainField4 , initData.showStrings[3].fieldText, "mainField4")
+ compare(app.hmiUIText.mediaTrack , initData.showStrings[4].fieldText, "mediaTrack")
+ compare(app.hmiUIText.statusBar , initData.showStrings[5].fieldText, "StatusBar" )
+ compare(app.hmiUIText.mediaClock , initData.showStrings[6].fieldText, "mediaClock")
+
+ }
+ catch (e) {}
+ destroyShow()
+ console.debug("exit")
+ }
+ //aligment of mainField1, mainField2
+ function test_05_alignment() {
+ console.debug("enter")
+ var initData = {
+ appID:1,
+ showStrings:[],
+ alignment:0,
+ }
+
+ createShow(1)
+ var app = dataContainer.getApplication(initData.appID)
+ sldUI.show (initData)
+
+ try {
+ //Magic with digits - because enum of text.Alighnment enum and sdl alignment doesn't match
+ var a;
+ if(app.hmiUITextAlignment === 1) a=0;
+ if(app.hmiUITextAlignment === 2) a=1;
+ if(app.hmiUITextAlignment === 4) a=2;
+ compare(initData.alignment, a, "Alignment")
+ initData.alignment=1
+ sldUI.show (initData)
+ var b;
+ if(app.hmiUITextAlignment === 1) b=0;
+ if(app.hmiUITextAlignment === 2) b=1;
+ if(app.hmiUITextAlignment === 4) b=2;
+ compare(initData.alignment, b, "Alignment")
+ initData.alignment=2
+ sldUI.show (initData)
+ var c;
+ if(app.hmiUITextAlignment === 1) c=0;
+ if(app.hmiUITextAlignment === 2) c=1;
+ if(app.hmiUITextAlignment === 4) c=2;
+ compare(initData.alignment, c, "Alignment")
+ }
+ catch (e) {}
+ destroyShow()
+ console.debug("exit")
+ }
+ //pole bez parametra
+ function test_06_no_param() {
+ console.debug("enter")
+ var initData = {
+ appID:1,
+ showStrings:[],
+ graphic:{imageType: "DYNAMIC"},
+ }
+
+ createShow(1)
+ var app = dataContainer.getApplication(initData.appID)
+ sldUI.show (initData)
+
+ try {
+
+ compare(app.hmiUIText.image, undefined, "image")
+
+ }
+ catch (e) {}
+ destroyShow()
+ console.debug("exit")
+ }
+}
+}
diff --git a/src/components/qt_hmi/test/src/tst_Slider.qml b/src/components/qt_hmi/test/src/tst_Slider.qml
new file mode 100644
index 000000000..0e6acef07
--- /dev/null
+++ b/src/components/qt_hmi/test/src/tst_Slider.qml
@@ -0,0 +1,204 @@
+/**
+ * @file tst_Slider.qml
+ * @brief Test Case for Slider.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtTest 1.0
+import QtQuick 2.0
+import QtMultimedia 5.0
+import com.ford.sdl.hmi.dbus_adapter 1.0
+import com.ford.sdl.hmi.hw_buttons 1.0
+import com.ford.sdl.hmi.log4cxx 1.0
+import "../qml_model_qt5/controls"
+import "../qml_model_qt5/views"
+import "../qml_model_qt5/hmi_api" as HmiApi
+import "../qml_model_qt5/models"
+import "../qml_model_qt5/popups"
+import "../qml_model_qt5/hmi_api/Common.js" as Common
+import "../qml_model_qt5/models/Constants.js" as Constants
+import "../qml_model_qt5/models/Internal.js" as Internal
+
+Item {
+ TestCase {
+ name: "Slider"
+ when: windowShown
+ property var mainWindowComponent : Qt.createComponent("../qml_model_qt5/MainWindow.qml")
+ property var mainObject
+ property var sldUI
+ property var dataContainer
+ property var sliderPopup
+ property var timer
+
+ function createSlider() {
+ mainObject = mainWindowComponent.createObject(parent)
+ var mainScreen = mainObject.getMainScreen()
+ mainScreen.visible = true
+ sldUI = mainObject.getUIProxy()
+ dataContainer = mainObject.getDataStorage()
+ sliderPopup = mainObject.getSlider()
+ timer = sliderPopup.getTimer()
+ }
+
+
+ function destroySlider() {
+ mainObject.destroy()
+ }
+
+ function test_01_timeoutZero() {
+ console.debug("enter")
+ var initData = {numTicks:9, position:4, sliderHeader:"header", sliderFooter:["footer"], timeout:0, appID:1}
+ createSlider()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
+ var actualResult = sldUI.slider(initData)
+ try {
+ compare(actualResult.sliderPosition, initData.position, "slider position")
+ } catch(e){}
+ destroySlider()
+ console.debug("exit")
+ }
+
+ function test_02_changePosition() {
+ console.debug("enter")
+ var initData = {numTicks:9, position:4, sliderHeader:"header", sliderFooter:["footer"], timeout:1, appID:1}
+ var expectedResult = {position : 2, resultCode : Common.Result.SUCCESS}
+ createSlider()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
+ sliderPopup.onReady.connect(function simulateUserAction(){sliderPopup.position = expectedResult.position})
+
+ sldUI.slider(initData)
+
+ timer.onTriggered()
+ try {
+ compare(dataContainer.uiSlider.position, expectedResult.position, "slider position")
+ compare(sliderPopup.resultCode, expectedResult.resultCode, "result code")
+ } catch (e) {}
+ destroySlider()
+ console.debug("exit")
+ }
+
+ function test_03_unChangedPosition() {
+ console.debug("enter")
+ var initData = {numTicks:9, position:4, sliderHeader:"header", sliderFooter:["footer"], timeout:1, appID:1}
+ var expectedResult = {position : 4, resultCode : Common.Result.SUCCESS}
+ createSlider()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
+
+ sldUI.slider(initData)
+
+ timer.onTriggered()
+ try {
+ compare(dataContainer.uiSlider.position, expectedResult.position, "slider position")
+ compare(sliderPopup.resultCode, expectedResult.resultCode, "result code")
+ } catch (e) {}
+ destroySlider()
+ console.debug("exit")
+ }
+
+
+ function test_04_changePositionBackPressed() {
+ console.debug("enter")
+ var initData = {numTicks:9, position:4, sliderHeader:"header", sliderFooter:["footer"], timeout:1, appID:1}
+ var expectedResult = {position : 4, resultCode : Common.Result.ABORTED}
+ createSlider()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
+ sliderPopup.onReady.connect(function simulateUserAction(){sliderPopup.position = expectedResult.position})
+
+ sldUI.slider(initData)
+ sliderPopup.getBackButton().clicked()
+
+ try {
+ compare(dataContainer.uiSlider.position, expectedResult.position, "slider position")
+ compare(sliderPopup.resultCode, expectedResult.resultCode, "result code")
+ } catch (e) {}
+ destroySlider()
+ console.debug("exit")
+ }
+
+ function test_05_secondCall() {
+ console.debug("enter")
+ var initData = {numTicks:9, position:4, sliderHeader:"header", sliderFooter:["footer"], timeout:1, appID:1}
+ var expectedResult = {position : 5, resultCode : Common.Result.ABORTED}
+ createSlider()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
+ sliderPopup.onReady.connect(function simulateUserAction(){sliderPopup.position = expectedResult.position})
+
+ sldUI.slider(initData)
+ initData.position = 5
+ var actualResult = sldUI.slider(initData)
+
+ try {
+ compare(actualResult.sliderPosition, expectedResult.position, "slider position")
+ compare(actualResult.__retCode, expectedResult.resultCode, "result code")
+ } catch (e) {}
+ destroySlider()
+ console.debug("exit")
+ }
+
+ function test_06_footerValueNoChange() {
+ console.debug("enter")
+ var initData = {numTicks:4, position:3, sliderHeader:"header", sliderFooter:["footer1", "footer2", "footer3", "footer4"], timeout:1, appID:1}
+ var expectedResult = {position: 3, footers:["footer1", "footer2", "footer3", "footer4"]}
+ createSlider()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
+
+ sldUI.slider(initData)
+
+ try {
+ compare(sliderPopup.getFooterText().text, expectedResult.footers[expectedResult.position - 1], "current footer")
+ } catch (e) {}
+ destroySlider()
+ console.debug("exit")
+ }
+
+ function test_07_footerValueChange() {
+ console.debug("enter")
+ var initData = {numTicks:4, position:2, sliderHeader:"header", sliderFooter:["footer1", "footer2", "footer3", "footer4"], timeout:1, appID:1}
+ var expectedResult = {position: 3, footers:["footer1", "footer2", "footer3", "footer4"]}
+ createSlider()
+ dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
+ sliderPopup.onReady.connect(function simulateUserAction(){
+ var rect = sliderPopup.getBorderRectangle()
+ console.debug("visible", sliderPopup.visible)
+ mouseClick(rect, rect.width / initData.numTicks * expectedResult.position, 1)
+ })
+
+ sldUI.slider(initData)
+
+ try {
+ compare(sliderPopup.getFooterText().text, expectedResult.footers[expectedResult.position - 1], "current footer")
+ } catch (e) {}
+ destroySlider()
+ console.debug("exit")
+ }
+
+ }
+}
diff --git a/src/components/resumption/CMakeLists.txt b/src/components/resumption/CMakeLists.txt
index 607912337..b8fa277ca 100644
--- a/src/components/resumption/CMakeLists.txt
+++ b/src/components/resumption/CMakeLists.txt
@@ -1,13 +1,48 @@
+# 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_directories (
- ./include
- ../utils/include/
- ../config_profile/include/
+ include
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/config_profile/include/
${JSONCPP_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
)
set (SOURCES
- ./src/last_state.cc
+ ${COMPONENTS_DIR}/resumption/src/last_state.cc
)
add_library("Resumption" ${SOURCES})
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/resumption/src/last_state.cc b/src/components/resumption/src/last_state.cc
index 15100c3e1..7d609fe84 100644
--- a/src/components/resumption/src/last_state.cc
+++ b/src/components/resumption/src/last_state.cc
@@ -40,7 +40,7 @@ namespace resumption {
CREATE_LOGGERPTR_GLOBAL(logger_, "LastState");
void LastState::SaveToFileSystem() {
- LOG4CXX_INFO(logger_, "LastState::SaveToFileSystem");
+ LOG4CXX_AUTO_TRACE(logger_);
const std::string file =
profile::Profile::instance()->app_info_storage();
const std::string& str = dictionary.toStyledString();
@@ -50,8 +50,11 @@ void LastState::SaveToFileSystem() {
DCHECK(file_system::CreateDirectoryRecursively(
profile::Profile::instance()->app_storage_folder()));
- LOG4CXX_INFO(logger_, "LastState::SaveToFileSystem " << file);
+ LOG4CXX_INFO(logger_, "LastState::SaveToFileSystem " << file
+ << str);
+
DCHECK(file_system::Write(file, char_vector_pdata));
+
}
void LastState::LoadFromFileSystem() {
@@ -61,7 +64,8 @@ void LastState::LoadFromFileSystem() {
bool result = file_system::ReadFile(file, buffer);
Json::Reader m_reader;
if (result && m_reader.parse(buffer, dictionary)) {
- LOG4CXX_INFO(logger_, "Valid last state was found.");
+ LOG4CXX_INFO(logger_, "Valid last state was found."
+ << dictionary.toStyledString());
return;
}
LOG4CXX_WARN(logger_, "No valid last state was found.");
diff --git a/src/components/resumption/test/CMakeLists.txt b/src/components/resumption/test/CMakeLists.txt
new file mode 100644
index 000000000..c7b7f52db
--- /dev/null
+++ b/src/components/resumption/test/CMakeLists.txt
@@ -0,0 +1,61 @@
+# 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.
+
+if(BUILD_TESTS)
+
+include_directories(
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/utils/include
+ ${COMPONENTS_DIR}/resumption/include
+ ${COMPONENTS_DIR}/config_profile/include
+ ${COMPONENTS_DIR}/include
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${CMAKE_BINARY_DIR}
+)
+
+set(LIBRARIES
+ gmock
+ ConfigProfile
+ Utils
+ Resumption
+ jsoncpp
+)
+
+set(SOURCES
+ ${COMPONENTS_DIR}/resumption/test/last_state_test.cc
+)
+
+#file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+#file(COPY app_info.dat DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+
+create_test("resumption_test" "${SOURCES}" "${LIBRARIES}")
+
+endif()
diff --git a/src/components/resumption/test/last_state_test.cc b/src/components/resumption/test/last_state_test.cc
new file mode 100644
index 000000000..d2b7f10ce
--- /dev/null
+++ b/src/components/resumption/test/last_state_test.cc
@@ -0,0 +1,102 @@
+/*
+ * 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 "resumption/last_state.h"
+#include "config_profile/profile.h"
+#include "utils/file_system.h"
+
+namespace test {
+namespace components {
+namespace resumption {
+
+using namespace ::resumption;
+using namespace ::Json;
+
+class LastStateTest : public ::testing::Test {
+ public:
+ virtual void SetUp() {
+ ASSERT_TRUE(::file_system::CreateFile("./app_info.dat"));
+ ::profile::Profile::instance()->UpdateValues();
+ }
+
+ virtual void TearDown() {
+ EXPECT_TRUE(::file_system::DeleteFile("./app_info.dat"));
+ }
+};
+
+TEST_F(LastStateTest, Basic) {
+ Value& dictionary = LastState::instance()->dictionary;
+ EXPECT_EQ("null\n", dictionary.toStyledString());
+}
+
+TEST_F(LastStateTest, SetGetData) {
+ {
+ Value& dictionary = LastState::instance()->dictionary;
+ Value bluetooth_info = dictionary["TransportManager"]["BluetoothAdapter"];
+ EXPECT_EQ("null\n", bluetooth_info.toStyledString());
+
+ Value tcp_adapter_info =
+ dictionary["TransportManager"]["TcpAdapter"]["devices"];
+ EXPECT_EQ("null\n", tcp_adapter_info.toStyledString());
+
+ Value resumption_time = dictionary["resumption"]["last_ign_off_time"];
+ EXPECT_EQ("null\n", resumption_time.toStyledString());
+
+ Value resumption_list = dictionary["resumption"]["resume_app_list"];
+ EXPECT_EQ("null\n", resumption_list.toStyledString());
+
+ Value test_value;
+ test_value["name"] = "test_device";
+
+ LastState::instance()
+ ->dictionary["TransportManager"]["TcpAdapter"]["devices"] = test_value;
+ LastState::instance()
+ ->dictionary["TransportManager"]["BluetoothAdapter"]["devices"] =
+ "bluetooth_device";
+ LastState::instance()->SaveToFileSystem();
+ }
+
+ Value& dictionary = LastState::instance()->dictionary;
+
+ Value bluetooth_info = dictionary["TransportManager"]["BluetoothAdapter"];
+ Value tcp_adapter_info = dictionary["TransportManager"]["TcpAdapter"];
+ EXPECT_EQ("{\n \"devices\" : \"bluetooth_device\"\n}\n",
+ bluetooth_info.toStyledString());
+ EXPECT_EQ(
+ "{\n \"devices\" : {\n \"name\" : \"test_device\"\n }\n}\n",
+ tcp_adapter_info.toStyledString());
+}
+
+} // namespace resumption
+} // namespace components
+} // namespace test
diff --git a/src/components/rpc_base/CMakeLists.txt b/src/components/rpc_base/CMakeLists.txt
index 2a1427414..94e67cc98 100644
--- a/src/components/rpc_base/CMakeLists.txt
+++ b/src/components/rpc_base/CMakeLists.txt
@@ -1,21 +1,58 @@
+# 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.
+
+
+set(RPC_BASE_INCLUDE_DIR ${COMPONENTS_DIR}/rpc_base/include)
+
include_directories(
include
${JSONCPP_INCLUDE_DIRECTORY}
)
set (SOURCES
- src/rpc_base/rpc_base.cc
+ ${COMPONENTS_DIR}/rpc_base/src/rpc_base/rpc_base.cc
)
set (HEADERS
- include/rpc_base/gtest_support.h
- include/rpc_base/rpc_base_dbus_inl.h
- include/rpc_base/rpc_base.h
- include/rpc_base/rpc_base_inl.h
- include/rpc_base/rpc_base_json_inl.h
- include/rpc_base/rpc_message.h
- include/rpc_base/validation_report.h
+ ${RPC_BASE_INCLUDE_DIR}/rpc_base/gtest_support.h
+ ${RPC_BASE_INCLUDE_DIR}/rpc_base/rpc_base_dbus_inl.h
+ ${RPC_BASE_INCLUDE_DIR}/rpc_base/rpc_base.h
+ ${RPC_BASE_INCLUDE_DIR}/rpc_base/rpc_base_inl.h
+ ${RPC_BASE_INCLUDE_DIR}/rpc_base/rpc_base_json_inl.h
+ ${RPC_BASE_INCLUDE_DIR}/rpc_base/rpc_message.h
+ ${RPC_BASE_INCLUDE_DIR}/rpc_base/validation_report.h
)
add_library(rpc_base ${HEADERS} ${SOURCES})
target_link_libraries(rpc_base jsoncpp)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif() \ No newline at end of file
diff --git a/src/components/rpc_base/include/rpc_base/gtest_support.h b/src/components/rpc_base/include/rpc_base/gtest_support.h
index 68d1a8314..daea5d388 100644
--- a/src/components/rpc_base/include/rpc_base/gtest_support.h
+++ b/src/components/rpc_base/include/rpc_base/gtest_support.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
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 56b099d9e..1792262a0 100644
--- a/src/components/rpc_base/include/rpc_base/rpc_base.h
+++ b/src/components/rpc_base/include/rpc_base/rpc_base.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -183,10 +183,12 @@ class Integer : public PrimitiveType {
// Methods
Integer();
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);
Integer& operator++();
Integer& operator+=(int value);
operator IntType() const;
@@ -229,6 +231,8 @@ class String : public PrimitiveType {
String(const Json::Value* value, const std::string& def_value);
bool operator<(String new_val);
String& operator=(const std::string& new_val);
+ String& operator=(const String& new_val);
+ bool operator==(const String& rhs);
operator const std::string& () const;
Json::Value ToJsonValue() const;
void ToDbusWriter(dbus::MessageWriter* writer) 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
index 7d66950fc..5f9c45a06 100644
--- 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
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h
index 4373f0ea2..9a59e169c 100644
--- a/src/components/rpc_base/include/rpc_base/rpc_base_inl.h
+++ b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef VALIDATED_TYPES_INL_H_
#define VALIDATED_TYPES_INL_H_
@@ -185,6 +185,13 @@ Integer<T, minval, maxval>& Integer<T, minval, maxval>::operator=(IntType new_va
}
template<typename T, T minval, T maxval>
+Integer<T, minval, maxval>& Integer<T, minval, maxval>::operator=(const Integer& new_val) {
+ this->value_ = new_val.value_;
+ this->value_state_= range_.Includes(new_val.value_) ? kValid : kInvalid;
+ return *this;
+}
+
+template<typename T, T minval, T maxval>
Integer<T, minval, maxval>& Integer<T, minval, maxval>::operator++() {
++value_;
return *this;
@@ -271,6 +278,18 @@ String<minlen, maxlen>& String<minlen, maxlen>::operator=(const std::string& new
}
template<size_t minlen, size_t maxlen>
+String<minlen, maxlen>& String<minlen, maxlen>::operator=(const String& new_val) {
+ value_.assign(new_val.value_);
+ value_state_ = new_val.value_state_;
+ return *this;
+}
+
+template<size_t minlen, size_t maxlen>
+bool String<minlen, maxlen>::operator==(const String& rhs) {
+ return value_ == rhs.value_;
+}
+
+template<size_t minlen, size_t maxlen>
String<minlen, maxlen>::operator const std::string&() const {
return value_;
}
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h
index a58109234..b5fd9a567 100644
--- a/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h
+++ b/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -139,6 +139,12 @@ Integer<T, minval, maxval>::Integer(const Json::Value* value)
}
template<typename T, T minval, T maxval>
+Integer<T, minval, maxval>::Integer(const Integer& val)
+ : PrimitiveType(range_.Includes(val.value_) ? kValid : kInvalid),
+ value_(val.value_) {
+}
+
+template<typename T, T minval, T maxval>
Integer<T, minval, maxval>::Integer(const Json::Value* value, IntType def_value)
: PrimitiveType(InitHelper(value, &Json::Value::isInt)),
value_(def_value) {
diff --git a/src/components/rpc_base/include/rpc_base/rpc_message.h b/src/components/rpc_base/include/rpc_base/rpc_message.h
index 48ef5ff39..18ace4552 100644
--- a/src/components/rpc_base/include/rpc_base/rpc_message.h
+++ b/src/components/rpc_base/include/rpc_base/rpc_message.h
@@ -1,34 +1,34 @@
-/**
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef TYPE_BASE_H_
#define TYPE_BASE_H_
diff --git a/src/components/rpc_base/include/rpc_base/validation_report.h b/src/components/rpc_base/include/rpc_base/validation_report.h
index eeadb35ee..b8a9c4d1c 100644
--- a/src/components/rpc_base/include/rpc_base/validation_report.h
+++ b/src/components/rpc_base/include/rpc_base/validation_report.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/rpc_base/src/rpc_base/rpc_base.cc b/src/components/rpc_base/src/rpc_base/rpc_base.cc
index 88f0f5374..f2290780e 100644
--- a/src/components/rpc_base/src/rpc_base/rpc_base.cc
+++ b/src/components/rpc_base/src/rpc_base/rpc_base.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/rpc_base/test/CMakeLists.txt b/src/components/rpc_base/test/CMakeLists.txt
new file mode 100644
index 000000000..76cf738f4
--- /dev/null
+++ b/src/components/rpc_base/test/CMakeLists.txt
@@ -0,0 +1,62 @@
+# 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.
+
+if (BUILD_TESTS)
+ include_directories (
+ ${COMPONENTS_DIR}/dbus/include
+ ${COMPONENTS_DIR}/dbus/src
+ ${COMPONENTS_DIR}/rpc_base/include
+ ${CMAKE_SOURCE_DIR}/src/3rd_party/dbus-1.7.8
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${JSONCPP_INCLUDE_DIRECTORY}
+)
+
+set(LIBRARIES
+ gmock
+ jsoncpp
+)
+
+set(SOURCES
+ rpc_base_json_test.cc
+ rpc_base_test.cc
+ validation_report_test.cc
+)
+
+if (${HMI_DBUS_API})
+ # Build dbus tests
+ include_directories(${DBUS_INCLUDE_DIRS})
+ set (LIBRARIES ${LIBRARIES} DBus)
+ set (SOURCES ${SOURCES} rpc_base_dbus_test.cc)
+endif ()
+
+create_test("rpc_base_test" "${SOURCES}" "${LIBRARIES}")
+
+endif()
+
diff --git a/src/components/rpc_base/test/rpc_base_dbus_test.cc b/src/components/rpc_base/test/rpc_base_dbus_test.cc
new file mode 100644
index 000000000..e217eff47
--- /dev/null
+++ b/src/components/rpc_base/test/rpc_base_dbus_test.cc
@@ -0,0 +1,690 @@
+/* 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 {
+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 test
diff --git a/src/components/rpc_base/test/rpc_base_json_test.cc b/src/components/rpc_base/test/rpc_base_json_test.cc
new file mode 100644
index 000000000..3a536937b
--- /dev/null
+++ b/src/components/rpc_base/test/rpc_base_json_test.cc
@@ -0,0 +1,373 @@
+/**
+ * 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 "json/value.h"
+#include "rpc_base/rpc_base.h"
+
+namespace test {
+using namespace rpc;
+using Json::Value;
+
+namespace {
+enum TestEnum {
+ kValue0,
+ kValue1,
+ kInvalidValue
+};
+
+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";
+ }
+}
+
+} // namespace
+
+TEST(ValidatedTypesJson, BooleanFromJsonTest) {
+ Value val(true);
+ Boolean boolean(&val);
+ ASSERT_TRUE(boolean.is_initialized());
+ ASSERT_TRUE(boolean.is_valid());
+ ASSERT_EQ(boolean, true);
+ Value readback = boolean.ToJsonValue();
+ ASSERT_TRUE(readback.isBool());
+ ASSERT_EQ(readback.asBool(), true);
+}
+
+TEST(ValidatedTypesJson, BooleanNullTest) {
+ Boolean boolean(&Value::null);
+ ASSERT_TRUE(boolean.is_initialized());
+ ASSERT_FALSE(boolean.is_valid());
+}
+
+TEST(ValidatedTypesJson, BooleanAbsentValueTest) {
+ Value* novalue = NULL;
+ Boolean boolean(novalue);
+ ASSERT_FALSE(boolean.is_initialized());
+ ASSERT_FALSE(boolean.is_valid());
+}
+
+TEST(ValidatedTypesJson, BooleanFromInvalidJsonTest) {
+ Value inv(7);
+ Boolean boolean(&inv);
+ ASSERT_TRUE(boolean.is_initialized());
+ ASSERT_FALSE(boolean.is_valid());
+}
+
+TEST(ValidatedTypesJson, IntegerFromJsonTest) {
+ Value int_val(42);
+ Integer<int32_t, -5, 192> integer(&int_val);
+ ASSERT_TRUE(integer.is_initialized());
+ ASSERT_TRUE(integer.is_valid());
+ Value readback = integer.ToJsonValue();
+ ASSERT_TRUE(readback.isInt());
+ ASSERT_EQ(readback.asInt(), 42);
+}
+
+TEST(ValidatedTypesJson, IntegerNullTest) {
+ Integer<int32_t, -5, 192> integer(&Value::null);
+ ASSERT_TRUE(integer.is_initialized());
+ ASSERT_FALSE(integer.is_valid());
+}
+
+TEST(ValidatedTypesJson, IntegerAbsentValueTest) {
+ Value* novalue = NULL;
+ Integer<int32_t, -5, 192> integer(novalue);
+ ASSERT_FALSE(integer.is_initialized());
+ ASSERT_FALSE(integer.is_valid());
+}
+
+TEST(ValidatedTypesJson, IntegerFromOverflowingJsonTest) {
+ Value int_val(0xFFFFFFFFFFll);
+ Integer<int32_t, -5, 192> integer(&int_val);
+ ASSERT_TRUE(integer.is_initialized());
+ ASSERT_FALSE(integer.is_valid());
+}
+
+TEST(ValidatedTypesJson, IntegerFromInvalidJsonTest) {
+ Value str_val("Hello");
+ Integer<int8_t, -3, 15> integer(&str_val);
+ ASSERT_TRUE(integer.is_initialized());
+ ASSERT_FALSE(integer.is_valid());
+}
+
+TEST(ValidatedTypesJson, IntegerFromOutOfRangeValueTest) {
+ Value big_int_val(500);
+ Integer<int8_t, 0, 100> integer(&big_int_val);
+ ASSERT_TRUE(integer.is_initialized());
+ ASSERT_FALSE(integer.is_valid());
+}
+
+TEST(ValidatedTypesJson, FloatFromJsonTest) {
+ Value float_value(4.2);
+ Float<1, 7> flt(&float_value);
+ ASSERT_TRUE(flt.is_initialized());
+ ASSERT_TRUE(flt.is_valid());
+ Value readback = flt.ToJsonValue();
+ ASSERT_TRUE(readback.isDouble());
+ ASSERT_EQ(readback.asDouble(), 4.2);
+}
+
+TEST(ValidatedTypesJson, FloatNullTest) {
+ Float<1, 7> flt(&Value::null);
+ ASSERT_TRUE(flt.is_initialized());
+ ASSERT_FALSE(flt.is_valid());
+}
+
+TEST(ValidatedTypesJson, FloatAbsentValueTest) {
+ Value* novalue = NULL;
+ Float<1, 7> flt(novalue);
+ ASSERT_FALSE(flt.is_initialized());
+ ASSERT_FALSE(flt.is_valid());
+}
+
+TEST(ValidatedTypesJson, FloatFromInvalidJsonTest) {
+ Value str_val("Hello");
+ Float<-5, 3> flt(&str_val);
+ ASSERT_TRUE(flt.is_initialized());
+ ASSERT_FALSE(flt.is_valid());
+}
+
+TEST(ValidatedTypesJson, StringFromJsonTest) {
+ Value str_val("Hello");
+ String<1, 42> str(&str_val);
+ ASSERT_TRUE(str.is_initialized());
+ ASSERT_TRUE(str.is_valid());
+ Value readback = str.ToJsonValue();
+ ASSERT_TRUE(readback.isString());
+ ASSERT_STREQ(readback.asCString(), "Hello");
+}
+
+TEST(ValidatedTypesJson, StringNullTest) {
+ String<1, 42> str(&Value::null);
+ ASSERT_TRUE(str.is_initialized());
+ ASSERT_FALSE(str.is_valid());
+}
+
+TEST(ValidatedTypesJson, StringFromInvalidJsonTest) {
+ Value int_val(42);
+ String<1, 500> str(&int_val);
+ ASSERT_TRUE(str.is_initialized());
+ ASSERT_FALSE(str.is_valid());
+}
+
+TEST(ValidatedTypesJson, StringAbsentValueTest) {
+ Value* novalue = NULL;
+ String<1, 500> str(novalue);
+ ASSERT_FALSE(str.is_initialized());
+ ASSERT_FALSE(str.is_valid());
+}
+
+TEST(ValidatedTypesJson, StringFromToLongJsonString) {
+ Value str_val("Too long string");
+ String<1, 5> str(&str_val);
+ ASSERT_TRUE(str.is_initialized());
+ ASSERT_FALSE(str.is_valid());
+}
+
+TEST(ValidatedTypesJson, EnumFromJsonTest) {
+ Value str_enum("kValue1");
+ Enum<TestEnum> enm(&str_enum);
+ ASSERT_TRUE(enm.is_initialized());
+ ASSERT_TRUE(enm.is_valid());
+ Value readback = enm.ToJsonValue();
+ ASSERT_TRUE(readback.isString());
+ ASSERT_STREQ(readback.asCString(), "kValue1");
+}
+
+TEST(ValidatedTypesJson, EnumNullTest) {
+ Enum<TestEnum> enm(&Value::null);
+ ASSERT_TRUE(enm.is_initialized());
+ ASSERT_FALSE(enm.is_valid());
+}
+
+TEST(ValidatedTypesJson, EnumAbsentValueTest) {
+ Value* novalue = NULL;
+ Enum<TestEnum> enm(novalue);
+ ASSERT_FALSE(enm.is_initialized());
+ ASSERT_FALSE(enm.is_valid());
+}
+
+TEST(ValidatedTypesJson, EnumFromInvalidJsonTest) {
+ Value str_value("Random string");
+ Enum<TestEnum> enm(&str_value);
+ ASSERT_TRUE(enm.is_initialized());
+ ASSERT_FALSE(enm.is_valid());
+}
+
+TEST(ValidatedTypesJson, ArrayFromJsonTest) {
+ Value array_value;
+ array_value.append(Value("haha"));
+ array_value.append(Value("hoho"));
+ Array<String<1, 32>, 2, 5> arr(&array_value);
+ ASSERT_TRUE(arr.is_initialized());
+ ASSERT_TRUE(arr.is_valid());
+ Value readback = arr.ToJsonValue();
+ ASSERT_TRUE(readback.isArray());
+ ASSERT_EQ(readback.size(), array_value.size());
+}
+
+TEST(ValidatedTypesJson, MandatoryArrayNullTest) {
+ Array<String<1, 32>, 2, 5> arr(&Value::null);
+ ASSERT_TRUE(arr.is_initialized());
+ ASSERT_FALSE(arr.is_valid());
+}
+
+TEST(ValidatedTypesJson, ArrayAbsentValueTest) {
+ Value* novalue = NULL;
+ Array<String<1, 32>, 2, 5> arr(novalue);
+ ASSERT_FALSE(arr.is_initialized());
+ ASSERT_FALSE(arr.is_valid());
+}
+
+TEST(ValidatedTypesJson, MandatoryMapNullTest) {
+ Map<String<1, 32>, 2, 5> map(&Value::null);
+ ASSERT_TRUE(map.is_initialized());
+ ASSERT_FALSE(map.is_valid());
+}
+
+TEST(ValidatedTypesJson, OptionalMapAbsentValueTest) {
+ Value* novalue = NULL;
+ Optional< Map<String<1, 32>, 0, 5> > map(novalue);
+ ASSERT_FALSE(map.is_initialized());
+ ASSERT_TRUE(map.is_valid());
+}
+
+TEST(ValidatedTypesJson, ArrayJsonTest) {
+ Value array_value;
+ array_value.append(Value("Hello"));
+ array_value.append(Value("World"));
+ Array<Integer<int8_t, 0, 32>, 2, 4> int_array(&array_value);
+ ASSERT_TRUE(int_array.is_initialized());
+ ASSERT_TRUE(int_array.is_valid());
+ ASSERT_EQ(int_array.size(), array_value.size());
+}
+
+TEST(ValidatedTypesJson, ArrayFromNonArrayJsonTest) {
+ Value array_value = "Hello";
+ Array<Integer<int8_t, 0, 32>, 0, 4> int_array(&array_value);
+ ASSERT_TRUE(int_array.is_initialized());
+ ASSERT_FALSE(int_array.is_valid());
+ ASSERT_TRUE(int_array.empty());
+}
+
+TEST(ValidatedTypesJson, MapFromNonArrayJsonTest) {
+ Value array_value = "Hello";
+ Map<Integer<int8_t, 0, 32>, 0, 4> int_map(&array_value);
+ ASSERT_TRUE(int_map.is_initialized());
+ ASSERT_FALSE(int_map.is_valid());
+ ASSERT_TRUE(int_map.empty());
+}
+
+TEST(ValidatedTypesJson, OptionalBoolFromJsonTest) {
+ Value bool_value(true);
+ Optional< Boolean > optional_bool;
+ *optional_bool = Boolean(&bool_value);
+ ASSERT_TRUE(optional_bool.is_initialized());
+ ASSERT_TRUE(optional_bool.is_valid());
+ Value readback = optional_bool->ToJsonValue();
+ ASSERT_TRUE(readback.isBool());
+ ASSERT_EQ(readback.asBool(), true);
+}
+
+TEST(ValidatedTypesJson, OptionalBoolFromAbsentValueTest) {
+ Value* none = NULL;
+ Optional< Boolean > optional_bool;
+ *optional_bool = Boolean(none);
+ ASSERT_FALSE(optional_bool.is_initialized());
+ // It is ok for Optional value to be absent
+ ASSERT_TRUE(optional_bool.is_valid());
+}
+
+TEST(ValidatedTypesJson, OptionalBoolFromNullValueTest) {
+ Optional< Boolean > optional_bool;
+ *optional_bool = Boolean(&Value::null);
+ ASSERT_TRUE(optional_bool.is_initialized());
+ // Optional values should not be absent
+ ASSERT_FALSE(optional_bool.is_valid());
+}
+
+TEST(ValidatedTypesJson, NullableIntFromNullValueTest) {
+ Nullable< Integer<int8_t, 1, 15> > nullable_int(&Value::null);
+ ASSERT_TRUE(nullable_int.is_initialized());
+ ASSERT_TRUE(nullable_int.is_valid());
+ ASSERT_TRUE(nullable_int.is_null());
+}
+
+TEST(ValidatedTypesJson, NullableIntFromNonNullValueTest) {
+ Value json(3);
+ Nullable< Integer<int8_t, 1, 15> > nullable_int(&json);
+ ASSERT_TRUE(nullable_int.is_initialized());
+ ASSERT_TRUE(nullable_int.is_valid());
+ ASSERT_FALSE(nullable_int.is_null());
+ ASSERT_EQ(3, nullable_int);
+}
+
+TEST(ValidatedTypesJson, NullableIntFromAbsentValueTest) {
+ Value* noval = NULL;
+ Nullable< Integer<int8_t, 1, 15> > nullable_int(noval);
+ ASSERT_FALSE(nullable_int.is_initialized());
+ ASSERT_FALSE(nullable_int.is_valid());
+ ASSERT_FALSE(nullable_int.is_null());
+}
+
+TEST(ValidatedTypesJson, OptionalIntFromJsonTest) {
+ Value int_value(42);
+ Optional< Integer<int64_t, 42, 43> > optional_int;
+ *optional_int = Integer<int64_t, 42, 43> (&int_value);
+ ASSERT_TRUE(optional_int.is_initialized());
+ ASSERT_TRUE(optional_int.is_valid());
+ Value readback = optional_int->ToJsonValue();
+ ASSERT_TRUE(readback.isInt());
+ ASSERT_EQ(readback.asInt(), 42);
+}
+
+
+} // namespace test
+
+
+
diff --git a/src/components/rpc_base/test/rpc_base_test.cc b/src/components/rpc_base/test/rpc_base_test.cc
new file mode 100644
index 000000000..553dacb85
--- /dev/null
+++ b/src/components/rpc_base/test/rpc_base_test.cc
@@ -0,0 +1,437 @@
+/**
+ * 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 "json/writer.h"
+#include "rpc_base/gtest_support.h"
+#include "rpc_base/rpc_base.h"
+
+namespace test {
+using namespace rpc;
+
+namespace {
+
+enum TestEnum {
+ kValue0,
+ kValue1,
+ kInvalidValue
+};
+
+bool IsValidEnum(TestEnum val) {
+ return val == kValue0 || val == kValue1;
+}
+
+} // namespace
+
+TEST(ValidatedTypes, TestBooleanDefaultConstructor) {
+ Boolean boolean;
+ ASSERT_FALSE(boolean.is_valid());
+ ASSERT_FALSE(boolean.is_initialized());
+ boolean = true;
+ bool val = boolean;
+ ASSERT_TRUE(val);
+ ASSERT_TRUE(boolean.is_initialized());
+}
+
+TEST(ValidatedTypes, TestBooleanInitializingConstructor) {
+ Boolean true_boolean(true);
+ ASSERT_RPCTYPE_VALID(true_boolean);
+ ASSERT_TRUE(true_boolean.is_initialized());
+ ASSERT_EQ(true_boolean, true);
+
+ Boolean false_boolean(false);
+ ASSERT_RPCTYPE_VALID(false_boolean);
+ ASSERT_TRUE(false_boolean.is_initialized());
+ ASSERT_EQ(false_boolean, false);
+}
+
+TEST(ValidatedTypes, TestIntegerDefaultConstructor) {
+ Integer<int32_t, 4, 100> integer;
+ ASSERT_FALSE(integer.is_valid());
+ ASSERT_FALSE(integer.is_initialized());
+ ASSERT_EQ(integer, 4);
+ integer = 5;
+ ASSERT_RPCTYPE_VALID(integer);
+ ASSERT_TRUE(integer.is_initialized());
+ ASSERT_EQ(integer, 5);
+ integer = 700;
+ ASSERT_FALSE(integer.is_valid());
+ ASSERT_TRUE(integer.is_initialized());
+ ASSERT_EQ(integer, 700);
+}
+
+TEST(ValidatedTypes, TestIntegerInitializingConstructor) {
+ Integer<int32_t, 0, 100> invalid_integer(200);
+ ASSERT_FALSE(invalid_integer.is_valid());
+ ASSERT_TRUE(invalid_integer.is_initialized());
+ ASSERT_EQ(invalid_integer, 200);
+
+ Integer<int32_t, 0, 100> valid_integer(42);
+ ASSERT_RPCTYPE_VALID(valid_integer);
+ ASSERT_TRUE(valid_integer.is_initialized());
+ ASSERT_EQ(valid_integer, 42);
+}
+
+TEST(ValidatedTypes, TestFloatDefaultConstructor) {
+ Float<-5, 12> flt;
+ ASSERT_FALSE(flt.is_initialized());
+ ASSERT_FALSE(flt.is_valid());
+ ASSERT_EQ(flt, -5.);
+
+ flt = 12.3;
+ ASSERT_TRUE(flt.is_initialized());
+ ASSERT_FALSE(flt.is_valid());
+ ASSERT_EQ(flt, 12.3);
+}
+
+TEST(ValidatedTypes, TestFloatInitializingConstructor) {
+ Float<13, 999, 10, 10> flt(4);
+ ASSERT_TRUE(flt.is_initialized());
+ ASSERT_RPCTYPE_VALID(flt);
+ ASSERT_EQ(flt, 4.);
+
+ flt = 1.2;
+ ASSERT_FALSE(flt.is_valid());
+ ASSERT_EQ(flt, 1.2);
+}
+
+TEST(ValidatedTypes, TestStringDefaultConstructor) {
+ String<1, 6> str;
+ ASSERT_FALSE(str.is_initialized());
+ ASSERT_FALSE(str.is_valid());
+ std::string val = str;
+ ASSERT_EQ(val, "");
+ str = "Test";
+ ASSERT_TRUE(str.is_initialized());
+ ASSERT_RPCTYPE_VALID(str);
+ val = str;
+ ASSERT_EQ(val, "Test");
+ str = "Long string";
+ ASSERT_TRUE(str.is_initialized());
+ ASSERT_FALSE(str.is_valid());
+ val = str;
+ ASSERT_EQ(val, "Long string");
+}
+
+TEST(ValidatedTypes, TestStringLengthRange) {
+ String<4, 10> str;
+ ASSERT_FALSE(str.is_initialized());
+ ASSERT_FALSE(str.is_valid());
+ str = "Hello";
+ ASSERT_TRUE(str.is_initialized());
+ ASSERT_RPCTYPE_VALID(str);
+ str = "Sh";
+ ASSERT_TRUE(str.is_initialized());
+ ASSERT_FALSE(str.is_valid());
+}
+
+TEST(ValidatedTypes, TestStringInitializingConstructor) {
+ String<1, 4> invalid_str("A string");
+ ASSERT_TRUE(invalid_str.is_initialized());
+ ASSERT_FALSE(invalid_str.is_valid());
+}
+
+TEST(ValidatedTypes, TestStringAssignment) {
+ String<1, 5> short_str("Short");
+ String<1, 10> long_str("A long string");
+ short_str = long_str;
+ ASSERT_TRUE(short_str.is_initialized());
+ ASSERT_FALSE(short_str.is_valid());
+}
+
+TEST(ValidatedTypes, TestArray) {
+ Array<String<1, 5>, 2, 10> arr;
+ ASSERT_FALSE(arr.is_initialized());
+ ASSERT_FALSE(arr.is_valid());
+ arr.push_back("Text");
+ arr.push_back("Dext");
+ ASSERT_RPCTYPE_VALID(arr);
+ ASSERT_TRUE(arr.is_initialized());
+ arr.push_back("Too long");
+ ASSERT_FALSE(arr.is_valid());
+}
+
+TEST(ValidatedTypes, TestArrayInitializingConstructor) {
+ std::vector<std::string> strings;
+ strings.push_back("One");
+ strings.push_back("Two");
+ Array<String<1, 5>, 2, 10> arr(strings);
+ ASSERT_TRUE(arr.is_initialized());
+ ASSERT_RPCTYPE_VALID(arr);
+}
+
+TEST(ValidatedTypes, TestOptionalEmptyArray) {
+ Optional< Array<Integer<int8_t, 0, 10>, 0, 5> > ai;
+ ASSERT_RPCTYPE_VALID(ai);
+ ASSERT_FALSE(ai.is_initialized());
+ Json::FastWriter fw;
+ std::string serialized = fw.write(ai.ToJsonValue());
+ ASSERT_EQ(serialized, "[]\n");
+}
+
+TEST(ValidatedTypes, TestMandatoryEmptyArray) {
+ Array<Integer<int8_t, 0, 10>, 0, 5> ai;
+ ASSERT_FALSE(ai.is_valid());
+ ASSERT_FALSE(ai.is_initialized());
+ Json::FastWriter fw;
+ std::string serialized = fw.write(ai.ToJsonValue());
+ ASSERT_EQ(serialized, "[]\n");
+}
+
+TEST(ValidatedTypes, TestMap) {
+ Map<String<1, 6>, 2, 10> map;
+ ASSERT_FALSE(map.is_initialized());
+ ASSERT_FALSE(map.is_valid());
+ map["a"] = "Hello";
+ map["b"] = "World";
+ ASSERT_TRUE(map.is_initialized());
+ ASSERT_RPCTYPE_VALID(map);
+ map["c"] = "Too long";
+ ASSERT_FALSE(map.is_valid());
+}
+
+TEST(ValidatedTypes, TestMapInitializingConstructor) {
+ std::map< std::string, std::string > init_map;
+ init_map["a"] = "Hello";
+ init_map["b"] = "World";
+ Map<String<1, 6>, 2, 10 > map(init_map);
+ ASSERT_TRUE(map.is_initialized());
+ ASSERT_RPCTYPE_VALID(map);
+}
+
+TEST(ValidatedTypes, TestEmptyMandatoryMap) {
+ Map<Integer<int8_t, 0, 10>, 0, 5> im;
+ ASSERT_FALSE(im.is_valid());
+ ASSERT_FALSE(im.is_initialized());
+ Json::FastWriter fw;
+ std::string serialized = fw.write(im.ToJsonValue());
+ ASSERT_EQ(serialized, "{}\n");
+}
+
+TEST(ValidatedTypes, TestEnumConstructor) {
+ Enum<TestEnum> te;
+ ASSERT_FALSE(te.is_initialized());
+ ASSERT_FALSE(te.is_valid());
+ te = kValue1;
+ ASSERT_TRUE(te.is_initialized());
+ ASSERT_RPCTYPE_VALID(te);
+ ASSERT_EQ(te, kValue1);
+ te = TestEnum(42);
+ ASSERT_TRUE(te.is_initialized());
+ ASSERT_FALSE(te.is_valid());
+}
+
+TEST(ValidatedTypes, TestNullableConstructor) {
+ Nullable< Integer<int8_t, 2, 10> >nullable_int;
+ ASSERT_FALSE(nullable_int.is_initialized());
+ ASSERT_FALSE(nullable_int.is_null());
+ ASSERT_FALSE(nullable_int.is_valid());
+ nullable_int = 5;
+ ASSERT_TRUE(nullable_int.is_initialized());
+ ASSERT_FALSE(nullable_int.is_null());
+ ASSERT_RPCTYPE_VALID(nullable_int);
+ nullable_int.set_to_null();
+ ASSERT_TRUE(nullable_int.is_initialized());
+ ASSERT_TRUE(nullable_int.is_null());
+ ASSERT_RPCTYPE_VALID(nullable_int);
+}
+
+TEST(ValidatedTypes, TestOptionalNullableConstructor) {
+ Optional< Nullable< Integer<int8_t, 2, 10> > > optional_nullable_int;
+ ASSERT_FALSE(optional_nullable_int.is_initialized());
+ ASSERT_FALSE(optional_nullable_int->is_null());
+ ASSERT_RPCTYPE_VALID(optional_nullable_int);
+ ASSERT_FALSE(optional_nullable_int);
+
+ *optional_nullable_int = 9;
+ ASSERT_TRUE(optional_nullable_int.is_initialized());
+ ASSERT_FALSE(optional_nullable_int->is_null());
+ ASSERT_RPCTYPE_VALID(optional_nullable_int);
+ ASSERT_EQ(9, *optional_nullable_int);
+ ASSERT_TRUE(optional_nullable_int);
+
+ optional_nullable_int->set_to_null();
+ ASSERT_TRUE(optional_nullable_int.is_initialized());
+ ASSERT_TRUE(optional_nullable_int->is_null());
+ ASSERT_RPCTYPE_VALID(optional_nullable_int);
+}
+
+TEST(ValidatedTypes, TestOptionalConstructor) {
+ Optional< Integer<int16_t, 3, 15> > optional_int;
+ ASSERT_FALSE(optional_int.is_initialized());
+ ASSERT_RPCTYPE_VALID(optional_int);
+ *optional_int = 42;
+ ASSERT_TRUE(optional_int.is_initialized());
+ ASSERT_FALSE(optional_int.is_valid());
+ *optional_int = 12;
+ ASSERT_TRUE(optional_int.is_initialized());
+ ASSERT_RPCTYPE_VALID(optional_int);
+ int readback = *optional_int;
+ ASSERT_EQ(readback, 12);
+}
+
+TEST(ValidatedTypes, TestOptionalInitializingConstructor) {
+ Optional< String<1, 12> > optional_string("Hello world");
+ ASSERT_TRUE(optional_string.is_initialized());
+ ASSERT_RPCTYPE_VALID(optional_string);
+ std::string value = *optional_string;
+ ASSERT_EQ(value, "Hello world");
+}
+
+TEST(ValidatedTypes, TestDifferentTypesAssignment) {
+ Integer<int8_t, 1, 3> val;
+ Integer<int32_t, 5, 90> val2(45);
+ val = val2;
+ ASSERT_TRUE(val2.is_initialized());
+ ASSERT_RPCTYPE_VALID(val2);
+ ASSERT_TRUE(val.is_initialized());
+ ASSERT_FALSE(val.is_valid());
+}
+
+TEST(ValidatedTypes, ReportUninitializedIntType) {
+ Integer<int8_t, 1, 3> val;
+ ASSERT_FALSE(val.is_valid());
+ ValidationReport report("val");
+ val.ReportErrors(&report);
+ ASSERT_EQ("val: value is not initialized\n", PrettyFormat(report));
+}
+
+TEST(ValidatedTypes, ReportIncorrectInitializedIntType) {
+ Integer<int8_t, 1, 3> val(5);
+ ASSERT_FALSE(val.is_valid());
+ ValidationReport report("val");
+ val.ReportErrors(&report);
+ ASSERT_EQ("val: value initialized incorrectly\n", PrettyFormat(report));
+}
+
+TEST(ValidatedTypes, ReportUninitializedOptionalType) {
+ Optional< Integer<int8_t, 1, 3> > val;
+ ASSERT_RPCTYPE_VALID(val);
+ ValidationReport report("val");
+ val.ReportErrors(&report);
+ ASSERT_EQ("", PrettyFormat(report));
+}
+
+TEST(ValidatedTypes, ReportIncorrectInitializedOptionalType) {
+ Optional< Integer<int8_t, 1, 3> > val(5);
+ ASSERT_FALSE(val.is_valid());
+ ValidationReport report("val");
+ val.ReportErrors(&report);
+ ASSERT_EQ("val: value initialized incorrectly\n", PrettyFormat(report));
+}
+
+TEST(ValidatedTypes, ReportUninitializedNullableIntType) {
+ Nullable< Integer<int8_t, 1, 3> > val;
+ ASSERT_FALSE(val.is_valid());
+ ValidationReport report("val");
+ val.ReportErrors(&report);
+ ASSERT_EQ("val: value is not initialized\n", PrettyFormat(report));
+}
+
+TEST(ValidatedTypes, ReportNullInitializedNullableIntType) {
+ Nullable< Integer<int8_t, 1, 3> > val;
+ val.set_to_null();
+ ASSERT_RPCTYPE_VALID(val);
+ ValidationReport report("val");
+ val.ReportErrors(&report);
+ ASSERT_EQ("", PrettyFormat(report));
+}
+
+TEST(ValidatedTypes, ReportNoninitializedIntArray) {
+ Array< Enum<TestEnum>, 1, 3 > array;
+ ASSERT_FALSE(array.is_valid());
+ ValidationReport report("array");
+ array.ReportErrors(&report);
+ ASSERT_EQ("array: object is not initialized\n", PrettyFormat(report));
+}
+
+TEST(ValidatedTypes, ReportIncorrectlyInitializedIntArray1) {
+ Array< Integer<int8_t, 1, 10>, 1, 3 > array;
+ array.push_back(11);
+ ASSERT_FALSE(array.is_valid());
+ ValidationReport report("array");
+ array.ReportErrors(&report);
+ ASSERT_EQ("array[0]: value initialized incorrectly\n", PrettyFormat(report));
+}
+
+TEST(ValidatedTypes, ReportIncorrectlyInitializedIntArray2) {
+ Array< Integer<int8_t, 1, 10>, 1, 3 > array;
+ array.push_back(1);
+ array.push_back(2);
+ array.push_back(3);
+ array.push_back(4);
+ ASSERT_FALSE(array.is_valid());
+ ValidationReport report("array");
+ array.ReportErrors(&report);
+ ASSERT_EQ("array: array has invalid size\n", PrettyFormat(report));
+}
+
+TEST(ValidatedTypes, ReportIncorrectlyInitializedArray3) {
+ Array< Integer<int8_t, 1, 10>, 1, 3 > array;
+ array.push_back(1);
+ array.push_back(2);
+ array.push_back(42);
+ array.push_back(4);
+ ValidationReport report("array");
+ array.ReportErrors(&report);
+ ASSERT_EQ("array: array has invalid size\n"
+ "array[2]: value initialized incorrectly\n", PrettyFormat(report));
+}
+
+TEST(ValidatedTypes, ReportUninitializedMap) {
+ Map< Integer<int8_t, 1, 10>, 1, 3 > map;
+ ValidationReport report("map");
+ map.ReportErrors(&report);
+ ASSERT_EQ("map: object is not initialized\n", PrettyFormat(report));
+}
+
+TEST(ValidatedTypes, ReportIncorrectlyInitializedMap1) {
+ Map< Integer<int8_t, 1, 10>, 1, 3 > map;
+ map["aha"] = 42;
+ ValidationReport report("map");
+ map.ReportErrors(&report);
+ ASSERT_EQ("map[\"aha\"]: value initialized incorrectly\n", PrettyFormat(report));
+}
+
+TEST(ValidatedTypes, ReportIncorrectlyInitializedMap2) {
+ Map< Integer<int8_t, 1, 10>, 1, 3 > map;
+ map["aha"] = 3;
+ map["haha"] = 12;
+ map["muhahaha"] = 17;
+ map["muhahaha"] = 22;
+ ValidationReport report("map");
+ map.ReportErrors(&report);
+ ASSERT_EQ("map[\"haha\"]: value initialized incorrectly\n"
+ "map[\"muhahaha\"]: value initialized incorrectly\n", PrettyFormat(report));
+}
+
+} // namespace codegen
diff --git a/src/components/rpc_base/test/validation_report_test.cc b/src/components/rpc_base/test/validation_report_test.cc
new file mode 100644
index 000000000..1493de395
--- /dev/null
+++ b/src/components/rpc_base/test/validation_report_test.cc
@@ -0,0 +1,156 @@
+/*
+ * 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>
+#include "gtest/gtest.h"
+#include "rpc_base/validation_report.h"
+
+namespace test {
+using namespace rpc;
+
+class ValidationReportTest : public testing::Test {
+ protected:
+ static ValidationReport* report_;
+ static ValidationReport* report_2;
+ static const std::string object_name_;
+ static const std::string object_name_2;
+ static const std::string subobject_name_1;
+ static const std::string subobject_name_2;
+ static const std::string subobject_name_3;
+ static const std::string test_validation_info_;
+ static const std::string parent_object_name_;
+
+ static void SetUpTestCase() {
+ report_ = new ValidationReport(object_name_);
+ report_2 = new ValidationReport(object_name_2);
+ }
+ virtual void TearDown() { ClearReports(); }
+
+ void ClearReports() {
+ ValidationReports& temp =
+ const_cast<ValidationReports&>(report_->subobject_reports());
+ temp.clear();
+ }
+
+ void GeneratePrettyFormatResult(std::string& result, const std::string& parent_name,
+ const std::string& obj_name, const std::string& val_info) {
+ std::string temp;
+ if (obj_name[0] != '[') {
+ temp = ".";
+ } else {
+ temp = "";
+ }
+ result = parent_name + temp + obj_name + ":" + " " +
+ val_info + "\n";
+ }
+
+ void ClearValidationInfo() {
+ std::string& temp = const_cast<std::string&>(report_->validation_info());
+ temp = "";
+ }
+
+ static void TearDownTestCase() {
+ delete report_;
+ delete report_2;
+ }
+
+ void FillReports(ValidationReports& reports_) {
+ reports_.push_back(ValidationReport("test_subobject1"));
+ reports_.push_back(ValidationReport("test_subobject2"));
+ reports_.push_back(ValidationReport("test_subobject3"));
+ }
+};
+
+ValidationReport* ValidationReportTest::report_ = NULL;
+ValidationReport* ValidationReportTest::report_2 = NULL;
+const std::string ValidationReportTest::object_name_ = "test_object";
+const std::string ValidationReportTest::object_name_2 = "[test_object2]";
+const std::string ValidationReportTest::subobject_name_1 = "test_subobject1";
+const std::string ValidationReportTest::subobject_name_2 = "test_subobject2";
+const std::string ValidationReportTest::subobject_name_3 = "test_subobject3";
+const std::string ValidationReportTest::test_validation_info_ =
+ "test_validation_info";
+const std::string ValidationReportTest::parent_object_name_ = "test_parent";
+
+
+TEST_F(ValidationReportTest, Ctor_and_object_name_test_ExpectDataCorrect) {
+ EXPECT_EQ(object_name_, report_->object_name());
+}
+
+TEST_F(ValidationReportTest, Set_Get_Validation_Info_ExpectDataCorrect) {
+ report_->set_validation_info("test_validation_info");
+ EXPECT_EQ(test_validation_info_, report_->validation_info());
+ ClearValidationInfo();
+}
+
+TEST_F(ValidationReportTest, Subobject_Reports_ExpectDataCorrect) {
+ // Check before act
+ EXPECT_EQ(0u, report_->subobject_reports().size());
+ // Act
+ report_->ReportSubobject(subobject_name_1).object_name();
+ report_->ReportSubobject(subobject_name_2).object_name();
+ report_->ReportSubobject(subobject_name_3).object_name();
+ // Check after act
+ EXPECT_EQ(3u, report_->subobject_reports().size());
+}
+
+TEST_F(ValidationReportTest, ReportSubobject_ExpectDataCorrect) {
+ // Act and check
+ EXPECT_EQ(subobject_name_1,
+ report_->ReportSubobject(subobject_name_1).object_name());
+ EXPECT_EQ(subobject_name_2,
+ report_->ReportSubobject(subobject_name_2).object_name());
+ EXPECT_EQ(subobject_name_3,
+ report_->ReportSubobject(subobject_name_3).object_name());
+ // Check after act
+ EXPECT_EQ(3u, report_->subobject_reports().size());
+}
+
+TEST_F(ValidationReportTest, PrettyFormat_ExpectDataCorrect) {
+ // Arrange
+ std::string result1;
+ std::string result2;
+ report_->set_validation_info(test_validation_info_);
+ report_2->set_validation_info(test_validation_info_);
+ // Act
+ impl::PrettyFormat(*report_, parent_object_name_, &result1);
+ impl::PrettyFormat(*report_2, parent_object_name_, &result2);
+ std::string temp1;
+ GeneratePrettyFormatResult(temp1, parent_object_name_, object_name_, test_validation_info_);
+ std::string temp2;
+ GeneratePrettyFormatResult(temp2, parent_object_name_, object_name_2, test_validation_info_);
+ // Checks
+ EXPECT_EQ(temp1, result1);
+ EXPECT_EQ(temp2, result2);
+}
+
+} // namespace rpc
diff --git a/src/components/security_manager/CMakeLists.txt b/src/components/security_manager/CMakeLists.txt
index 13a22a5b2..6973a98e0 100644
--- a/src/components/security_manager/CMakeLists.txt
+++ b/src/components/security_manager/CMakeLists.txt
@@ -1,19 +1,54 @@
+# 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_directories(
- ./include/
- ../protocol_handler/include/
- ../connection_handler/include
- ../utils/include/
+ include/
+ ${COMPONENTS_DIR}/protocol_handler/include/
+ ${COMPONENTS_DIR}/connection_handler/include
+ ${COMPONENTS_DIR}/utils/include/
${JSONCPP_INCLUDE_DIRECTORY}
${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/jsoncpp/include
${APR_INCLUDE_DIRECTORY}
)
set (SOURCES
- src/security_manager_impl.cc
- src/security_query.cc
- src/crypto_manager_impl.cc
- src/ssl_context_impl.cc
+ ${COMPONENTS_DIR}/security_manager/src/security_manager_impl.cc
+ ${COMPONENTS_DIR}/security_manager/src/security_query.cc
+ ${COMPONENTS_DIR}/security_manager/src/crypto_manager_impl.cc
+ ${COMPONENTS_DIR}/security_manager/src/ssl_context_impl.cc
)
add_library(SecurityManager ${SOURCES})
target_link_libraries(SecurityManager crypto ssl ProtocolHandler jsoncpp ProtocolLibrary)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif() \ No newline at end of file
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 2b17e8d27..2aa03087e 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
@@ -63,7 +63,7 @@ typedef utils::PrioritizedQueue<SecurityMessage> SecurityMessageQueue;
typedef threads::MessageLoopThread<SecurityMessageQueue> SecurityMessageLoop;
/**
- * \brief SecurityManagerImpl class implements SecurityManager inteface
+ * \brief SecurityManagerImpl class implements SecurityManager interface
*/
class SecurityManagerImpl
: public SecurityManager,
diff --git a/src/components/security_manager/src/security_manager_impl.cc b/src/components/security_manager/src/security_manager_impl.cc
index 156ac5b83..dee1770e7 100644
--- a/src/components/security_manager/src/security_manager_impl.cc
+++ b/src/components/security_manager/src/security_manager_impl.cc
@@ -349,15 +349,22 @@ void SecurityManagerImpl::SendInternalError(const uint32_t connection_key,
void SecurityManagerImpl::SendQuery(const SecurityQuery& query,
const uint32_t connection_key) {
const std::vector<uint8_t> data_sending = query.DeserializeQuery();
-
- const ::protocol_handler::RawMessagePtr rawMessagePtr(
- new protocol_handler::RawMessage(connection_key,
- protocol_handler::PROTOCOL_VERSION_3,
- &data_sending[0], data_sending.size(),
- protocol_handler::kControl));
- DCHECK(protocol_handler_);
- // Add RawMessage to ProtocolHandler message query
- protocol_handler_->SendMessageToMobileApp(rawMessagePtr, false);
+ uint32_t connection_handle = 0;
+ uint8_t sessionID = 0;
+ uint8_t protocol_version;
+ session_observer_->PairFromKey(connection_key, &connection_handle,
+ &sessionID);
+ if (session_observer_->ProtocolVersionUsed(connection_handle, sessionID,
+ protocol_version)) {
+ const ::protocol_handler::RawMessagePtr rawMessagePtr(
+ new protocol_handler::RawMessage(connection_key,
+ protocol_version,
+ &data_sending[0], data_sending.size(),
+ protocol_handler::kControl));
+ DCHECK(protocol_handler_);
+ // Add RawMessage to ProtocolHandler message query
+ protocol_handler_->SendMessageToMobileApp(rawMessagePtr, false);
+ }
}
const char *SecurityManagerImpl::ConfigSection() {
diff --git a/src/components/security_manager/test/CMakeLists.txt b/src/components/security_manager/test/CMakeLists.txt
new file mode 100644
index 000000000..6554bb797
--- /dev/null
+++ b/src/components/security_manager/test/CMakeLists.txt
@@ -0,0 +1,66 @@
+# 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.
+
+if (BUILD_TESTS)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/protocol_handler/test/include
+ ${COMPONENTS_DIR}/transport_manager/test/include
+ ${COMPONENTS_DIR}/security_manager/include
+ include
+)
+
+set(SOURCES
+ #${COMPONENTS_DIR}/security_manager/test/crypto_manager_impl_test.cc
+ #${COMPONENTS_DIR}/security_manager/test/security_manager_test.cc
+ #${COMPONENTS_DIR}/security_manager/test/security_query_test.cc
+ ${COMPONENTS_DIR}/security_manager/test/security_query_matcher.cc
+ )
+
+set(LIBRARIES
+ gmock
+ ${SecurityManagerLibrary}
+)
+
+set(CERT_LIST
+ ${CMAKE_SOURCE_DIR}/mycert.pem
+ ${CMAKE_SOURCE_DIR}/mykey.pem
+)
+
+foreach( file_i ${CERT_LIST})
+ file(COPY ${file_i} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+endforeach( file_i )
+
+add_library (test_security_manager ${SOURCES})
+target_link_libraries (test_security_manager ${LIBRARIES} )
+create_test (security_manager_test "${SOURCES}" "${LIBRARIES}")
+
+endif ()
diff --git a/src/components/security_manager/test/crypto_manager_impl_test.cc b/src/components/security_manager/test/crypto_manager_impl_test.cc
new file mode 100644
index 000000000..52ac42b41
--- /dev/null
+++ b/src/components/security_manager/test/crypto_manager_impl_test.cc
@@ -0,0 +1,462 @@
+/*
+ * 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 <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "security_manager/crypto_manager.h"
+#include "security_manager/crypto_manager_impl.h"
+#include "security_manager/ssl_context.h"
+
+#ifdef __QNXNTO__
+#include <openssl/ssl3.h>
+#else
+#include <openssl/tls1.h>
+#endif
+
+#ifdef __QNXNTO__
+#define FORD_CIPHER SSL3_TXT_RSA_DES_192_CBC3_SHA
+#else
+// Used cipher from ford protocol requirement
+#define FORD_CIPHER TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384
+#endif
+
+#define ALL_CIPHERS "ALL"
+
+namespace test {
+namespace components {
+namespace security_manager_test {
+
+namespace {
+bool isErrorFatal(SSL *connection, int res) {
+ const int error = SSL_get_error(connection, res);
+ return (error != SSL_ERROR_WANT_READ && error != SSL_ERROR_WANT_WRITE);
+}
+}
+// TODO(EZamakhov): May be split to SSLContext and Cryptomanager tests (separate files)
+// TODO(EZamakhov): add test for EnsureBufferSizeEnough
+class SSLTest : public testing::Test {
+ protected:
+ static void SetUpTestCase() {
+ crypto_manager = new security_manager::CryptoManagerImpl();
+ const bool crypto_manager_initialization = crypto_manager->Init(
+ security_manager::SERVER, security_manager::TLSv1_2, "mycert.pem",
+ "mykey.pem", FORD_CIPHER, false);
+ EXPECT_TRUE(crypto_manager_initialization);
+
+ client_manager = new security_manager::CryptoManagerImpl();
+ const bool client_manager_initialization = client_manager->Init(
+ security_manager::CLIENT, security_manager::TLSv1_2, "", "",
+ FORD_CIPHER,
+ false);
+ EXPECT_TRUE(client_manager_initialization);
+ }
+
+ static void TearDownTestCase() {
+ crypto_manager->Finish();
+ client_manager->Finish();
+ delete crypto_manager;
+ delete client_manager;
+ }
+
+ virtual void SetUp() {
+ server_ctx = crypto_manager->CreateSSLContext();
+ client_ctx = client_manager->CreateSSLContext();
+ }
+
+ virtual void TearDown() {
+ crypto_manager->ReleaseSSLContext(server_ctx);
+ client_manager->ReleaseSSLContext(client_ctx);
+ }
+
+ static security_manager::CryptoManager* crypto_manager;
+ static security_manager::CryptoManager* client_manager;
+ security_manager::SSLContext *server_ctx;
+ security_manager::SSLContext *client_ctx;
+};
+
+security_manager::CryptoManager* SSLTest::crypto_manager;
+security_manager::CryptoManager* SSLTest::client_manager;
+
+TEST(CryptoManagerTest, UsingBeforeInit) {
+ security_manager::CryptoManager *crypto_manager = new security_manager::CryptoManagerImpl();
+ EXPECT_TRUE(crypto_manager->CreateSSLContext() == NULL);
+ EXPECT_EQ(crypto_manager->LastError(), std::string ("Initialization is not completed"));
+ delete crypto_manager;
+}
+
+TEST(CryptoManagerTest, WrongInit) {
+ security_manager::CryptoManager *crypto_manager = new security_manager::CryptoManagerImpl();
+
+ //We have to cast (-1) to security_manager::Protocol Enum to be accepted by crypto_manager->Init(...)
+ security_manager::Protocol UNKNOWN = static_cast<security_manager::Protocol>(-1);
+
+ // Unknown protocol version
+ EXPECT_FALSE(crypto_manager->Init(security_manager::SERVER, UNKNOWN,
+ "mycert.pem", "mykey.pem", FORD_CIPHER, false));
+
+ EXPECT_FALSE(crypto_manager->LastError().empty());
+ // Unexistent cert file
+ EXPECT_FALSE(crypto_manager->Init(security_manager::SERVER, security_manager::TLSv1_2,
+ "unexists_file.pem", "mykey.pem", FORD_CIPHER, false));
+ EXPECT_FALSE(crypto_manager->LastError().empty());
+ // Unexistent key file
+ EXPECT_FALSE(crypto_manager->Init(security_manager::SERVER, security_manager::TLSv1_2,
+ "mycert.pem", "unexists_file.pem", FORD_CIPHER, false));
+ EXPECT_FALSE(crypto_manager->LastError().empty());
+ // Unexistent cipher value
+ EXPECT_FALSE(crypto_manager->Init(security_manager::SERVER, security_manager::TLSv1_2,
+ "mycert.pem", "mykey.pem", "INVALID_UNKNOWN_CIPHER", false));
+ EXPECT_FALSE(crypto_manager->LastError().empty());
+
+ delete crypto_manager;
+}
+
+//TEST(CryptoManagerTest, CorrectInit) {
+// security_manager::CryptoManager *crypto_manager = new security_manager::CryptoManagerImpl();
+// // Empty cert and key values for SERVER
+// EXPECT_TRUE(crypto_manager->Init(security_manager::SERVER, security_manager::TLSv1_2,
+// "", "", FORD_CIPHER, false));
+// EXPECT_TRUE(crypto_manager->LastError().empty());
+// // Recall init
+// EXPECT_TRUE(crypto_manager->Init(security_manager::CLIENT, security_manager::TLSv1_2,
+// "", "", FORD_CIPHER, false));
+// EXPECT_TRUE(crypto_manager->LastError().empty());
+// // Recall init with other protocols
+// EXPECT_TRUE(crypto_manager->Init(security_manager::CLIENT, security_manager::TLSv1_1,
+// "", "", FORD_CIPHER, false));
+// EXPECT_TRUE(crypto_manager->LastError().empty());
+// EXPECT_TRUE(crypto_manager->Init(security_manager::CLIENT, security_manager::TLSv1,
+// "", "", FORD_CIPHER, false));
+// EXPECT_TRUE(crypto_manager->LastError().empty());
+
+// // Cipher value
+// EXPECT_TRUE(crypto_manager->Init(security_manager::SERVER, security_manager::TLSv1_2,
+// "mycert.pem", "mykey.pem", ALL_CIPHERS, false));
+// EXPECT_TRUE(crypto_manager->LastError().empty());
+// delete crypto_manager;
+//}
+
+TEST(CryptoManagerTest, ReleaseNull) {
+ using security_manager::CryptoManager;
+ using security_manager::CryptoManagerImpl;
+
+ CryptoManager *cm = new CryptoManagerImpl();
+ EXPECT_NO_THROW(cm->ReleaseSSLContext(NULL));
+ delete cm;
+}
+
+TEST_F(SSLTest, BrokenHandshake) {
+ const uint8_t *server_buf;
+ const uint8_t *client_buf;
+ size_t server_buf_len;
+ size_t client_buf_len;
+ ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
+ client_ctx->StartHandshake(&client_buf,
+ &client_buf_len));
+ ASSERT_FALSE(client_buf == NULL);
+ ASSERT_GT(client_buf_len, 0u);
+ // Broke 3 bytes for get abnormal fail of handshake
+ const_cast<uint8_t*>(client_buf)[0] ^= 0xFF;
+ const_cast<uint8_t*>(client_buf)[client_buf_len / 2] ^= 0xFF;
+ const_cast<uint8_t*>(client_buf)[client_buf_len - 1] ^= 0xFF;
+ ASSERT_EQ(security_manager::SSLContext::Handshake_Result_AbnormalFail,
+ server_ctx->DoHandshakeStep(client_buf,
+ client_buf_len,
+ &server_buf,
+ &server_buf_len));
+}
+
+// TODO(EZamakhov): split to SSL/TLS1/1.1/1.2 tests
+// TODO{ALeshin}: APPLINK-10846
+//TEST_F(SSLTest, Positive) {
+
+// const uint8_t *server_buf;
+// const uint8_t *client_buf;
+// size_t server_buf_len;
+// size_t client_buf_len;
+// ASSERT_EQ(client_ctx->StartHandshake(&client_buf,
+// &client_buf_len),
+// security_manager::SSLContext::Handshake_Result_Success);
+// ASSERT_FALSE(client_buf == NULL);
+// ASSERT_GT(client_buf_len, 0u);
+
+// for (;;) {
+// ASSERT_EQ(server_ctx->DoHandshakeStep(client_buf,
+// client_buf_len,
+// &server_buf,
+// &server_buf_len),
+// security_manager::SSLContext::Handshake_Result_Success);
+// ASSERT_FALSE(server_buf == NULL);
+// ASSERT_GT(server_buf_len, 0u);
+
+// ASSERT_EQ(client_ctx->DoHandshakeStep(server_buf,
+// server_buf_len,
+// &client_buf,
+// &client_buf_len),
+// security_manager::SSLContext::Handshake_Result_Success);
+// if (server_ctx->IsInitCompleted()) {
+// break;
+// }
+
+// ASSERT_FALSE(client_buf == NULL);
+// ASSERT_GT(client_buf_len, 0u);
+// }
+// // expect empty buffers after init complete
+// ASSERT_TRUE(client_buf == NULL);
+// ASSERT_EQ(client_buf_len, 0u);
+// // expect both side initialization complete
+// 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(text, text_len, &encrypted_text, &encrypted_text_len));
+
+// ASSERT_NE(encrypted_text, (void*)NULL);
+// ASSERT_GT(encrypted_text_len, 0u);
+
+// // Decrypt text on server side
+// EXPECT_TRUE(server_ctx->Decrypt(encrypted_text, encrypted_text_len, &text, &text_len));
+// ASSERT_NE(text, (void*)NULL);
+// ASSERT_GT(text_len, 0u);
+
+// ASSERT_EQ(strncmp(reinterpret_cast<const char*>(text),
+// "abra",
+// 4), 0);
+//}
+
+//TODO{Aleshin}: APPLINK-10846
+//TEST_F(SSLTest, EcncryptionFail) {
+
+// const uint8_t *server_buf;
+// const uint8_t *client_buf;
+// size_t server_buf_len;
+// size_t client_buf_len;
+// ASSERT_EQ(client_ctx->StartHandshake(&client_buf,
+// &client_buf_len),
+// security_manager::SSLContext::Handshake_Result_Success);
+
+// while (!server_ctx->IsInitCompleted()) {
+// ASSERT_FALSE(client_buf == NULL);
+// ASSERT_GT(client_buf_len, 0u);
+// ASSERT_EQ(server_ctx->DoHandshakeStep(client_buf, client_buf_len,
+// &server_buf, &server_buf_len),
+// security_manager::SSLContext::Handshake_Result_Success);
+// ASSERT_FALSE(server_buf == NULL);
+// ASSERT_GT(server_buf_len, 0u);
+
+// ASSERT_EQ(client_ctx->DoHandshakeStep(server_buf, server_buf_len,
+// &client_buf, &client_buf_len),
+// security_manager::SSLContext::Handshake_Result_Success);
+// }
+// // expect empty buffers after init complete
+// ASSERT_TRUE(client_buf == NULL);
+// ASSERT_EQ(client_buf_len, 0u);
+// // expect both side initialization complete
+// 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(text, text_len, &encrypted_text, &encrypted_text_len));
+// ASSERT_NE(encrypted_text, (void*)NULL);
+// ASSERT_GT(encrypted_text_len, 0u);
+
+// std::vector<uint8_t> broken(encrypted_text, encrypted_text + encrypted_text_len);
+// // Broke message
+// broken[encrypted_text_len / 2] ^= 0xFF;
+
+// const uint8_t *out_text;
+// size_t out_text_size;
+// // Decrypt broken text on server side
+// 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(encrypted_text, encrypted_text_len, &out_text, &out_text_size));
+// EXPECT_FALSE(server_ctx->Encrypt(text, text_len, &encrypted_text, &encrypted_text_len));
+//}
+
+/*
+ TEST_F(SSLTest, DISABLED_BadData) {
+ using security_manager::LastError;
+ int res = 0;
+
+ uint8_t *outBuf = new uint8_t[1024 * 1024];
+ const uint8_t *inBuf;
+
+ for(;;) {
+ res = SSL_do_handshake(connection);
+ if (res >= 0) {
+ break;
+ }
+
+ if (isErrorFatal(connection, res)) {
+ break;
+ }
+
+ size_t outLen = BIO_ctrl_pending(bioOut);
+ if (outLen) {
+ BIO_read(bioOut, outBuf, outLen);
+ }
+ size_t inLen;
+ server_ctx->DoHandshakeStep(outBuf, outLen, &inBuf, &inLen);
+ EXPECT_TRUE(inBuf != NULL);
+
+ if (inLen) {
+ BIO_write(bioIn, inBuf, inLen);
+ }
+ }
+ delete[] outBuf;
+
+ EXPECT_EQ(res, 1);
+
+ BIO *bioF = BIO_new(BIO_f_ssl());
+ BIO_set_ssl(bioF, connection, BIO_NOCLOSE);
+
+ const char *text = "Hello, it's the text to be encrypted";
+ uint8_t *encryptedText = new uint8_t[1024];
+ const uint8_t *decryptedText;
+ size_t text_len;
+
+ // Encrypt text on client side
+ BIO_write(bioF, text, sizeof(text));
+ text_len = BIO_ctrl_pending(bioOut);
+ size_t len = BIO_read(bioOut, encryptedText, text_len);
+
+ // Make improvements
+ encryptedText[len / 3] ^= 0x80;
+
+ // Decrypt text on server
+ server_ctx->Decrypt(encryptedText, len, &decryptedText, &text_len);
+
+ delete[] encryptedText;
+
+ EXPECT_FALSE(decryptedText == NULL);
+ EXPECT_GT(LastError().length(), 0u);
+ delete[] encryptedText;
+ }
+
+
+
+ TEST_F(SSLTest, Positive2) {
+ using security_manager::LastError;
+ int res = 0;
+
+ uint8_t *outBuf = new uint8_t[1024 * 1024];
+ const uint8_t *inBuf;
+
+ for(;;) {
+ res = SSL_do_handshake(connection);
+ if (res >= 0) {
+ break;
+ }
+
+ if (isErrorFatal(connection, res)) {
+ break;
+ }
+
+ size_t outLen = BIO_ctrl_pending(bioOut);
+ if (outLen) {
+ BIO_read(bioOut, outBuf, outLen);
+ }
+ size_t inLen;
+ server_ctx->DoHandshakeStep(outBuf, outLen, &inBuf, &inLen);
+ EXPECT_TRUE(inBuf != NULL);
+
+ if (inLen) {
+ BIO_write(bioIn, inBuf, inLen);
+ }
+ }
+ delete[] outBuf;
+
+ EXPECT_EQ(res, 1);
+
+ EXPECT_NE(SSL_is_init_finished(connection), 0u);
+
+ BIO *bioF = BIO_new(BIO_f_ssl());
+ BIO_set_ssl(bioF, connection, BIO_NOCLOSE);
+
+ const int N =1000;
+ int last_max = 0;
+ int min_oh = N , max_oh = 0;
+ for (int l = 1; l < N; ++l) {
+ char *text = new char[l+1];
+ text[l]='\0';
+ uint8_t *encryptedText = new uint8_t[1024*N];
+ const uint8_t *decryptedText;
+ size_t text_len;
+ // Encrypt text on client side
+ BIO_write(bioF, text, l);
+ text_len = BIO_ctrl_pending(bioOut);
+ size_t len = BIO_read(bioOut, encryptedText, text_len);
+ const int temp = len - l;
+ min_oh = temp < min_oh ? temp : min_oh;
+ max_oh = temp > max_oh ? temp : max_oh;
+ if (last_max < len) {
+ std::cout << l << "->" << len;
+ if (l > 1) {
+ std::cout << ", last overhead = " << last_max << "-" << l-1
+ << " = " << last_max - (l - 1) << "bytes || ";
+ std::cout << " overhead = " << len << "-" << l
+ << " = " << len - l << "bytes";
+ }
+ std::cout << std::endl;
+ last_max = len;
+
+ // Decrypt text on server
+ server_ctx->Decrypt(encryptedText, len, &decryptedText, &text_len);
+ const_cast<uint8_t*>(decryptedText)[text_len] = 0;
+
+ EXPECT_TRUE(decryptedText != NULL);
+ EXPECT_EQ(strcmp(reinterpret_cast<const char*>(decryptedText), text), 0u);
+ delete[] text;
+ }
+ std::cout << " min = " << min_oh << ", max = " << max_oh << std::endl;
+ }
+ //*/
+
+}
+ // namespace crypto_manager_test
+} // namespace components
+} // namespace test
+
diff --git a/src/components/security_manager/test/include/security_manager_mock.h b/src/components/security_manager/test/include/security_manager_mock.h
new file mode 100644
index 000000000..886b022c3
--- /dev/null
+++ b/src/components/security_manager/test/include/security_manager_mock.h
@@ -0,0 +1,311 @@
+/*
+ * 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 TEST_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_MOCK_H_
+#define TEST_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_MOCK_H_
+
+#include <gmock/gmock.h>
+#include <string>
+#include <list>
+#include "utils/byte_order.h"
+#include "security_manager/security_manager.h"
+#include "security_manager/ssl_context.h"
+#include "security_manager/security_query.h"
+
+namespace test {
+namespace components {
+namespace security_manager_test {
+
+/*
+ * MOCK implementation of ::security_manager::SecurityManager
+ */
+class SecurityManagerMock : public ::security_manager::SecurityManager {
+ public:
+ MOCK_METHOD1(set_session_observer,
+ void(::protocol_handler::SessionObserver *));
+ MOCK_METHOD1(set_protocol_handler,
+ void(::protocol_handler::ProtocolHandler *));
+ MOCK_METHOD1(set_crypto_manager,
+ void(::security_manager::CryptoManager *));
+ 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_METHOD1(StartHandshake,
+ void(uint32_t));
+ MOCK_METHOD1(AddListener,
+ void(::security_manager::SecurityManagerListener *));
+ MOCK_METHOD1(RemoveListener,
+ void(::security_manager::SecurityManagerListener *));
+ // protocol_handler::ProtocolObserver part
+ MOCK_METHOD1(OnMessageReceived,
+ void(const ::protocol_handler::RawMessagePtr));
+ MOCK_METHOD1(OnMobileMessageSent,
+ void(const ::protocol_handler::RawMessagePtr));
+};
+
+/*
+ * MOCK implementation of protocol_handler::SessionObserver interface
+ */
+class SessionObserverMock : public protocol_handler::SessionObserver {
+ public:
+ MOCK_METHOD2(SetSSLContext,
+ int (const uint32_t& key,
+ security_manager::SSLContext* context));
+ MOCK_METHOD2(GetSSLContext,
+ security_manager::SSLContext* (
+ const uint32_t& key,
+ const protocol_handler::ServiceType& service_type));
+ MOCK_METHOD2(SetProtectionFlag,
+ void(
+ const uint32_t& key,
+ const protocol_handler::ServiceType& service_type));
+ MOCK_METHOD5(OnSessionStartedCallback,
+
+ uint32_t(
+ 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));
+
+ MOCK_METHOD4(OnSessionEndedCallback,
+ uint32_t(
+ const transport_manager::ConnectionUID& connection_handle,
+ const uint8_t sessionId,
+ const uint32_t& hashCode,
+ const protocol_handler::ServiceType& service_type));
+
+ MOCK_METHOD1(OnApplicationFloodCallBack,
+ void(const uint32_t&));
+
+ MOCK_METHOD1(OnMalformedMessageCallback,
+ void(const uint32_t&));
+
+ MOCK_METHOD2(KeyFromPair,
+ uint32_t(
+ transport_manager::ConnectionUID connection_handle,
+ uint8_t sessionId));
+ MOCK_METHOD3(PairFromKey,
+ void(
+ uint32_t key,
+ transport_manager::ConnectionUID* connection_handle,
+ uint8_t* sessionId));
+ MOCK_METHOD4(GetDataOnSessionKey,
+ int32_t(uint32_t key,
+ uint32_t* app_id,
+ std::list<int32_t>* sessions_list,
+ uint32_t* device_id));
+
+ MOCK_METHOD4(GetDataOnDeviceID,
+ int32_t(
+ uint32_t device_handle,
+ std::string* device_name,
+ std::list<uint32_t>* applications_list,
+ std::string* mac_address));
+
+ MOCK_METHOD5(GetDataOnDeviceID,
+ int32_t(
+ uint32_t device_handle,
+ std::string *device_name,
+ std::list<uint32_t> *applications_list,
+ std::string *mac_address,
+ std::string *connection_type));
+
+ MOCK_METHOD2(IsHeartBeatSupported,
+ bool( transport_manager::ConnectionUID connection_handle,
+ uint8_t session_id));
+
+ MOCK_METHOD3(ProtocolVersionUsed,
+ bool(uint32_t connection_id, uint8_t session_id,
+ uint8_t& protocol_version));
+};
+/*
+ * MOCK implementation of protocol_handler::ProtocolObserver interface
+ */
+class ProtocoloObserverMock : public protocol_handler::ProtocolHandler {
+ public:
+ MOCK_METHOD2(SendMessageToMobileApp,
+ void(const protocol_handler::RawMessagePtr message,
+ bool final_message));
+ MOCK_METHOD1(AddProtocolObserver,
+ void(protocol_handler::ProtocolObserver* observer));
+ MOCK_METHOD1(RemoveProtocolObserver,
+ void(protocol_handler::ProtocolObserver* observer));
+ MOCK_METHOD2(SendFramesNumber,
+ 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 implementation of security_manager::SSLContext interface
+ */
+class CryptoManagerMock : public security_manager::CryptoManager {
+ public:
+ MOCK_METHOD6(Init,
+ bool (security_manager::Mode mode,
+ security_manager::Protocol protocol,
+ const std::string& cert_filename,
+ const std::string& key_filename,
+ const std::string& ciphers_list,
+ bool verify_peer));
+ MOCK_METHOD0(Finish,
+ void ());
+ MOCK_METHOD0(CreateSSLContext,
+ security_manager::SSLContext* ());
+ MOCK_METHOD1(ReleaseSSLContext,
+ void(security_manager::SSLContext*));
+ MOCK_CONST_METHOD0(LastError,
+ std::string());
+};
+/*
+ * MOCK implementation of security_manager::SSLContext interface
+ */
+class SSLContextMock : public security_manager::SSLContext {
+ public:
+ MOCK_CONST_METHOD0(mode, int ());
+ MOCK_METHOD2(StartHandshake,
+ security_manager::SSLContext::HandshakeResult (
+ const uint8_t** const, size_t*));
+ MOCK_METHOD4(DoHandshakeStep,
+ security_manager::SSLContext::HandshakeResult (
+ const uint8_t* const, size_t,
+ const uint8_t** const, size_t*));
+ MOCK_METHOD4(Encrypt,
+ bool (const uint8_t* const, size_t,
+ const uint8_t** const, size_t*));
+ MOCK_METHOD4(Decrypt,
+ bool (const uint8_t* const, size_t,
+ const uint8_t** const, size_t*));
+ MOCK_CONST_METHOD1(get_max_block_size, size_t (size_t));
+ MOCK_CONST_METHOD0(IsInitCompleted, bool());
+ MOCK_CONST_METHOD0(IsHandshakePending, bool());
+ MOCK_CONST_METHOD0(LastError,
+ std::string());
+};
+/*
+ * MOCK implementation of security_manager::SecurityManagerListener
+ */
+class SMListenerMock : public security_manager::SecurityManagerListener {
+ public:
+ MOCK_METHOD2(OnHandshakeDone,
+ bool(uint32_t connection_key,
+ bool success));
+};
+
+/*
+ * Matcher for RawMessages
+ * Check binary data of RawMessages
+ */
+MATCHER_P2(RawMessageEq, exp_data, exp_data_size,
+ std::string(negation ? "is not" : "is") + " RawMessages "){
+ const size_t arg_data_size = arg->data_size();
+ if (arg_data_size != exp_data_size) {
+ *result_listener << "Got " << arg_data_size << " bytes "
+ << " expected " << exp_data_size << " bytes";
+ return false;
+ }
+ const uint8_t *arg_data = arg->data();
+ for (int i = 0; i < arg_data_size; ++i) {
+ if (arg_data[i] != exp_data[i]) {
+ *result_listener << "Fail in " << i << " byte";
+ return false;
+ }
+ }
+ return true;
+}
+
+/*
+ * Matcher for checking RawMessage with InternalError Query
+ * Check error id
+ */
+MATCHER_P(InternalErrorWithErrId, expectedErrorId,
+ std::string(negation ? "is not" : "is")
+ + " InternalError with selected error" ){
+ const size_t header_size = sizeof(security_manager::SecurityQuery::QueryHeader);
+ if (arg->data_size() <= header_size) {
+ *result_listener << "Size " << arg->data_size()
+ << " bytes less or equal sizeof(QueryHeader)="
+ << header_size;
+ return false;
+ }
+ const uint8_t *data = arg->data();
+ const uint8_t query_type = data[0];
+ if (security_manager::SecurityQuery::NOTIFICATION != query_type) {
+ *result_listener << "RawMessage is not notification, type=0x"
+ << std::hex << static_cast<int>(query_type);
+ return false;
+ }
+ // Read Big-Endian number
+ const uint32_t query_id = data[1] << 16 |
+ data[2] << 8 |
+ data[3];
+ if (security_manager::SecurityQuery::SEND_INTERNAL_ERROR != query_id) {
+ *result_listener << "Notification is not InternalError, id=0x"
+ << std::hex << query_id;
+ return false;
+ }
+ const uint32_t json_size = data[8] << 24 |
+ data[9] << 16 |
+ data[10] << 8 |
+ data[11];
+ if (header_size + json_size >= arg->data_size()) {
+ *result_listener << "InternalError contains only JSON data.";
+ return false;
+ }
+ // Read err_id as bin data number
+ const uint8_t* err_id =
+ reinterpret_cast<const uint8_t*>(data + header_size + json_size);
+ if (expectedErrorId != *err_id) {
+ *result_listener << "InternalError id " << static_cast<int>(*err_id)
+ << " and not equal error " << expectedErrorId;
+ return false;
+ }
+ return true;
+}
+
+} // namespace security_manager_test
+} // namespace components
+} // namespace test
+/*
+ * Matcher for checking QueryHeader equal in GTests
+ */
+::testing::AssertionResult QueryHeader_EQ(
+ const char* m_expr, const char* n_expr,
+ const ::security_manager::SecurityQuery::QueryHeader& q1,
+ const ::security_manager::SecurityQuery::QueryHeader& q2);
+
+#endif // TEST_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_MOCK_H_
diff --git a/src/components/security_manager/test/security_manager_test.cc b/src/components/security_manager/test/security_manager_test.cc
new file mode 100644
index 000000000..30f81ee62
--- /dev/null
+++ b/src/components/security_manager/test/security_manager_test.cc
@@ -0,0 +1,823 @@
+/*
+ * 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 <string>
+
+#include "utils/byte_order.h"
+#include "protocol/common.h"
+#include "security_manager/security_manager_impl.h"
+
+#include "protocol_handler_mock.h"
+#include "protocol_observer_mock.h"
+#include "include/security_manager_mock.h"
+#include "transport_manager_mock.h"
+
+// TODO(EZamakhov): add test on get correct/wrong InternalError
+// TODO(EZamakhov): check connection_key the same and seq_number
+// TODO(EZamakhov): check ::SendData with correct query_id and query_type
+
+namespace test {
+namespace components {
+namespace security_manager_test {
+
+using namespace ::protocol_handler;
+using ::protocol_handler::ServiceType;
+using namespace ::transport_manager;
+using namespace ::security_manager;
+
+// 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 uint8_t handshake_data[] = { 0x1, 0x2, 0x3, 0x4, 0x5 };
+const size_t handshake_data_size = sizeof(handshake_data)
+ / sizeof(handshake_data[0]);
+
+uint8_t handshake_data_out[] = { 0x6, 0x7, 0x8 };
+uint8_t *handshake_data_out_pointer = handshake_data_out;
+const size_t handshake_data_out_size = sizeof(handshake_data_out)
+ / sizeof(handshake_data_out[0]);
+
+using ::security_manager::SecurityQuery;
+using security_manager_test::InternalErrorWithErrId;
+using ::testing::Return;
+using ::testing::ReturnNull;
+using ::testing::DoAll;
+using ::testing::SetArgPointee;
+using ::testing::_;
+using ::security_manager::SecurityManager;
+using ::security_manager::SecurityManagerImpl;
+
+class SecurityManagerTest : public ::testing::Test {
+ protected:
+ void SetUp() OVERRIDE {
+ security_manager_.reset(new SecurityManagerImpl());
+ security_manager_->set_session_observer(&mock_session_observer);
+ security_manager_->set_protocol_handler(&mock_protocol_handler);
+ security_manager_->AddListener(&mock_sm_listener);
+ }
+ void TearDown() OVERRIDE {
+ // Wait call methods in thread
+ usleep(100000);
+ }
+
+ void SetMockCryptoManger() {
+ security_manager_->set_crypto_manager(&mock_crypto_manager);
+ }
+ /*
+ * Wrapper for fast emulate recieve SecurityManager::OnMessageReceived
+ */
+ void call_OnMessageReceived(const uint8_t* const data, uint32_t dataSize,
+ const ServiceType serviceType) {
+ const ::protocol_handler::RawMessagePtr rawMessagePtr(
+ new ::protocol_handler::RawMessage(key, protocolVersion, data, dataSize,
+ serviceType));
+ security_manager_->OnMessageReceived(rawMessagePtr);
+ }
+ /*
+ * Wrapper for fast emulate recieve query
+ */
+ void EmulateMobileMessage(SecurityQuery::QueryHeader header,
+ const uint8_t* const data,
+ const uint32_t data_size) {
+ // convert to Big-Endian (network) order
+ const uint32_t query_id = header.query_id << 8;
+ header.query_id = LE_TO_BE32(query_id);
+ header.json_size = LE_TO_BE32(header.json_size);
+ header.seq_number = LE_TO_BE32(header.seq_number);
+
+ const size_t data_sending_size = sizeof(header) + data_size;
+ uint8_t* data_sending = new uint8_t[data_sending_size];
+ memcpy(data_sending, &header, sizeof(header));
+ memcpy(data_sending + sizeof(header), data, data_size);
+
+ call_OnMessageReceived(data_sending, data_sending_size, kControl);
+ delete[] data_sending;
+ }
+ /*
+ * Wrapper for fast emulate recieve Handshake
+ */
+ void EmulateMobileMessageHandShake(const uint8_t* const data,
+ const uint32_t data_size,
+ const int repeat_count = 1) {
+ const SecurityQuery::QueryHeader header(SecurityQuery::NOTIFICATION,
+ SecurityQuery::SEND_HANDSHAKE_DATA,
+ seq_number);
+ 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::SessionObserverMock> mock_session_observer;
+ testing::StrictMock<protocol_handler_test::ProtocolHandlerMock> mock_protocol_handler;
+ testing::StrictMock<security_manager_test::CryptoManagerMock> mock_crypto_manager;
+ testing::StrictMock<security_manager_test::SSLContextMock> mock_ssl_context_new;
+ testing::StrictMock<security_manager_test::SSLContextMock> mock_ssl_context_exists;
+ testing::StrictMock<security_manager_test::SMListenerMock> mock_sm_listener;
+};
+// Test Bodies
+
+/*
+ * SecurityManager shall not set NULL interfaces
+ * 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);
+ security_manager_->AddListener(NULL);
+ // additional check not null config section
+ EXPECT_TRUE(SecurityManagerImpl::ConfigSection());
+}
+/*
+ * Add/Remove NULL listeners do not any additional logics
+ */
+TEST_F(SecurityManagerTest, Listeners_NULL) {
+ security_manager_->AddListener(NULL);
+ security_manager_->RemoveListener(NULL);
+}
+/*
+ * Twice remove listener
+ */
+TEST_F(SecurityManagerTest, Listeners_TwiceRemoveListeners) {
+ security_manager_->RemoveListener(&mock_sm_listener);
+ security_manager_->RemoveListener(&mock_sm_listener);
+}
+/*
+ * Add and remove listeners
+ */
+TEST_F(SecurityManagerTest, Listeners_NoListeners) {
+ // Check correct removing listener
+ security_manager_->RemoveListener(&mock_sm_listener);
+
+ // Expect no calls
+ testing::StrictMock<SMListenerMock> mock_listener2;
+ security_manager_->AddListener(&mock_listener2);
+ security_manager_->RemoveListener(&mock_listener2);
+
+ security_manager_->NotifyListenersOnHandshakeDone(key, true);
+ security_manager_->NotifyListenersOnHandshakeDone(key, false);
+}
+/*
+ * Notifying two listeners
+ */
+TEST_F(SecurityManagerTest, Listeners_Notifying) {
+ // Check correct removing listener
+ security_manager_->RemoveListener(&mock_sm_listener);
+
+ testing::StrictMock<SMListenerMock> mock_listener1;
+ testing::StrictMock<SMListenerMock> mock_listener2;
+
+ const bool first_call_value = true;
+ // Expect call both listeners on 1st call
+ EXPECT_CALL(mock_listener1, OnHandshakeDone(key, first_call_value)).
+ // Emulate false (reject) result
+ WillOnce(Return(false));
+ EXPECT_CALL(mock_listener2, OnHandshakeDone(key, first_call_value)).
+ // Emulate true (accept) result
+ WillOnce(Return(true));
+
+ const bool second_call_value = false;
+ // Expect call last listener on 2d call
+ EXPECT_CALL(mock_listener1, OnHandshakeDone(key, second_call_value)).
+ // Emulate false (reject) result
+ WillOnce(Return(true));
+
+ // Expect no call 3d call
+
+ security_manager_->AddListener(&mock_listener1);
+ security_manager_->AddListener(&mock_listener2);
+ // 1st call
+ security_manager_->NotifyListenersOnHandshakeDone(key, first_call_value);
+ // 2nd call
+ security_manager_->NotifyListenersOnHandshakeDone(key, second_call_value);
+ // 3nd call
+ security_manager_->NotifyListenersOnHandshakeDone(key, false);
+}
+/*
+ * SecurityManager with NULL CryptoManager shall send
+ * InternallError (ERROR_NOT_SUPPORTED) on any Query
+ */
+TEST_F(SecurityManagerTest, SecurityManager_NULLCryptoManager) {
+ // Expect InternalError with ERROR_ID
+ 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, ProtocolVersionUsed(connection_id, session_id,_)).
+ WillOnce(Return(true));
+
+ EXPECT_CALL(
+ mock_protocol_handler,
+ SendMessageToMobileApp( InternalErrorWithErrId( SecurityManager::ERROR_NOT_SUPPORTED), is_final));
+ const SecurityQuery::QueryHeader header(SecurityQuery::REQUEST,
+ // It could be any query id
+ SecurityQuery::INVALID_QUERY_ID);
+ const uint8_t data = 0;
+ EmulateMobileMessage(header, &data, 1);
+}
+/*
+ * Shall skip all OnMobileMessageSent
+ */
+TEST_F(SecurityManagerTest, OnMobileMessageSent) {
+ const ::protocol_handler::RawMessagePtr rawMessagePtr(
+ new ::protocol_handler::RawMessage(key, protocolVersion, NULL, 0));
+ security_manager_->OnMobileMessageSent(rawMessagePtr);
+}
+/*
+ * Shall skip all not-Secure messages
+ */
+TEST_F(SecurityManagerTest, GetWrongServiceType) {
+ // Call with wrong Service type
+ call_OnMessageReceived(NULL, 0, kRpc);
+ call_OnMessageReceived(NULL, 0, kAudio);
+ call_OnMessageReceived(NULL, 0, kMobileNav);
+ call_OnMessageReceived(NULL, 0, kBulk);
+ call_OnMessageReceived(NULL, 0, kInvalidServiceType);
+}
+/*
+ * Shall send InternallError on null data recieved
+ */
+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, ProtocolVersionUsed(connection_id, session_id,_)).
+ WillOnce(Return(true));
+
+ EXPECT_CALL(
+ mock_protocol_handler,
+ SendMessageToMobileApp( InternalErrorWithErrId( SecurityManager::ERROR_INVALID_QUERY_SIZE), is_final));
+ // Call with NULL data
+ call_OnMessageReceived(NULL, 0, secureServiceType);
+}
+/*
+ * Shall send InternallError on null data recieved
+ */
+TEST_F(SecurityManagerTest, GetWrongJSONSize) {
+ SetMockCryptoManger();
+ 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, ProtocolVersionUsed(connection_id, session_id,_)).
+ WillOnce(Return(true));
+ // Expect InternalError with ERROR_ID
+ EXPECT_CALL(
+ mock_protocol_handler,
+ SendMessageToMobileApp( InternalErrorWithErrId( SecurityManager::ERROR_INVALID_QUERY_SIZE), is_final));
+ SecurityQuery::QueryHeader header(
+ SecurityQuery::REQUEST,
+ SecurityQuery::INVALID_QUERY_ID);
+ header.json_size = 0x0FFFFFFF;
+ EmulateMobileMessage(header, NULL, 0);
+}
+/*
+ * Shall send InternallError on INVALID_QUERY_ID
+ */
+TEST_F(SecurityManagerTest, GetInvalidQueryId) {
+ SetMockCryptoManger();
+ 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, ProtocolVersionUsed(connection_id, session_id,_)).
+ WillOnce(Return(true));
+ // Expect InternalError with ERROR_ID
+ EXPECT_CALL(
+ mock_protocol_handler,
+ SendMessageToMobileApp( InternalErrorWithErrId( SecurityManager::ERROR_INVALID_QUERY_ID), is_final));
+ const SecurityQuery::QueryHeader header(
+ SecurityQuery::REQUEST,
+ SecurityQuery::INVALID_QUERY_ID);
+ const uint8_t data = 0;
+ EmulateMobileMessage(header, &data, 1);
+}
+/*
+ * Shall send Internall Error on call
+ * CreateSSLContext for already protected connections
+ */
+TEST_F(SecurityManagerTest, CreateSSLContext_ServiceAlreadyProtected) {
+ SetMockCryptoManger();
+
+ // Return mock SSLContext
+ EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl)).
+ WillOnce(Return(&mock_ssl_context_new));
+
+ const security_manager::SSLContext* rezult = security_manager_->CreateSSLContext(key);
+ EXPECT_EQ(rezult, &mock_ssl_context_new);
+}
+/*
+ * Shall send Internall Error on error create SSL
+ */
+TEST_F(SecurityManagerTest, CreateSSLContext_ErrorCreateSSL) {
+ SetMockCryptoManger();
+ // Expect InternalError with ERROR_ID
+ 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, ProtocolVersionUsed(connection_id, session_id,_)).
+ WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_protocol_handler,
+ SendMessageToMobileApp( InternalErrorWithErrId( SecurityManager::ERROR_INTERNAL), is_final));
+
+ // Emulate SessionObserver and CryptoManager result
+ EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl)).
+ WillOnce(ReturnNull());
+ EXPECT_CALL(mock_crypto_manager, CreateSSLContext()).
+ WillOnce(ReturnNull());
+
+ const bool rezult = security_manager_->CreateSSLContext(key);
+ EXPECT_FALSE(rezult);
+}
+/*
+ * Shall send InternalError with SERVICE_NOT_FOUND
+ * on getting any Error with call SetSSLContext
+ */
+TEST_F(SecurityManagerTest, CreateSSLContext_SetSSLContextError) {
+ SetMockCryptoManger();
+ // Expect InternalError with ERROR_ID
+ 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, ProtocolVersionUsed(connection_id, session_id,_)).
+ WillOnce(Return(true));
+
+ EXPECT_CALL(
+ mock_protocol_handler,
+ SendMessageToMobileApp( InternalErrorWithErrId( SecurityManager::ERROR_UNKWOWN_INTERNAL_ERROR), is_final));
+
+ // Emulate SessionObserver and CryptoManager result
+ EXPECT_CALL(mock_session_observer, GetSSLContext(key, 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)).
+ WillOnce(Return(SecurityManager::ERROR_UNKWOWN_INTERNAL_ERROR));
+
+ const bool rezult = security_manager_->CreateSSLContext(key);
+ EXPECT_FALSE(rezult);
+}
+/*
+ * Shall protect connection on correct call CreateSSLContext
+ */
+TEST_F(SecurityManagerTest, CreateSSLContext_Success) {
+ SetMockCryptoManger();
+ // Expect no Errors
+ // 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_crypto_manager, CreateSSLContext()).
+ WillOnce(Return(&mock_ssl_context_new));
+ EXPECT_CALL(mock_session_observer, SetSSLContext(key, &mock_ssl_context_new)).
+ WillOnce(Return(SecurityManager::ERROR_SUCCESS));
+
+ const bool rezult = security_manager_->CreateSSLContext(key);
+ EXPECT_TRUE(rezult);
+}
+/*
+ * Shall send InternallError on call StartHandshake for uprotected service
+ */
+TEST_F(SecurityManagerTest, StartHandshake_ServiceStillUnprotected) {
+ SetMockCryptoManger();
+ 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, ProtocolVersionUsed(connection_id, session_id,_)).
+ WillOnce(Return(true));
+ // Expect InternalError with ERROR_INTERNAL
+ EXPECT_CALL(mock_protocol_handler,
+ SendMessageToMobileApp( InternalErrorWithErrId( SecurityManager::ERROR_INTERNAL), is_final));
+ // Expect notifying listeners (unsuccess)
+ EXPECT_CALL(mock_sm_listener, OnHandshakeDone(key, false)).WillOnce(Return(true));
+
+ // Emulate SessionObserver result
+ EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl)).
+ WillOnce(ReturnNull());
+
+ security_manager_->StartHandshake(key);
+}
+/*
+ * Shall send InternallError on SSL error and notify listeners
+ */
+TEST_F(SecurityManagerTest, StartHandshake_SSLInternalError) {
+ SetMockCryptoManger();
+
+ 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, ProtocolVersionUsed(connection_id, session_id,_)).
+ WillOnce(Return(true));
+
+ // 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, false)).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, StartHandshake(_, _)).
+ WillOnce(DoAll(SetArgPointee<0>(handshake_data_out_pointer),
+ SetArgPointee<1>(handshake_data_out_size),
+ Return(security_manager::SSLContext::
+ Handshake_Result_Fail)));
+
+ security_manager_->StartHandshake(key);
+}
+/*
+ * Shall send data on call StartHandshake
+ */
+TEST_F(SecurityManagerTest, StartHandshake_SSLInitIsNotComplete) {
+ SetMockCryptoManger();
+ 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, 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));
+
+ // 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(security_manager::SSLContext::
+ Handshake_Result_Success))).
+ WillOnce(DoAll(SetArgPointee<0>((uint8_t*)NULL),
+ SetArgPointee<1>(handshake_data_out_size),
+ Return(security_manager::SSLContext::
+ Handshake_Result_Success))).
+ WillOnce(DoAll(SetArgPointee<0>(handshake_data_out_pointer),
+ SetArgPointee<1>(handshake_data_out_size),
+ Return(security_manager::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) {
+ SetMockCryptoManger();
+ // Expect no message send
+ // Expect notifying listeners (success)
+ EXPECT_CALL(mock_sm_listener, OnHandshakeDone(key, true)).
+ 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);
+}
+/*
+ * Shall send InternallError on
+ * getting SEND_HANDSHAKE_DATA with NULL data
+ */
+TEST_F(SecurityManagerTest, ProccessHandshakeData_WrongDataSize) {
+ SetMockCryptoManger();
+ 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, ProtocolVersionUsed(connection_id, session_id,_)).
+ WillOnce(Return(true));
+
+ // Expect InternalError with ERROR_ID
+ EXPECT_CALL(
+ mock_protocol_handler,
+ SendMessageToMobileApp( InternalErrorWithErrId( SecurityManager::ERROR_INVALID_QUERY_SIZE), is_final));
+ EmulateMobileMessageHandShake(NULL, 0);
+}
+/*
+ * Shall send InternallError on
+ * getting SEND_HANDSHAKE_DATA from mobile side
+ * for service which is not protected
+ */
+TEST_F(SecurityManagerTest, ProccessHandshakeData_ServiceNotProtected) {
+ SetMockCryptoManger();
+ // Expect InternalError with ERROR_ID
+ 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, ProtocolVersionUsed(connection_id, session_id,_)).
+ WillOnce(Return(true));
+
+ EXPECT_CALL(
+ mock_protocol_handler,
+ SendMessageToMobileApp( InternalErrorWithErrId( SecurityManager::ERROR_SERVICE_NOT_PROTECTED), is_final));
+ // Expect notifying listeners (unsuccess)
+ EXPECT_CALL(mock_sm_listener, OnHandshakeDone(key, false)).
+ WillOnce(Return(true));
+
+ // Emulate SessionObserver result
+ EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl)).
+ WillOnce(ReturnNull());
+
+ const uint8_t data[] = {0x1, 0x2};
+ EmulateMobileMessageHandShake(data, sizeof(data)/sizeof(data[0]));
+}
+/*
+ * Shall send InternallError on getting
+ * SEND_HANDSHAKE_DATA from mobile side with invalid handshake
+ * data (DoHandshakeStep return NULL pointer)
+ */
+TEST_F(SecurityManagerTest, ProccessHandshakeData_InvalidData) {
+ SetMockCryptoManger();
+
+ // Count handshake calls
+ const int handshake_emulates = 4;
+
+ uint32_t connection_id = 0;
+ uint8_t session_id = 0;
+ //uint8_t protocol_version = 0;
+ EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _)).
+ Times(handshake_emulates);
+ EXPECT_CALL(mock_session_observer, ProtocolVersionUsed(connection_id, session_id,_)).
+ Times(handshake_emulates).
+ WillRepeatedly(Return(true));
+
+ // Expect InternalError with ERROR_ID
+ EXPECT_CALL(
+ mock_protocol_handler,
+ SendMessageToMobileApp( InternalErrorWithErrId( SecurityManager::ERROR_SSL_INVALID_DATA), is_final)).
+ Times(handshake_emulates);
+ // Expect notifying listeners (unsuccess)
+ EXPECT_CALL(mock_sm_listener, OnHandshakeDone(key, false)).
+ WillOnce(Return(true));
+
+ // Emulate SessionObserver and CryptoManager result
+ EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl)).
+ Times(handshake_emulates).
+ WillRepeatedly(Return(&mock_ssl_context_exists));
+ // Emulate DoHandshakeStep fail logics
+ EXPECT_CALL(
+ mock_ssl_context_exists, DoHandshakeStep(_, handshake_data_size, _, _)).
+ WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
+ SetArgPointee<3>(handshake_data_out_size),
+ Return(security_manager::SSLContext::
+ Handshake_Result_AbnormalFail))).
+ WillOnce(DoAll(SetArgPointee<2>((uint8_t*)NULL),
+ SetArgPointee<3>(handshake_data_out_size),
+ Return(security_manager::SSLContext::
+ Handshake_Result_AbnormalFail))).
+ WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
+ SetArgPointee<3>(0),
+ Return(security_manager::SSLContext::
+ Handshake_Result_AbnormalFail))).
+ WillOnce(DoAll(SetArgPointee<2>((uint8_t*)NULL),
+ SetArgPointee<3>(0),
+ Return(security_manager::SSLContext::
+ Handshake_Result_AbnormalFail)));
+
+
+ // On each wrong handshake will be asked error
+ EXPECT_CALL(mock_ssl_context_exists, LastError()).
+ Times(handshake_emulates);
+
+ // Emulate handshare #handshake_emulates times for 5 cases
+ EmulateMobileMessageHandShake(handshake_data, handshake_data_size,
+ handshake_emulates);
+}
+/*
+ * Shall send HandshakeData on getting SEND_HANDSHAKE_DATA from mobile side
+ * with correct handshake data Check Fail and sussecc states
+ */
+TEST_F(SecurityManagerTest, ProccessHandshakeData_Answer) {
+ SetMockCryptoManger();
+ // Count handshake calls
+ const int handshake_emulates = 2;
+
+ uint32_t connection_id = 0;
+ uint8_t session_id = 0;
+ //uint8_t protocol_version = 0;
+ EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _)).
+ Times(handshake_emulates);
+ EXPECT_CALL(mock_session_observer, ProtocolVersionUsed(connection_id, session_id,_)).
+ Times(handshake_emulates).
+ WillRepeatedly(Return(true));
+
+ // Expect InternalError with ERROR_ID
+ EXPECT_CALL(mock_protocol_handler, SendMessageToMobileApp(
+ // FIXME : !!!
+ _, is_final)).
+ Times(handshake_emulates);
+ // Expect notifying listeners (unsuccess)
+ EXPECT_CALL(mock_sm_listener, OnHandshakeDone(key, false)).
+ WillOnce(Return(true));
+
+ // Emulate SessionObserver and CryptoManager result
+ EXPECT_CALL(mock_ssl_context_exists, IsInitCompleted()).
+ Times(handshake_emulates).
+ WillRepeatedly(Return(false));
+ EXPECT_CALL(
+ mock_session_observer, GetSSLContext(key, kControl)).
+ Times(handshake_emulates).
+ WillRepeatedly(Return(&mock_ssl_context_exists));
+
+ // Emulate DoHandshakeStep correct logics
+ EXPECT_CALL(
+ mock_ssl_context_exists, DoHandshakeStep(_, handshake_data_size, _, _)).
+ WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
+ SetArgPointee<3>(handshake_data_out_size),
+ Return(security_manager::SSLContext::
+ Handshake_Result_Success))).
+ WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
+ SetArgPointee<3>(handshake_data_out_size),
+ Return(security_manager::SSLContext::
+ Handshake_Result_Fail)));
+
+ EmulateMobileMessageHandShake(handshake_data, handshake_data_size,
+ handshake_emulates);
+}
+/*
+ * Shall call all listeners on success end handshake
+ * and return handshake data
+ * Check Fail and sussecc states
+ */
+TEST_F(SecurityManagerTest, ProccessHandshakeData_HandShakeFinished) {
+ SetMockCryptoManger();
+ // Count handshake calls
+ const int handshake_emulates = 6;
+ // Expect no errors
+ // Expect notifying listeners (success)
+ EXPECT_CALL(mock_sm_listener, OnHandshakeDone(key, true)).
+ WillOnce(Return(true));
+
+ // Emulate SessionObserver and CryptoManager result
+ EXPECT_CALL(
+ mock_session_observer, GetSSLContext(key, kControl)).
+ Times(handshake_emulates).
+ WillRepeatedly(Return(&mock_ssl_context_exists));
+ EXPECT_CALL(
+ mock_ssl_context_exists, IsInitCompleted()).
+ Times(handshake_emulates).
+ WillRepeatedly(Return(true));
+ // FIXME(EZamakhov): add DoHandshakeStep matcher for compare handshake data
+ EXPECT_CALL(
+ mock_ssl_context_exists, DoHandshakeStep(_, handshake_data_size, _, _)).
+ // two states with correct out data
+ WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
+ SetArgPointee<3>(handshake_data_out_size),
+ Return(security_manager::SSLContext::
+ Handshake_Result_Success))).
+ WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
+ SetArgPointee<3>(handshake_data_out_size),
+ Return(security_manager::SSLContext::
+ Handshake_Result_Fail))).
+ // two states with with null pointer data
+ WillOnce(DoAll(SetArgPointee<2>((uint8_t*)NULL),
+ SetArgPointee<3>(handshake_data_out_size),
+ Return(security_manager::SSLContext::
+ Handshake_Result_Success))).
+ WillOnce(DoAll(SetArgPointee<2>((uint8_t*)NULL),
+ SetArgPointee<3>(handshake_data_out_size),
+ Return(security_manager::SSLContext::
+ Handshake_Result_Fail))).
+ // two states with with null data size
+ WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
+ SetArgPointee<3>(0),
+ Return(security_manager::SSLContext::
+ Handshake_Result_Success))).
+ WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
+ SetArgPointee<3>(0),
+ Return(security_manager::SSLContext::
+ Handshake_Result_Success)));
+
+ // Expect send two message (with correct pointer and size data)
+
+ 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, ProtocolVersionUsed(connection_id, session_id,_)).
+ Times(2).
+ WillRepeatedly(Return(true));
+
+ EXPECT_CALL(
+ mock_protocol_handler, SendMessageToMobileApp(_, is_final)).
+ Times(2);
+
+ // Expect NO InternalError with ERROR_ID
+ EmulateMobileMessageHandShake(handshake_data, handshake_data_size, handshake_emulates);
+}
+/*
+ * Shall not any query on getting empty SEND_INTERNAL_ERROR
+ */
+TEST_F(SecurityManagerTest, GetInternalError_NullData) {
+ SetMockCryptoManger();
+
+ const SecurityQuery::QueryHeader header( SecurityQuery::NOTIFICATION,
+ SecurityQuery::SEND_INTERNAL_ERROR, 0);
+ EmulateMobileMessage(header, NULL, 0);
+}
+/*
+ * Shall not send any query on getting SEND_INTERNAL_ERROR
+ */
+TEST_F(SecurityManagerTest, GetInternalError) {
+ SetMockCryptoManger();
+
+ const SecurityQuery::QueryHeader header( SecurityQuery::NOTIFICATION,
+ SecurityQuery::SEND_INTERNAL_ERROR, 0);
+ const uint8_t data[] = {0x1, 0x2};
+ EmulateMobileMessage(header, data, sizeof(data)/sizeof(data[0]));
+}
+/*
+ * Shall not send any query on getting SEND_INTERNAL_ERROR with error string
+ */
+TEST_F(SecurityManagerTest, GetInternalError_WithErrText) {
+ SetMockCryptoManger();
+
+ SecurityQuery::QueryHeader header( SecurityQuery::NOTIFICATION,
+ SecurityQuery::SEND_INTERNAL_ERROR, 0);
+ std::string error("JSON wrong string");
+ header.json_size = error.size();
+ EmulateMobileMessage(header,
+ reinterpret_cast<const uint8_t*>(error.c_str()),
+ error.size());
+}
+/*
+ * Shall not send any query on getting SEND_INTERNAL_ERROR with error string
+ */
+TEST_F(SecurityManagerTest, GetInternalError_WithErrJSONText) {
+ SetMockCryptoManger();
+
+ SecurityQuery::QueryHeader header( SecurityQuery::NOTIFICATION,
+ SecurityQuery::SEND_INTERNAL_ERROR, 0);
+ std::string error(" { \"id\": 1 } ");
+ header.json_size = error.size();
+ EmulateMobileMessage(header,
+ reinterpret_cast<const uint8_t*>(error.c_str()),
+ error.size());
+}
+
+} // namespace security_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/security_manager/test/security_query_matcher.cc b/src/components/security_manager/test/security_query_matcher.cc
new file mode 100644
index 000000000..2320e8343
--- /dev/null
+++ b/src/components/security_manager/test/security_query_matcher.cc
@@ -0,0 +1,123 @@
+/*
+ * 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 <gmock/gmock.h>
+#include <string>
+#include "utils/byte_order.h"
+#include "security_manager/security_query.h"
+
+namespace test {
+namespace components {
+namespace security_manager_test {
+
+/*
+ * Matcher for checking RawMessage with InternalError Query
+ * Check error id
+ */
+MATCHER_P(InternalErrorWithErrId, expectedErrorId,
+ std::string(negation ? "is not" : "is")
+ + " InternalError with selected error" ){
+ const size_t header_size =
+ sizeof(security_manager::SecurityQuery::QueryHeader);
+ if (arg->data_size() <= header_size) {
+ *result_listener << "Size " << arg->data_size()
+ << " bytes less or equal sizeof(QueryHeader)="
+ << header_size;
+ return false;
+ }
+ const uint8_t *data = arg->data();
+ const uint8_t query_type = data[0];
+ if (security_manager::SecurityQuery::NOTIFICATION != query_type) {
+ *result_listener << "RawMessage is not notification, type=0x"
+ << std::hex << static_cast<int>(query_type);
+ return false;
+ }
+ // Read Big-Endian number
+ const uint32_t query_id = data[1] << 16 |
+ data[2] << 8 |
+ data[3];
+ if (security_manager::SecurityQuery::SEND_INTERNAL_ERROR != query_id) {
+ *result_listener << "Notification is not InternalError, id=0x"
+ << std::hex << query_id;
+ return false;
+ }
+ const uint32_t json_size = data[8] << 24 |
+ data[9] << 16 |
+ data[10] << 8 |
+ data[11];
+ if (header_size + json_size >= arg->data_size()) {
+ *result_listener << "InternalError contains only JSON data.";
+ return false;
+ }
+ // Read err_id as bin data number
+ const uint8_t *err_id =
+ reinterpret_cast<const uint8_t *>(data + header_size + json_size);
+ if (expectedErrorId != *err_id) {
+ *result_listener << "InternalError id " << static_cast<int>(*err_id)
+ << " and not equal error " << expectedErrorId;
+ return false;
+ }
+ return true;
+}
+
+} // namespace security_manager_test
+} // namespace components
+} // namespace test
+/*
+ * Matcher for checking QueryHeader equal in GTests
+ */
+::testing::AssertionResult QueryHeader_EQ(
+ const char *m_expr, const char *n_expr,
+ const ::security_manager::SecurityQuery::QueryHeader &q1,
+ const ::security_manager::SecurityQuery::QueryHeader &q2);
+
+::testing::AssertionResult QueryHeader_EQ(
+ const char* m_expr, const char* n_expr,
+ const ::security_manager::SecurityQuery::QueryHeader& q1,
+ const ::security_manager::SecurityQuery::QueryHeader& q2) {
+ ::testing::AssertionResult fail_result = ::testing::AssertionFailure();
+ fail_result << "(\"" << m_expr << " and \"" << n_expr << "\") are not equal "
+ << " : different ";
+ if (q1.json_size != q2.json_size)
+ return fail_result << "json_size_1=" << q1.json_size << ", json_size_2="
+ << q2.json_size;
+ if (q1.query_id != q2.query_id)
+ return fail_result << "query_id_1=" << q1.query_id << ", query_id_2="
+ << q2.query_id;
+ if (q1.query_type != q2.query_type)
+ return fail_result << "query_type_1=" << q1.query_type << ", query_type_2="
+ << q2.query_type;
+ if (q1.seq_number != q2.seq_number)
+ return fail_result << "seq_number_1=" << q1.seq_number << ", seq_number_2="
+ << q2.seq_number;
+ return ::testing::AssertionSuccess();
+}
diff --git a/src/components/security_manager/test/security_query_test.cc b/src/components/security_manager/test/security_query_test.cc
new file mode 100644
index 000000000..6db076fd5
--- /dev/null
+++ b/src/components/security_manager/test/security_query_test.cc
@@ -0,0 +1,456 @@
+/*
+ * 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 <vector>
+#include <string>
+#include "security_manager/security_query.h"
+#include "protocol_handler/protocol_payload.h"
+#include "utils/byte_order.h"
+#include "include/security_manager_mock.h"
+
+// Test values for compare after serialization and byteorder conversion
+#define SEQ_NUMBER 0x12345678u
+#define CONNECTION_KEY 0xABCDEF0u
+
+namespace test {
+namespace components {
+namespace security_manager_test {
+
+using ::security_manager::SecurityQuery;
+
+class SecurityQueryTest : public ::testing::Test {
+ protected:
+ void SetUp() OVERRIDE {
+ // init_header used for SecurityQuery initialization
+ init_header.query_type = SecurityQuery::NOTIFICATION;
+ init_header.query_id = SecurityQuery::SEND_HANDSHAKE_DATA;
+ init_header.seq_number = SEQ_NUMBER;
+ init_header.json_size = 0u;
+
+ // invalid_header is default (not initialized) QueryHeader
+ invalid_header.query_type = SecurityQuery::INVALID_QUERY_TYPE;
+ invalid_header.query_id = SecurityQuery::INVALID_QUERY_ID;
+ invalid_header.seq_number = 0u;
+ invalid_header.json_size = 0u;
+ }
+ /*
+ * Wrapper for fast call SecurityQuery::SerializeQuery
+ * Used for handling header and data array to byte array for serialization
+ */
+ std::vector<uint8_t> DeserializeData(SecurityQuery::QueryHeader header,
+ const uint8_t * const binary_data,
+ const size_t bin_data_size) const {
+ // convert to Big-Endian (network) order
+ const uint32_t query_id = header.query_id << 8;
+ header.query_id = LE_TO_BE32(query_id);
+ header.seq_number = LE_TO_BE32(header.seq_number);
+ header.json_size = LE_TO_BE32(header.json_size);
+ std::vector<uint8_t> vector;
+ vector.reserve(sizeof(header) + bin_data_size);
+ // copy header data
+ const uint8_t* header_data = reinterpret_cast<uint8_t*>(&header);
+ vector.insert(vector.end(), header_data, header_data + sizeof(header));
+ // copy all data
+ vector.insert(vector.end(), binary_data, binary_data + bin_data_size);
+ return vector;
+ }
+ SecurityQuery::QueryHeader init_header, invalid_header;
+};
+/*
+ * Security QueryHeader shall be the same size as RPC header
+ * for correct working on Mobile side (3*8 byte)
+ */
+TEST_F(SecurityQueryTest, Equal_RPCHeader) {
+ ASSERT_EQ(sizeof(SecurityQuery::QueryHeader)*8,
+ ::protocol_handler::ProtocolPayloadV2SizeBits());
+}
+/*
+ * Security QueryHeader default construction
+ */
+TEST_F(SecurityQueryTest, QueryHeaderConstructor) {
+ const SecurityQuery::QueryHeader new_header;
+
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, new_header, invalid_header);
+}
+/*
+ * Security QueryHeader shall construct with correct fields
+ */
+TEST_F(SecurityQueryTest, QueryHeaderConstructor2) {
+ SecurityQuery::QueryHeader new_header(SecurityQuery::NOTIFICATION,
+ SecurityQuery::SEND_HANDSHAKE_DATA,
+ SEQ_NUMBER);
+ ASSERT_EQ(new_header.query_type, SecurityQuery::NOTIFICATION);
+ ASSERT_EQ(new_header.query_id, SecurityQuery::SEND_HANDSHAKE_DATA);
+ ASSERT_EQ(new_header.seq_number, SEQ_NUMBER);
+ ASSERT_EQ(new_header.json_size, 0u);
+
+ SecurityQuery::QueryHeader new_header2(SecurityQuery::RESPONSE,
+ SecurityQuery::SEND_INTERNAL_ERROR,
+ SEQ_NUMBER + 1);
+ ASSERT_EQ(new_header2.query_type, SecurityQuery::RESPONSE);
+ ASSERT_EQ(new_header2.query_id, SecurityQuery::SEND_INTERNAL_ERROR);
+ ASSERT_EQ(new_header2.seq_number, SEQ_NUMBER + 1);
+ ASSERT_EQ(new_header2.json_size, 0u);
+}
+/*
+ * Security QueryHeader shall copy of all filed on construction from copy
+ */
+TEST_F(SecurityQueryTest, QueryHeaderCopyConstructor) {
+ SecurityQuery::QueryHeader new_header(init_header);
+
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, new_header, init_header);
+}
+/*
+ * Security QueryHeader shall construct with NULL fields
+ */
+TEST_F(SecurityQueryTest, QueryConstructor) {
+ const SecurityQuery query;
+
+ ASSERT_EQ(query.get_connection_key(), 0u);
+ ASSERT_EQ(query.get_data_size(), 0u);
+ ASSERT_EQ(query.get_data(), reinterpret_cast<uint8_t *>(NULL));
+ ASSERT_TRUE(query.get_json_message().empty());
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, query.get_header(), invalid_header);
+
+ // Deserialization shall return invalid header as vector
+ const std::vector<uint8_t> vector = DeserializeData(invalid_header, NULL, 0);
+ const std::vector<uint8_t> deserialize_vector = query.DeserializeQuery();
+ ASSERT_EQ(deserialize_vector, vector);
+}
+/*
+ * Security QueryHeader shall construct with specified fields
+ */
+TEST_F(SecurityQueryTest, QueryConstructor2) {
+ const SecurityQuery query(init_header, CONNECTION_KEY);
+
+ ASSERT_EQ(query.get_connection_key(), CONNECTION_KEY);
+ ASSERT_EQ(query.get_data_size(), 0u);
+ ASSERT_EQ(query.get_data(), reinterpret_cast<uint8_t *>(NULL));
+ ASSERT_TRUE(query.get_json_message().empty());
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, query.get_header(), init_header);
+
+ // Deserialization shall return init header as vector
+ const std::vector<uint8_t> vector = DeserializeData(init_header, NULL, 0);
+ const std::vector<uint8_t> deserialize_vector = query.DeserializeQuery();
+ ASSERT_EQ(deserialize_vector, vector);
+}
+/*
+ * Security QueryHeader shall construct with specified fields
+ */
+TEST_F(SecurityQueryTest, QueryConstructor3) {
+ uint8_t raw_data[] = {0x0, 0x1, 0x2};
+ const size_t raw_data_size =
+ sizeof(raw_data)/sizeof(raw_data[0]);
+
+ SecurityQuery query(init_header,
+ CONNECTION_KEY,
+ raw_data, raw_data_size);
+
+ ASSERT_EQ(query.get_connection_key(), CONNECTION_KEY);
+ ASSERT_EQ(query.get_data_size(), raw_data_size);
+ // query shall handle own array of byte data
+ ASSERT_NE(query.get_data(), reinterpret_cast<uint8_t *>(NULL));
+ for (size_t i = 0; i < raw_data_size; ++i) {
+ ASSERT_EQ(query.get_data()[i], raw_data[i]);
+ }
+ ASSERT_TRUE(query.get_json_message().empty());
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, query.get_header(), init_header);
+
+ // Deserialization shall return vector equal header + data array
+ const std::vector<uint8_t> vector =
+ DeserializeData(init_header, raw_data, raw_data_size);
+ const std::vector<uint8_t> deserialize_vector = query.DeserializeQuery();
+ ASSERT_EQ(deserialize_vector, vector);
+}
+/*
+ * Security Query setters
+ */
+TEST_F(SecurityQueryTest, Setters) {
+ const std::string str = "test example string";
+ uint8_t raw_data[] = {0x6, 0x7, 0x8};
+ const size_t raw_data_size =
+ sizeof(raw_data)/sizeof(raw_data[0]);
+
+ SecurityQuery query;
+ query.set_connection_key(CONNECTION_KEY);
+ query.set_data(raw_data, raw_data_size);
+ query.set_json_message(str);
+ query.set_header(init_header);
+
+ ASSERT_EQ(query.get_connection_key(), CONNECTION_KEY);
+ ASSERT_EQ(query.get_data_size(), raw_data_size);
+ // query shall handle own array of byte data
+ ASSERT_NE(query.get_data(), reinterpret_cast<uint8_t *>(NULL));
+ for (size_t i = 0; i < raw_data_size; ++i) {
+ ASSERT_EQ(query.get_data()[i], raw_data[i]);
+ }
+ ASSERT_EQ(query.get_json_message(), str);
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, query.get_header(), init_header);
+}
+/*
+ * SecurityQuery serializes NULL data
+ */
+TEST_F(SecurityQueryTest, Parse_NullData) {
+ SecurityQuery query;
+ const bool result = query.SerializeQuery(NULL, 0u);
+
+ ASSERT_FALSE(result);
+ // check side-effects
+ ASSERT_EQ(query.get_connection_key(), 0u);
+ ASSERT_EQ(query.get_data_size(), 0u);
+ ASSERT_EQ(query.get_data(), reinterpret_cast<uint8_t *>(NULL));
+ ASSERT_TRUE(query.get_json_message().empty());
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, query.get_header(), invalid_header);
+}
+/*
+ * SecurityQuery serializes few (less header size) data
+ */
+TEST_F(SecurityQueryTest, Parse_LessHeaderData) {
+ std::vector<uint8_t> vector(sizeof(init_header) - 1, 0);
+
+ SecurityQuery query;
+ const bool result = query.SerializeQuery(&vector[0], vector.size());
+
+ ASSERT_FALSE(result);
+ // check side-effects
+ ASSERT_EQ(query.get_connection_key(), 0u);
+ ASSERT_EQ(query.get_data_size(), 0u);
+ ASSERT_EQ(query.get_data(), reinterpret_cast<uint8_t *>(NULL));
+ ASSERT_TRUE(query.get_json_message().empty());
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, query.get_header(), invalid_header);
+}
+/*
+ * SecurityQuery serializes data equal header size
+ */
+TEST_F(SecurityQueryTest, Parse_HeaderData) {
+ const std::vector<uint8_t> vector =
+ DeserializeData(init_header, NULL, 0u);
+
+ SecurityQuery query;
+ const bool result = query.SerializeQuery(&vector[0], vector.size());
+
+ ASSERT_TRUE(result);
+ // check side-effects
+ ASSERT_EQ(query.get_connection_key(), 0u);
+ ASSERT_EQ(query.get_data_size(), 0u);
+ ASSERT_EQ(query.get_data(), reinterpret_cast<uint8_t *>(NULL));
+ ASSERT_TRUE(query.get_json_message().empty());
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, query.get_header(), init_header);
+
+ // Deserialization shall return vector equal serialization vector
+ const std::vector<uint8_t> deserialize_vector = query.DeserializeQuery();
+ ASSERT_EQ(deserialize_vector, vector);
+}
+/*
+ * SecurityQuery serializes wrong header
+ */
+TEST_F(SecurityQueryTest, Parse_HeaderDataWrong) {
+ // Wrong json size
+ init_header.json_size = 0x0FFFFFFF;
+ const std::vector<uint8_t> vector =
+ DeserializeData(init_header, NULL, 0u);
+
+ SecurityQuery query;
+ const bool result = query.SerializeQuery(&vector[0], vector.size());
+
+ ASSERT_FALSE(result);
+ // check side-effects
+ ASSERT_EQ(query.get_connection_key(), 0u);
+ ASSERT_EQ(query.get_data_size(), 0u);
+ ASSERT_EQ(query.get_data(), reinterpret_cast<uint8_t *>(NULL));
+ ASSERT_TRUE(query.get_json_message().empty());
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, query.get_header(), init_header);
+
+ // Deserialization shall return vector equal serialization vector
+ const std::vector<uint8_t> deserialize_vector = query.DeserializeQuery();
+ ASSERT_EQ(deserialize_vector, vector);
+}
+/*
+ * SecurityQuery serializes data contains header and binary data
+ * with INVALID_QUERY_TYPE
+ */
+TEST_F(SecurityQueryTest, Parse_InvalidQuery) {
+ SecurityQuery::QueryHeader invalid_query_header(
+ SecurityQuery::INVALID_QUERY_TYPE,
+ SecurityQuery::INVALID_QUERY_ID,
+ SEQ_NUMBER);
+
+ // some sample data
+ uint8_t raw_data[] = {0x6, 0x7, 0x8};
+ const size_t raw_data_size =
+ sizeof(raw_data)/sizeof(raw_data[0]);
+
+ const std::vector<uint8_t> vector =
+ DeserializeData(invalid_query_header, raw_data, raw_data_size);
+
+ SecurityQuery query;
+ const bool result = query.SerializeQuery(&vector[0], vector.size());
+
+ ASSERT_TRUE(result);
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, query.get_header(), invalid_query_header);
+ ASSERT_EQ(query.get_data_size(), raw_data_size);
+ // query shall handle own array of byte data
+ ASSERT_NE(query.get_data(), reinterpret_cast<uint8_t *>(NULL));
+ for (size_t i = 0; i < raw_data_size; ++i) {
+ ASSERT_EQ(query.get_data()[i], raw_data[+ i]);
+ }
+ // check side-effects
+ ASSERT_EQ(query.get_connection_key(), 0u);
+ ASSERT_TRUE(query.get_json_message().empty());
+
+ // Deserialization shall return vector equal serialization vector
+ const std::vector<uint8_t> deserialize_vector = query.DeserializeQuery();
+ ASSERT_EQ(deserialize_vector, vector);
+}
+/*
+ * SecurityQuery serializes data contains header and binary data
+ * with unknown types and ids
+ */
+TEST_F(SecurityQueryTest, Parse_InvalidQuery_UnknownTypeId) {
+ SecurityQuery::QueryHeader invalid_type_id_header(
+ SecurityQuery::INVALID_QUERY_TYPE - 1,
+ // Use not enum value for additional testing
+ SecurityQuery::INVALID_QUERY_ID - 1,
+ SEQ_NUMBER);
+
+ const std::vector<uint8_t> vector =
+ DeserializeData(invalid_type_id_header, NULL, 0u);
+
+ SecurityQuery query;
+ const bool result = query.SerializeQuery(&vector[0], vector.size());
+ ASSERT_TRUE(result);
+ // Parse set all unknown types and ids to INVALID_QUERY_ID
+ invalid_type_id_header.query_type = SecurityQuery::INVALID_QUERY_TYPE;
+ invalid_type_id_header.query_id = SecurityQuery::INVALID_QUERY_ID;
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, query.get_header(), invalid_type_id_header);
+ // check side-effects
+ ASSERT_EQ(query.get_data_size(), 0u);
+ ASSERT_EQ(query.get_data(), reinterpret_cast<uint8_t *>(NULL));
+ ASSERT_EQ(query.get_connection_key(), 0u);
+ ASSERT_TRUE(query.get_json_message().empty());
+}
+/*
+ * Security QueryH Parse data contains header and binary data
+ * with unknown types and ids
+ */
+TEST_F(SecurityQueryTest, Parse_InvalidQuery_UnknownId_Response) {
+ SecurityQuery::QueryHeader invalid_id_header(
+ SecurityQuery::RESPONSE,
+ // Use not enum value for additional testing
+ SecurityQuery::INVALID_QUERY_ID - 2,
+ SEQ_NUMBER);
+ const std::vector<uint8_t> vector =
+ DeserializeData(invalid_id_header, NULL, 0u);
+
+ SecurityQuery query;
+ const bool result = query.SerializeQuery(&vector[0], vector.size());
+ ASSERT_TRUE(result);
+ // Parse set all unknown types and ids to INVALID_QUERY_ID
+ invalid_id_header.query_id = SecurityQuery::INVALID_QUERY_ID;
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, query.get_header(), invalid_id_header);
+ // check side-effects
+ ASSERT_EQ(query.get_data_size(), 0u);
+ ASSERT_EQ(query.get_data(), reinterpret_cast<uint8_t *>(NULL));
+ ASSERT_EQ(query.get_connection_key(), 0u);
+ ASSERT_TRUE(query.get_json_message().empty());
+}
+/*
+ * SecurityQuery serializes data contains header and binary data
+ * with INVALID_QUERY_TYPE
+ */
+TEST_F(SecurityQueryTest, Parse_Handshake) {
+ SecurityQuery::QueryHeader handshake_header(
+ SecurityQuery::NOTIFICATION,
+ SecurityQuery::SEND_HANDSHAKE_DATA,
+ SEQ_NUMBER);
+ // some sample data
+ uint8_t raw_data[] = {0x6, 0x7, 0x8};
+ const size_t raw_data_size =
+ sizeof(raw_data)/sizeof(raw_data[0]);
+
+ const std::vector<uint8_t> vector =
+ DeserializeData(handshake_header, raw_data, raw_data_size);
+
+ SecurityQuery query;
+ const bool result = query.SerializeQuery(&vector[0], vector.size());
+ ASSERT_TRUE(result);
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, query.get_header(), handshake_header);
+ ASSERT_EQ(query.get_data_size(), raw_data_size);
+ // query shall handle own array of byte data
+ ASSERT_NE(query.get_data(), reinterpret_cast<uint8_t *>(NULL));
+ for (size_t i = 0; i < raw_data_size; ++i) {
+ ASSERT_EQ(query.get_data()[i], raw_data[+ i]);
+ }
+ // check side-effects
+ ASSERT_EQ(query.get_connection_key(), 0u);
+ ASSERT_TRUE(query.get_json_message().empty());
+
+ // Deserialization shall return vector equal serialization vector
+ const std::vector<uint8_t> deserialize_vector = query.DeserializeQuery();
+ ASSERT_EQ(deserialize_vector, vector);
+}
+/*
+ * SecurityQuery serializes data contains header and binary data
+ * with SEND_HANDSHAKE_DATA
+ */
+TEST_F(SecurityQueryTest, Parse_InternalError) {
+ std::string error_str = "{some error}";
+ SecurityQuery::QueryHeader internal_error_header(
+ SecurityQuery::REQUEST,
+ SecurityQuery::SEND_INTERNAL_ERROR,
+ SEQ_NUMBER);
+ internal_error_header.json_size = error_str.size();
+
+ const uint8_t* raw_data = reinterpret_cast<const uint8_t*>(error_str.c_str());
+
+ const std::vector<uint8_t> vector =
+ DeserializeData(internal_error_header, raw_data, error_str.size());
+
+ SecurityQuery query;
+ const bool result = query.SerializeQuery(&vector[0], vector.size());
+ ASSERT_TRUE(result);
+ EXPECT_PRED_FORMAT2(QueryHeader_EQ, query.get_header(), internal_error_header);
+ // check side-effects
+ ASSERT_EQ(query.get_data_size(), 0u);
+ ASSERT_EQ(query.get_data(), reinterpret_cast<uint8_t *>(NULL));
+ ASSERT_EQ(query.get_connection_key(), 0u);
+ ASSERT_EQ(query.get_json_message(), error_str);
+
+ // Deserialization shall return vector equal serialization vector
+ const std::vector<uint8_t> deserialize_vector = query.DeserializeQuery();
+ ASSERT_EQ(deserialize_vector, vector);
+}
+
+} // namespace security_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/smart_objects/CMakeLists.txt b/src/components/smart_objects/CMakeLists.txt
index 89f0dbdce..c1d599db6 100644
--- a/src/components/smart_objects/CMakeLists.txt
+++ b/src/components/smart_objects/CMakeLists.txt
@@ -1,21 +1,54 @@
+# 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.
+
+
+set(SMART_OBJECTS_SRC_DIR ${COMPONENTS_DIR}/smart_objects/src)
+
include_directories (
- ./include
- ../utils/include/
+ include
+ ${COMPONENTS_DIR}/utils/include/
)
set (SOURCES
- ./src/smart_object.cc
- ./src/smart_schema.cc
- ./src/schema_item.cc
- ./src/always_false_schema_item.cc
- ./src/always_true_schema_item.cc
- ./src/default_shema_item.cc
- ./src/bool_schema_item.cc
- ./src/number_schema_item.cc
- ./src/enum_schema_item.cc
- ./src/string_schema_item.cc
- ./src/object_schema_item.cc
- ./src/array_schema_item.cc
+ ${SMART_OBJECTS_SRC_DIR}/smart_object.cc
+ ${SMART_OBJECTS_SRC_DIR}/smart_schema.cc
+ ${SMART_OBJECTS_SRC_DIR}/schema_item.cc
+ ${SMART_OBJECTS_SRC_DIR}/always_false_schema_item.cc
+ ${SMART_OBJECTS_SRC_DIR}/always_true_schema_item.cc
+ ${SMART_OBJECTS_SRC_DIR}/default_shema_item.cc
+ ${SMART_OBJECTS_SRC_DIR}/bool_schema_item.cc
+ ${SMART_OBJECTS_SRC_DIR}/number_schema_item.cc
+ ${SMART_OBJECTS_SRC_DIR}/enum_schema_item.cc
+ ${SMART_OBJECTS_SRC_DIR}/string_schema_item.cc
+ ${SMART_OBJECTS_SRC_DIR}/object_schema_item.cc
+ ${SMART_OBJECTS_SRC_DIR}/array_schema_item.cc
)
add_library("SmartObjects" ${SOURCES})
@@ -24,3 +57,7 @@ if(ENABLE_LOG)
target_link_libraries("SmartObjects" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
+
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 f5dd8ba42..fb4d287fe 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
@@ -85,7 +85,10 @@ class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> {
TNumberSchemaItem(const TSchemaItemParameter<NumberType>& MinValue,
const TSchemaItemParameter<NumberType>& MaxValue,
const TSchemaItemParameter<NumberType>& DefaultValue);
- bool isNumberType(SmartType type);
+ /**
+ * @brief Compares if param value type is correct
+ **/
+ bool isValidNumberType(SmartType type);
/**
* @brief Minimum and Maximum allowed values.
@@ -105,16 +108,27 @@ TNumberSchemaItem<NumberType>::create(
}
template<typename NumberType>
-bool TNumberSchemaItem<NumberType>::isNumberType(SmartType type) {
- return SmartType_Integer == type || SmartType_Double == type;
+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))) {
+ return true;
+ } else {
+ return false;
+ }
}
template<typename NumberType>
Errors::eType TNumberSchemaItem<NumberType>::validate(const SmartObject& Object) {
- if (!isNumberType(Object.getType())) {
+ if (!isValidNumberType(Object.getType())) {
return Errors::INVALID_VALUE;
}
- NumberType value;
+ NumberType value(0);
if (typeid(int32_t) == typeid(value)) {
value = Object.asInt();
} else if (typeid(uint32_t) == typeid(value)) {
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 6a2b7b7f4..bd70b7ea1 100644
--- a/src/components/smart_objects/include/smart_objects/smart_object.h
+++ b/src/components/smart_objects/include/smart_objects/smart_object.h
@@ -114,6 +114,13 @@ typedef std::map<std::string, SmartObject> SmartMap;
**/
typedef std::vector<uint8_t> SmartBinary;
+typedef utils::SharedPtr<SmartObject> SmartObjectSPtr;
+
+/**
+ * @brief List of SmartObjects
+ */
+typedef std::vector<SmartObjectSPtr> SmartObjectList;
+
/**
* @brief Main SmartObject class
*
diff --git a/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
new file mode 100644
index 000000000..cf1d107ba
--- /dev/null
+++ b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
@@ -0,0 +1,94 @@
+/*
+ * 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 <string>
+
+#include "gmock/gmock.h"
+
+#include "smart_objects/smart_object.h"
+#include "smart_objects/always_false_schema_item.h"
+
+namespace test {
+namespace components {
+namespace SmartObjects {
+namespace SchemaItem {
+using namespace NsSmartDeviceLink::NsSmartObjects;
+
+/**
+ * Test AlwaysFalseSchemaItem
+ **/
+TEST(test_AlwaysFalseSchemaItemTest, simple_test) {
+ SmartObject obj;
+
+ ISchemaItemPtr item = CAlwaysFalseSchemaItem::create();
+
+ obj = 5;
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(5, obj.asInt());
+
+ obj = true;
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_TRUE(obj.asBool());
+
+ obj = "Test";
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(std::string("Test"), obj.asString());
+
+ obj["First"] = "Some string";
+ obj["Second"] = 555;
+ resultType = item->validate(obj["First"]);
+ EXPECT_EQ(Errors::ERROR, resultType);
+ resultType = item->validate(obj["Second"]);
+ EXPECT_EQ(Errors::ERROR, resultType);
+ resultType = item->validate(obj);
+ 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]);
+ EXPECT_EQ(Errors::ERROR, resultType);
+ resultType = item->validate(obj[1]);
+ EXPECT_EQ(Errors::ERROR, resultType);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_TRUE(obj[0].asBool());
+ EXPECT_FALSE(obj[1].asBool());
+}
+} // namespace SchemaItem
+} // namespace SmartObjects
+} // namespace components
+} // namespace test
diff --git a/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
new file mode 100644
index 000000000..a29567293
--- /dev/null
+++ b/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
@@ -0,0 +1,95 @@
+/*
+ * 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 <string>
+
+#include "gmock/gmock.h"
+
+#include "smart_objects/smart_object.h"
+#include "smart_objects/always_true_schema_item.h"
+
+namespace test {
+namespace components {
+namespace SmartObjects {
+namespace SchemaItem {
+
+using namespace NsSmartDeviceLink::NsSmartObjects;
+
+/**
+ * Test AlwaysTrueSchemaItem
+ **/
+TEST(test_AlwaysTrueSchemaItemTest, simple_test) {
+ SmartObject obj;
+
+ ISchemaItemPtr item = CAlwaysTrueSchemaItem::create();
+
+ obj = 5;
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(5, obj.asInt());
+
+ obj = true;
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_TRUE(obj.asBool());
+
+ obj = "Test";
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(std::string("Test"), obj.asString());
+
+ obj["First"] = "Some string";
+ obj["Second"] = 555;
+ resultType = item->validate(obj["First"]);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj["Second"]);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj);
+ 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]);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj[1]);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_TRUE(obj[0].asBool());
+ EXPECT_FALSE(obj[1].asBool());
+}
+} // namespace SchemaItem
+} // namespace SmartObjects
+} // namespace components
+} // namespace test
diff --git a/src/components/smart_objects/test/ArraySchemaItem_test.cc b/src/components/smart_objects/test/ArraySchemaItem_test.cc
new file mode 100644
index 000000000..e8cad4012
--- /dev/null
+++ b/src/components/smart_objects/test/ArraySchemaItem_test.cc
@@ -0,0 +1,342 @@
+/*
+ * 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 <string>
+
+#include "gmock/gmock.h"
+
+#include "smart_objects/smart_object.h"
+#include "smart_objects/array_schema_item.h"
+#include "smart_objects/string_schema_item.h"
+
+namespace test {
+namespace components {
+namespace SmartObjects {
+namespace SchemaItem {
+
+/**
+ * Test ArraySchemaItem no schema item, no min and max size
+ **/
+TEST(test_no_default_value, test_ArraySchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ SmartObject obj;
+
+ ISchemaItemPtr item = CArraySchemaItem::create(); // No schema item, no min and max size
+
+ obj[0] = 38;
+ obj[1] = true;
+ obj[2] = "New String";
+ obj[3][0] = 39;
+ obj[3][1] = false;
+ obj[3][2] = "Another String";
+
+ EXPECT_EQ(38, obj[0].asInt());
+ EXPECT_TRUE(obj[1].asBool());
+ EXPECT_EQ(std::string("New String"), obj[2].asString());
+ EXPECT_EQ(39, obj[3][0].asInt());
+ EXPECT_FALSE(obj[3][1].asBool());
+ EXPECT_EQ(std::string("Another String"), obj[3][2].asString());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj[0]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[1]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[2]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[3]);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ item->applySchema(obj);
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj[0]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[1]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[2]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[3]);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ EXPECT_EQ(38, obj[0].asInt());
+ EXPECT_TRUE(obj[1].asBool());
+ EXPECT_EQ(std::string("New String"), obj[2].asString());
+ EXPECT_EQ(39, obj[3][0].asInt());
+ EXPECT_FALSE(obj[3][1].asBool());
+ EXPECT_EQ(std::string("Another String"), obj[3][2].asString());
+
+ //Object - valid string
+ obj = "New valid string";
+ ASSERT_EQ(std::string("New valid string"), obj.asString());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ //Obj - bool
+ obj = true;
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ //Object - number
+ obj = 3.1415926;
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+}
+
+/**
+ * Test ArraySchemaItem with schema item
+ *
+ * Create ArraySchemaItem with schema item. Method validate should return true
+ * only if all array elements are valid schema item objects
+ **/
+TEST(test_item_with_default_value, test_ArraySchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ SmartObject obj;
+
+ ISchemaItemPtr item = CArraySchemaItem::create(); // No min and max size
+
+ obj[0] = "Some String";
+ obj[1] = "true";
+ obj[2] = "New String";
+
+ EXPECT_EQ(std::string("Some String"), obj[0].asString());
+ EXPECT_EQ(std::string("true"), obj[1].asString());
+ EXPECT_EQ(std::string("New String"), obj[2].asString());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj[0]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[1]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[2]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ item->applySchema(obj);
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj[0]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[1]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[2]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ EXPECT_EQ(std::string("Some String"), obj[0].asString());
+ EXPECT_EQ(std::string("true"), obj[1].asString());
+ EXPECT_EQ(std::string("New String"), obj[2].asString());
+
+ obj[3][0] = "39";
+ obj[3][1] = "false";
+ obj[3][2] = "Another String";
+
+ EXPECT_EQ(std::string("39"), obj[3][0].asString());
+ EXPECT_EQ(std::string("false"), obj[3][1].asString());
+ EXPECT_EQ(std::string("Another String"), obj[3][2].asString());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj[3]);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ obj[3][3] = "Another very very loooooong String";
+
+ resultType = item->validate(obj[3]);
+ EXPECT_EQ(Errors::OK, resultType);
+}
+
+/**
+ * Test ArraySchemaItem with min size
+ **/
+TEST(test_array_with_min_size, test_ArraySchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ SmartObject obj;
+
+ ISchemaItemPtr item = CArraySchemaItem::create(
+ CStringSchemaItem::create(TSchemaItemParameter<size_t>(25)),
+ TSchemaItemParameter<size_t>(3));
+
+ obj[0] = "Some String";
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ obj[1] = "true";
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ obj[2] = "New String";
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ EXPECT_EQ(std::string("Some String"), obj[0].asString());
+ EXPECT_EQ(std::string("true"), obj[1].asString());
+ EXPECT_EQ(std::string("New String"), obj[2].asString());
+}
+
+/**
+ * Test ArraySchemaItem with min size
+ **/
+TEST(test_array_with_max_size, test_ArraySchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ SmartObject obj;
+
+ ISchemaItemPtr item = CArraySchemaItem::create(
+ CStringSchemaItem::create(TSchemaItemParameter<size_t>(),
+ TSchemaItemParameter<size_t>(25)),
+ TSchemaItemParameter<size_t>(), TSchemaItemParameter<size_t>(3)); // No min size
+
+ obj[0] = "Some String";
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ obj[1] = "true";
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ obj[2] = "New String";
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ obj[3] = "Another String";
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ EXPECT_EQ(std::string("Some String"), obj[0].asString());
+ EXPECT_EQ(std::string("true"), obj[1].asString());
+ EXPECT_EQ(std::string("New String"), obj[2].asString());
+ EXPECT_EQ(std::string("Another String"), obj[3].asString());
+}
+
+/**
+ * Test ArraySchemaItem with min and max size
+ **/
+TEST(test_array_with_min_and_max_size, test_ArraySchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ SmartObject obj;
+
+ ISchemaItemPtr item = CArraySchemaItem::create(
+ CStringSchemaItem::create(TSchemaItemParameter<size_t>(),
+ TSchemaItemParameter<size_t>(25)),
+ TSchemaItemParameter<size_t>(2), TSchemaItemParameter<size_t>(4));
+
+ obj[0] = "Some String";
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ obj[1] = "true";
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ obj[2] = "New String";
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ obj[3] = "Another String";
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ obj[4] = "Out of array";
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ EXPECT_EQ(std::string("Some String"), obj[0].asString());
+ EXPECT_EQ(std::string("true"), obj[1].asString());
+ EXPECT_EQ(std::string("New String"), obj[2].asString());
+ EXPECT_EQ(std::string("Another String"), obj[3].asString());
+ EXPECT_EQ(std::string("Out of array"), obj[4].asString());
+}
+
+TEST(test_map_validate, test_ArraySchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ SmartObject obj;
+
+ ISchemaItemPtr item = CArraySchemaItem::create(
+ CStringSchemaItem::create(TSchemaItemParameter<size_t>(),
+ TSchemaItemParameter<size_t>(25)),
+ TSchemaItemParameter<size_t>(2), TSchemaItemParameter<size_t>(4));
+
+ obj["array"][0] = "Some String";
+
+ int resultType = item->validate(obj["array"]);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ obj["array"][1] = "true";
+
+ resultType = item->validate(obj["array"]);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ obj["array"][2] = "New String";
+
+ resultType = item->validate(obj["array"]);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ obj["array"][3] = "Another String";
+
+ resultType = item->validate(obj["array"]);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ obj["array"][4] = "Out of array";
+
+ resultType = item->validate(obj["array"]);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj);
+ 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());
+ EXPECT_EQ(std::string("New String"), obj["array"][2].asString());
+ EXPECT_EQ(std::string("Another String"), obj["array"][3].asString());
+ EXPECT_EQ(std::string("Out of array"), obj["array"][4].asString());
+}
+} // namespace SchemaItem
+} // namespace SmartObjects
+} // namespace components
+} // namespace test
+
diff --git a/src/components/smart_objects/test/BoolSchemaItem_test.cc b/src/components/smart_objects/test/BoolSchemaItem_test.cc
new file mode 100644
index 000000000..c56dd9aa2
--- /dev/null
+++ b/src/components/smart_objects/test/BoolSchemaItem_test.cc
@@ -0,0 +1,208 @@
+/*
+ * 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 <string>
+
+#include "gmock/gmock.h"
+
+#include "utils/shared_ptr.h"
+
+#include "smart_objects/smart_object.h"
+#include "smart_objects/bool_schema_item.h"
+
+namespace test {
+namespace components {
+namespace SmartObjects {
+namespace SchemaItem {
+using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
+
+/**
+ * Test BoolSchemaItem no default value
+ *
+ * Create SchemaItem without default value. Method setDefaultValue should always return false
+ * and leave SmartObject in previous state.
+ **/
+TEST(test_no_default_value, test_BoolSchemaItemTest) {
+ NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+
+ ISchemaItemPtr item =
+ NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create(); // No default value
+
+ obj = 5;
+ ASSERT_EQ(5, obj.asInt());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+
+ obj = true;
+ ASSERT_TRUE(obj.asBool());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ bool resDefault = item->setDefaultValue(obj);
+ EXPECT_FALSE(resDefault);
+ EXPECT_TRUE(obj.asBool());
+
+ obj = "Test";
+ ASSERT_EQ(std::string("Test"), obj.asString());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_FALSE(resDefault);
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+}
+
+/**
+ * Test BoolSchemaItem with default value
+ *
+ * Create SchemaItem with default value. Method setDefaultValue should return true,
+ * Bool SmartObject should contain default value.
+ * Not bool SmartObject should converted to BoolObject and setted up by default value.
+ **/
+TEST(test_item_with_default_value, test_BoolSchemaItemTest) {
+ NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+
+ ISchemaItemPtr item =
+ NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create(
+ NsSmartDeviceLink::NsSmartObjects::TSchemaItemParameter<bool>(false)); // Default value = false
+
+ obj = 5;
+ ASSERT_EQ(5, obj.asInt());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+
+ obj = true;
+ ASSERT_TRUE(obj.asBool());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ bool resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_FALSE(obj.asBool());
+
+ obj = "Test";
+ ASSERT_EQ(std::string("Test"), obj.asString());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_FALSE(obj.asBool());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_FALSE(obj.asBool());
+}
+
+TEST(test_map_validate, test_BoolSchemaItemTest) {
+ NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ISchemaItemPtr item =
+ NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create(
+ NsSmartDeviceLink::NsSmartObjects::TSchemaItemParameter<bool>(false)); // Default value = false
+
+ obj["aa"] = true;
+ ASSERT_TRUE(obj["aa"].asBool());
+
+ int resultType = item->validate(obj["aa"]);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+
+ bool resDefault = item->setDefaultValue(obj["aa"]);
+ EXPECT_TRUE(resDefault);
+ EXPECT_FALSE(obj["aa"].asBool());
+
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_FALSE(obj.asBool());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+
+ obj["ind"] = true;
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+}
+
+TEST(test_array_validate, test_BoolSchemaItemTest) {
+ NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ISchemaItemPtr item =
+ NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create();
+
+ obj[0] = true;
+ obj[1] = false;
+
+ ASSERT_TRUE(obj[0].asBool());
+ ASSERT_FALSE(obj[1].asBool());
+
+ int resultType = item->validate(obj[0]);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+
+ resultType = item->validate(obj[1]);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+
+ bool resDefault = item->setDefaultValue(obj[0]);
+ EXPECT_FALSE(resDefault);
+ EXPECT_TRUE(obj[0].asBool());
+
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_FALSE(resDefault);
+ EXPECT_FALSE(obj[1].asBool());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+
+ obj = false;
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+}
+} // namespace SchemaItem"
+} // namespace SmartObjects"
+} // namespace components"
+} // namespace test"
diff --git a/src/components/smart_objects/test/CMakeLists.txt b/src/components/smart_objects/test/CMakeLists.txt
new file mode 100644
index 000000000..e8bc20b6b
--- /dev/null
+++ b/src/components/smart_objects/test/CMakeLists.txt
@@ -0,0 +1,66 @@
+# 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.
+
+if(BUILD_TESTS)
+add_definitions(-DUNIT_TESTS)
+
+include_directories (
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/smart_objects/include
+ ${COMPONENTS_DIR}/formatters/include/
+ ${JSONCPP_INCLUDE_DIRECTORY}
+)
+
+set(LIBRARIES
+ gmock_main
+ SmartObjects
+ formatters
+ jsoncpp
+)
+
+set(SOURCES
+ ${COMPONENTS_DIR}/smart_objects/test/SmartObjectDraft_test.cc
+ ${COMPONENTS_DIR}/smart_objects/test/SmartObjectInvalid_test.cc
+ ${COMPONENTS_DIR}/smart_objects/test/SmartObjectStress_test.cc
+ ${COMPONENTS_DIR}/smart_objects/test/SmartObjectUnit_test.cc
+ ${COMPONENTS_DIR}/smart_objects/test/smart_object_performance_test.cc
+ ${COMPONENTS_DIR}/smart_objects/test/map_performance_test.cc
+ ${COMPONENTS_DIR}/smart_objects/test/BoolSchemaItem_test.cc
+ ${COMPONENTS_DIR}/smart_objects/test/NumberSchemaItem_test.cc
+ ${COMPONENTS_DIR}/smart_objects/test/StringSchemaItem_test.cc
+ ${COMPONENTS_DIR}/smart_objects/test/ArraySchemaItem_test.cc
+ ${COMPONENTS_DIR}/smart_objects/test/CObjectSchemaItem_test.cc
+ ${COMPONENTS_DIR}/smart_objects/test/AlwaysTrueSchemaItem_test.cc
+ ${COMPONENTS_DIR}/smart_objects/test/AlwaysFalseSchemaItem_test.cc
+)
+
+create_test("smart_object_test" "${SOURCES}" "${LIBRARIES}")
+
+endif()
diff --git a/src/components/smart_objects/test/CObjectSchemaItem_test.cc b/src/components/smart_objects/test/CObjectSchemaItem_test.cc
new file mode 100644
index 000000000..56f365e5c
--- /dev/null
+++ b/src/components/smart_objects/test/CObjectSchemaItem_test.cc
@@ -0,0 +1,453 @@
+/*
+ * 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 <string>
+
+#include "gmock/gmock.h"
+#include "smart_objects/smart_object.h"
+#include "smart_objects/smart_schema.h"
+#include "smart_objects/array_schema_item.h"
+#include "smart_objects/bool_schema_item.h"
+#include "smart_objects/string_schema_item.h"
+#include "smart_objects/enum_schema_item.h"
+#include "smart_objects/number_schema_item.h"
+#include "smart_objects/schema_item_parameter.h"
+#include "smart_objects/object_schema_item.h"
+#include "formatters/generic_json_formatter.h"
+#include "formatters/CSmartFactory.hpp"
+
+namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+namespace smartobj = NsSmartDeviceLink::NsSmartObjects;
+
+using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+
+namespace test {
+namespace components {
+namespace SmartObjects {
+namespace SchemaItem {
+
+namespace FunctionID {
+enum eType {
+ INVALID_ENUM = -1,
+ Function0 = 0,
+ Function1,
+ Function2,
+ Function3,
+ Function4,
+ Function5,
+ Function6
+};
+} // namespace FunctionID
+
+namespace ResultType {
+enum eType {
+ INVALID_ENUM = -1,
+ APPLICATION_NOT_REGISTERED = 0,
+ SUCCESS,
+ TOO_MANY_PENDING_REQUESTS,
+ REJECTED,
+ INVALID_DATA,
+ OUT_OF_MEMORY,
+ ABORTED,
+ USER_DISALLOWED,
+ GENERIC_ERROR,
+ DISALLOWED
+};
+} // namespace ResultType
+
+namespace Keys {
+const char RESULT_CODE[] = "resultCode";
+const char INFO[] = "info";
+const char SUCCESS[] = "success";
+}
+
+class ObjectSchemaItemTest : public ::testing::Test {
+ protected:
+ ISchemaItemPtr schema_item;
+ // Create SmartObjectSchema for test object
+ void SetUp() {
+ std::set<FunctionID::eType> function_values;
+ function_values.insert(FunctionID::Function0);
+ function_values.insert(FunctionID::Function1);
+ function_values.insert(FunctionID::Function2);
+ function_values.insert(FunctionID::Function3);
+ function_values.insert(FunctionID::Function4);
+ function_values.insert(FunctionID::Function5);
+ function_values.insert(FunctionID::Function6);
+
+ std::set<ResultType::eType> resultCode_values;
+ resultCode_values.insert(ResultType::APPLICATION_NOT_REGISTERED);
+ resultCode_values.insert(ResultType::SUCCESS);
+ resultCode_values.insert(ResultType::TOO_MANY_PENDING_REQUESTS);
+ resultCode_values.insert(ResultType::REJECTED);
+ resultCode_values.insert(ResultType::INVALID_DATA);
+ resultCode_values.insert(ResultType::OUT_OF_MEMORY);
+ resultCode_values.insert(ResultType::ABORTED);
+ resultCode_values.insert(ResultType::USER_DISALLOWED);
+ resultCode_values.insert(ResultType::GENERIC_ERROR);
+ resultCode_values.insert(ResultType::DISALLOWED);
+
+ CObjectSchemaItem::Members paramsMembersMap;
+ paramsMembersMap[S_FUNCTION_ID] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<FunctionID::eType>::create(function_values), true);
+ paramsMembersMap[S_CORRELATION_ID] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(), true);
+ paramsMembersMap[S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(TSchemaItemParameter<int>(1),
+ TSchemaItemParameter<int>(2)),
+ true);
+
+ CObjectSchemaItem::Members schemaMembersMap;
+ schemaMembersMap[Keys::RESULT_CODE] = CObjectSchemaItem::SMember(
+ TEnumSchemaItem<ResultType::eType>::create(resultCode_values), false);
+ schemaMembersMap[Keys::INFO] = CObjectSchemaItem::SMember(
+ CStringSchemaItem::create(TSchemaItemParameter<size_t>(0),
+ TSchemaItemParameter<size_t>(10)),
+ false);
+ schemaMembersMap[Keys::SUCCESS] = CObjectSchemaItem::SMember(
+ CBoolSchemaItem::create(), false);
+
+ CObjectSchemaItem::Members rootMembersMap;
+ rootMembersMap[S_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(paramsMembersMap), true);
+ rootMembersMap[S_MSG_PARAMS] = CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(schemaMembersMap), true);
+
+ schema_item = CObjectSchemaItem::create(rootMembersMap);
+ }
+};
+
+TEST_F(ObjectSchemaItemTest, validation_correct) {
+ 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;
+
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+}
+
+TEST_F(ObjectSchemaItemTest, validation_correct_skip_not_mandatory) {
+ SmartObject obj;
+ obj[S_PARAMS][S_FUNCTION_ID] = 1;
+ obj[S_PARAMS][S_CORRELATION_ID] = -0xFF1;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 1;
+ // skip non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
+ obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
+
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+}
+
+TEST_F(ObjectSchemaItemTest, validation_invalid_param) {
+ SmartObject obj;
+ obj[S_PARAMS] = "some parameters";
+ obj[S_MSG_PARAMS] = "some message parameters";
+
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+
+ obj[S_PARAMS][S_FUNCTION_ID] = "some function";
+ obj[S_PARAMS][S_CORRELATION_ID] = "some correlation id";
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 3;
+ obj[S_MSG_PARAMS][Keys::RESULT_CODE] = "some result";
+ obj[S_MSG_PARAMS][Keys::SUCCESS] = 0xABC;
+
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+
+ obj[S_PARAMS][S_FUNCTION_ID] = 1;
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+
+ obj[S_PARAMS][S_CORRELATION_ID] = -0xFF1;
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+
+ obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 1;
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+
+ obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
+
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+}
+TEST_F(ObjectSchemaItemTest, validation_invalid_not_mandatory_param) {
+ 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::SUCCESS] = true;
+
+ // invalid non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
+ obj[S_MSG_PARAMS][Keys::INFO] = 0x10;
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+
+ // invalid non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
+ obj[S_MSG_PARAMS][Keys::INFO] = true;
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+
+ // invalid non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
+ obj[S_MSG_PARAMS][Keys::INFO] = SmartObject();
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+
+ obj[S_MSG_PARAMS][Keys::INFO] = "info";
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+}
+
+TEST_F(ObjectSchemaItemTest, validation_missing_mandatory) {
+ SmartObject obj;
+ // missed obj[S_PARAMS][S_FUNCTION_ID]
+ // missed obj[S_PARAMS][S_CORRELATION_ID]
+ // missed obj[S_PARAMS][S_PROTOCOL_VERSION]
+ obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 2;
+ obj[S_MSG_PARAMS][Keys::INFO] = "123";
+ obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
+
+ EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER, schema_item->validate(obj));
+
+ obj[S_PARAMS][S_FUNCTION_ID] = 2;
+ // S_CORRELATION_ID and S_PROTOCOL_VERSION is still missed
+ EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER, schema_item->validate(obj));
+
+ obj[S_PARAMS][S_CORRELATION_ID] = 0XFF2;
+ // S_PROTOCOL_VERSION is still missed
+ EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER, schema_item->validate(obj));
+
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+}
+
+TEST_F(ObjectSchemaItemTest, validation_unexpected_param) {
+ const char* fake1 = "FAKE_PARAM1";
+ const char* fake2 = "FAKE_PARAM2";
+ const char* fake3 = "FAKE_PARAM3";
+
+ SmartObject obj;
+ obj[S_PARAMS][S_FUNCTION_ID] = 0;
+ obj[S_PARAMS][S_CORRELATION_ID] = 0XFF;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 2;
+ obj[S_MSG_PARAMS][Keys::INFO] = "123";
+ obj[S_MSG_PARAMS][Keys::SUCCESS] = true;
+
+ obj[fake1] = SmartObject(static_cast<int64_t>(0));
+ // any fake parameter is OK
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+
+ obj[S_PARAMS][fake2] = SmartObject("123");
+ // any fake parameters are OK
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+
+ obj[S_MSG_PARAMS][fake3] = true;
+ // any fake parameters are OK
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+}
+
+TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
+ const char* fake1 = "FAKE_PARAM1";
+ const char* fake2 = "FAKE_PARAM2";
+ const char* fake3 = "FAKE_PARAM3";
+
+ SmartObject obj = SmartObject(SmartType::SmartType_Map);
+ obj[S_PARAMS][S_FUNCTION_ID] = 0;
+ obj[S_PARAMS][S_CORRELATION_ID] = 0XFF;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 2;
+ obj[S_MSG_PARAMS][Keys::INFO] = "123";
+ obj[S_MSG_PARAMS][Keys::SUCCESS] = true;
+
+ obj[fake1] = SmartObject(static_cast<int64_t>(0));
+ obj[S_PARAMS][fake2] = SmartObject("123");
+ obj[S_MSG_PARAMS][fake3] = true;
+
+ // Check apply schema
+ schema_item->applySchema(obj);
+
+ EXPECT_TRUE(obj.keyExists(fake1));
+ EXPECT_TRUE(obj[S_PARAMS].keyExists(fake2));
+ EXPECT_TRUE(obj[S_MSG_PARAMS].keyExists(fake3));
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+
+ // all fake parameters are removed on unapply schema
+ schema_item->unapplySchema(obj);
+
+ EXPECT_FALSE(obj.keyExists(fake1));
+ EXPECT_FALSE(obj[S_PARAMS].keyExists(fake2));
+ EXPECT_FALSE(obj[S_MSG_PARAMS].keyExists(fake3));
+
+ obj[fake1] = SmartObject(static_cast<int64_t>(0));
+ obj[S_PARAMS][fake2] = SmartObject("123");
+ obj[S_MSG_PARAMS][fake3] = true;
+
+ // Check unapply schema
+ schema_item->unapplySchema(obj);
+ // all fake parameters are removed on apply schema
+ EXPECT_FALSE(obj.keyExists(fake1));
+ EXPECT_FALSE(obj[S_PARAMS].keyExists(fake2));
+ EXPECT_FALSE(obj[S_MSG_PARAMS].keyExists(fake3));
+ // Invalide state after enum convertion
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+}
+
+TEST_F(ObjectSchemaItemTest, validation_empty_params) {
+ SmartObject obj;
+ obj[S_PARAMS][S_FUNCTION_ID] = 1;
+ obj[S_PARAMS][S_CORRELATION_ID] = 0xFF;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ obj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ // S_MSG_PARAMS has only fake parameter
+ obj[S_MSG_PARAMS]["FAKE_PARAM1"] = SmartObject();
+ obj[S_MSG_PARAMS]["FAKE_PARAM2"] = SmartObject(0x1);
+ obj[S_MSG_PARAMS]["FAKE_PARAM3"] = SmartObject("2");
+
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+
+ schema_item->applySchema(obj);
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+
+ schema_item->unapplySchema(obj);
+ // Invalide state after enum convertion
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+}
+
+TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
+ SmartObject object;
+ object[S_PARAMS][S_FUNCTION_ID] = SmartObject();
+ object[S_PARAMS][S_CORRELATION_ID] = 0XFF0;
+ object[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ object[S_MSG_PARAMS][Keys::RESULT_CODE] = SmartObject();
+ object[S_MSG_PARAMS][Keys::INFO] = "0123456789";
+ object[S_MSG_PARAMS][Keys::SUCCESS] = true;
+
+ typedef EnumConversionHelper<ResultType::eType>::CStringToEnumMap Results;
+ const Results results =
+ EnumConversionHelper<ResultType::eType>::cstring_to_enum_map();
+
+ typedef EnumConversionHelper<FunctionID::eType>::CStringToEnumMap Functions;
+ const Functions functions =
+ EnumConversionHelper<FunctionID::eType>::cstring_to_enum_map();
+
+ for (Results::const_iterator res_it = results.begin();
+ res_it != results.end(); ++res_it) {
+ for (Functions::const_iterator func_it = functions.begin();
+ func_it != functions.end(); ++func_it) {
+ const char* const function_str = func_it->first;
+ const char* const result_type_str = res_it->first;
+ const FunctionID::eType function_type = func_it->second;
+ const ResultType::eType result_type = res_it->second;
+
+ object[S_PARAMS][S_FUNCTION_ID] = function_str;
+ object[S_MSG_PARAMS][Keys::RESULT_CODE] = result_type_str;
+
+ // S_FUNCTION_ID and RESULT_CODE are not converted to int
+ EXPECT_NE(Errors::OK, schema_item->validate(object));
+
+ schema_item->applySchema(object);
+ EXPECT_EQ(Errors::OK, schema_item->validate(object));
+
+ // check conversion result
+ EXPECT_EQ(function_type, object[S_PARAMS][S_FUNCTION_ID].asInt());
+ EXPECT_EQ(result_type, object[S_MSG_PARAMS][Keys::RESULT_CODE].asInt());
+
+ schema_item->unapplySchema(object);
+ // S_FUNCTION_ID and RESULT_CODE are string
+ EXPECT_NE(Errors::OK, schema_item->validate(object));
+
+ // check conversion result
+ EXPECT_EQ(function_str, object[S_PARAMS][S_FUNCTION_ID].asString());
+ EXPECT_EQ(result_type_str,
+ object[S_MSG_PARAMS][Keys::RESULT_CODE].asString());
+ }
+ }
+}
+// ----------------------------------------------------------------------------
+}// namespace SchemaItem
+} // namespace SmartObjects
+} // namespace components
+} // namespace test
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+namespace FunctionID = test::components::SmartObjects::SchemaItem::FunctionID;
+typedef EnumConversionHelper<FunctionID::eType> FunctionConvertor;
+
+template<>
+const FunctionConvertor::EnumToCStringMap FunctionConvertor::enum_to_cstring_map_ =
+ FunctionConvertor::InitEnumToCStringMap();
+
+template<>
+const FunctionConvertor::CStringToEnumMap FunctionConvertor::cstring_to_enum_map_ =
+ FunctionConvertor::InitCStringToEnumMap();
+
+template<>
+const char* const FunctionConvertor::cstring_values_[] =
+ { "Function0", "Function1", "Function2", "Function3", "Function4",
+ "Function5", "Function6" };
+
+template<>
+const FunctionID::eType FunctionConvertor::enum_values_[] = {
+ FunctionID::Function0, FunctionID::Function1, FunctionID::Function2,
+ FunctionID::Function3, FunctionID::Function4, FunctionID::Function5,
+ FunctionID::Function6 };
+
+// ----------------------------------------------------------------------------
+
+namespace ResultType = test::components::SmartObjects::SchemaItem::ResultType;
+typedef EnumConversionHelper<ResultType::eType> ResultTypeConvertor;
+
+template<>
+const ResultTypeConvertor::EnumToCStringMap ResultTypeConvertor::enum_to_cstring_map_ =
+ ResultTypeConvertor::InitEnumToCStringMap();
+
+template<>
+const ResultTypeConvertor::CStringToEnumMap ResultTypeConvertor::cstring_to_enum_map_ =
+ ResultTypeConvertor::InitCStringToEnumMap();
+
+template<>
+const char* const ResultTypeConvertor::cstring_values_[] = {
+ "APPLICATION_NOT_REGISTERED", "SUCCESS", "TOO_MANY_PENDING_REQUESTS",
+ "REJECTED", "INVALID_DATA", "OUT_OF_MEMORY", "ABORTED", "USER_DISALLOWED",
+ "GENERIC_ERROR", "DISALLOWED" };
+
+template<>
+const ResultType::eType ResultTypeConvertor::enum_values_[] = {
+ ResultType::APPLICATION_NOT_REGISTERED, ResultType::SUCCESS,
+ ResultType::TOO_MANY_PENDING_REQUESTS, ResultType::REJECTED,
+ ResultType::INVALID_DATA, ResultType::OUT_OF_MEMORY, ResultType::ABORTED,
+ ResultType::USER_DISALLOWED, ResultType::GENERIC_ERROR,
+ ResultType::DISALLOWED };
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
diff --git a/src/components/smart_objects/test/EnumSchemaItem_test.cc b/src/components/smart_objects/test/EnumSchemaItem_test.cc
new file mode 100644
index 000000000..e99e2f4e6
--- /dev/null
+++ b/src/components/smart_objects/test/EnumSchemaItem_test.cc
@@ -0,0 +1,272 @@
+/*
+ * 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 "gmock/gmock.h"
+
+#include "smart_objects/smart_object.h"
+#include "smart_objects/enum_schema_item.h"
+#include "smart_objects/string_schema_item.h"
+
+#include <string>
+
+namespace test {
+namespace components {
+namespace SmartObjects {
+namespace SchemaItem {
+
+using namespace NsSmartDeviceLink::NsSmartObjects;
+namespace TestType {
+enum eType {
+ INVALID_ENUM = -1,
+ USER_EXIT = 0,
+ IGNITION_OFF,
+ BLUETOOTH_OFF,
+ USB_DISCONNECTED,
+ TOO_MANY_REQUESTS,
+ MASTER_RESET,
+ FACTORY_DEFAULTS,
+ APP_UNAUTHORIZED
+};
+}
+
+class EnumSchemaItemTest : public ::testing::Test {
+ protected:
+ EnumSchemaItemTest() {
+ testEnum.insert(TestType::USER_EXIT);
+ testEnum.insert(TestType::IGNITION_OFF);
+ testEnum.insert(TestType::BLUETOOTH_OFF);
+ testEnum.insert(TestType::USB_DISCONNECTED);
+ testEnum.insert(TestType::TOO_MANY_REQUESTS);
+ testEnum.insert(TestType::MASTER_RESET);
+ testEnum.insert(TestType::FACTORY_DEFAULTS);
+ testEnum.insert(TestType::APP_UNAUTHORIZED);
+ }
+
+ virtual void SetUp() {
+ }
+
+ std::set<TestType::eType> testEnum;
+};
+
+/**
+ * Test EnumSchemaItem
+ *
+ * Create SchemaItem with default value. Method setDefaultValue should return true,
+ * SmartObject should contain default value.
+ * Not Enum SmartObject should converted to intObject and setted up by the default value.
+ **/
+TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
+ SmartObject obj;
+ ISchemaItemPtr item = TEnumSchemaItem<TestType::eType>::create(
+ testEnum,
+ TSchemaItemParameter<TestType::eType>(TestType::FACTORY_DEFAULTS));
+
+ //Object - valid enum
+ obj = TestType::BLUETOOTH_OFF;
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ bool resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
+
+ //Obj - bool
+ obj = true;
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
+
+ //Object - number
+ obj = 3.1415926;
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
+
+ //Object - string
+ obj = "Some string";
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
+}
+
+/**
+ * Test EnumSchemaItem with default value
+ *
+ * Create SchemaItem without default value. Method setDefaultValue should return false,
+ * SmartObject should contain previous value.
+ **/
+TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
+ SmartObject obj;
+
+ ISchemaItemPtr item = TEnumSchemaItem<TestType::eType>::create(
+ testEnum, TSchemaItemParameter<TestType::eType>());
+
+ //Object - valid enum
+ obj = TestType::BLUETOOTH_OFF;
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ bool resDefault = item->setDefaultValue(obj);
+ EXPECT_FALSE(resDefault);
+ EXPECT_EQ(TestType::BLUETOOTH_OFF, obj.asInt());
+
+ //Obj - bool
+ obj = true;
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_FALSE(resDefault);
+ EXPECT_TRUE(obj.asBool());
+
+ //Object - number
+ obj = 3.1415926;
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_FALSE(resDefault);
+ EXPECT_EQ(3.1415926, obj.asDouble());
+
+ //Object - string
+ obj = "Some string";
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_FALSE(resDefault);
+ EXPECT_EQ(std::string("Some string"), obj.asString());
+
+ //Object - int in range of enum
+ obj = 6;
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object - int out of enum range
+ obj = 15;
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+}
+
+/**
+ * Test apply and unapply EnumSchemaItem
+ **/
+TEST_F(EnumSchemaItemTest, test_apply_unapply_schema) {
+ SmartObject obj;
+
+ ISchemaItemPtr item = TEnumSchemaItem<TestType::eType>::create(
+ testEnum,
+ TSchemaItemParameter<TestType::eType>(TestType::FACTORY_DEFAULTS));
+
+ //Object - valid enum
+ obj = TestType::BLUETOOTH_OFF;
+ int resultType = item->validate(obj);
+ 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);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(std::string("FACTORY_DEFAULTS"), obj.asString());
+
+ item->applySchema(obj);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
+
+ obj = "TOO_MANY_REQUESTS";
+ item->applySchema(obj);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(TestType::TOO_MANY_REQUESTS, obj.asInt());
+
+ obj = "ENOUGH_REQUESTS";
+ item->applySchema(obj);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(std::string("ENOUGH_REQUESTS"), obj.asString());
+}
+
+}
+}
+}
+}
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+template<>
+const EnumConversionHelper<
+ test::components::SmartObjects::SchemaItem::TestType::eType>::EnumToCStringMap EnumConversionHelper<
+ test::components::SmartObjects::SchemaItem::TestType::eType>::enum_to_cstring_map_ =
+ EnumConversionHelper<
+ test::components::SmartObjects::SchemaItem::TestType::eType>::InitEnumToCStringMap();
+
+template<>
+const EnumConversionHelper<
+ test::components::SmartObjects::SchemaItem::TestType::eType>::CStringToEnumMap EnumConversionHelper<
+ test::components::SmartObjects::SchemaItem::TestType::eType>::cstring_to_enum_map_ =
+ EnumConversionHelper<
+ test::components::SmartObjects::SchemaItem::TestType::eType>::InitCStringToEnumMap();
+
+template<>
+const char* const EnumConversionHelper<
+ test::components::SmartObjects::SchemaItem::TestType::eType>::cstring_values_[] =
+ { "USER_EXIT", "IGNITION_OFF", "BLUETOOTH_OFF", "USB_DISCONNECTED",
+ "TOO_MANY_REQUESTS", "MASTER_RESET", "FACTORY_DEFAULTS",
+ "APP_UNAUTHORIZED" };
+
+template<>
+const test::components::SmartObjects::SchemaItem::TestType::eType EnumConversionHelper<
+ test::components::SmartObjects::SchemaItem::TestType::eType>::enum_values_[] =
+ { test::components::SmartObjects::SchemaItem::TestType::USER_EXIT,
+ test::components::SmartObjects::SchemaItem::TestType::IGNITION_OFF,
+ test::components::SmartObjects::SchemaItem::TestType::BLUETOOTH_OFF,
+ test::components::SmartObjects::SchemaItem::TestType::USB_DISCONNECTED,
+ test::components::SmartObjects::SchemaItem::TestType::TOO_MANY_REQUESTS,
+ test::components::SmartObjects::SchemaItem::TestType::MASTER_RESET,
+ test::components::SmartObjects::SchemaItem::TestType::FACTORY_DEFAULTS,
+ test::components::SmartObjects::SchemaItem::TestType::APP_UNAUTHORIZED };
+
+}
+}
diff --git a/src/components/smart_objects/test/NumberSchemaItem_test.cc b/src/components/smart_objects/test/NumberSchemaItem_test.cc
new file mode 100644
index 000000000..cc5622869
--- /dev/null
+++ b/src/components/smart_objects/test/NumberSchemaItem_test.cc
@@ -0,0 +1,813 @@
+/*
+ * 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 <string>
+
+#include "gmock/gmock.h"
+#include "smart_objects/smart_object.h"
+#include "smart_objects/number_schema_item.h"
+
+namespace test {
+namespace components {
+namespace SmartObjects {
+namespace SchemaItem {
+
+using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
+
+/**
+ * Test NumberSchemaItem as INT with no default value
+ *
+ * Create SchemaItem without default value. Method setDefaultValue should always return false
+ * and leave SmartObject in previous state.
+ **/
+TEST(test_int_no_default_value, test_NumberSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<int>::create(); // No default value, no min, no max
+
+ //Object int
+ obj = 5;
+ ASSERT_EQ(5, obj.asInt());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Obj bool
+ obj = true;
+ ASSERT_TRUE(obj.asBool());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ //Set default value
+ bool resDefault = item->setDefaultValue(obj);
+ EXPECT_FALSE(resDefault);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_TRUE(obj.asBool());
+
+ //Obj string
+ obj = "Test";
+ ASSERT_EQ(std::string("Test"), obj.asString());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_FALSE(resDefault);
+ resultType = item->validate(obj);
+ 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;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<int>::create(
+ TSchemaItemParameter<int>(10)); // No default value, no max value
+
+ //Object int correct
+ obj = 15;
+ ASSERT_EQ(15, obj.asInt());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object int incorrect
+ obj = 9;
+ ASSERT_EQ(9, obj.asInt());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ //Object int correct
+ obj = 10;
+ ASSERT_EQ(10, obj.asInt());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+}
+
+/**
+ * Test NumberSchemaItem as INT with setted max value
+ **/
+TEST(test_int_max_value, test_NumberSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<int>::create(
+ TSchemaItemParameter<int>(), TSchemaItemParameter<int>(749)); // No default value, no min value
+
+ //Object int correct
+ obj = 749;
+ ASSERT_EQ(749, obj.asInt());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object int incorrect
+ obj = 750;
+ ASSERT_EQ(750, obj.asInt());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ //Object int correct
+ obj = -750;
+ ASSERT_EQ(-750, obj.asInt());
+
+ resultType = item->validate(obj);
+ 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;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<int>::create(
+ TSchemaItemParameter<int>(-949), TSchemaItemParameter<int>(749)); // No default value
+
+ //Object int correct
+ obj = 749;
+ ASSERT_EQ(749, obj.asInt());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object int incorrect
+ obj = 750;
+ ASSERT_EQ(750, obj.asInt());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ //Object int correct
+ obj = -949;
+ ASSERT_EQ(-949, obj.asInt());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object int incorrect
+ obj = -950;
+ ASSERT_EQ(-950, obj.asInt());
+
+ resultType = item->validate(obj);
+ 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;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<int>::create(
+ TSchemaItemParameter<int>(-12000), TSchemaItemParameter<int>(100),
+ TSchemaItemParameter<int>(-38));
+
+ //Object int correct
+ obj = -12000;
+ ASSERT_EQ(-12000, obj.asInt());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object int incorrect
+ obj = -12001;
+ ASSERT_EQ(-12001, obj.asInt());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ //Object int correct
+ obj = 100;
+ ASSERT_EQ(100, obj.asInt());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object int incorrect
+ obj = 101;
+ ASSERT_EQ(101, obj.asInt());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ //Set default value
+ bool resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(-38, obj.asInt());
+
+ //Object string
+ obj = "string";
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(-38, obj.asInt());
+}
+
+/**
+ * Test NumberSchemaItem as INT with default value out of range
+ **/
+TEST(test_int_default_value_out_of_range, test_NumberSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<int>::create(
+ TSchemaItemParameter<int>(90), TSchemaItemParameter<int>(100),
+ TSchemaItemParameter<int>(50)); // Default value out of range
+
+ //Object int correct
+ obj = 90;
+ ASSERT_EQ(90, obj.asInt());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object int incorrect
+ obj = 89;
+ ASSERT_EQ(89, obj.asInt());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ //Object int correct
+ obj = 100;
+ ASSERT_EQ(100, obj.asInt());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object int incorrect
+ obj = 101;
+ ASSERT_EQ(101, obj.asInt());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ //Set default value
+ bool resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(50, obj.asInt());
+
+ //Object string
+ obj = "string";
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(50, obj.asInt());
+}
+
+TEST(test_int_map_validate, test_NumberSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<int>::create(
+ TSchemaItemParameter<int>(-120), TSchemaItemParameter<int>(100),
+ TSchemaItemParameter<int>(-38));
+
+ obj["min"] = -120;
+ obj["out_of_min"] = -121;
+ obj["max"] = 100;
+ obj["out_of_max"] = 101;
+
+ int resultType = item->validate(obj["min"]);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj["max"]);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj["out_of_min"]);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj["out_of_max"]);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ //Set default value
+ bool resDefault = item->setDefaultValue(obj["aa"]);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(-38, obj["aa"].asInt());
+
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(-38, obj.asInt());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ resultType = item->validate(obj["min"]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+}
+
+TEST(test_int_array_validate, test_NumberSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<int>::create(
+ TSchemaItemParameter<int>(-120), TSchemaItemParameter<int>(100),
+ TSchemaItemParameter<int>(-38));
+
+ obj[0] = -121;
+ obj[1] = -120;
+ obj[2] = 100;
+ obj[3] = 101;
+
+ int resultType = item->validate(obj[0]);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ resultType);
+
+ resultType = item->validate(obj[1]);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+
+ resultType = item->validate(obj[2]);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+
+ resultType = item->validate(obj[3]);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ resultType);
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+
+ bool resDefault = item->setDefaultValue(obj[0]);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(-38, obj[0].asInt());
+
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(-38, obj.asInt());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+
+ resultType = item->validate(obj[0]);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+}
+
+/**
+ * Test NumberSchemaItem as DOUBLE with no default value
+ *
+ * Create SchemaItem without default value. Method setDefaultValue should always return false
+ * and leave SmartObject in previous state.
+ **/
+TEST(test_double_no_default_value, test_NumberSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<double>::create(); // No default value, no min, no max
+
+ //Object int
+ obj = 5.79;
+ ASSERT_EQ(5.79, obj.asDouble());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Obj bool
+ obj = true;
+ ASSERT_TRUE(obj.asBool());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ //Set default value
+ bool resDefault = item->setDefaultValue(obj);
+ EXPECT_FALSE(resDefault);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_TRUE(obj.asBool());
+
+ //Obj string
+ obj = "Test";
+ ASSERT_EQ(std::string("Test"), obj.asString());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ //Set default value
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_FALSE(resDefault);
+ resultType = item->validate(obj);
+ 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;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<double>::create(
+ TSchemaItemParameter<double>(10.0)); // No default value, no max value
+
+ //Object double correct
+ obj = 10.000001;
+ ASSERT_EQ(10.000001, obj.asDouble());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object double incorrect
+ obj = 9.999999;
+ ASSERT_EQ(9.999999, obj.asDouble());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ /*
+ //Object int
+ obj = 10;
+ ASSERT_EQ(10, obj.asInt());
+
+ resultType = item->validate(obj);
+ 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;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<double>::create(
+ TSchemaItemParameter<double>(), TSchemaItemParameter<double>(749.0)); // No default value, no min value
+
+ //Object double correct
+ obj = 749.0;
+ ASSERT_EQ(749.0, obj.asDouble());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object double incorrect
+ obj = 749.0001;
+ ASSERT_EQ(749.0001, obj.asDouble());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ //Object double correct
+ obj = -750.0;
+ ASSERT_EQ(-750.0, obj.asDouble());
+
+ resultType = item->validate(obj);
+ 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;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<double>::create(
+ TSchemaItemParameter<double>(-949.0),
+ TSchemaItemParameter<double>(749.0)); // No default value
+
+ //Object double correct
+ obj = 749.0;
+ ASSERT_EQ(749.0, obj.asDouble());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object double incorrect
+ obj = 749.001;
+ ASSERT_EQ(749.001, obj.asDouble());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ //Object double correct
+ obj = -949.0;
+ ASSERT_EQ(-949.0, obj.asDouble());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object double incorrect
+ obj = -949.00001;
+ ASSERT_EQ(-949.00001, obj.asDouble());
+
+ resultType = item->validate(obj);
+ 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;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<double>::create(
+ TSchemaItemParameter<double>(-12000.0),
+ TSchemaItemParameter<double>(100.0), TSchemaItemParameter<double>(-38.0));
+
+ //Object double correct
+ obj = -12000.0;
+ ASSERT_EQ(-12000.0, obj.asDouble());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object double incorrect
+ obj = -12000.01;
+ ASSERT_EQ(-12000.01, obj.asDouble());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ //Object double correct
+ obj = 100.0;
+ ASSERT_EQ(100.0, obj.asDouble());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object double incorrect
+ obj = 100.001;
+ ASSERT_EQ(100.001, obj.asDouble());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ //Set default value
+ bool resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(-38.0, obj.asDouble());
+
+ //Object string
+ obj = "string";
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(-38.0, obj.asDouble());
+}
+
+/**
+ * Test NumberSchemaItem as DOUBLE with default value out of range
+ **/
+TEST(test_double_default_value_out_of_range, test_NumberSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<double>::create(
+ TSchemaItemParameter<double>(90.0), TSchemaItemParameter<double>(100.0),
+ TSchemaItemParameter<double>(50.0)); // Default value out of range
+
+ //Object double correct
+ obj = 90.0;
+ ASSERT_EQ(90.0, obj.asDouble());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object double incorrect
+ obj = 89.999;
+ ASSERT_EQ(89.999, obj.asDouble());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ //Object double correct
+ obj = 100.0;
+ ASSERT_EQ(100.0, obj.asDouble());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ //Object double incorrect
+ obj = 100.001;
+ ASSERT_EQ(100.001, obj.asDouble());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ //Set default value
+ bool resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(50.0, obj.asDouble());
+
+ //Object string
+ obj = "string";
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(50.0, obj.asDouble());
+}
+
+TEST(test_double_map_validate, test_NumberSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<double>::create(
+ TSchemaItemParameter<double>(-120.0), TSchemaItemParameter<double>(100.0),
+ TSchemaItemParameter<double>(-38.0));
+
+ obj["min"] = -120.0;
+ obj["out_of_min"] = -120.001;
+ obj["max"] = 100.0;
+ obj["out_of_max"] = 100.001;
+
+ int resultType = item->validate(obj["min"]);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj["max"]);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj["out_of_min"]);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj["out_of_max"]);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ bool resDefault = item->setDefaultValue(obj["aa"]);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(-38.0, obj["aa"].asDouble());
+
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(-38.0, obj.asDouble());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ resultType = item->validate(obj["min"]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+}
+
+TEST(test_double_array_validate, test_NumberSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+
+ SmartObject obj;
+
+ ISchemaItemPtr item = TNumberSchemaItem<double>::create(
+ TSchemaItemParameter<double>(-120.0), TSchemaItemParameter<double>(100.0),
+ TSchemaItemParameter<double>(-38.0));
+
+ obj[0] = -120.001;
+ obj[1] = -120.0;
+ obj[2] = 100.0;
+ obj[3] = 100.000001;
+
+ int resultType = item->validate(obj[0]);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ resultType);
+
+ resultType = item->validate(obj[1]);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+
+ resultType = item->validate(obj[2]);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+
+ resultType = item->validate(obj[3]);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ resultType);
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+
+ bool resDefault = item->setDefaultValue(obj[0]);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(-38.0, obj[0].asDouble());
+
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(-38.0, obj.asDouble());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+
+ resultType = item->validate(obj[0]);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType);
+}
+
+TEST(test_int_double_value, test_NumberSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+
+ ISchemaItemPtr item = TNumberSchemaItem<int>::create(
+ TSchemaItemParameter<int>(10),
+ TSchemaItemParameter<int>(100)); // No default value
+
+ SmartObject obj;
+ const double value = 10.0001;
+ obj = value;
+ ASSERT_EQ(value, obj.asDouble());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+}
+
+TEST(test_double_int_value, DISABLED_test_NumberSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+
+ ISchemaItemPtr item = TNumberSchemaItem<double>::create(
+ TSchemaItemParameter<double>(10.0),
+ TSchemaItemParameter<double>(100.0)); // No default value
+
+ SmartObject obj;
+ const int value = 99;
+ obj = value;
+ ASSERT_EQ(value, obj.asInt());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+}
+
+} // namespace SchemaItem
+} // namespace SmartObjects
+} // namespace components
+} // namespace test
diff --git a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
new file mode 100644
index 000000000..11a1ed3d2
--- /dev/null
+++ b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
@@ -0,0 +1,714 @@
+//TODO
+//this test file should be refactored. Now it doesn't test anything.
+//Previously it tests equality of objects but should test time for object's conversion
+/*
+ * 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 "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"
+#include "formatters/CFormatterJsonSDLRPCv2.hpp"
+#include "formatters/CFormatterJsonSDLRPCv1.hpp"
+#include "smart_objects/array_schema_item.h"
+#include "smart_objects/bool_schema_item.h"
+#include "smart_objects/object_schema_item.h"
+#include "smart_objects/string_schema_item.h"
+#include "smart_objects/enum_schema_item.h"
+#include "smart_objects/number_schema_item.h"
+#include "smart_objects/schema_item_parameter.h"
+
+#include <string>
+#include <time.h>
+
+namespace test {
+namespace components {
+namespace SmartObjects {
+namespace SmartObjectConvertionTimeTest {
+
+using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace NsSmartDeviceLink::NsSmartObjects;
+
+namespace TestType {
+enum eType {
+ INVALID_ENUM = -1,
+ APPLICATION_NOT_REGISTERED = 0,
+ SUCCESS,
+ TOO_MANY_PENDING_REQUESTS,
+ REJECTED,
+ INVALID_DATA,
+ OUT_OF_MEMORY,
+ ABORTED,
+ USER_DISALLOWED,
+ GENERIC_ERROR,
+ DISALLOWED
+};
+}
+
+namespace FunctionIdTest {
+enum eType {
+ INVALID_ENUM = -1,
+ RegisterAppInterface,
+ UnregisterAppInterface,
+ SetGlobalProperties,
+};
+}
+
+namespace MessageTypeTest {
+enum eType {
+ INVALID_ENUM = -1,
+ request,
+ response,
+ notification
+};
+}
+
+class SmartObjectConvertionTimeTest : public ::testing::Test {
+ protected:
+
+ double getConvertionTimeToJsonV2Format(const SmartObject& srcObj,
+ std::string& jsonString) {
+ timespec convertionStartTime, convertionEndTime;
+ clock_gettime(CLOCK_REALTIME, &convertionStartTime);
+
+ // SmartObjects --> JSON
+ NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv2::toString(
+ srcObj, jsonString);
+
+ clock_gettime(CLOCK_REALTIME, &convertionEndTime);
+
+ return static_cast<double>(convertionEndTime.tv_sec
+ - convertionStartTime.tv_sec)
+ + static_cast<double>(convertionEndTime.tv_nsec
+ - convertionStartTime.tv_nsec) * 1e-9;
+ }
+
+ double getConvertionTimeFromJsonV2Format(std::string& jsonString,
+ SmartObject& dstObj) {
+ timespec convertionStartTime, convertionEndTime;
+ clock_gettime(CLOCK_REALTIME, &convertionStartTime);
+
+ // JSON --> SmartObjects
+ NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv2::fromString<
+ FunctionIdTest::eType, MessageTypeTest::eType>(
+ jsonString, dstObj, FunctionIdTest::RegisterAppInterface,
+ MessageTypeTest::request, 13);
+
+ clock_gettime(CLOCK_REALTIME, &convertionEndTime);
+ return static_cast<double>(convertionEndTime.tv_sec
+ - convertionStartTime.tv_sec)
+ + static_cast<double>(convertionEndTime.tv_nsec
+ - convertionStartTime.tv_nsec) * 1e-9;
+ }
+
+ double getConvertionTimeToJsonV1Format(const SmartObject& srcObj,
+ std::string& jsonString) {
+ timespec convertionStartTime, convertionEndTime;
+ clock_gettime(CLOCK_REALTIME, &convertionStartTime);
+
+ // SmartObjects --> JSON
+ NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv1::toString(
+ srcObj, jsonString);
+
+ clock_gettime(CLOCK_REALTIME, &convertionEndTime);
+ return static_cast<double>(convertionEndTime.tv_sec
+ - convertionStartTime.tv_sec)
+ + static_cast<double>(convertionEndTime.tv_nsec
+ - convertionStartTime.tv_nsec) * 1e-9;
+ }
+
+ double getConvertionTimeFromJsonV1Format(std::string& jsonString,
+ SmartObject& dstObj) {
+ timespec convertionStartTime, convertionEndTime;
+ clock_gettime(CLOCK_REALTIME, &convertionStartTime);
+
+ // JSON --> SmartObjects
+ NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv1::fromString<
+ FunctionIdTest::eType, MessageTypeTest::eType>(jsonString, dstObj);
+
+ clock_gettime(CLOCK_REALTIME, &convertionEndTime);
+ return static_cast<double>(convertionEndTime.tv_sec
+ - convertionStartTime.tv_sec)
+ + static_cast<double>(convertionEndTime.tv_nsec
+ - convertionStartTime.tv_nsec) * 1e-9;
+ }
+
+ void calculateConvertionTime(SmartObject& srcObj, SmartObject& dstObj) {
+ std::string jsonString;
+ double convertionToTime = 0.0;
+ double convertionFromTime = 0.0;
+ const int cycles = 1;
+
+ for (int i = 0; i < cycles; i++) {
+ convertionToTime += getConvertionTimeToJsonV1Format(srcObj, jsonString);
+// printf("%s\n", jsonString.c_str());
+ convertionFromTime += getConvertionTimeFromJsonV1Format(jsonString,
+ dstObj);
+ }
+ printf(
+ "Format V1. Convertion TO time = %.8f, Convertion FROM time = %.8f\n",
+ convertionToTime / cycles, convertionFromTime / cycles);
+
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1; // adjust protocol version
+
+ srcObj.getSchema().applySchema(dstObj);
+ // The objects are different after remove non-schemed fields
+// EXPECT_TRUE(srcObj == dstObj);
+
+ convertionToTime = 0.0;
+ convertionFromTime = 0.0;
+ for (int i = 0; i < cycles; i++) {
+ convertionToTime += getConvertionTimeToJsonV2Format(srcObj, jsonString);
+ convertionFromTime += getConvertionTimeFromJsonV2Format(jsonString,
+ dstObj);
+ }
+ printf(
+ "Format V2. Convertion TO time = %.8f, Convertion FROM time = %.8f\n",
+ convertionToTime / cycles, convertionFromTime / cycles);
+
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2; // adjust protocol version
+
+ dstObj.getSchema().applySchema(dstObj);
+ // The objects are different after remove non-schemed fields
+// EXPECT_TRUE(srcObj == dstObj);
+ }
+
+ void calculateConvertionTimeWithJsonStringOutput(const SmartObject& srcObj,
+ SmartObject& dstObj) {
+ std::string jsonString;
+ double convertionToTime = getConvertionTimeToJsonV1Format(srcObj,
+ jsonString);
+ double convertionFromTime = getConvertionTimeFromJsonV1Format(jsonString,
+ dstObj);
+ printf("\nJSON string V1 = %s", jsonString.c_str());
+ printf(
+ "\nFormat V1. Convertion TO time = %.8f, Convertion FROM time = %.8f\n",
+ convertionToTime, convertionFromTime);
+
+ convertionToTime = getConvertionTimeToJsonV2Format(srcObj, jsonString);
+ convertionFromTime = getConvertionTimeFromJsonV2Format(jsonString, dstObj);
+ printf("\nJSON string V2 = %s", jsonString.c_str());
+ printf(
+ "\nFormat V2. Convertion TO time = %.8f, Convertion FROM time = %.8f\n",
+ convertionToTime, convertionFromTime);
+ }
+
+ // The basic Schema just for enum conversion (FunctionId and MessageType)
+ CSmartSchema initBasicObjectSchema() {
+ std::set<FunctionIdTest::eType> functionId_allowedEnumSubsetValues;
+ functionId_allowedEnumSubsetValues.insert(
+ FunctionIdTest::RegisterAppInterface);
+ functionId_allowedEnumSubsetValues.insert(
+ FunctionIdTest::UnregisterAppInterface);
+ functionId_allowedEnumSubsetValues.insert(
+ FunctionIdTest::SetGlobalProperties);
+
+ std::set<MessageTypeTest::eType> messageType_allowedEnumSubsetValues;
+ messageType_allowedEnumSubsetValues.insert(MessageTypeTest::request);
+ messageType_allowedEnumSubsetValues.insert(MessageTypeTest::response);
+ messageType_allowedEnumSubsetValues.insert(MessageTypeTest::notification);
+
+ ISchemaItemPtr functionId_SchemaItem =
+ TEnumSchemaItem<FunctionIdTest::eType>::create(
+ functionId_allowedEnumSubsetValues);
+
+ ISchemaItemPtr messageType_SchemaItem = TEnumSchemaItem<
+ MessageTypeTest::eType>::create(messageType_allowedEnumSubsetValues);
+
+ CObjectSchemaItem::Members paramsMembersMap;
+ paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] =
+ CObjectSchemaItem::SMember(functionId_SchemaItem, true);
+ paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] =
+ CObjectSchemaItem::SMember(messageType_SchemaItem, true);
+ paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] =
+ CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+
+ std::map<std::string, CObjectSchemaItem::SMember> rootMembersMap;
+ rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] =
+ CObjectSchemaItem::SMember(CObjectSchemaItem::create(paramsMembersMap),
+ true);
+
+ return CSmartSchema(CObjectSchemaItem::create(rootMembersMap));
+ }
+
+ //Create SmartObjectSchema for test object
+ CSmartSchema initObjectSchema() {
+ std::set<TestType::eType> resultCode_allowedEnumSubsetValues;
+ resultCode_allowedEnumSubsetValues.insert(
+ TestType::APPLICATION_NOT_REGISTERED);
+ resultCode_allowedEnumSubsetValues.insert(TestType::SUCCESS);
+ resultCode_allowedEnumSubsetValues.insert(
+ TestType::TOO_MANY_PENDING_REQUESTS);
+ resultCode_allowedEnumSubsetValues.insert(TestType::REJECTED);
+ resultCode_allowedEnumSubsetValues.insert(TestType::INVALID_DATA);
+ resultCode_allowedEnumSubsetValues.insert(TestType::OUT_OF_MEMORY);
+ resultCode_allowedEnumSubsetValues.insert(TestType::ABORTED);
+ resultCode_allowedEnumSubsetValues.insert(TestType::USER_DISALLOWED);
+ resultCode_allowedEnumSubsetValues.insert(TestType::GENERIC_ERROR);
+ resultCode_allowedEnumSubsetValues.insert(TestType::DISALLOWED);
+
+ std::set<FunctionIdTest::eType> functionId_allowedEnumSubsetValues;
+ functionId_allowedEnumSubsetValues.insert(
+ FunctionIdTest::RegisterAppInterface);
+ functionId_allowedEnumSubsetValues.insert(
+ FunctionIdTest::UnregisterAppInterface);
+ functionId_allowedEnumSubsetValues.insert(
+ FunctionIdTest::SetGlobalProperties);
+
+ std::set<MessageTypeTest::eType> messageType_allowedEnumSubsetValues;
+ messageType_allowedEnumSubsetValues.insert(MessageTypeTest::request);
+ messageType_allowedEnumSubsetValues.insert(MessageTypeTest::response);
+ messageType_allowedEnumSubsetValues.insert(MessageTypeTest::notification);
+
+ ISchemaItemPtr success_SchemaItem = CBoolSchemaItem::create(
+ TSchemaItemParameter<bool>());
+
+ ISchemaItemPtr resultCode_SchemaItem =
+ TEnumSchemaItem<TestType::eType>::create(
+ resultCode_allowedEnumSubsetValues,
+ TSchemaItemParameter<TestType::eType>());
+
+ ISchemaItemPtr info_SchemaItem = CStringSchemaItem::create(
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(1000),
+ TSchemaItemParameter<std::string>());
+
+ ISchemaItemPtr tryAgainTime_SchemaItem = TNumberSchemaItem<int>::create(
+ TSchemaItemParameter<int>(0), TSchemaItemParameter<int>(2000000000),
+ TSchemaItemParameter<int>());
+
+ std::map<std::string, CObjectSchemaItem::SMember> schemaMembersMap;
+
+ schemaMembersMap["success"] = CObjectSchemaItem::SMember(success_SchemaItem,
+ true);
+ schemaMembersMap["resultCode"] = CObjectSchemaItem::SMember(
+ resultCode_SchemaItem, true);
+ schemaMembersMap["info"] = CObjectSchemaItem::SMember(info_SchemaItem,
+ false);
+ schemaMembersMap["tryAgainTime"] = 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] =
+ CObjectSchemaItem::SMember(
+ TEnumSchemaItem<MessageTypeTest::eType>::create(
+ messageType_allowedEnumSubsetValues),
+ true);
+ paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] =
+ CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] =
+ CObjectSchemaItem::SMember(
+ TNumberSchemaItem<int>::create(TSchemaItemParameter<int>(1),
+ TSchemaItemParameter<int>(2)),
+ true);
+ paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::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] =
+ CObjectSchemaItem::SMember(CObjectSchemaItem::create(paramsMembersMap),
+ true);
+ return CSmartSchema(CObjectSchemaItem::create(rootMembersMap));
+ }
+};
+
+TEST_F(SmartObjectConvertionTimeTest, test_int_object_convertion) {
+ SmartObject srcObj, dstObj;
+ CSmartSchema schema = initObjectSchema();
+
+ srcObj.setSchema(schema);
+ dstObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ srcObj[S_MSG_PARAMS]["value"] = 5;
+
+ printf("\n INT value.\n");
+ calculateConvertionTime(srcObj, dstObj);
+}
+
+TEST_F(SmartObjectConvertionTimeTest, test_double_object_convertion) {
+ SmartObject srcObj, dstObj;
+ CSmartSchema schema = initObjectSchema();
+
+ srcObj.setSchema(schema);
+ dstObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["value1"] = 3.1415926;
+ srcObj[S_MSG_PARAMS]["value2"] = 32.6;
+ srcObj[S_MSG_PARAMS]["value3"] = 33.945;
+ srcObj[S_MSG_PARAMS]["value4"] = -12.5487698;
+ srcObj[S_MSG_PARAMS]["value5"] = 0.61287346;
+
+ printf("\n Double value.\n");
+ calculateConvertionTime(srcObj, dstObj);
+}
+
+TEST_F(SmartObjectConvertionTimeTest, test_some_object_convertion) {
+ SmartObject srcObj, dstObj;
+ CSmartSchema schema = initObjectSchema();
+
+ srcObj.setSchema(schema);
+ dstObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["appId"] = "APP ID";
+ srcObj[S_MSG_PARAMS]["appName"] = "APP NAME";
+ srcObj[S_MSG_PARAMS]["appType"][0] = "SYSTEM";
+ srcObj[S_MSG_PARAMS]["appType"][1] = "COMMUNICATION";
+ srcObj[S_MSG_PARAMS]["hmiDisplayLanguageDesired"] = "RU-RU";
+ srcObj[S_MSG_PARAMS]["isMediaApplication"] = true;
+ srcObj[S_MSG_PARAMS]["languageDesired"] = "EN-US";
+ srcObj[S_MSG_PARAMS]["ngnMediaScreenAppName"] = "SCREEN NAME";
+ srcObj[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"] = 2;
+ srcObj[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"] = 10;
+ srcObj[S_MSG_PARAMS]["ttsName"][0]["text"] = "ABC";
+ srcObj[S_MSG_PARAMS]["ttsName"][0]["type"] = "TEXT";
+ srcObj[S_MSG_PARAMS]["vrSynonyms"][0] = "Synonym1";
+ srcObj[S_MSG_PARAMS]["vrSynonyms"][1] = "Synonym2";
+ srcObj[S_MSG_PARAMS]["null"] = SmartObject();
+ srcObj[S_MSG_PARAMS]["double"] = -0.1234;
+
+ printf("\n Random object.\n");
+ calculateConvertionTime(srcObj, dstObj);
+}
+
+TEST_F(SmartObjectConvertionTimeTest, test_map_object_convertion) {
+ SmartObject srcObj, dstObj, mapObj, innerObj;
+ CSmartSchema schema = initObjectSchema();
+
+ srcObj.setSchema(schema);
+ dstObj.setSchema(schema);
+
+ // First iteration
+ mapObj["request"]["name"] = "My Request";
+ mapObj["request"]["id"] = 123;
+ mapObj["response"]["name"] = "My Response";
+ mapObj["response"]["id"] = 456;
+ mapObj["we"]["need"]["to"]["go"]["deeper"] = true;
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["value"] = mapObj;
+
+ printf("\n MAP object.\n");
+ calculateConvertionTime(srcObj, dstObj);
+
+ // Second iteration
+ innerObj = mapObj;
+ mapObj["request"]["value"] = innerObj;
+ mapObj["response"]["value"] = innerObj;
+ mapObj["we"]["need"]["to"]["go"]["deeper"]["value"] = innerObj;
+ srcObj[S_MSG_PARAMS]["value"] = mapObj;
+
+ printf("\n Complex MAP object.\n");
+ calculateConvertionTime(srcObj, dstObj);
+
+ // Third iteration
+ innerObj = mapObj;
+ mapObj["request"]["value"] = innerObj;
+ mapObj["response"]["value"] = innerObj;
+ mapObj["we"]["need"]["to"]["go"]["deeper"]["value"] = innerObj;
+ srcObj[S_MSG_PARAMS]["value"] = mapObj;
+
+ printf("\n Very Complex MAP object.\n");
+ calculateConvertionTime(srcObj, dstObj);
+
+ // Last iteration
+ innerObj = mapObj;
+ mapObj["request"]["value"] = innerObj;
+ mapObj["response"]["value"] = innerObj;
+ mapObj["we"]["need"]["to"]["go"]["deeper"]["value"] = innerObj;
+ srcObj[S_MSG_PARAMS]["value"] = mapObj;
+
+ printf("\n Very Very Complex MAP object.\n");
+ calculateConvertionTime(srcObj, dstObj);
+}
+
+TEST_F(SmartObjectConvertionTimeTest, test_array_convertion) {
+ SmartObject srcObj, dstObj, arrayObj, innerObj;
+ CSmartSchema schema = initObjectSchema();
+ int arraySize = 10;
+
+ srcObj.setSchema(schema);
+ dstObj.setSchema(schema);
+
+ // First iteration
+ for (int i = 0; i < arraySize; i++) {
+ arrayObj[i] = rand();
+ }
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["array"] = arrayObj;
+
+ printf("\n Array object [%d].\n", arraySize);
+ calculateConvertionTime(srcObj, dstObj);
+
+ // Second iteration
+ printf("\n Array object [%d x %d].\n", arraySize, arraySize);
+ innerObj = arrayObj;
+ for (int i = 0; i < arraySize; i++) {
+ arrayObj[i] = innerObj;
+ }
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["array"] = arrayObj;
+
+ calculateConvertionTime(srcObj, dstObj);
+
+ // Third iteration
+ printf("\n Array object [%d x %d x %d].\n", arraySize, arraySize, arraySize);
+ innerObj = arrayObj;
+ for (int i = 0; i < arraySize; i++) {
+ arrayObj[i] = innerObj;
+ }
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["array"] = arrayObj;
+
+ calculateConvertionTime(srcObj, dstObj);
+
+ // Fourth iteration
+ printf("\n Array object [%d x %d x %d x %d].\n", arraySize, arraySize,
+ arraySize, arraySize);
+ innerObj = arrayObj;
+ for (int i = 0; i < arraySize; i++) {
+ arrayObj[i] = innerObj;
+ }
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["array"] = arrayObj;
+
+ calculateConvertionTime(srcObj, dstObj);
+
+ // Last iteration
+ printf("\n Array object [%d x %d x %d x %d x %d].\n", arraySize, arraySize,
+ arraySize, arraySize, arraySize);
+ innerObj = arrayObj;
+ for (int i = 0; i < arraySize; i++) {
+ arrayObj[i] = innerObj;
+ }
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["array"] = arrayObj;
+
+ calculateConvertionTime(srcObj, dstObj);
+}
+
+TEST_F(SmartObjectConvertionTimeTest, test_object_with_enum_convertion) {
+ SmartObject srcObj, dstObj;
+ CSmartSchema schema = initObjectSchema();
+
+ srcObj.setSchema(schema);
+ dstObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["success"] = true;
+ srcObj[S_MSG_PARAMS]["resultCode"] = 2;
+ srcObj[S_MSG_PARAMS]["info"] = "Some string";
+ srcObj[S_MSG_PARAMS]["tryAgainTime"] = 322;
+ srcObj.setSchema(schema);
+
+ printf("\n Object with enum.\n");
+ calculateConvertionTime(srcObj, dstObj);
+}
+
+TEST_F(SmartObjectConvertionTimeTest, test_object_without_enum_convertion) {
+ SmartObject srcObj, dstObj;
+ CSmartSchema schema = initObjectSchema();
+
+ srcObj.setSchema(schema);
+ dstObj.setSchema(schema);
+
+ srcObj[S_PARAMS][S_MESSAGE_TYPE] = MessageTypeTest::request;
+ srcObj[S_PARAMS][S_FUNCTION_ID] = FunctionIdTest::RegisterAppInterface;
+ srcObj[S_PARAMS][S_CORRELATION_ID] = 13;
+ srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
+ srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
+ srcObj[S_MSG_PARAMS]["success"] = true;
+ srcObj[S_MSG_PARAMS]["resultCode"] = 2;
+ srcObj[S_MSG_PARAMS]["info"] = "Some string";
+ srcObj[S_MSG_PARAMS]["tryAgainTime"] = 322;
+
+ printf("\n Object without enum.\n");
+ calculateConvertionTime(srcObj, dstObj);
+}
+
+}
+}
+}
+}
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+template<>
+const EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::eType>::EnumToCStringMap EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::eType>::enum_to_cstring_map_ =
+ EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::eType>::InitEnumToCStringMap();
+
+template<>
+const EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::eType>::CStringToEnumMap EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::eType>::cstring_to_enum_map_ =
+ EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::eType>::InitCStringToEnumMap();
+
+template<>
+const char* const EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::eType>::cstring_values_[] =
+ { "APPLICATION_NOT_REGISTERED", "SUCCESS", "TOO_MANY_PENDING_REQUESTS",
+ "REJECTED", "INVALID_DATA", "OUT_OF_MEMORY", "ABORTED",
+ "USER_DISALLOWED", "GENERIC_ERROR", "DISALLOWED" };
+
+template<>
+const test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::eType EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::eType>::enum_values_[] =
+ {
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::APPLICATION_NOT_REGISTERED,
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::SUCCESS,
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::TOO_MANY_PENDING_REQUESTS,
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::REJECTED,
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::INVALID_DATA,
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::OUT_OF_MEMORY,
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::ABORTED,
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::USER_DISALLOWED,
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::GENERIC_ERROR,
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::TestType::DISALLOWED };
+
+template<>
+const EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::FunctionIdTest::eType>::EnumToCStringMap EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::FunctionIdTest::eType>::enum_to_cstring_map_ =
+ EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::FunctionIdTest::eType>::InitEnumToCStringMap();
+
+template<>
+const EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::FunctionIdTest::eType>::CStringToEnumMap EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::FunctionIdTest::eType>::cstring_to_enum_map_ =
+ EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::FunctionIdTest::eType>::InitCStringToEnumMap();
+
+template<>
+const char* const EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::FunctionIdTest::eType>::cstring_values_[] =
+ { "RegisterAppInterface", "UnregisterAppInterface", "SetGlobalProperties" };
+
+template<>
+const test::components::SmartObjects::SmartObjectConvertionTimeTest::FunctionIdTest::eType EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::FunctionIdTest::eType>::enum_values_[] =
+ {
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::FunctionIdTest::RegisterAppInterface,
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::FunctionIdTest::UnregisterAppInterface,
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::FunctionIdTest::SetGlobalProperties };
+
+template<>
+const EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::MessageTypeTest::eType>::EnumToCStringMap EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::MessageTypeTest::eType>::enum_to_cstring_map_ =
+ EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::MessageTypeTest::eType>::InitEnumToCStringMap();
+
+template<>
+const EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::MessageTypeTest::eType>::CStringToEnumMap EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::MessageTypeTest::eType>::cstring_to_enum_map_ =
+ EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::MessageTypeTest::eType>::InitCStringToEnumMap();
+
+template<>
+const char* const EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::MessageTypeTest::eType>::cstring_values_[] =
+ { "request", "response", "notification" };
+
+template<>
+const test::components::SmartObjects::SmartObjectConvertionTimeTest::MessageTypeTest::eType EnumConversionHelper<
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::MessageTypeTest::eType>::enum_values_[] =
+ {
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::MessageTypeTest::request,
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::MessageTypeTest::response,
+ test::components::SmartObjects::SmartObjectConvertionTimeTest::MessageTypeTest::notification };
+
+}
+}
diff --git a/src/components/smart_objects/test/SmartObjectDraft_test.cc b/src/components/smart_objects/test/SmartObjectDraft_test.cc
new file mode 100644
index 000000000..85c97c262
--- /dev/null
+++ b/src/components/smart_objects/test/SmartObjectDraft_test.cc
@@ -0,0 +1,364 @@
+/*
+ * 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 <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+
+#include "smart_objects/smart_object.h"
+
+using ::testing::ElementsAre;
+using ::testing::ContainerEq;
+
+namespace test {
+namespace components {
+namespace SmartObjects {
+namespace SmartObjectDraftTest {
+
+using NsSmartDeviceLink::NsSmartObjects::SmartObject;
+using NsSmartDeviceLink::NsSmartObjects::SmartType;
+
+TEST(SmartObjectsDraftTest, primitive_types) {
+ SmartObject obj;
+
+ obj = true;
+ ASSERT_TRUE(obj.asBool());
+ ASSERT_EQ(SmartType::SmartType_Boolean, obj.getType());
+
+ obj = 5;
+ ASSERT_EQ(5, obj.asInt());
+ ASSERT_EQ(SmartType::SmartType_Integer, obj.getType());
+
+ obj = 'A';
+ ASSERT_DOUBLE_EQ('A', obj.asChar());
+ ASSERT_EQ(SmartType::SmartType_Character, obj.getType());
+
+ obj = "Test";
+ ASSERT_EQ(std::string("Test"), obj.asString());
+ ASSERT_EQ(SmartType::SmartType_String, obj.getType());
+
+ obj = 6.0;
+ ASSERT_DOUBLE_EQ(6.0, obj.asDouble());
+ ASSERT_EQ(SmartType::SmartType_Double, obj.getType());
+}
+
+TEST(SmartObjectsDraftTest, test_map_access) {
+ SmartObject obj;
+
+ obj["aa"] = true;
+ ASSERT_TRUE(obj["aa"].asInt());
+ ASSERT_EQ(SmartType::SmartType_Map, obj.getType());
+
+ obj["aa"]["fds"]["Fsdf"] = 123;
+ ASSERT_EQ(123, obj["aa"]["fds"]["Fsdf"].asInt());
+ ASSERT_EQ(SmartType::SmartType_Map, obj.getType());
+}
+
+TEST(SmartObjectsDraftTest, test_array_access) {
+ SmartObject obj;
+
+ obj[0] = 5;
+ obj[-1] = 6; // Appending new item to array
+
+ ASSERT_EQ(5, obj[0].asInt());
+ ASSERT_EQ(6, obj[1].asInt());
+ ASSERT_EQ(SmartType::SmartType_Array, obj.getType());
+}
+
+TEST(SmartObjectsDraftTest, test_public_interface) {
+ SmartObject obj;
+
+ // ---- INTEGER ---- //
+ obj = 1;
+ ASSERT_EQ(1, obj.asInt());
+
+ // ---- unsigned int ---- //
+ obj = static_cast<unsigned int>(100);
+ ASSERT_EQ(100u, obj.asUInt());
+
+ // ---- DOUBLE ---- //
+ obj = 3.14;
+ ASSERT_EQ(3.14, obj.asDouble());
+
+ // ---- CHAR ---- //
+ obj = 'a';
+ ASSERT_EQ('a', obj.asChar());
+
+ // ---- BOOL ---- //
+ obj = true;
+ ASSERT_TRUE(obj.asBool());
+
+ // ---- CHAR* ---- //
+ obj = "Hello, world";
+ ASSERT_EQ(std::string("Hello, world"), obj.asString());
+
+ // ---- STD::STRING ---- //
+ obj = std::string("Hello, world");
+ ASSERT_EQ(std::string("Hello, world"), obj.asString());
+
+ // ---- Binary ---- //
+ NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData;
+ binaryData.push_back('\0');
+ binaryData.push_back('a');
+ obj = binaryData;
+ ASSERT_THAT(obj.asBinary(), ElementsAre('\0', 'a'));
+
+ // ---- ARRAY ---- //
+ obj[0] = 1;
+ obj[1] = true;
+ obj[2] = 'a';
+ obj[3] = 3.14;
+
+ ASSERT_EQ(1, obj[0].asInt());
+ ASSERT_TRUE(obj[1].asBool());
+ ASSERT_EQ('a', obj[2].asChar());
+ ASSERT_EQ(3.14, obj[3].asDouble());
+
+ // ---- DEEP ARRAY ---- //
+ obj[0] = 1;
+ obj[1][0] = 3.14;
+ obj[1][1][0] = true;
+
+ ASSERT_EQ(1, obj[0].asInt());
+ ASSERT_EQ(3.14, obj[1][0].asDouble());
+ ASSERT_TRUE(obj[1][1][0].asBool());
+
+ // ---- MAP ---- //
+ obj["name"] = "My name";
+ obj["count"] = 10;
+ obj["isValid"] = true;
+
+ ASSERT_EQ(std::string("My name"), obj["name"].asString());
+ ASSERT_EQ(10, obj["count"].asInt());
+ ASSERT_TRUE(obj["isValid"].asBool());
+
+ // ---- DEEP MAP ---- //
+ obj["request"]["name"] = "My Request";
+ obj["request"]["id"] = 123;
+ obj["response"]["name"] = "My Response";
+ obj["response"]["id"] = 456;
+ obj["we"]["need"]["to"]["go"]["deeper"] = true;
+
+ ASSERT_EQ(std::string("My Request"), obj["request"]["name"].asString());
+ ASSERT_EQ(123, obj["request"]["id"].asInt());
+ ASSERT_EQ(std::string("My Response"), obj["response"]["name"].asString());
+ ASSERT_EQ(456, obj["response"]["id"].asInt());
+ ASSERT_TRUE(obj["we"]["need"]["to"]["go"]["deeper"].asBool());
+}
+
+TEST(SmartObjectsDraftTest, test_helper_methods) {
+ SmartObject obj;
+
+ // ---- INTEGER ---- //
+ obj = 1;
+ ASSERT_EQ(1, obj.asInt());
+
+ // ---- unsigned int ---- //
+ obj = static_cast<unsigned int>(100);
+ ASSERT_EQ(100u, obj.asUInt());
+
+ // ---- DOUBLE ---- //
+ obj = 3.14;
+ ASSERT_EQ(3.14, obj.asDouble());
+ //TEST_COMPONENTS_SMART_OBJECTS_SMARTOBJECTDRAFTTEST_H_
+ // ---- CHAR ---- //
+ obj = 'a';
+ ASSERT_EQ('a', obj.asChar());
+
+ // ---- BOOL ---- //
+ obj = true;
+ ASSERT_TRUE(obj.asBool());
+
+ // ---- STD::STRING ---- //
+ obj = std::string("Hello, world");
+ ASSERT_EQ(std::string("Hello, world"), obj.asString());
+
+ // ---- Binary ---- //
+ NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData;
+ binaryData.push_back('\0');
+ binaryData.push_back('a');
+ obj = binaryData;
+ ASSERT_THAT(obj.asBinary(), ElementsAre('\0', 'a'));
+}
+
+TEST(SmartObjectsDraftTest, compare_empty_objects_by_types) {
+ ASSERT_EQ(SmartObject(), SmartObject());
+
+ std::vector<SmartType> smart_types;
+ smart_types.push_back(SmartType::SmartType_Null);
+ smart_types.push_back(SmartType::SmartType_Boolean);
+ smart_types.push_back(SmartType::SmartType_Integer);
+ smart_types.push_back(SmartType::SmartType_Character);
+ smart_types.push_back(SmartType::SmartType_String);
+ smart_types.push_back(SmartType::SmartType_Double);
+ smart_types.push_back(SmartType::SmartType_Map);
+ smart_types.push_back(SmartType::SmartType_Array);
+ smart_types.push_back(SmartType::SmartType_Binary);
+ smart_types.push_back(SmartType::SmartType_Invalid);
+
+ for (size_t i = 0u; i < smart_types.size(); ++i) {
+ const SmartType type_i = smart_types[i];
+ for (size_t j = 0u; j < smart_types.size(); ++j) {
+ const SmartType type_j = smart_types[i];
+ if (type_i == type_j) {
+ ASSERT_EQ(SmartObject(type_i), SmartObject(type_j));
+ ASSERT_EQ(SmartObject(type_j), SmartObject(type_i));
+ } else {
+ ASSERT_NE(SmartObject(type_i), SmartObject(type_j));
+ ASSERT_EQ(SmartObject(type_j), SmartObject(type_i));
+ }
+ }
+ }
+}
+
+TEST(SmartObjectsDraftTest, compare_integer_type) {
+ SmartObject value = SmartObject(0xFFFFF);
+ SmartObject same_value = SmartObject(static_cast<int64_t>(value.asInt()));
+
+ ASSERT_EQ(value, same_value);
+ ASSERT_EQ(same_value, value);
+
+ SmartObject other_value = SmartObject(0x00000);
+
+ ASSERT_NE(value, other_value);
+ ASSERT_NE(other_value, value);
+
+ ASSERT_NE(other_value, same_value);
+ ASSERT_NE(same_value, other_value);
+
+ ASSERT_NE(value, SmartObject());
+ ASSERT_NE(other_value, SmartObject());
+ ASSERT_NE(same_value, SmartObject());
+}
+
+TEST(SmartObjectsDraftTest, compare_double_type) {
+ SmartObject value = SmartObject(6.0);
+ SmartObject same_value = SmartObject(6.0);
+
+ ASSERT_EQ(value, same_value);
+ ASSERT_EQ(same_value, value);
+
+ SmartObject other_value = SmartObject(6.0000001);
+
+ ASSERT_NE(value, other_value);
+ ASSERT_NE(other_value, value);
+
+ ASSERT_NE(other_value, same_value);
+ ASSERT_NE(same_value, other_value);
+
+ ASSERT_NE(value, SmartObject());
+ ASSERT_NE(other_value, SmartObject());
+ ASSERT_NE(same_value, SmartObject());
+}
+
+TEST(SmartObjectsDraftTest, compare_bool_type) {
+ SmartObject value = SmartObject(true);
+ SmartObject same_value = SmartObject(true);
+
+ ASSERT_EQ(value, same_value);
+ ASSERT_EQ(same_value, value);
+
+ SmartObject other_value = SmartObject(false);
+
+ ASSERT_NE(value, other_value);
+ ASSERT_NE(other_value, value);
+
+ ASSERT_NE(other_value, same_value);
+ ASSERT_NE(same_value, other_value);
+
+ ASSERT_NE(value, SmartObject());
+ ASSERT_NE(other_value, SmartObject());
+ ASSERT_NE(same_value, SmartObject());
+}
+
+TEST(SmartObjectsDraftTest, compare_string_type) {
+ SmartObject value = SmartObject("Test string");
+ SmartObject same_value = SmartObject(std::string("Test string"));
+
+ ASSERT_EQ(value, same_value);
+ ASSERT_EQ(same_value, value);
+
+ SmartObject other_value = SmartObject("Other string");
+
+ ASSERT_NE(value, other_value);
+ ASSERT_NE(other_value, value);
+
+ ASSERT_NE(other_value, same_value);
+ ASSERT_NE(same_value, other_value);
+
+ ASSERT_NE(value, SmartObject());
+ ASSERT_NE(other_value, SmartObject());
+ ASSERT_NE(same_value, SmartObject());
+}
+
+TEST(SmartObjectsDraftTest, compare_map_type) {
+ SmartObject value;
+ value["KEY1"] = "VALUE1";
+ value["KEY2"] = 0;
+ value["KEY3"] = false;
+
+ SmartObject same_value;
+ same_value["KEY1"] = "VALUE1";
+ same_value["KEY2"] = 0;
+ same_value["KEY3"] = false;
+
+ ASSERT_EQ(value, same_value);
+ ASSERT_EQ(same_value, value);
+
+ SmartObject other_value;
+ other_value["KEY1"] = "VALUE1";
+ other_value["KEY2"] = 0;
+ // no KEY3 field
+
+ SmartObject other_value2;
+ other_value2["KEY1"] = "VALUE1";
+ other_value2["KEY2"] = 0;
+ // other ype of KEY3 field
+ other_value2["KEY3"] = "VALUE3";
+
+ ASSERT_NE(value, other_value);
+ ASSERT_NE(other_value, value);
+
+ ASSERT_NE(value, other_value2);
+ ASSERT_NE(other_value2, value);
+
+ ASSERT_NE(value, SmartObject());
+ ASSERT_NE(same_value, SmartObject());
+ ASSERT_NE(other_value, SmartObject());
+ ASSERT_NE(other_value2, SmartObject());
+}
+// TODO(Ezamakhov): add test for conversion string/int/double
+}// namespace SmartObjectDraftTest
+} // namespace SmartObjects
+} // namespace components
+} // namespace test
diff --git a/src/components/smart_objects/test/SmartObjectInvalid_test.cc b/src/components/smart_objects/test/SmartObjectInvalid_test.cc
new file mode 100644
index 000000000..6a3caf295
--- /dev/null
+++ b/src/components/smart_objects/test/SmartObjectInvalid_test.cc
@@ -0,0 +1,177 @@
+/*
+ * 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 <string>
+
+#include "gmock/gmock.h"
+
+#include "smart_objects/smart_object.h"
+
+namespace test {
+namespace components {
+namespace SmartObjects {
+namespace SmartObjectInvalidTest {
+using namespace NsSmartDeviceLink::NsSmartObjects;
+
+TEST(test_SmartObjectInvalidTest, simple_type_can_be_set_in_constructor) {
+ SmartObject objMap(SmartType_Map);
+ ASSERT_EQ(SmartType_Map, objMap.getType());
+
+ SmartObject objArray(SmartType_Array);
+ ASSERT_EQ(SmartType_Array, objArray.getType());
+
+ SmartObject objInt(SmartType_Integer);
+ ASSERT_EQ(SmartType_Integer, objInt.getType());
+
+ SmartObject objDouble(SmartType_Double);
+ ASSERT_EQ(SmartType_Double, objDouble.getType());
+
+ SmartObject objBoolean(SmartType_Boolean);
+ ASSERT_EQ(SmartType_Boolean, objBoolean.getType());
+
+ SmartObject objChar(SmartType_Character);
+ ASSERT_EQ(SmartType_Character, objChar.getType());
+
+ SmartObject objString(SmartType_String);
+ ASSERT_EQ(SmartType_String, objString.getType());
+
+ SmartObject objBinary(SmartType_Binary);
+ ASSERT_EQ(SmartType_Binary, objBinary.getType());
+
+ SmartObject objInvalid(SmartType_Invalid);
+ ASSERT_EQ(SmartType_Invalid, objInvalid.getType());
+
+ SmartObject objNullConstructor(SmartType_Null);
+ ASSERT_EQ(SmartType_Null, objNullConstructor.getType());
+
+ SmartObject objNullDefault;
+ ASSERT_EQ(SmartType_Null, objNullDefault.getType());
+}
+
+TEST(test_SmartObjectInvalidTest, invalid_object_remains_invalid) {
+ SmartObject obj(SmartType_Invalid);
+ ASSERT_EQ(SmartType_Invalid, obj.getType());
+
+ obj = 1;
+ ASSERT_EQ(SmartType_Invalid, obj.getType());
+ ASSERT_EQ(invalid_int_value, obj.asInt());
+
+ // ---- unsigned int ---- //
+ obj = static_cast<unsigned int>(100);
+ ASSERT_EQ(SmartType_Invalid, obj.getType());
+ ASSERT_EQ(invalid_unsigned_int_value, obj.asUInt());
+
+ // ---- DOUBLE ---- //
+ obj = 3.14;
+ ASSERT_EQ(SmartType_Invalid, obj.getType());
+ ASSERT_EQ(invalid_double_value, obj.asDouble());
+
+ // ---- CHAR ---- //
+ obj = 'a';
+ ASSERT_EQ(SmartType_Invalid, obj.getType());
+ ASSERT_EQ(invalid_char_value, obj.asChar());
+
+ // ---- BOOL ---- //
+ obj = true;
+ ASSERT_EQ(SmartType_Invalid, obj.getType());
+ ASSERT_EQ(invalid_bool_value, obj.asBool());
+
+ // ---- CHAR* ---- //
+ obj = "Hello, world";
+ ASSERT_EQ(SmartType_Invalid, obj.getType());
+ ASSERT_EQ(invalid_string_value, obj.asString());
+
+ // ---- STD::STRING ---- //
+ obj = std::string("Hello, world");
+ ASSERT_EQ(SmartType_Invalid, obj.getType());
+ ASSERT_EQ(invalid_string_value, obj.asString());
+
+ // ---- BINARY ---- //
+ NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData;
+ binaryData.push_back('\0');
+ binaryData.push_back('a');
+ obj = binaryData;
+ ASSERT_EQ(SmartType_Invalid, obj.getType());
+ ASSERT_EQ(invalid_binary_value, obj.asBinary());
+
+ // ---- ARRAY ---- //
+ obj[0] = 1;
+ obj[1] = true;
+ obj[2] = 'a';
+ obj[3] = 3.14;
+
+ ASSERT_EQ(SmartType_Invalid, obj.getType());
+ ASSERT_EQ(invalid_int_value, obj[0].asInt());
+ ASSERT_EQ(invalid_bool_value, obj[1].asBool());
+ ASSERT_EQ(invalid_char_value, obj[2].asChar());
+ ASSERT_EQ(invalid_double_value, obj[3].asDouble());
+
+ // ---- DEEP ARRAY ---- //
+ obj[0] = 1;
+ obj[1][0] = 3.14;
+ obj[1][1][0] = true;
+
+ ASSERT_EQ(SmartType_Invalid, obj.getType());
+ ASSERT_EQ(invalid_int_value, obj[0].asInt());
+ ASSERT_EQ(invalid_double_value, obj[1][0].asDouble());
+ ASSERT_EQ(invalid_bool_value, obj[1][1][0].asBool());
+
+ // ---- MAP ---- //
+ obj["name"] = "My name";
+ obj["count"] = 10;
+ obj["isValid"] = true;
+
+ ASSERT_EQ(SmartType_Invalid, obj.getType());
+ ASSERT_EQ(invalid_string_value, obj["name"].asString());
+ ASSERT_EQ(invalid_int_value, obj["count"].asInt());
+ ASSERT_EQ(invalid_bool_value, obj["isValid"].asBool());
+
+ // ---- DEEP MAP ---- //
+ obj["request"]["name"] = "My Request";
+ obj["request"]["id"] = 123;
+ obj["response"]["name"] = "My Response";
+ obj["response"]["id"] = 456;
+ obj["we"]["need"]["to"]["go"]["deeper"] = true;
+
+ ASSERT_EQ(SmartType_Invalid, obj.getType());
+
+ ASSERT_EQ(invalid_string_value, obj["request"]["name"].asString());
+ ASSERT_EQ(invalid_int_value, obj["request"]["id"].asInt());
+ ASSERT_EQ(invalid_string_value, obj["response"]["name"].asString());
+ ASSERT_EQ(invalid_int_value, obj["response"]["id"].asInt());
+ ASSERT_EQ(invalid_bool_value,
+ obj["we"]["need"]["to"]["go"]["deeper"].asBool());
+}
+} // namespace SmartObjectInvalidTest
+} // namespace SmartObjects
+} // namespace components
+} // namespace test
diff --git a/src/components/smart_objects/test/SmartObjectStress_test.cc b/src/components/smart_objects/test/SmartObjectStress_test.cc
new file mode 100644
index 000000000..4fb7b2efc
--- /dev/null
+++ b/src/components/smart_objects/test/SmartObjectStress_test.cc
@@ -0,0 +1,336 @@
+/*
+ * 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 <sstream>
+#include "gmock/gmock.h"
+#include "smart_objects/smart_object.h"
+
+//#define NO_INCLUSIVE_MAPS
+//#define COPY_SUB_OBJECTS_WORKAROUND
+
+namespace test {
+namespace components {
+namespace SmartObjects {
+namespace SmartObjectStressTest {
+
+using namespace NsSmartDeviceLink::NsSmartObjects;
+
+class StressTestHelper : public ::testing::Test {
+ private:
+ char get_random_char() const {
+ return static_cast<char>('A' + (rand() % 52));
+ }
+
+ std::string to_string(const int value) const {
+ std::ostringstream oss;
+ oss << value;
+ return oss.str();
+ }
+
+ std::string to_string(const double value) const {
+ // Content is the same as in SmartObject::convert_double_to_string
+ std::stringstream ss;
+ ss << std::fixed << std::setprecision(10) << value; //convert double to string w fixed notation, hi precision
+ std::string s = ss.str(); //output to std::string
+ s.erase(s.find_last_not_of('0') + 1, std::string::npos); //remove trailing 000s (123.1200 => 123.12, 123.000 => 123.)
+ if (s[s.size() - 1] == '.') {
+ s.erase(s.end() - 1); //remove dangling decimal (123. => 123)
+ }
+ return s;
+ }
+
+ std::string to_string(const char ch) const {
+ char buff[2];
+ sprintf(buff, "%c", ch);
+ return std::string(buff);
+ }
+
+ std::string to_string(const bool b) const {
+ return std::string((b) ? "true" : "false");
+ }
+
+ protected:
+ typedef std::map<std::string, std::string> VerificationMap;
+ VerificationMap mVerifyMap;
+
+ std::vector<std::string> split(const std::string &s, char delim) const {
+ std::vector < std::string > elems;
+
+ std::stringstream ss(s);
+ std::string item;
+ while (std::getline(ss, item, delim)) {
+ elems.push_back(item);
+ }
+
+ return elems;
+ }
+
+ std::string generate_key(const char *pPrefix, const int index) const {
+ char buff[32];
+ sprintf(buff, "%s%d", pPrefix, index);
+ return std::string(buff);
+ }
+
+ void makeRandomObject(SmartObject &obj, const int size,
+ std::string key_path) {
+ int type_id = rand() % 8;
+
+ switch (type_id) {
+ case 0: // int
+ {
+ int iVal = rand();
+ obj = iVal;
+ mVerifyMap[key_path] = to_string(iVal);
+ //std::cout << "Created int, value: " << iVal << std::endl;
+ break;
+ }
+ case 1: // bool
+ {
+ bool bVal = static_cast<bool>(rand() % 2);
+ obj = bVal;
+ mVerifyMap[key_path] = to_string(bVal);
+ //std::cout << "Created bool, value: " << to_string(bVal) << std::endl;
+ break;
+ }
+ case 2: // double
+ {
+ double dVal = 100.0 / (rand() % 200);
+ obj = dVal;
+ mVerifyMap[key_path] = to_string(dVal);
+ //std::cout << "Created double, value: " << dVal << std::endl;
+ break;
+ }
+ case 3: // char
+ {
+ char cVal = get_random_char();
+ obj = cVal;
+ mVerifyMap[key_path] = to_string(cVal);
+ //std::cout << "Created char, value: " << cVal << std::endl;
+ break;
+ }
+ case 4: // string
+ {
+ std::string strVal(rand() % 200, get_random_char());
+ obj = strVal; // string with random char filled random size
+ mVerifyMap[key_path] = strVal;
+ //std::cout << "Created string, value: " << strVal << std::endl;
+ break;
+ }
+ case 5: // map
+ if (size <= 0)
+ break;
+
+ //std::cout << "Creating a map with size: " << size << std::endl;
+ mVerifyMap[key_path] = "map";
+ for (int i = 0; i < size; i++) {
+ std::string key = generate_key("M", i);
+#ifdef NO_INCLUSIVE_MAPS
+ obj[key] = key;
+#else
+ obj[key] = SmartObject();
+ makeRandomObject(obj[key], size - 1, key_path + key + ' '); // recursion
+#endif // MAP_WORKAROUND
+ }
+ break;
+ case 6: // array
+ if (size <= 0)
+ break;
+
+ //std::cout << "Creating an array with size: " << size << std::endl;
+ mVerifyMap[key_path] = "array";
+ for (int i = 0; i < size; i++) {
+ obj[i] = SmartObject(); // just init it as an array
+ makeRandomObject(obj[i], size - 1,
+ key_path + generate_key("A", i) + ' '); // recursion
+ }
+ break;
+ case 7: // binary
+ int dataSize = rand() % 200;
+ char randomChar = get_random_char();
+ std::string strDataVal(dataSize, randomChar);
+ std::string strVal("c:");
+ strVal += strDataVal;
+
+ NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryVal(dataSize,
+ randomChar);
+
+ obj = binaryVal; // string with binary data filled with random chars
+ mVerifyMap[key_path] = strVal;
+ //std::cout << "Created string, value: " << strVal << std::endl;
+ break;
+ }
+ }
+
+ SmartObject get_object(SmartObject &rootObj, const std::string &path) const {
+ std::vector < std::string > obj_tokens;
+ SmartObject lastObj = rootObj;
+
+ obj_tokens = split(path, ' ');
+
+ for (size_t i = 0; i < obj_tokens.size(); i++) {
+ if (obj_tokens[i][0] == 'A') // array
+ {
+ int index = atoi(&(obj_tokens[i].c_str()[1])); // get integer skipping first char
+#ifdef COPY_SUB_OBJECTS_WORKAROUND
+ lastObj = SmartObject(lastObj[index]);
+#else
+ lastObj = lastObj[index]; // go to the child object
+#endif
+ } else if (obj_tokens[i][0] == 'M') // map
+ {
+#ifdef COPY_SUB_OBJECTS_WORKAROUND
+ lastObj = SmartObject(lastObj[obj_tokens[i]]);
+#else
+ lastObj = lastObj[obj_tokens[i]]; // go to the child object
+#endif
+ } else {
+ //FAIL();
+ EXPECT_TRUE(false);
+ }
+ }
+ return lastObj;
+ }
+};
+
+/*
+ * The test creates the initial SmartObject and use it as an array for the next SmartObjects.
+ * Each next SmartObject is randomly assigned to some type.
+ * If one of the object happens to be a container it fills it with SmartObject of random type. The amount of these
+ * objects is the size of the parent container -1.
+ * The iteration continues until all nodes are simple SmartObjects (not arrays or maps)
+ */
+TEST_F(StressTestHelper, StressTest) {
+ SmartObject objects;
+
+ const int size = 11;
+
+ for (int i = 0; i < size; i++) {
+ SmartObject obj;
+
+ makeRandomObject(obj, size - 1, generate_key("A", i) + ' ');
+
+ objects[i] = obj;
+ }
+
+ for (VerificationMap::const_iterator it = mVerifyMap.begin();
+ it != mVerifyMap.end(); it++) {
+ std::string value(it->second);
+ SmartObject obj = get_object(objects, it->first);
+
+ // Binary data check
+ if (!value.compare(0, 2, "c:")) {
+ std::string etalonData = value.substr(2);
+
+ ASSERT_EQ(NsSmartDeviceLink::NsSmartObjects::SmartType_Binary,
+ obj.getType());
+
+ NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData =
+ obj.asBinary();
+ ASSERT_EQ(etalonData.size(), binaryData.size());
+
+ for (size_t i = 0; i < etalonData.size(); ++i) {
+ {
+ std::string etalonData = value.substr(2);
+
+ ASSERT_EQ(NsSmartDeviceLink::NsSmartObjects::SmartType_Binary,
+ obj.getType());
+
+ NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData = obj
+ .asBinary();
+ ASSERT_EQ(etalonData.size(), binaryData.size());
+
+ for (size_t i = 0; i < etalonData.size(); ++i) {
+ ASSERT_EQ(etalonData.at(i), binaryData.at(i));
+ }
+ continue;
+ }
+
+ ASSERT_EQ(etalonData.at(i), binaryData.at(i));
+ }
+ continue;
+ }
+
+#ifdef NO_INCLUSIVE_MAPS
+ if (!value.compare("map"))
+ {
+ std::vector<std::string> path = split(it->first, ' ');
+
+ std::string map_value = path[path.size()-1];
+ ASSERT_EQ(map_value, static_cast<std::string>(obj));
+ continue;
+ }
+#endif
+ if (value.compare("map") && value.compare("array")) {
+ //std::cout << "Verification key: " << it->first << " Value: " << value << std::endl;
+ //std::cout << "Object Value: " << static_cast<std::string>(obj) << std::endl;
+
+ if (!value.compare("true")) {
+ ASSERT_TRUE(obj.asBool());
+ } else if (!value.compare("false")) {
+ ASSERT_FALSE(obj.asBool());
+ } else {
+ ASSERT_EQ(value, obj.asString())<< "Object value is not correct. Object path: " << it->first;
+ }
+ }
+ }
+}
+
+TEST_F(StressTestHelper, ExtraManualDebugTest) {
+ SmartObject obj;
+
+ obj[0] = false;
+ obj[1] = 0.869495;
+ obj[2] = true;
+ obj[3] = 'Q';
+ obj[4] = true;
+ obj[5] = 3.704;
+ obj[6] = SmartObject();
+ obj[6][0] =
+ std::string(
+ "ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt");
+ obj[6][1] = 'K';
+ obj[6][2] = 0.735294;
+ obj[6][3] = 'I';
+ obj[6][4] = SmartObject();
+ obj[6][4]["M0"] = 0.59432;
+ SmartObject & refObj = obj[6][4];
+ refObj["M1"]["M0"]["M0"][0] = true;
+
+ // FIXME: Figure out why there's a trailing zero while converting from double to string
+ ASSERT_EQ("0.59432", get_object(obj, "A6 A4 M0").asString());
+ ASSERT_TRUE(get_object(obj, "A6 A4 M1 M0 M0 A0").asBool());
+}
+
+}
+}
+}
+}
diff --git a/src/components/smart_objects/test/SmartObjectUnit_test.cc b/src/components/smart_objects/test/SmartObjectUnit_test.cc
new file mode 100644
index 000000000..d1d790f9d
--- /dev/null
+++ b/src/components/smart_objects/test/SmartObjectUnit_test.cc
@@ -0,0 +1,584 @@
+/*
+ * 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 "gmock/gmock.h"
+#include "smart_objects/smart_object.h"
+
+namespace test {
+namespace components {
+namespace SmartObjects {
+namespace SmartObjectUnitTest {
+
+using namespace NsSmartDeviceLink::NsSmartObjects;
+
+class TestHelper : public ::testing::Test {
+ protected:
+
+ void makeMapObject(SmartObject& obj, const int size) const {
+ char i_key[8], j_key[8], k_key[8], value[8];
+
+ for (int i = 0; i < size; i++)
+ for (int j = 0; j < size; j++)
+ for (int k = 0; k < size; k++) {
+ sprintf(i_key, "i_%d", i);
+ sprintf(j_key, "j_%d", j);
+ sprintf(k_key, "k_%d", k);
+ sprintf(value, "%d", i + j + k);
+ obj[i_key][j_key][k_key] = value;
+ }
+ }
+
+ void checkMapObject(SmartObject& obj, const int size) const {
+ char i_key[8], j_key[8], k_key[8], value[8];
+
+ for (int i = 0; i < size; i++)
+ for (int j = 0; j < size; j++)
+ for (int k = 0; k < size; k++) {
+ sprintf(i_key, "i_%d", i);
+ sprintf(j_key, "j_%d", j);
+ sprintf(k_key, "k_%d", k);
+ sprintf(value, "%d", i + j + k);
+
+ ASSERT_EQ(std::string(value), obj[i_key][j_key][k_key].asString())<<
+ "Wrong value in the map at [" << i_key << "][" << j_key << "][" << k_key << "]";
+ }
+ }
+
+ void makeArrayObject(SmartObject& obj, int size, int base = 0) {
+ for (int i = 0; i < size; i++)
+ for (int j = 0; j < size; j++)
+ for (int k = 0; k < size; k++) {
+ obj[i][j][k] = base + i + j + k;
+ }
+ }
+
+ void checkArrayObject(SmartObject& obj, int size, int base = 0) {
+ for (int i = 0; i < size; i++)
+ for (int j = 0; j < size; j++)
+ for (int k = 0; k < size; k++) {
+ ASSERT_EQ(base + i + j + k, obj[i][j][k].asInt()) <<
+ "Wrong value in the array at index: " << i << ", " << j << ", " << k;
+ }
+ }
+ };
+
+ /*
+ * Tests different types sequentially
+ */
+TEST(BasicMixtedTypes, test_SmartObjectUnitTest) {
+ SmartObject obj;
+
+ ASSERT_EQ(invalid_int_value, obj.asInt())<< "Wrong cast to int just after construction";
+
+ obj = 10;
+ ASSERT_EQ(10, obj.asInt())<< "Wrong cast to int";
+
+ obj = "some string";
+ ASSERT_EQ("some string", obj.asString())<< "Wrong cast to std::string";
+
+ obj = false;
+ ASSERT_FALSE(obj.asBool())<< "Wrong cast to bool";
+
+ obj = 'A';
+ ASSERT_EQ('A', obj.asChar())<< "Wrong cast to char";
+
+ obj = 3.14;
+ ASSERT_EQ(3.14, obj.asDouble())<< "Wrong cast to double";
+
+ // array test
+ for (int i = 0; i < 100; i++) {
+ obj[i] = i;
+ ASSERT_EQ(i, obj[i].asInt());
+ }
+
+ // map test
+ for (int i = 0; i < 100; i++) {
+ char key[8];
+ sprintf(key, "%d", i);
+ obj[key] = i;
+ ASSERT_EQ(i, obj[key].asInt());
+ }
+}
+
+TEST_F(TestHelper, BasicArrayTest) {
+ SmartObject obj;
+
+ ASSERT_EQ(invalid_int_value,
+ obj[0].asInt())<< "Wrong value at accessing non existent index";
+ ASSERT_EQ(invalid_int_value,
+ obj["non_existent_key"].asInt())<< "Wrong value at accessing non existent key";
+
+ obj[0] = 1;
+ ASSERT_EQ(1, obj[0].asInt())<< "Wrong value at 0 index";
+ obj[1] = 2;
+ ASSERT_EQ(2, obj[1].asInt())<< "Wrong value at 1 index";
+
+ obj[0][0] = 3;
+ obj[1][0] = 1;
+ ASSERT_EQ(3, obj[0][0].asInt())<< "Wrong value at index 0, 0";
+
+ obj[0][0][0] = 4;
+ obj[0][1][0] = 5;
+ ASSERT_EQ(4, obj[0][0][0].asInt())<< "Wrong value at index 0, 0, 0";
+
+ const int size = 32;
+ makeArrayObject(obj, size);
+
+ checkArrayObject(obj, size);
+}
+
+TEST_F(TestHelper, BasicMapTest) {
+ SmartObject obj;
+
+ ASSERT_EQ(invalid_int_value,
+ obj["non_existent_key"].asInt())<< "Wrong value for non existent key";
+
+ obj["abc"]["def"]["ghi"] = 5;
+ ASSERT_EQ(5, obj["abc"]["def"]["ghi"].asInt())<< "Wrong value for triple map";
+
+ obj["123"]["456"]["789"] = "string test";
+
+ ASSERT_EQ("string test", obj["123"]["456"]["789"].asString())<<
+ "Wrong value for triple map";
+
+ const int size = 32;
+
+ makeMapObject(obj, size);
+
+ checkMapObject(obj, size);
+}
+
+TEST(ConstructorsTest, test_SmartObjectUnitTest) {
+ SmartObject objInt(5678);
+ ASSERT_EQ(5678, objInt.asInt())<< "Wrong constructor with int param";
+
+ const char* c_str = "test c_string";
+ SmartObject obj_c_str(c_str);
+ ASSERT_EQ("test c_string", obj_c_str.asString())<< "Wrong constructor with c_str param";
+
+ SmartObject obj_std_str(std::string("test std_string"));
+ ASSERT_EQ(std::string("test std_string"), obj_std_str.asString());
+
+ SmartObject obj_char('R');
+ ASSERT_EQ('R', obj_char.asChar())<< "Wrong constructor with char param";
+
+ SmartObject obj_double(-0.4321);
+ ASSERT_EQ(-0.4321, obj_double.asDouble())<< "Wrong constructor with double param";
+
+ SmartObject obj_bool(true);
+ ASSERT_TRUE(obj_bool.asBool())<< "Wrong constructor with bool param";
+
+ SmartObject src_obj;
+
+ src_obj["key_1"] = "value_1"; // FIXME: String assignment crashes test
+ src_obj["key_2"]["sub_key_1"] = "value_2";
+
+ SmartObject dst_obj(src_obj);
+ ASSERT_EQ("value_1", dst_obj["key_1"].asString())<< "Copy constructor is not correct";
+ ASSERT_EQ("value_2", dst_obj["key_2"]["sub_key_1"].asString())<<
+ "Copy constructor is not correct";
+}
+
+TEST(FromString, TypeConversion) {
+ {
+ // String to bool
+ SmartObject obj;
+ ASSERT_EQ(invalid_bool_value, obj.asBool());
+ obj = "true";
+ ASSERT_EQ(invalid_bool_value, obj.asBool());
+ obj = "false";
+ ASSERT_EQ(invalid_bool_value, obj.asBool());
+ obj = true;
+ ASSERT_TRUE(obj.asBool());
+ }
+ {
+ // String to int
+ SmartObject obj;
+ ASSERT_EQ(invalid_int_value, obj.asInt());
+ obj = "0";
+ ASSERT_EQ(0, obj.asInt());
+ obj = "-34323";
+ ASSERT_EQ(-34323, obj.asInt());
+ obj = "+1234";
+ ASSERT_EQ(1234, obj.asInt());
+ obj = "3232.0";
+ ASSERT_EQ(invalid_int_value, obj.asInt());
+ obj = "123wtf";
+ ASSERT_EQ(invalid_int_value, obj.asInt());
+ obj = "";
+ ASSERT_EQ(invalid_int_value, obj.asInt());
+ obj = " 123 ";
+ ASSERT_EQ(invalid_int_value, obj.asInt());
+ obj = " 123";
+ ASSERT_EQ(123, obj.asInt());
+ }
+ {
+ // String to char
+ SmartObject obj;
+ ASSERT_EQ(invalid_char_value, obj.asChar());
+ obj = "C";
+ ASSERT_EQ('C', obj.asChar());
+ obj = "\n";
+ ASSERT_EQ('\n', obj.asChar());
+ obj = " A";
+ ASSERT_EQ(invalid_char_value, obj.asChar());
+ obj = "";
+ ASSERT_EQ(invalid_char_value, obj.asChar());
+ }
+ {
+ // String to double
+ SmartObject obj;
+ ASSERT_EQ(invalid_double_value, obj.asDouble());
+ obj = "1234";
+ ASSERT_EQ(1234, obj.asDouble());
+ obj = "-0.1234";
+ ASSERT_EQ(-0.1234, obj.asDouble());
+ obj = ".54321";
+ ASSERT_EQ(.54321, obj.asDouble());
+ obj = "123.45.6";
+ ASSERT_EQ(invalid_double_value, obj.asDouble());
+ obj = "123 wtf";
+ ASSERT_EQ(invalid_double_value, obj.asDouble());
+ obj = " 0.5";
+ ASSERT_EQ(0.5, obj.asDouble());
+ }
+ {
+ // String to Map
+ SmartObject obj;
+ ASSERT_EQ(invalid_int_value, obj["key"].asInt());
+ obj = "this is not a map";
+ ASSERT_EQ(invalid_char_value, obj["some_key"].asChar());
+ }
+ {
+ // String to Array
+ SmartObject obj;
+ ASSERT_EQ(invalid_bool_value, obj[0].asBool());
+ obj = "this is not an array";
+ ASSERT_EQ(invalid_double_value, obj[0].asDouble());
+ }
+ {
+ // String to Binary
+ SmartObject obj;
+ ASSERT_EQ(invalid_binary_value, obj.asBinary());
+ obj = "this is not an array";
+ ASSERT_EQ(invalid_binary_value, obj.asBinary());
+ }
+}
+
+TEST(FromBool, TypeConversion) {
+ SmartObject obj;
+
+ obj = true;
+
+ ASSERT_EQ(invalid_string_value, obj.asString());
+ ASSERT_TRUE(obj.asBool());
+ ASSERT_EQ(1, obj.asInt());
+ ASSERT_EQ(invalid_char_value, obj.asChar());
+ ASSERT_EQ(1.0, obj.asDouble());
+ ASSERT_EQ(invalid_int_value, obj["key"].asInt());
+ ASSERT_EQ(invalid_char_value, obj[0].asChar());
+ ASSERT_EQ(invalid_binary_value, obj.asBinary());
+
+ obj = false;
+
+ ASSERT_EQ(invalid_string_value, obj.asString());
+ ASSERT_FALSE(obj.asBool());
+ ASSERT_EQ(0, obj.asBool());
+ ASSERT_EQ(invalid_char_value, obj.asChar());
+ ASSERT_EQ(0, obj.asDouble());
+ ASSERT_EQ(invalid_int_value, obj["key"].asInt());
+ ASSERT_EQ(invalid_char_value, obj[0].asChar());
+ ASSERT_EQ(invalid_binary_value, obj.asBinary());
+}
+
+TEST(FromInt, TypeConversion) {
+ SmartObject obj;
+
+ obj = 123;
+
+ ASSERT_EQ("123", obj.asString());
+ ASSERT_TRUE(obj.asBool());
+ ASSERT_EQ(invalid_char_value, obj.asChar());
+ ASSERT_EQ(123.0, obj.asDouble());
+ ASSERT_EQ(invalid_binary_value, obj.asBinary());
+
+ obj = 5;
+ ASSERT_EQ("5", obj.asString());
+ ASSERT_EQ(invalid_char_value, obj.asChar());
+
+ obj = 0;
+ ASSERT_EQ("0", obj.asString());
+ ASSERT_FALSE(obj.asBool());
+
+ obj = 1;
+ ASSERT_TRUE(obj.asBool());
+
+ obj = -1234;
+ ASSERT_EQ(-1234, obj.asInt());
+ ASSERT_EQ("-1234", obj.asString());
+ ASSERT_EQ(-1234.0, obj.asDouble());
+ ASSERT_EQ(invalid_char_value, obj.asChar());
+ ASSERT_TRUE(obj.asBool());
+ ASSERT_EQ(invalid_binary_value, obj.asBinary());
+}
+
+TEST(FromChar, TypeConversion) {
+ SmartObject obj;
+
+ obj = '1';
+
+ ASSERT_EQ("1", obj.asString());
+ ASSERT_EQ(invalid_int_value, obj.asInt());
+ ASSERT_EQ('1', obj.asChar());
+ ASSERT_EQ(invalid_double_value, obj.asDouble());
+ ASSERT_EQ(invalid_int_value, obj["key"].asInt());
+ ASSERT_EQ(invalid_char_value, obj[0].asChar());
+ ASSERT_EQ(invalid_binary_value, obj.asBinary());
+
+ obj = '0';
+
+ ASSERT_EQ("0", obj.asString());
+ ASSERT_EQ(invalid_int_value, obj.asInt());
+ ASSERT_EQ('0', obj.asChar());
+ ASSERT_EQ(invalid_double_value, obj.asDouble());
+ ASSERT_EQ(invalid_int_value, obj["key"].asInt());
+ ASSERT_EQ(invalid_char_value, obj[0].asChar());
+ ASSERT_EQ(invalid_binary_value, obj.asBinary());
+}
+
+TEST(FromDouble, TypeConversion) {
+ SmartObject obj;
+
+ obj = 0.1;
+ ASSERT_EQ("0.1", obj.asString()); // FIXME: result 0.100000
+ ASSERT_EQ(0, obj.asInt());
+ ASSERT_EQ(invalid_char_value, obj.asChar());
+ ASSERT_EQ(0.1, obj.asDouble());
+ ASSERT_TRUE(obj.asBool());
+ ASSERT_EQ(invalid_binary_value, obj.asBinary());
+
+ obj = 0.9;
+ ASSERT_EQ("0.9", obj.asString());
+ ASSERT_EQ(0, obj.asInt());
+ ASSERT_TRUE(obj.asBool());
+
+ obj = -12323.999;
+ ASSERT_EQ("-12323.999", obj.asString());
+ ASSERT_EQ(-12323, obj.asInt());
+ ASSERT_TRUE(obj.asBool());
+
+ obj = 0.0;
+ ASSERT_EQ("0", obj.asString());
+ ASSERT_EQ(0, obj.asInt());
+ ASSERT_FALSE(obj.asBool());
+ ASSERT_EQ(invalid_binary_value, obj.asBinary());
+}
+
+TEST(FromMap, TypeConversion) {
+ SmartObject obj;
+
+ obj["key1"] = 123;
+
+ ASSERT_EQ(invalid_string_value, obj.asString());
+ ASSERT_EQ(invalid_int_value, obj.asInt());
+ ASSERT_EQ(invalid_char_value, obj.asChar());
+ ASSERT_EQ(invalid_double_value, obj.asDouble());
+ ASSERT_EQ(123, obj["key1"].asInt());
+ ASSERT_EQ(invalid_char_value, obj[0].asChar());
+ ASSERT_EQ(invalid_binary_value, obj.asBinary());
+}
+
+TEST(FromArray, TypeConversion) {
+ SmartObject obj;
+
+ obj[0] = 'A';
+ obj[1] = -123;
+
+ ASSERT_EQ(invalid_string_value, obj.asString());
+ ASSERT_EQ(invalid_int_value, obj.asInt());
+ ASSERT_EQ(invalid_char_value, obj.asChar());
+ ASSERT_EQ(invalid_double_value, obj.asDouble());
+ ASSERT_EQ('A', obj[0].asChar());
+ ASSERT_EQ(invalid_int_value, obj["key1"].asInt());
+ ASSERT_EQ(invalid_binary_value, obj.asBinary());
+}
+
+TEST_F(TestHelper, AssignmentTest) {
+ SmartObject objSrc, objDst;
+
+ objSrc = -6;
+ objDst = 7;
+ objDst = objSrc;
+ ASSERT_EQ(-6, objDst.asInt())<< "Wrong assignment for int object";
+
+ objSrc = "Some test string";
+ objDst = "Other string";
+ objDst = objSrc;
+ ASSERT_EQ("Some test string",
+ objDst.asString())<< "Wrong assignment for std::string object";
+
+ objSrc = 0.5;
+ objDst = 4;
+ objDst = objSrc;
+ ASSERT_EQ(0.5, objDst.asDouble())<< "Wrong assignment for double object";
+
+ objSrc = true;
+ objDst = false;
+ objDst = objSrc;
+ ASSERT_TRUE(objDst.asBool())<< "Wrong assignment for bool object";
+
+ const int size = 32;
+ makeMapObject(objSrc, size);
+ objDst["a"]["b"] = 4;
+ objDst = objSrc;
+ checkMapObject(objDst, size);
+
+ makeArrayObject(objSrc, size, 5);
+ makeArrayObject(objDst, 23, 6);
+ objDst = objSrc;
+ checkArrayObject(objDst, size, 5);
+}
+
+TEST_F(TestHelper, SizeTest) {
+ SmartObject obj;
+
+ ASSERT_EQ(0u, obj.length())<< "Wrong size for the uninitialized object";
+
+ obj = 1234;
+ ASSERT_EQ(0u, obj.length())<< "Wrong size for the int object";
+
+ std::string str("Some test very long string");
+ obj = str;
+ ASSERT_EQ(str.size(), obj.length())<<
+ "The size of the object containing string is not correct";
+
+ obj = true;
+ ASSERT_EQ(0u, obj.length())<< "Wrong size of the true";
+
+ obj = 0.1234;
+ ASSERT_EQ(0u, obj.length())<< "Wrong size of the double";
+
+ obj = 'A';
+ ASSERT_EQ(0u, obj.length())<< "Wrong size of the char";
+
+ makeMapObject(obj, 12);
+ ASSERT_EQ(12u, obj.length())<< "Wrong size of the object containing map";
+
+ makeArrayObject(obj, 21);
+ ASSERT_EQ(21u, obj.length())<< "Wrong size of the object containing array";
+}
+
+TEST(CopyObjectsTest, SmartObjectTest) {
+ SmartObject obj;
+
+ obj[0] = "test string";
+
+ obj = obj[0];
+
+ ASSERT_EQ("test string", obj.asString());
+
+ obj["abc"] = "new test string";
+ obj = obj["abc"];
+
+ ASSERT_EQ("new test string", obj.asString());
+}
+
+TEST(CopyConstructorTest, SmartObjectTest) {
+ SmartObject srcObj;
+
+ srcObj[0] = "test string";
+
+ SmartObject dstObj = srcObj[0];
+
+ ASSERT_EQ("test string", dstObj.asString());
+}
+
+TEST(MapEraseTest, SmartObjectTest) {
+ SmartObject srcObj;
+
+ srcObj["one"] = 1;
+ srcObj["two"] = 2;
+ srcObj["three"] = 3;
+
+ ASSERT_EQ(3u, srcObj.length());
+ ASSERT_EQ(2, srcObj["two"].asInt());
+
+ ASSERT_TRUE(srcObj.erase("two"));
+ ASSERT_FALSE(srcObj.erase("two"));
+
+ ASSERT_EQ(2u, srcObj.length());
+ ASSERT_EQ(-1, srcObj["two"].asInt());
+ // The element "two" was accessed in the previous line so the element has been created
+ ASSERT_EQ(3u, srcObj.length());
+
+ srcObj["two"] = 2;
+
+ ASSERT_EQ(1, srcObj["one"].asInt());
+ ASSERT_EQ(2, srcObj["two"].asInt());
+ ASSERT_EQ(3, srcObj["three"].asInt());
+
+ ASSERT_TRUE(srcObj.erase("one"));
+
+ ASSERT_EQ(2u, srcObj.length());
+
+ ASSERT_TRUE(srcObj.erase("two"));
+
+ ASSERT_EQ(1u, srcObj.length());
+
+ ASSERT_TRUE(srcObj.erase("three"));
+
+ ASSERT_EQ(0u, srcObj.length());
+
+ srcObj["one"]["two"]["three"]["0"] = "1";
+ srcObj["one"]["two"]["three"]["1"] = "2";
+
+ ASSERT_EQ(1u, srcObj.length());
+ ASSERT_EQ(1u, srcObj["one"].length());
+ ASSERT_EQ(1u, srcObj["one"]["two"].length());
+ ASSERT_EQ(2u, srcObj["one"]["two"]["three"].length());
+
+ ASSERT_TRUE(srcObj["one"]["two"]["three"].erase("0"));
+ ASSERT_FALSE(srcObj["one"]["two"]["three"].erase("0"));
+
+ ASSERT_EQ(1u, srcObj["one"]["two"]["three"].length());
+
+ ASSERT_TRUE(srcObj["one"].erase("two"));
+ ASSERT_EQ(0u, srcObj["one"].length());
+
+ srcObj = 1234; // not a map
+ ASSERT_FALSE(srcObj.erase("one"));
+}
+// TODO: Add a test to check accessing an array at strange indexes.
+}// namespace SmartObjectUnitTest
+} // namespace SmartObjects
+} // namespace components
+} // namespace test
diff --git a/src/components/smart_objects/test/StringSchemaItem_test.cc b/src/components/smart_objects/test/StringSchemaItem_test.cc
new file mode 100644
index 000000000..5fe179a7e
--- /dev/null
+++ b/src/components/smart_objects/test/StringSchemaItem_test.cc
@@ -0,0 +1,302 @@
+/*
+ * 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 <string>
+
+#include "gmock/gmock.h"
+
+#include "smart_objects/smart_object.h"
+#include "smart_objects/string_schema_item.h"
+
+namespace test {
+namespace components {
+namespace SmartObjects {
+namespace SchemaItem {
+
+/**
+ * Test StringSchemaItem no default value
+ *
+ * Create SchemaItem without default value. Method setDefaultValue should always return false
+ * and leave SmartObject in previous state.
+ **/
+TEST(test_no_default_value, test_StringSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ SmartObject obj;
+
+ ISchemaItemPtr item = CStringSchemaItem::create(); // No default value, no max length
+
+ //Object - valid string
+ obj = "New valid string";
+ ASSERT_EQ(std::string("New valid string"), obj.asString());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ bool resDefault = item->setDefaultValue(obj);
+ EXPECT_FALSE(resDefault);
+ EXPECT_EQ(std::string("New valid string"), obj.asString());
+
+ //Obj - bool
+ obj = true;
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_FALSE(resDefault);
+ EXPECT_TRUE(obj.asBool());
+
+ //Object - number
+ obj = 3.1415926;
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_FALSE(resDefault);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(3.1415926, obj.asDouble());
+}
+
+/**
+ * Test StringSchemaItem with default value
+ *
+ * Create SchemaItem with default value. Method setDefaultValue should return true,
+ * String SmartObject should contain default value.
+ * Not string SmartObject should converted to StringObject and setted up by the default value.
+ **/
+TEST(test_item_with_default_value, test_StringSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ SmartObject obj;
+
+ ISchemaItemPtr item = CStringSchemaItem::create(
+ TSchemaItemParameter<size_t>(), TSchemaItemParameter<size_t>(),
+ TSchemaItemParameter<std::string>("Default string")); // Default value, no max length
+
+ //Object - valid string
+ obj = "New valid string";
+ ASSERT_EQ(std::string("New valid string"), obj.asString());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ bool resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(std::string("Default string"), obj.asString());
+
+ //Obj - bool
+ obj = true;
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(std::string("Default string"), obj.asString());
+
+ //Object - number
+ obj = 3.1415926;
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(std::string("Default string"), obj.asString());
+}
+
+/**
+ * Test StringSchemaItem with max length
+ **/
+TEST(test_item_with_max_length, test_StringSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ SmartObject obj;
+
+ ISchemaItemPtr item = CStringSchemaItem::create(
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(25),
+ TSchemaItemParameter<std::string>("Default string"));
+
+ //Object - valid string
+ obj = "New valid string";
+ ASSERT_EQ(std::string("New valid string"), obj.asString());
+
+ int resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+ bool resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(std::string("Default string"), obj.asString());
+
+ //Object - too long string
+ obj = "New very very loooooong string";
+ ASSERT_EQ(std::string("New very very loooooong string"), obj.asString());
+
+ resultType = item->validate(obj);
+ 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);
+ EXPECT_EQ(Errors::OK, resultType);
+}
+
+TEST(test_map_validate, test_StringSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ SmartObject obj;
+
+ ISchemaItemPtr item = CStringSchemaItem::create(
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(25),
+ TSchemaItemParameter<std::string>("Default string"));
+
+ obj["str"] = "New valid string";
+ obj["long"] = "New very very loooooong string";
+ obj["bool"] = true;
+ obj["num"] = 3.14;
+
+ int resultType = item->validate(obj["str"]);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ resultType = item->validate(obj["long"]);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ resultType = item->validate(obj["bool"]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ resultType = item->validate(obj["num"]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ bool resDefault = item->setDefaultValue(obj["str"]);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(std::string("Default string"), obj["str"].asString());
+
+ resDefault = item->setDefaultValue(obj["bool"]);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(std::string("Default string"), obj["bool"].asString());
+
+ resDefault = item->setDefaultValue(obj["num"]);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(std::string("Default string"), obj["num"].asString());
+
+ resultType = item->validate(obj["str"]);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ resultType = item->validate(obj["long"]);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ resultType = item->validate(obj["bool"]);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ resultType = item->validate(obj["num"]);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(std::string("Default string"), obj.asString());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+}
+
+TEST(test_array_validate, test_StringSchemaItemTest) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ SmartObject obj;
+
+ ISchemaItemPtr item = CStringSchemaItem::create(
+ TSchemaItemParameter<size_t>(0), TSchemaItemParameter<size_t>(25),
+ TSchemaItemParameter<std::string>("Default string"));
+
+ obj[0] = "New valid string";
+ obj[1] = "New very very loooooong string";
+ obj[2] = true;
+ obj[3] = 3.14;
+ obj[4] = "New valid string";
+
+ int resultType = item->validate(obj[0]);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ resultType = item->validate(obj[1]);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+
+ resultType = item->validate(obj[2]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ resultType = item->validate(obj[3]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ resultType = item->validate(obj[4]);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+
+ bool resDefault = item->setDefaultValue(obj[0]);
+ EXPECT_TRUE(resDefault);
+ resDefault = item->setDefaultValue(obj[2]);
+ EXPECT_TRUE(resDefault);
+ resDefault = item->setDefaultValue(obj[4]);
+ EXPECT_TRUE(resDefault);
+
+ //Set default value for non-initialized element
+ resDefault = item->setDefaultValue(obj[5]);
+ EXPECT_TRUE(resDefault);
+
+ EXPECT_EQ(std::string("Default string"), obj[0].asString());
+ EXPECT_EQ(std::string("Default string"), obj[2].asString());
+ EXPECT_EQ(std::string("Default string"), obj[4].asString());
+ EXPECT_EQ(std::string("Default string"), obj[5].asString());
+
+ resultType = item->validate(obj[0]);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj[1]);
+ EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj[2]);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj[3]);
+ EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[4]);
+ EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj[5]);
+ EXPECT_EQ(Errors::OK, resultType);
+
+ resDefault = item->setDefaultValue(obj);
+ EXPECT_TRUE(resDefault);
+ EXPECT_EQ(std::string("Default string"), obj.asString());
+
+ resultType = item->validate(obj);
+ EXPECT_EQ(Errors::OK, resultType);
+}
+} // namespace SchemaItem
+} // namespace SmartObjects
+} // namespace components
+} // namespace test
diff --git a/src/components/smart_objects/test/map_performance_test.cc b/src/components/smart_objects/test/map_performance_test.cc
new file mode 100644
index 000000000..e7e9ccffa
--- /dev/null
+++ b/src/components/smart_objects/test/map_performance_test.cc
@@ -0,0 +1,75 @@
+/*
+ * 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 <string>
+#include <vector>
+#include <map>
+
+#include "gmock/gmock.h"
+
+typedef std::string Key;
+typedef std::vector<std::string> Value;
+typedef std::map<Key, Value> Map;
+
+namespace {
+void MakeMapObject(Map &obj, const int size) {
+ char i_key[8], j_key[8];
+
+ Value array;
+ for (int i = 0; i < size; i++) {
+ for (int j = 0; j < size; j++) {
+ sprintf(j_key, "j_%d", j);
+ array.push_back(j_key);
+ }
+
+ sprintf(i_key, "i_%d", i);
+ obj[i_key] = array;
+ }
+}
+}
+
+TEST(SmartObjectPerformanceTest, SmartObjectMapPerformance) {
+ Map object;
+ MakeMapObject(object, 100);
+
+ for (Map::const_iterator i = object.begin(); i != object.end(); ++i) {
+ printf("%s - ", i->first.c_str());
+ const Value& value = i->second;
+
+ Value::const_iterator item = std::find(value.begin(), value.end(), "j_9");
+ if (item != value.end()) {
+ printf("%s\n", item->c_str());
+ } else {
+ printf("none...\n");
+ }
+ }
+}
diff --git a/src/components/smart_objects/test/smart_object_performance_test.cc b/src/components/smart_objects/test/smart_object_performance_test.cc
new file mode 100644
index 000000000..72b6c1fa6
--- /dev/null
+++ b/src/components/smart_objects/test/smart_object_performance_test.cc
@@ -0,0 +1,75 @@
+/*
+ * 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 <string>
+#include <set>
+
+#include "gmock/gmock.h"
+
+#include "smart_objects/smart_object.h"
+
+using namespace NsSmartDeviceLink::NsSmartObjects;
+
+namespace {
+void MakeMapObject(SmartObject &obj, const int size) {
+ char i_key[8], j_key[8];
+
+ SmartObject array;
+ for (int i = 0; i < size; i++) {
+ for (int j = 0; j < size; j++) {
+ sprintf(j_key, "j_%d", j);
+ array[-1] = j_key;
+ }
+
+ sprintf(i_key, "i_%d", i);
+ obj[i_key] = array;
+ }
+}
+}
+
+TEST(SmartObjectPerformanceTest, SmartObjectPerformance) {
+ SmartObject object;
+ MakeMapObject(object, 100);
+
+ std::set < std::string > keys = object.enumerate();
+ for (std::set<std::string>::iterator i = keys.begin(); i != keys.end(); ++i) {
+ printf("%s - ", i->c_str());
+ SmartArray* array = object[*i].asArray();
+
+ SmartArray::iterator item = std::find(array->begin(), array->end(), "j_9");
+ if (item != array->end()) {
+ printf("%s\n", item->asString().c_str());
+ } else {
+ printf("none...\n");
+ }
+ }
+}
diff --git a/src/components/test_main.cc b/src/components/test_main.cc
new file mode 100755
index 000000000..a0aee7614
--- /dev/null
+++ b/src/components/test_main.cc
@@ -0,0 +1,10 @@
+#include "gmock/gmock.h"
+#include "utils/logger.h"
+
+int main(int argc, char** argv) {
+ testing::InitGoogleMock(&argc, argv);
+ const int result = RUN_ALL_TESTS();
+ DEINIT_LOGGER();
+ return result;
+}
+
diff --git a/src/components/time_tester/CMakeLists.txt b/src/components/time_tester/CMakeLists.txt
index df84bffb1..24f0fa98e 100644
--- a/src/components/time_tester/CMakeLists.txt
+++ b/src/components/time_tester/CMakeLists.txt
@@ -1,30 +1,69 @@
-include_directories (
- ./include/time_tester
- ../utils/include/
- ../protocol_handler/include/
- ../connection_handler/include/
- ../transport_manager/include/
- ../application_manager/include/
- ../hmi_message_handler/include/
- ../formatters/include/
- ../media_manager/include/
- ../smart_objects/include/
- ../config_profile/include/
+# 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.
+
+
+set(TIME_TESTER_SRC_DIR ${COMPONENTS_DIR}/time_tester/src)
+
+include_directories(
+ include/time_tester
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/protocol_handler/include/
+ ${COMPONENTS_DIR}/connection_handler/include/
+ ${COMPONENTS_DIR}/transport_manager/include/
+ ${COMPONENTS_DIR}/application_manager/include/
+ ${COMPONENTS_DIR}/policy/src/policy/include/
+ ${COMPONENTS_DIR}/hmi_message_handler/include/
+ ${COMPONENTS_DIR}/formatters/include/
+ ${COMPONENTS_DIR}/media_manager/include/
+ ${COMPONENTS_DIR}/smart_objects/include/
+ ${COMPONENTS_DIR}/config_profile/include/
${JSONCPP_INCLUDE_DIRECTORY}
${CMAKE_BINARY_DIR}/src/components/
${LOG4CXX_INCLUDE_DIRECTORY}
)
-set (SOURCES
- ./src/metric_wrapper.cc
- ./src/time_manager.cc
- ./src/application_manager_observer.cc
- ./src/transport_manager_observer.cc
- ./src/protocol_handler_observer.cc
- ./src/application_manager_metric.cc
- ./src/transport_manager_metric.cc
- ./src/protocol_handler_metric.cc
+set(SOURCES
+ ${TIME_TESTER_SRC_DIR}/metric_wrapper.cc
+ ${TIME_TESTER_SRC_DIR}/time_manager.cc
+ ${TIME_TESTER_SRC_DIR}/application_manager_observer.cc
+ ${TIME_TESTER_SRC_DIR}/transport_manager_observer.cc
+ ${TIME_TESTER_SRC_DIR}/protocol_handler_observer.cc
+ ${TIME_TESTER_SRC_DIR}/application_manager_metric.cc
+ ${TIME_TESTER_SRC_DIR}/transport_manager_metric.cc
+ ${TIME_TESTER_SRC_DIR}/protocol_handler_metric.cc
)
add_library("TimeTester" ${SOURCES})
target_link_libraries("TimeTester" ${LIBRARIES})
+add_dependencies("TimeTester" HMI_API MOBILE_API)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/time_tester/include/time_tester/application_manager_observer.h b/src/components/time_tester/include/time_tester/application_manager_observer.h
index 8331682ec..9c224f892 100644
--- a/src/components/time_tester/include/time_tester/application_manager_observer.h
+++ b/src/components/time_tester/include/time_tester/application_manager_observer.h
@@ -1,34 +1,34 @@
/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_APPLICATION_MANAGER_OBSERVER_H_
#define SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_APPLICATION_MANAGER_OBSERVER_H_
diff --git a/src/components/time_tester/include/time_tester/json_keys.h b/src/components/time_tester/include/time_tester/json_keys.h
index d1ace3f9d..532202067 100644
--- a/src/components/time_tester/include/time_tester/json_keys.h
+++ b/src/components/time_tester/include/time_tester/json_keys.h
@@ -1,4 +1,4 @@
-/**
+/*
*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
diff --git a/src/components/time_tester/include/time_tester/protocol_handler_observer.h b/src/components/time_tester/include/time_tester/protocol_handler_observer.h
index 780e9992f..4c962cfc8 100644
--- a/src/components/time_tester/include/time_tester/protocol_handler_observer.h
+++ b/src/components/time_tester/include/time_tester/protocol_handler_observer.h
@@ -1,34 +1,34 @@
/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_PROTOCOL_HANDLER_OBSERVER_H_
#define SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_PROTOCOL_HANDLER_OBSERVER_H_
diff --git a/src/components/time_tester/include/time_tester/time_manager.h b/src/components/time_tester/include/time_tester/time_manager.h
index 66dd97595..dc56d3682 100644
--- a/src/components/time_tester/include/time_tester/time_manager.h
+++ b/src/components/time_tester/include/time_tester/time_manager.h
@@ -1,34 +1,34 @@
/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_TIME_MANAGER_INCLUDE_TIME_MANAGER_MEDIA_MANAGER_H_
#define SRC_COMPONENTS_TIME_MANAGER_INCLUDE_TIME_MANAGER_MEDIA_MANAGER_H_
@@ -50,6 +50,8 @@
namespace time_tester {
+using ::utils::MessageQueue;
+
class TimeManager {
public:
TimeManager();
@@ -64,25 +66,27 @@ class TimeManager {
explicit Streamer(TimeManager* const server);
~Streamer();
void threadMain() OVERRIDE;
- bool exitThreadMain() OVERRIDE;
+ void exitThreadMain() OVERRIDE;
bool IsReady() const;
void Start();
void Stop();
bool Send(const std::string &msg);
- volatile bool is_client_connected_;
- private:
+ void PushMessage(utils::SharedPtr<MetricWrapper> metric);
+ volatile bool is_client_connected_;
+ private:
+ void ShutDownAndCloseSocket(int32_t socket_fd);
TimeManager* const server_;
- int32_t new_socket_fd_;
+ int32_t server_socket_fd_;
+ int32_t client_socket_fd_;
volatile bool stop_flag_;
+ MessageQueue<utils::SharedPtr<MetricWrapper> > messages_;
DISALLOW_COPY_AND_ASSIGN(Streamer);
};
int16_t port_;
std::string ip_;
- int32_t socket_fd_;
bool is_ready_;
threads::Thread* thread_;
- MessageQueue<utils::SharedPtr<MetricWrapper> > messages_;
Streamer* streamer_;
ApplicationManagerObserver app_observer;
TransportManagerObserver tm_observer;
diff --git a/src/components/time_tester/include/time_tester/transport_manager_observer.h b/src/components/time_tester/include/time_tester/transport_manager_observer.h
index ee8388832..bd46ba082 100644
--- a/src/components/time_tester/include/time_tester/transport_manager_observer.h
+++ b/src/components/time_tester/include/time_tester/transport_manager_observer.h
@@ -1,34 +1,34 @@
/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_TRANSPORT_MANAGER_OBSERVER_H_
#define SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_TRANSPORT_MANAGER_OBSERVER_H_
diff --git a/src/components/time_tester/src/application_manager_observer.cc b/src/components/time_tester/src/application_manager_observer.cc
index 67d7268da..c0d87a055 100644
--- a/src/components/time_tester/src/application_manager_observer.cc
+++ b/src/components/time_tester/src/application_manager_observer.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 "application_manager_observer.h"
#include "utils/shared_ptr.h"
#include "time_manager.h"
diff --git a/src/components/time_tester/src/time_manager.cc b/src/components/time_tester/src/time_manager.cc
index 6cabe3ad1..db389dbda 100644
--- a/src/components/time_tester/src/time_manager.cc
+++ b/src/components/time_tester/src/time_manager.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 "time_manager.h"
@@ -50,50 +50,44 @@ namespace time_tester {
CREATE_LOGGERPTR_GLOBAL(logger_, "TimeManager")
TimeManager::TimeManager():
- socket_fd_(0),
thread_(NULL),
- messages_(),
streamer_(NULL),
app_observer(this),
tm_observer(this),
ph_observer(this) {
ip_ = profile::Profile::instance()->server_address();
port_ = profile::Profile::instance()->time_testing_port();
+ streamer_ = new Streamer(this);
+ thread_ = threads::CreateThread("TimeManager", streamer_ );
}
TimeManager::~TimeManager() {
- LOG4CXX_INFO(logger_, "Destroing TimeManager");
Stop();
}
void TimeManager::Init(protocol_handler::ProtocolHandlerImpl* ph) {
+ LOG4CXX_AUTO_TRACE(logger_);
DCHECK(ph);
- if (!thread_) {
- streamer_ = new Streamer(this);
- thread_ = threads::CreateThread("TimeManager", streamer_ );
- application_manager::ApplicationManagerImpl::instance()->SetTimeMetricObserver(&app_observer);
- transport_manager::TransportManagerDefault::instance()->SetTimeMetricObserver(&tm_observer);
- ph->SetTimeMetricObserver(&ph_observer);
- thread_->startWithOptions(threads::ThreadOptions());
- LOG4CXX_INFO(logger_, "Create and start sending thread");
- }
+ if (!ph) {
+ LOG4CXX_DEBUG(logger_, "ProtocolHandler poiner is NULL");
+ return;
+ }
+
+ application_manager::ApplicationManagerImpl::instance()->SetTimeMetricObserver(&app_observer);
+ transport_manager::TransportManagerDefault::instance()->SetTimeMetricObserver(&tm_observer);
+ ph->SetTimeMetricObserver(&ph_observer);
+ thread_->start(threads::ThreadOptions());
}
void TimeManager::Stop() {
- if (thread_) {
- thread_->stop();
- thread_ = NULL;
- if (socket_fd_ != -1) {
- ::close(socket_fd_);
- }
- }
- messages_.Reset();
- LOG4CXX_INFO(logger_, "TimeManager stopped");
+ LOG4CXX_AUTO_TRACE(logger_);
+ threads::DeleteThread(thread_);
+ thread_ = NULL;
}
void TimeManager::SendMetric(utils::SharedPtr<MetricWrapper> metric) {
if ((NULL != streamer_ )&& streamer_->is_client_connected_) {
- messages_.push(metric);
+ streamer_->PushMessage(metric);
}
}
@@ -101,7 +95,8 @@ TimeManager::Streamer::Streamer(
TimeManager* const server)
: is_client_connected_(false),
server_(server),
- new_socket_fd_(0),
+ server_socket_fd_(0),
+ client_socket_fd_(0),
stop_flag_(false) {
}
@@ -110,54 +105,55 @@ TimeManager::Streamer::~Streamer() {
}
void TimeManager::Streamer::threadMain() {
- LOG4CXX_INFO(logger_, "Streamer::threadMain");
+ LOG4CXX_AUTO_TRACE(logger_);
Start();
-
while (!stop_flag_) {
- new_socket_fd_ = accept(server_->socket_fd_, NULL, NULL);
- if (0 > new_socket_fd_) {
+ LOG4CXX_INFO(logger_, "Server socket is listening ");
+ client_socket_fd_ = accept(server_socket_fd_, NULL, NULL);
+ if (0 > client_socket_fd_) {
LOG4CXX_ERROR(logger_, "Cant open socket . Socket is busy ");
Stop();
break;
}
+ LOG4CXX_INFO(logger_, "Client connected");
is_client_connected_ = true;
while (is_client_connected_) {
- while (!server_->messages_.empty()) {
- utils::SharedPtr<MetricWrapper> metric = server_->messages_.pop();
+ while (!messages_.empty()) {
+ utils::SharedPtr<MetricWrapper> metric = messages_.pop();
is_client_connected_ = Send(metric->GetStyledString());
}
if (!IsReady()) {
LOG4CXX_INFO(logger_, "Client disconnected.");
- Stop();
break;
}
- server_->messages_.wait();
+ messages_.wait();
}
}
}
-bool TimeManager::Streamer::exitThreadMain() {
- LOG4CXX_INFO(logger_, "Streamer::exitThreadMain");
- stop_flag_ = true;
+void TimeManager::Streamer::exitThreadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
Stop();
- server_->messages_.Shutdown();
- return false;
+ messages_.Shutdown();
}
void TimeManager::Streamer::Start() {
- server_->socket_fd_ = socket(AF_INET, SOCK_STREAM, 0);
+ LOG4CXX_AUTO_TRACE(logger_);
+ server_socket_fd_ = socket(AF_INET, SOCK_STREAM, 0);
- if (0 >= server_->socket_fd_) {
+ if (0 >= server_socket_fd_) {
LOG4CXX_ERROR_EXT(logger_, "Server open error");
return;
+ } else {
+ LOG4CXX_DEBUG(logger_, "Server socket : " << server_socket_fd_);
}
int32_t optval = 1;
- if (-1 == setsockopt(server_->socket_fd_, SOL_SOCKET, SO_REUSEADDR,
+ if (-1 == setsockopt(server_socket_fd_, SOL_SOCKET, SO_REUSEADDR,
&optval, sizeof optval)) {
LOG4CXX_ERROR_EXT(logger_, "Unable to set sockopt");
return;
@@ -168,37 +164,49 @@ void TimeManager::Streamer::Start() {
serv_addr_.sin_family = AF_INET;
serv_addr_.sin_port = htons(server_->port_);
- if (-1 == bind(server_->socket_fd_,
+ if (-1 == bind(server_socket_fd_,
reinterpret_cast<struct sockaddr*>(&serv_addr_),
sizeof(serv_addr_))) {
LOG4CXX_ERROR(logger_, "Unable to bind server "
<< server_->ip_.c_str() << ':' << server_->port_);
return;
}
- if (-1 == listen(server_->socket_fd_, 1)) {
+ if (-1 == listen(server_socket_fd_, 1)) {
LOG4CXX_ERROR(logger_, "Streamer listen error " << strerror(errno) );
return;
}
- LOG4CXX_INFO(logger_, "Streamer is listetning for connections");
}
-void TimeManager::Streamer::Stop() {
- LOG4CXX_INFO(logger_, "SocketStreamerAdapter::Streamer::stop");
- if (!new_socket_fd_) {
- return;
- }
-
- if (-1 == shutdown(new_socket_fd_, SHUT_RDWR)) {
- LOG4CXX_ERROR(logger_, "Unable to shutdown socket");
- return;
+void TimeManager::Streamer::ShutDownAndCloseSocket(int32_t socket_fd) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (0 < socket_fd){
+ LOG4CXX_INFO(logger_, "Shutdown socket");
+ if (-1 == ::shutdown(socket_fd, SHUT_RDWR)) {
+ LOG4CXX_ERROR(logger_, "Unable to shutdown socket");
+ }
+ if (-1 == close(socket_fd)) {
+ LOG4CXX_ERROR(logger_, "Unable to close socket");
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Socket in not connected: " << socket_fd);
}
+}
- if (-1 == close(new_socket_fd_)) {
- LOG4CXX_ERROR(logger_, "Unable to close socket");
+void TimeManager::Streamer::Stop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (stop_flag_) {
+ LOG4CXX_WARN(logger_, "Already Stopped");
return;
}
+ stop_flag_ = true;
+ messages_.Reset();
+ LOG4CXX_WARN(logger_, "Stop server_socket_fd_");
+ ShutDownAndCloseSocket(server_socket_fd_);
+ server_socket_fd_ = -1;
- new_socket_fd_ = -1;
+ LOG4CXX_WARN(logger_, "Stop client_socket_fd_");
+ ShutDownAndCloseSocket(client_socket_fd_);
+ client_socket_fd_ = -1;
is_client_connected_ = false;
}
@@ -206,12 +214,12 @@ bool TimeManager::Streamer::IsReady() const {
bool result = true;
fd_set fds;
FD_ZERO(&fds);
- FD_SET(new_socket_fd_, &fds);
- TimevalStruct tv;
+ FD_SET(client_socket_fd_, &fds);
+ TimevalStruct tv = {0, 0};
tv.tv_sec = 5; // set a 5 second timeout
tv.tv_usec = 0;
- const int retval = select(new_socket_fd_ + 1, 0, &fds, 0, &tv);
+ const int retval = select(client_socket_fd_ + 1, 0, &fds, 0, &tv);
if (-1 == retval) {
LOG4CXX_ERROR_EXT(logger_, "An error occurred");
@@ -225,16 +233,21 @@ bool TimeManager::Streamer::IsReady() const {
}
bool TimeManager::Streamer::Send(const std::string& msg) {
+ LOG4CXX_AUTO_TRACE(logger_);
if (!IsReady()) {
LOG4CXX_ERROR_EXT(logger_, " Socket is not ready");
return false;
}
- if (-1 == ::send(new_socket_fd_, msg.c_str(),
+ if (-1 == ::send(client_socket_fd_, msg.c_str(),
msg.size(), MSG_NOSIGNAL)) {
LOG4CXX_ERROR_EXT(logger_, " Unable to send");
return false;
}
return true;
}
+
+void TimeManager::Streamer::PushMessage(utils::SharedPtr<MetricWrapper> metric) {
+ messages_.push(metric);
+}
} // namespace time_tester
diff --git a/src/components/time_tester/src/transport_manager_observer.cc b/src/components/time_tester/src/transport_manager_observer.cc
index 41cb30126..6c63a576e 100644
--- a/src/components/time_tester/src/transport_manager_observer.cc
+++ b/src/components/time_tester/src/transport_manager_observer.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 "transport_manager_observer.h"
#include <time.h>
diff --git a/src/components/time_tester/test/CMakeLists.txt b/src/components/time_tester/test/CMakeLists.txt
new file mode 100644
index 000000000..006f6a430
--- /dev/null
+++ b/src/components/time_tester/test/CMakeLists.txt
@@ -0,0 +1,93 @@
+# 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.
+
+if(BUILD_TESTS)
+
+include_directories (
+ ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/include
+ ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/gtest/include
+ ${COMPONENTS_DIR}/include/utils
+ ${COMPONENTS_DIR}/include/protocol_handler
+ ${COMPONENTS_DIR}/time_tester/include
+ ${COMPONENTS_DIR}/utils/include
+ ${COMPONENTS_DIR}/protocol_handler/include
+ ${COMPONENTS_DIR}/application_manager/include
+ ${COMPONENTS_DIR}/protocol_handler/test
+ )
+
+
+set(testSources
+ #metric_wrapper_test.cc
+ #time_manager_test.cc
+ #protocol_handler_metric_test.cc
+ protocol_handler_observer_test.cc
+ #transport_manager_metric_test.cc
+ transport_manager_observer_test.cc
+ #application_manager_metric_test.cc
+ application_manager_observer_test.cc
+)
+
+set(testLibraries
+ gmock
+ TimeTester
+ jsoncpp
+ Utils
+ MediaManager
+ ProtocolHandler
+ v4_protocol_v1_2_no_extra
+ SmartObjects
+ ProtocolLibrary
+ ConfigProfile
+ connectionHandler
+ ApplicationManager
+ Resumption
+ jsoncpp
+ transport_manager
+ MediaManager
+ ProtocolHandler
+)
+
+if (BUILD_USB_SUPPORT)
+ list(APPEND testLibraries Libusb-1.0.16)
+endif()
+
+if (BUILD_BT_SUPPORT)
+ list(APPEND testLibraries bluetooth)
+endif()
+
+if (BUILD_AVAHI_SUPPORT)
+ list(APPEND testLibraries avahi-client avahi-common)
+endif()
+
+file(COPY log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+
+create_test("time_tester_test" "${testSources}" "${testLibraries}")
+
+endif()
diff --git a/src/components/time_tester/test/application_manager_metric_test.cc b/src/components/time_tester/test/application_manager_metric_test.cc
new file mode 100644
index 000000000..7d09cc85c
--- /dev/null
+++ b/src/components/time_tester/test/application_manager_metric_test.cc
@@ -0,0 +1,118 @@
+/*
+ * 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 "json_keys.h"
+#include "utils/resource_usage.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager_metric.h"
+
+namespace test {
+namespace components {
+namespace time_tester_test {
+
+using namespace ::time_tester;
+
+TEST(ApplicationManagerMetricWrapper, grabResources) {
+ ApplicationManagerMetricWrapper metric_test;
+ EXPECT_TRUE(metric_test.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::AMMetricObserver::MessageMetric();
+ metric_test.message_metric->begin = start_time;
+ metric_test.message_metric->end = end_time;
+ NsSmartDeviceLink::NsSmartObjects::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);
+ Json::Value jvalue = metric_test.GetJsonMetric();
+
+ EXPECT_EQ("null\n", jvalue[time_tester::strings::stime].toStyledString());
+ EXPECT_EQ("null\n", jvalue[time_tester::strings::utime].toStyledString());
+ EXPECT_EQ("null\n", jvalue[time_tester::strings::memory].toStyledString());
+
+ EXPECT_EQ(date_time::DateTime::getuSecs(start_time), jvalue[time_tester::strings::begin].asInt64());
+ EXPECT_EQ(date_time::DateTime::getuSecs(end_time), jvalue[time_tester::strings::end].asInt64());
+ EXPECT_EQ(obj["params"][application_manager::strings::correlation_id].asInt(), jvalue[time_tester::strings::correlation_id].asInt64());
+ EXPECT_EQ(obj["params"][application_manager::strings::connection_key].asInt(), jvalue[time_tester::strings::connection_key].asInt());
+}
+
+TEST(ApplicationManagerMetricWrapper, GetJsonMetricWithGrabResources) {
+ ApplicationManagerMetricWrapper metric_test;
+ utils::ResourseUsage* resources = utils::Resources::getCurrentResourseUsage();
+ EXPECT_TRUE(metric_test.grabResources());
+
+ 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::AMMetricObserver::MessageMetric();
+ metric_test.message_metric->begin = start_time;
+ metric_test.message_metric->end = end_time;
+ NsSmartDeviceLink::NsSmartObjects::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);
+ Json::Value jvalue = metric_test.GetJsonMetric();
+
+ EXPECT_EQ(date_time::DateTime::getuSecs(start_time), jvalue[time_tester::strings::begin].asInt64());
+ EXPECT_EQ(date_time::DateTime::getuSecs(end_time), jvalue[time_tester::strings::end].asInt64());
+ EXPECT_EQ(obj["params"][application_manager::strings::correlation_id].asInt(), jvalue[time_tester::strings::correlation_id].asInt64());
+ EXPECT_EQ(obj["params"][application_manager::strings::connection_key].asInt(), jvalue[time_tester::strings::connection_key].asInt());
+
+ EXPECT_EQ(date_time::DateTime::getuSecs(start_time), jvalue[time_tester::strings::begin].asInt64());
+ EXPECT_EQ(date_time::DateTime::getuSecs(end_time), jvalue[time_tester::strings::end].asInt64());
+
+ EXPECT_NEAR(resources->stime, jvalue[time_tester::strings::stime].asInt(),1);
+ EXPECT_NEAR(resources->utime, jvalue[time_tester::strings::utime].asInt(),1);
+ EXPECT_EQ(resources->memory, jvalue[time_tester::strings::memory].asInt());
+
+ delete resources;
+}
+
+} // namespace time_tester
+} // namespace components
+} // namespace test
diff --git a/src/components/time_tester/test/application_manager_observer_test.cc b/src/components/time_tester/test/application_manager_observer_test.cc
new file mode 100644
index 000000000..f63394e4f
--- /dev/null
+++ b/src/components/time_tester/test/application_manager_observer_test.cc
@@ -0,0 +1,59 @@
+/*
+ * 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 "include/time_manager_mock.h"
+#include "application_manager/time_metric_observer.h"
+#include "application_manager_metric.h"
+#include "application_manager_observer.h"
+#include "utils/shared_ptr.h"
+#include "time_manager.h"
+
+namespace test {
+namespace components {
+namespace time_tester_test {
+
+using namespace time_tester;
+using ::testing::_;
+
+TEST(ApplicationManagerObserver, DISABLED_CallOnMessage) {
+ TimeManagerMock time_manager_mock;
+ ApplicationManagerObserver app_observer(&time_manager_mock);
+ typedef application_manager::AMMetricObserver::MessageMetric AMMetric;
+ utils::SharedPtr<AMMetric> ptr = application_manager::AMMetricObserver::MessageMetricSharedPtr();
+ EXPECT_CALL(time_manager_mock, SendMetric(_));
+ app_observer.OnMessage(ptr);
+}
+
+} // namespace time_tester
+} // namespace components
+} // namespace test
diff --git a/src/components/time_tester/test/include/time_manager_mock.h b/src/components/time_tester/test/include/time_manager_mock.h
new file mode 100644
index 000000000..dfdfa2da7
--- /dev/null
+++ b/src/components/time_tester/test/include/time_manager_mock.h
@@ -0,0 +1,57 @@
+/*
+ * 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 TEST_COMPONENTS_TIME_MANAGER_INCLUDE_TIME_MANAGER_MOCK_H_
+#define TEST_COMPONENTS_TIME_MANAGER_INCLUDE_TIME_MANAGER_MOCK_H_
+
+#include <gmock/gmock.h>
+#include "time_manager.h"
+#include "metric_wrapper.h"
+namespace test {
+namespace components {
+namespace time_tester_test {
+
+using namespace time_tester;
+/*
+ * MOCK implementation of ::security_manager::SecurityManager
+ */
+class TimeManagerMock : public time_tester::TimeManager {
+ public:
+ MOCK_METHOD1(Init, void(protocol_handler::ProtocolHandlerImpl* ph));
+ MOCK_METHOD0(Stop, void());
+ MOCK_METHOD0(Start, void());
+ MOCK_METHOD1(SendMetric, void(utils::SharedPtr<MetricWrapper> metric));
+};
+} // time_tester_test
+} // components
+} // test
+#endif // TEST_COMPONENTS_TIME_MANAGER_INCLUDE_TIME_MANAGER_MOCK_H_
diff --git a/src/components/time_tester/test/log4cxx.properties b/src/components/time_tester/test/log4cxx.properties
new file mode 100644
index 000000000..68adbfa7f
--- /dev/null
+++ b/src/components/time_tester/test/log4cxx.properties
@@ -0,0 +1,19 @@
+# Only ERROR and FATAL messages are logged to console
+log4j.appender.Console=org.apache.log4j.ConsoleAppender
+log4j.appender.Console.ImmediateFlush=true
+log4j.appender.Console.layout=org.apache.log4j.PatternLayout
+log4j.appender.Console.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %m%n
+log4j.appender.Console.Threshold=DEBUG
+
+# Log for all SmartDeviceLinkCore messages
+log4j.appender.SmartDeviceLinkCoreLogFile=org.apache.log4j.FileAppender
+log4j.appender.SmartDeviceLinkCoreLogFile.File=SmartDeviceLinkCore.log
+log4j.appender.SmartDeviceLinkCoreLogFile.append=true
+log4j.appender.SmartDeviceLinkCoreLogFile.DatePattern='.' yyyy-MM-dd HH-mm
+log4j.appender.SmartDeviceLinkCoreLogFile.ImmediateFlush=true
+log4j.appender.SmartDeviceLinkCoreLogFile.layout=org.apache.log4j.PatternLayout
+log4j.appender.SmartDeviceLinkCoreLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %F:%L %M: %m%n
+
+
+# All SmartDeviceLinkCore logs
+log4j.rootLogger=ALL, Console, SmartDeviceLinkCoreLogFile
diff --git a/src/components/time_tester/test/metric_wrapper_test.cc b/src/components/time_tester/test/metric_wrapper_test.cc
new file mode 100644
index 000000000..5eddf0fb6
--- /dev/null
+++ b/src/components/time_tester/test/metric_wrapper_test.cc
@@ -0,0 +1,82 @@
+/*
+ * 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 "metric_wrapper.h"
+#include "json_keys.h"
+#include "json/json.h"
+#include "utils/resource_usage.h"
+
+namespace test {
+namespace components {
+namespace time_tester_test {
+
+using namespace ::time_tester;
+
+TEST(MetricWrapper, grabResources) {
+ MetricWrapper metric_test;
+ EXPECT_TRUE(metric_test.grabResources());
+}
+
+TEST(MetricWrapper, GetJsonMetricWithoutGrab) {
+ MetricWrapper metric_test;
+ Json::Value jvalue = metric_test.GetJsonMetric();
+
+ EXPECT_EQ("null\n", jvalue[strings::stime].toStyledString());
+ EXPECT_EQ("null\n", jvalue[strings::utime].toStyledString());
+ EXPECT_EQ("null\n", jvalue[strings::memory].toStyledString());
+}
+
+TEST(MetricWrapper, GetJsonMetricWithGrabResources) {
+ MetricWrapper metric_test;
+ utils::ResourseUsage* resources = utils::Resources::getCurrentResourseUsage();
+ EXPECT_TRUE(resources != NULL);
+ EXPECT_TRUE(metric_test.grabResources());
+ Json::Value jvalue = metric_test.GetJsonMetric();
+
+ EXPECT_TRUE(jvalue[strings::stime].isInt());
+ EXPECT_TRUE(jvalue[strings::utime].isInt());
+ EXPECT_TRUE(jvalue[strings::memory].isInt());
+ EXPECT_NE("null/n", jvalue[strings::stime].toStyledString());
+ EXPECT_NE("null/n", jvalue[strings::utime].toStyledString());
+ EXPECT_NE("null/n", jvalue[strings::memory].toStyledString());
+
+ EXPECT_NEAR(resources->stime, jvalue[strings::stime].asInt(),1);
+ EXPECT_NEAR(resources->utime, jvalue[strings::utime].asInt(),1);
+ EXPECT_EQ(resources->memory, jvalue[strings::memory].asInt());
+
+ delete resources;
+}
+
+} // namespace time_tester
+} // namespace components
+} // namespace test
diff --git a/src/components/time_tester/test/protocol_handler_metric_test.cc b/src/components/time_tester/test/protocol_handler_metric_test.cc
new file mode 100644
index 000000000..150e1205f
--- /dev/null
+++ b/src/components/time_tester/test/protocol_handler_metric_test.cc
@@ -0,0 +1,119 @@
+/*
+ * 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 "json_keys.h"
+#include "json/json.h"
+#include "utils/resource_usage.h"
+#include "protocol_handler_metric.h"
+#include "protocol_handler/time_metric_observer.h"
+
+namespace test {
+namespace components {
+namespace time_tester_test {
+
+using namespace ::time_tester;
+
+TEST(ProtocolHandlerMetricTest, grabResources) {
+ ProtocolHandlerMecticWrapper metric_test;
+ EXPECT_TRUE(metric_test.grabResources());
+}
+
+TEST(ProtocolHandlerMetricTest, GetJsonMetric) {
+ ProtocolHandlerMecticWrapper 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 protocol_handler::PHMetricObserver::MessageMetric();
+ metric_test.message_metric->begin = start_time;
+ metric_test.message_metric->end = end_time;
+ metric_test.message_metric->message_id = 5;
+ metric_test.message_metric->connection_key = 2;
+ Json::Value jvalue = metric_test.GetJsonMetric();
+
+ EXPECT_EQ("\"ProtocolHandler\"\n", jvalue[strings::logger].toStyledString());
+ EXPECT_EQ("null\n", jvalue[strings::stime].toStyledString());
+ 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(5, jvalue[strings::message_id].asInt64());
+ EXPECT_EQ(2, jvalue[strings::connection_key].asInt());
+}
+
+TEST(ProtocolHandlerMetricTest, GetJsonMetricWithGrabResources) {
+ ProtocolHandlerMecticWrapper metric_test;
+ utils::ResourseUsage* resources = utils::Resources::getCurrentResourseUsage();
+ EXPECT_TRUE(resources != NULL);
+ EXPECT_TRUE(metric_test.grabResources());
+
+ 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 protocol_handler::PHMetricObserver::MessageMetric();
+ metric_test.message_metric->begin = start_time;
+ metric_test.message_metric->end = end_time;
+ metric_test.message_metric->message_id = 5;
+ metric_test.message_metric->connection_key = 2;
+ Json::Value jvalue = metric_test.GetJsonMetric();
+
+ EXPECT_TRUE(jvalue[strings::stime].isInt());
+ EXPECT_TRUE(jvalue[strings::utime].isInt());
+ EXPECT_TRUE(jvalue[strings::memory].isInt());
+ EXPECT_NE("null/n", jvalue[strings::stime].toStyledString());
+ 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(5, jvalue[strings::message_id].asInt64());
+ EXPECT_EQ(2, jvalue[strings::connection_key].asInt());
+
+ EXPECT_NEAR(resources->stime, jvalue[strings::stime].asInt(),1);
+ EXPECT_NEAR(resources->utime, jvalue[strings::utime].asInt(),1);
+ EXPECT_EQ(resources->memory, jvalue[strings::memory].asInt());
+ delete resources;
+}
+
+} // namespace time_tester
+} // namespace components
+} // namespace test
diff --git a/src/components/time_tester/test/protocol_handler_observer_test.cc b/src/components/time_tester/test/protocol_handler_observer_test.cc
new file mode 100644
index 000000000..8922334ae
--- /dev/null
+++ b/src/components/time_tester/test/protocol_handler_observer_test.cc
@@ -0,0 +1,81 @@
+/*
+ * 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 "time_manager.h"
+#include "include/time_manager_mock.h"
+#include "protocol_handler/time_metric_observer.h"
+
+namespace test {
+namespace components {
+namespace time_tester_test {
+
+using namespace time_tester;
+using ::testing::_;
+
+TEST(ProtocolHandlerObserverTest, DISABLED_MessageProcess) {
+ TimeManagerMock time_manager_mock;
+
+ ProtocolHandlerObserver pr_handler(&time_manager_mock);
+ uint32_t message_id = 1;
+ TimevalStruct start_time;
+ start_time.tv_sec = 1;
+ start_time.tv_usec = 0;
+ pr_handler.StartMessageProcess(message_id, start_time);
+
+ typedef protocol_handler::PHMetricObserver::MessageMetric MetricType;
+ utils::SharedPtr<MetricType> message_metric = new MetricType();
+ message_metric->message_id = 1;
+ EXPECT_CALL(time_manager_mock, SendMetric(_));
+ pr_handler.EndMessageProcess(message_metric);
+}
+
+TEST(ProtocolHandlerObserverTest, MessageProcessWithZeroMessageId) {
+ TimeManagerMock time_manager_mock;
+
+ ProtocolHandlerObserver pr_handler(&time_manager_mock);
+ uint32_t message_id = 0;
+ TimevalStruct start_time;
+ start_time.tv_sec = 1;
+ start_time.tv_usec = 0;
+ pr_handler.StartMessageProcess(message_id, start_time);
+
+ typedef protocol_handler::PHMetricObserver::MessageMetric MetricType;
+ utils::SharedPtr<MetricType> message_metric = new MetricType();
+ message_metric->message_id = 0;
+ EXPECT_CALL(time_manager_mock, SendMetric(_)).Times(0);
+ pr_handler.EndMessageProcess(message_metric);
+}
+
+} // namespace time_tester
+} // namespace components
+} // namespace test
diff --git a/src/components/time_tester/test/time_manager_test.cc b/src/components/time_tester/test/time_manager_test.cc
new file mode 100644
index 000000000..60f3bd681
--- /dev/null
+++ b/src/components/time_tester/test/time_manager_test.cc
@@ -0,0 +1,72 @@
+/*
+ * 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 "gmock/gmock.h"
+#include "time_manager.h"
+#include "protocol_handler/time_metric_observer.h"
+#include "protocol_handler.h"
+#include "include/protocol_handler_mock.h"
+
+namespace test {
+namespace components {
+namespace time_tester_test {
+
+using namespace time_tester;
+
+class StreamerMock : public Streamer {
+ public:
+ StreamerMock(TimeManager* const server)
+ : Streamer(server) {
+ is_client_connected_ = true;
+ }
+ MOCK_METHOD1(PushMessage,void(utils::SharedPtr<MetricWrapper> metric));
+};
+
+TEST(TimeManagerTest, DISABLED_MessageProcess) {
+ //TODO(AK) APPLINK-13351 Disable due to refactor TimeTester
+ protocol_handler_test::TransportManagerMock transport_manager_mock;
+ protocol_handler::ProtocolHandlerImpl protocol_handler_mock(&transport_manager_mock, 0, 0, 0, 0, 0);
+ TimeManager * time_manager = new TimeManager();
+ // Streamer will be deleted by Thread
+ StreamerMock* streamer_mock = new StreamerMock(time_manager);
+ time_manager->set_streamer(streamer_mock);
+ time_manager->Init(&protocol_handler_mock);
+ utils::SharedPtr<MetricWrapper> test_metric;
+ EXPECT_CALL(*streamer_mock, PushMessage(test_metric));
+ time_manager->SendMetric(test_metric);
+ delete time_manager;
+}
+
+} // namespace time_tester
+} // namespace components
+} // namespace test
diff --git a/src/components/time_tester/test/transport_manager_metric_test.cc b/src/components/time_tester/test/transport_manager_metric_test.cc
new file mode 100644
index 000000000..2bb09416e
--- /dev/null
+++ b/src/components/time_tester/test/transport_manager_metric_test.cc
@@ -0,0 +1,110 @@
+/*
+ * 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 "json_keys.h"
+#include "json/json.h"
+#include "utils/resource_usage.h"
+#include "transport_manager_metric.h"
+#include "protocol_handler/time_metric_observer.h"
+
+namespace test {
+namespace components {
+namespace time_tester_test {
+
+using namespace ::time_tester;
+
+TEST(TransportManagerMetricWrapper, grabResources) {
+ TransportManagerMecticWrapper metric_test;
+ EXPECT_TRUE(metric_test.grabResources());
+}
+
+TEST(TransportManagerMetricWrapper, GetJsonMetric) {
+ TransportManagerMecticWrapper 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 transport_manager::TMMetricObserver::MessageMetric();
+ metric_test.message_metric->begin = start_time;
+ metric_test.message_metric->end = end_time;
+ metric_test.message_metric->data_size = 1000;
+ Json::Value jvalue = metric_test.GetJsonMetric();
+
+ EXPECT_EQ("null\n", jvalue[strings::stime].toStyledString());
+ 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(1000, jvalue[strings::data_size].asInt());
+}
+
+TEST(TransportManagerMetricWrapper, GetJsonMetricWithGrabResources) {
+ TransportManagerMecticWrapper metric_test;
+ utils::ResourseUsage* resources = utils::Resources::getCurrentResourseUsage();
+ EXPECT_TRUE(resources != NULL);
+ EXPECT_TRUE(metric_test.grabResources());
+
+ 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 transport_manager::TMMetricObserver::MessageMetric();
+ metric_test.message_metric->begin = start_time;
+ metric_test.message_metric->end = end_time;
+
+ metric_test.message_metric->data_size = 1000;
+ 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(1000, jvalue[strings::data_size].asInt());
+
+ EXPECT_NEAR(resources->stime, jvalue[strings::stime].asInt(),1);
+ EXPECT_NEAR(resources->utime, jvalue[strings::utime].asInt(),1);
+ EXPECT_EQ(resources->memory, jvalue[strings::memory].asInt());
+
+ delete resources;
+}
+
+} // namespace time_tester
+} // namespace components
+} // namespace test
diff --git a/src/components/time_tester/test/transport_manager_observer_test.cc b/src/components/time_tester/test/transport_manager_observer_test.cc
new file mode 100644
index 000000000..9dcf27bd9
--- /dev/null
+++ b/src/components/time_tester/test/transport_manager_observer_test.cc
@@ -0,0 +1,58 @@
+/*
+ * 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 "include/time_manager_mock.h"
+#include "protocol_handler/time_metric_observer.h"
+#include "transport_manager_metric.h"
+#include "transport_manager_observer.h"
+
+namespace test {
+namespace components {
+namespace time_tester_test {
+
+using namespace time_tester;
+using ::testing::_;
+
+TEST(TransportManagerObserverTest, DISABLED_MessageProcess) {
+ TimeManagerMock time_manager_mock;
+ TransportManagerObserver tr_observer(&time_manager_mock);
+ protocol_handler::RawMessage* ptr = new ::protocol_handler::RawMessage(0, 0, NULL, 0);
+ tr_observer.StartRawMsg(ptr);
+ EXPECT_CALL(time_manager_mock, SendMetric(_));
+ tr_observer.StopRawMsg(ptr);
+ delete ptr;
+}
+
+} // namespace time_tester
+} // namespace components
+} // namespace test
diff --git a/src/components/transport_manager/CMakeLists.txt b/src/components/transport_manager/CMakeLists.txt
index 15ecc9161..764f1cdaf 100644
--- a/src/components/transport_manager/CMakeLists.txt
+++ b/src/components/transport_manager/CMakeLists.txt
@@ -1,12 +1,43 @@
+# 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.
+
set(target TransportManager)
+set(TM_SRC_DIR ${COMPONENTS_DIR}/transport_manager/src)
include_directories (
- ./include
- ../utils/include/
- ../protocol_handler/include
- ../connection_handler/include
- ../config_profile/include
- ../resumption/include
+ include
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/protocol_handler/include
+ ${COMPONENTS_DIR}/connection_handler/include
+ ${COMPONENTS_DIR}/config_profile/include
+ ${COMPONENTS_DIR}/resumption/include
${JSONCPP_INCLUDE_DIRECTORY}
${LIBUSB_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
@@ -17,50 +48,50 @@ if (BUILD_BT_SUPPORT)
endif()
set (SOURCES
- ./src/transport_manager_impl.cc
- ./src/transport_manager_default.cc
- ./src/transport_adapter/transport_adapter_listener_impl.cc
- ./src/transport_adapter/transport_adapter_impl.cc
- ./src/tcp/tcp_transport_adapter.cc
- ./src/transport_adapter/threaded_socket_connection.cc
- ./src/tcp/tcp_client_listener.cc
- ./src/tcp/tcp_device.cc
- ./src/tcp/tcp_socket_connection.cc
- ./src/tcp/tcp_connection_factory.cc
+ ${TM_SRC_DIR}/transport_manager_impl.cc
+ ${TM_SRC_DIR}/transport_manager_default.cc
+ ${TM_SRC_DIR}/transport_adapter/transport_adapter_listener_impl.cc
+ ${TM_SRC_DIR}/transport_adapter/transport_adapter_impl.cc
+ ${TM_SRC_DIR}/tcp/tcp_transport_adapter.cc
+ ${TM_SRC_DIR}/transport_adapter/threaded_socket_connection.cc
+ ${TM_SRC_DIR}/tcp/tcp_client_listener.cc
+ ${TM_SRC_DIR}/tcp/tcp_device.cc
+ ${TM_SRC_DIR}/tcp/tcp_socket_connection.cc
+ ${TM_SRC_DIR}/tcp/tcp_connection_factory.cc
)
if (BUILD_AVAHI_SUPPORT)
list (APPEND SOURCES
- ./src/tcp/dnssd_service_browser.cc
+ ${TM_SRC_DIR}/tcp/dnssd_service_browser.cc
)
endif()
if (BUILD_BT_SUPPORT)
list (APPEND SOURCES
- ./src/bluetooth/bluetooth_device_scanner.cc
- ./src/bluetooth/bluetooth_transport_adapter.cc
- ./src/bluetooth/bluetooth_connection_factory.cc
- ./src/bluetooth/bluetooth_socket_connection.cc
- ./src/bluetooth/bluetooth_device.cc
+ ${TM_SRC_DIR}/bluetooth/bluetooth_device_scanner.cc
+ ${TM_SRC_DIR}/bluetooth/bluetooth_transport_adapter.cc
+ ${TM_SRC_DIR}/bluetooth/bluetooth_connection_factory.cc
+ ${TM_SRC_DIR}/bluetooth/bluetooth_socket_connection.cc
+ ${TM_SRC_DIR}/bluetooth/bluetooth_device.cc
)
endif()
if (BUILD_USB_SUPPORT)
list (APPEND SOURCES
- ./src/usb/usb_aoa_adapter.cc
- ./src/usb/usb_connection_factory.cc
- ./src/usb/usb_device_scanner.cc
+ ${TM_SRC_DIR}/usb/usb_aoa_adapter.cc
+ ${TM_SRC_DIR}/usb/usb_connection_factory.cc
+ ${TM_SRC_DIR}/usb/usb_device_scanner.cc
)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
list (APPEND SOURCES
- ./src/usb/libusb/usb_handler.cc
- ./src/usb/libusb/usb_connection.cc
- ./src/usb/libusb/platform_usb_device.cc
+ ${TM_SRC_DIR}/usb/libusb/usb_handler.cc
+ ${TM_SRC_DIR}/usb/libusb/usb_connection.cc
+ ${TM_SRC_DIR}/usb/libusb/platform_usb_device.cc
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "QNX")
list(APPEND SOURCES
- ./src/usb/qnx/usb_handler.cc
- ./src/usb/qnx/usb_connection.cc
- ./src/usb/qnx/platform_usb_device.cc
+ ${TM_SRC_DIR}/usb/qnx/usb_handler.cc
+ ${TM_SRC_DIR}/usb/qnx/usb_connection.cc
+ ${TM_SRC_DIR}/usb/qnx/platform_usb_device.cc
)
endif()
endif(BUILD_USB_SUPPORT)
@@ -92,4 +123,12 @@ if (BUILD_BT_SUPPORT)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
-endif() \ No newline at end of file
+endif()
+
+add_library("transport_manager" ${SOURCES}
+ ${TRANSPORT_MANAGER_SOURCES}
+)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_connection_factory.h b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_connection_factory.h
index 48d1f1553..4d1d47437 100644
--- a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_connection_factory.h
+++ b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_connection_factory.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file bluetooth_connection_factory.h
* \brief BluetoothConnectionFactory class header file.
*
diff --git a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device.h b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device.h
index 4abef3c60..f28147a3b 100644
--- a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device.h
+++ b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file bluetooth_device.h
* \brief BluetoothDevice class header file.
*
@@ -37,11 +37,6 @@
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_DEVICE_H_
#include <bluetooth/bluetooth.h>
-#include <bluetooth/hci.h>
-#include <bluetooth/hci_lib.h>
-#include <bluetooth/sdp.h>
-#include <bluetooth/sdp_lib.h>
-#include <bluetooth/rfcomm.h>
#include <vector>
diff --git a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h
index 0c68c6721..d1bed9b3d 100644
--- a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h
+++ b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file bluetooth_device_scanner.h
* \brief BluetoothDeviceScanner class header file.
*
@@ -46,7 +46,9 @@
#include "transport_manager/transport_adapter/device_scanner.h"
#include "utils/conditional_variable.h"
#include "utils/lock.h"
-#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+
+class Thread;
namespace transport_manager {
namespace transport_adapter {
diff --git a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_socket_connection.h b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_socket_connection.h
index e1606da87..3de77ab52 100644
--- a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_socket_connection.h
+++ b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_socket_connection.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file bluetooth_socket_connection.h
* \brief BluetoothSocketConnection class header file.
*
diff --git a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h
index 075b5da55..69a588fd3 100644
--- a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h
+++ b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file bluetooth_transport_adapter.h
* \brief BluetoothAdapter class header file.
*
diff --git a/src/components/transport_manager/include/transport_manager/tcp/dnssd_service_browser.h b/src/components/transport_manager/include/transport_manager/tcp/dnssd_service_browser.h
index cd319ca54..079494d03 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/dnssd_service_browser.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/dnssd_service_browser.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file dnssd_service_browser.h
* \brief DnssdServiceBrowser class header file.
*
@@ -36,14 +36,15 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_DNSSD_SERVICE_BROWSER_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_DNSSD_SERVICE_BROWSER_H_
-#include <string>
-#include <vector>
-#include <pthread.h>
#include <avahi-client/client.h>
#include <avahi-client/lookup.h>
#include <avahi-common/error.h>
#include <avahi-common/thread-watch.h>
+#include <string>
+#include <vector>
+
+#include "utils/lock.h"
#include "transport_manager/transport_adapter/device_scanner.h"
#include "transport_manager/transport_adapter/transport_adapter.h"
@@ -74,13 +75,15 @@ class DnssdServiceBrowser : public DeviceScanner {
*
* @param controller Pointer to the device adapter controller.
*/
- DnssdServiceBrowser(class TransportAdapterController* controller);
+ explicit DnssdServiceBrowser(class TransportAdapterController* controller);
virtual ~DnssdServiceBrowser();
+
protected:
virtual TransportAdapter::Error Init();
virtual TransportAdapter::Error Scan();
virtual void Terminate();
virtual bool IsInitialised() const;
+
private:
TransportAdapter::Error CreateAvahiClientAndBrowser();
void AddService(AvahiIfIndex interface, AvahiProtocol protocol,
@@ -121,13 +124,12 @@ class DnssdServiceBrowser : public DeviceScanner {
typedef std::vector<DnssdServiceRecord> ServiceRecords;
ServiceRecords service_records_;
- pthread_mutex_t mutex_;
+ sync_primitives::Lock mutex_;
bool initialised_;
-}
-;
+};
-} // namespace
-} // namespace
+} // namespace transport_adapter
+} // namespace transport_manager
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_DNSSD_SERVICE_BROWSER
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_DNSSD_SERVICE_BROWSER_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 12eab5a1b..d5a24f07e 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
@@ -1,4 +1,4 @@
-/**
+/*
* \file tcp_client_listener.h
* \brief TcpClientListener class header file.
*
@@ -36,10 +36,10 @@
#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/threads/thread_delegate.h"
#include "transport_manager/transport_adapter/client_connection_listener.h"
-#include "utils/threads/thread_delegate.h"
-#include "utils/threads/thread.h"
+class Thread;
namespace transport_manager {
namespace transport_adapter {
@@ -49,8 +49,7 @@ class TransportAdapterController;
/**
* @brief Listener of device adapter that use TCP transport.
*/
-class TcpClientListener : public ClientConnectionListener,
- public threads::ThreadDelegate {
+class TcpClientListener : public ClientConnectionListener {
public:
/**
* @breaf Constructor.
@@ -64,14 +63,6 @@ class TcpClientListener : public ClientConnectionListener,
bool enable_keepalive);
/**
- * @brief Start TCP client listener thread.
- */
- void threadMain();
-
- bool exitThreadMain();
- protected:
-
- /**
* @brief Destructor.
*/
virtual ~TcpClientListener();
@@ -107,18 +98,29 @@ class TcpClientListener : public ClientConnectionListener,
* @brief Terminate TCP client listener thread.
*/
virtual TransportAdapter::Error StopListening();
+
private:
const uint16_t port_;
const bool enable_keepalive_;
TransportAdapterController* controller_;
- // TODO(Eamakhov): change to threads::Thread usage
threads::Thread* thread_;
int socket_;
- bool thread_started_;
bool thread_stop_requested_;
+
+ void Loop();
+ void StopLoop();
+
+ class ListeningThreadDelegate : public threads::ThreadDelegate {
+ public:
+ explicit ListeningThreadDelegate(TcpClientListener* parent);
+ virtual void threadMain();
+ void exitThreadMain();
+ private:
+ TcpClientListener* parent_;
+ };
};
} // namespace transport_adapter
} // namespace transport_manager
-#endif /* TCP_CLIENT_LISTENER_H_ */
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CLIENT_LISTENER_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_connection_factory.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_connection_factory.h
index fba85aa60..7f238e91e 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/tcp_connection_factory.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_connection_factory.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file tcp_connection_factory.h
* \brief TcpConnectionFactory class header file.
*
@@ -47,14 +47,12 @@ namespace transport_adapter {
*/
class TcpConnectionFactory : public ServerConnectionFactory {
public:
-
/**
* @brief Constructor.
*
* @param controller Pointer to the device adapter controller.
*/
- TcpConnectionFactory(TransportAdapterController* controller);
- protected:
+ explicit TcpConnectionFactory(TransportAdapterController* controller);
/**
* @brief Start TCP connection factory.
@@ -69,8 +67,8 @@ class TcpConnectionFactory : public ServerConnectionFactory {
*
* @return Error information about possible reason of failure.
*/
- virtual TransportAdapter::Error CreateConnection(const DeviceUID& device_uid,
- const ApplicationHandle& app_handle);
+ virtual TransportAdapter::Error CreateConnection(
+ const DeviceUID& device_uid, const ApplicationHandle& app_handle);
/**
* @brief
@@ -89,6 +87,7 @@ class TcpConnectionFactory : public ServerConnectionFactory {
* @brief Destructor.
*/
virtual ~TcpConnectionFactory();
+
private:
TransportAdapterController* controller_;
};
@@ -96,4 +95,4 @@ class TcpConnectionFactory : public ServerConnectionFactory {
} // namespace transport_adapter
} // namespace transport_manager
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_CONNECTION_FACTORY_H_
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CONNECTION_FACTORY_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h
index 08821ab3c..45bcc405d 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file tcp_device.h
* \brief TcpDevice class header file.
*
@@ -36,9 +36,6 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_DEVICE_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_DEVICE_H_
-#include "transport_manager/transport_adapter/device.h"
-
-#include <map>
#include <memory.h>
#include <signal.h>
#include <errno.h>
@@ -47,6 +44,12 @@
#include <sys/types.h>
#include <sys/socket.h>
+#include <map>
+#include <string>
+
+#include "utils/lock.h"
+#include "transport_manager/transport_adapter/device.h"
+
namespace transport_manager {
namespace transport_adapter {
@@ -136,7 +139,7 @@ class TcpDevice : public Device {
uint16_t port;
};
std::map<ApplicationHandle, Application> applications_;
- mutable pthread_mutex_t applications_mutex_;
+ mutable sync_primitives::Lock applications_mutex_;
const in_addr_t in_addr_;
const std::string name_;
ApplicationHandle last_handle_;
@@ -145,4 +148,4 @@ class TcpDevice : public Device {
} // namespace transport_adapter
} // namespace transport_manager
-#endif /* TCP_DEVICE_H_ */
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_DEVICE_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_socket_connection.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_socket_connection.h
index 8fe7b8e83..432a0aa76 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/tcp_socket_connection.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_socket_connection.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file tcp_socket_connection.h
* \brief TcpSocketConnection class header file.
*
@@ -53,7 +53,6 @@ class TransportAdapterController;
*/
class TcpSocketConnection : public ThreadedSocketConnection {
public:
-
/**
* @brief Constructor.
*
@@ -69,8 +68,8 @@ class TcpSocketConnection : public ThreadedSocketConnection {
* @brief Destructor.
*/
virtual ~TcpSocketConnection();
- protected:
+ protected:
/**
* @brief
*/
@@ -82,7 +81,6 @@ class TcpSocketConnection : public ThreadedSocketConnection {
*/
class TcpServerOiginatedSocketConnection : public ThreadedSocketConnection {
public:
-
/**
* @brief Constructor.
*
@@ -98,8 +96,8 @@ class TcpServerOiginatedSocketConnection : public ThreadedSocketConnection {
* @brief Destructor.
*/
virtual ~TcpServerOiginatedSocketConnection();
- protected:
+ protected:
/**
* @brief
*/
@@ -109,4 +107,4 @@ class TcpServerOiginatedSocketConnection : public ThreadedSocketConnection {
} // namespace transport_adapter
} // namespace transport_manager
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_SOCKET_CONNECTION_H_
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_SOCKET_CONNECTION_H_
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 1319c40ee..5c1582230 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
@@ -1,4 +1,4 @@
-/**
+/*
* \file tcp_transport_adapter.h
* \brief TcpTransportAdapter class header file.
*
@@ -33,8 +33,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_ADAPTER_H_
-#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_ADAPTER_H_
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_TRANSPORT_ADAPTER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_TRANSPORT_ADAPTER_H_
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
@@ -55,8 +55,8 @@ class TcpTransportAdapter : public TransportAdapterImpl {
* @brief Destructor.
*/
virtual ~TcpTransportAdapter();
- protected:
+ protected:
/**
* @brief Return type of device.
*
@@ -80,4 +80,4 @@ class TcpTransportAdapter : public TransportAdapterImpl {
} // namespace transport_adapter
} // namespace transport_manager
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_ADAPTER
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_TRANSPORT_ADAPTER_H_
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/client_connection_listener.h b/src/components/transport_manager/include/transport_manager/transport_adapter/client_connection_listener.h
index 41658fb45..018dd4681 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/client_connection_listener.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/client_connection_listener.h
@@ -1,6 +1,4 @@
-/**
- * \file client_connection_listener.h
- * \brief ClientConnectionListener class header file.
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
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 094cb5192..e3f0b3d1d 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
@@ -1,4 +1,4 @@
-/**
+/*
* \file connection.h
* \brief Connection class header.
* Copyright (c) 2013, Ford Motor Company
@@ -39,7 +39,6 @@
#include "transport_manager/transport_adapter/transport_adapter.h"
namespace transport_manager {
-
namespace transport_adapter {
/**
@@ -48,10 +47,6 @@ namespace transport_adapter {
class Connection {
public:
/**
- * @brief Constructor.
- */
- Connection() {}
- /**
* @brief Destructor.
**/
virtual ~Connection() {}
@@ -71,6 +66,8 @@ class Connection {
virtual TransportAdapter::Error Disconnect() = 0;
};
+typedef utils::SharedPtr<Connection> ConnectionSPtr;
+
} // namespace transport_adapter
} // namespace transport_manager
#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CONNECTION_H_
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/device_scanner.h b/src/components/transport_manager/include/transport_manager/transport_adapter/device_scanner.h
index 5b09a726e..36759a938 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/device_scanner.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/device_scanner.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file device_scanner.h
* \brief DeviceScanner class header file.
* Copyright (c) 2013, Ford Motor Company
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/server_connection_factory.h b/src/components/transport_manager/include/transport_manager/transport_adapter/server_connection_factory.h
index d944594d8..19c37aa6a 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/server_connection_factory.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/server_connection_factory.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file server_connection_factory.h
* \brief ServerConnectionFactory class header file.
* Copyright (c) 2013, Ford Motor Company
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 851f250a8..5e0caa22e 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
@@ -1,4 +1,4 @@
-/**
+/*
* \file threaded_socket_connection.h
* \brief Header for classes responsible for communication over sockets.
* Copyright (c) 2013, Ford Motor Company
@@ -41,10 +41,12 @@
#include "transport_manager/transport_adapter/connection.h"
#include "protocol/common.h"
#include "utils/threads/thread_delegate.h"
-#include "utils/threads/thread.h"
+#include "utils/lock.h"
using ::transport_manager::transport_adapter::Connection;
+class Thread;
+
namespace transport_manager {
namespace transport_adapter {
@@ -53,10 +55,8 @@ class TransportAdapterController;
/**
* @brief Class responsible for communication over sockets.
*/
-class ThreadedSocketConnection : public Connection,
- public threads::ThreadDelegate {
+class ThreadedSocketConnection : public Connection {
public:
-
/**
* @brief Send data frame.
*
@@ -86,8 +86,8 @@ class ThreadedSocketConnection : public Connection,
void set_socket(int socket) {
socket_ = socket;
}
- protected:
+ protected:
/**
* @brief Constructor.
*
@@ -104,7 +104,6 @@ class ThreadedSocketConnection : public Connection,
*/
virtual ~ThreadedSocketConnection();
-
virtual bool Establish(ConnectError** error) = 0;
/**
@@ -129,11 +128,18 @@ class ThreadedSocketConnection : public Connection,
}
private:
+ class SocketConnectionDelegate : public threads::ThreadDelegate {
+ public:
+ explicit SocketConnectionDelegate(ThreadedSocketConnection* connection);
+ void threadMain() OVERRIDE;
+ void exitThreadMain() OVERRIDE;
+ private:
+ ThreadedSocketConnection* connection_;
+ };
int read_fd_;
int write_fd_;
void threadMain();
- bool exitThreadMain();
void Transmit();
void Finalize();
TransportAdapter::Error Notify() const;
@@ -147,7 +153,7 @@ class ThreadedSocketConnection : public Connection,
**/
typedef std::queue<protocol_handler::RawMessagePtr> FrameQueue;
FrameQueue frames_to_send_;
- mutable pthread_mutex_t frames_to_send_mutex_;
+ mutable sync_primitives::Lock frames_to_send_mutex_;
int socket_;
bool terminate_flag_;
@@ -159,4 +165,4 @@ class ThreadedSocketConnection : public Connection,
} // namespace transport_adapter
} // namespace transport_manager
-#endif //SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_transport_adapter_SOCKET_COMMUNICATION
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_THREADED_SOCKET_CONNECTION_H_
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 aaa1139b9..f0148ad1a 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
@@ -95,7 +95,7 @@ class TransportAdapterController {
* @param device_handle Device unique identifier.
* @param app_handle Handle of application.
*/
- virtual void ConnectionCreated(Connection* connection,
+ virtual void ConnectionCreated(ConnectionSPtr connection,
const DeviceUID& device_handle,
const ApplicationHandle& app_handle) = 0;
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
index 2c27e0d20..5306a7af5 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
@@ -39,6 +39,8 @@
#include <memory>
#include <string>
+#include "utils/lock.h"
+#include "utils/rwlock.h"
#include "transport_manager/transport_adapter/transport_adapter.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/transport_adapter/connection.h"
@@ -99,6 +101,12 @@ class TransportAdapterImpl : public TransportAdapter,
virtual TransportAdapter::Error Init();
/**
+ * @brief Stops device adapter
+ * Called from transport manager to stop device adapter
+ */
+ virtual void Terminate();
+
+ /**
* @brief Add listener to the container(list) of device adapter listeners.
*
* @param listener Pointer to the device adapter listener.
@@ -264,7 +272,7 @@ class TransportAdapterImpl : public TransportAdapter,
* @param device_handle Device unique identifier.
* @param app_handle Handle of application.
*/
- virtual void ConnectionCreated(Connection* connection,
+ virtual void ConnectionCreated(ConnectionSPtr connection,
const DeviceUID& device_handle,
const ApplicationHandle& app_handle);
@@ -405,9 +413,7 @@ class TransportAdapterImpl : public TransportAdapter,
virtual TMMetricObserver* GetTimeMetricObserver();
#endif // TIME_TESTER
-
protected:
-
/**
* @brief Store adapter state where applicable
*/
@@ -425,6 +431,13 @@ class TransportAdapterImpl : public TransportAdapter,
*/
virtual bool ToBeAutoConnected(DeviceSptr device) const;
+
+ /**
+ * @brief Returns true if \a device is to be disconnected automatically when
+ * all applications will be closed
+ */
+ virtual bool ToBeAutoDisconnected(DeviceSptr device) const;
+
/**
* @brief Find connection that has state - ESTABLISHED.
*
@@ -433,7 +446,7 @@ class TransportAdapterImpl : public TransportAdapter,
*
* @return pointer to the connection.
*/
- Connection* FindEstablishedConnection(const DeviceUID& device_handle,
+ ConnectionSPtr FindEstablishedConnection(const DeviceUID& device_handle,
const ApplicationHandle& app_handle) const;
private:
@@ -451,6 +464,15 @@ class TransportAdapterImpl : public TransportAdapter,
void RemoveDevice(const DeviceUID& device_handle);
/**
+ * Checks whether application is single active on device
+ * @param device_uid
+ * @param app_uid
+ * @return true if this application is the single application on device
+ */
+ bool IsSingleApplication(const DeviceUID& device_uid,
+ const ApplicationHandle& app_uid);
+
+ /**
* @brief Listener for device adapter notifications.
**/
TransportAdapterListenerList listeners_;
@@ -464,7 +486,7 @@ class TransportAdapterImpl : public TransportAdapter,
* @brief Structure that holds information about connection.
*/
struct ConnectionInfo {
- Connection* connection;
+ ConnectionSPtr connection;
DeviceUID device_id;
ApplicationHandle app_handle;
enum {
@@ -493,7 +515,7 @@ class TransportAdapterImpl : public TransportAdapter,
/**
* @brief Mutex restricting access to device map.
**/
- mutable pthread_mutex_t devices_mutex_;
+ mutable sync_primitives::Lock devices_mutex_;
/**
* @brief Container(map) of connections.
@@ -503,9 +525,16 @@ class TransportAdapterImpl : public TransportAdapter,
/**
* @brief Mutex restricting access to connections map.
**/
- mutable pthread_mutex_t connections_mutex_;
+ mutable sync_primitives::RWLock connections_lock_;
protected:
+#ifdef TIME_TESTER
+ /**
+ * @brief Pointer to time metric observer
+ */
+ TMMetricObserver* metric_observer_;
+#endif // TIME_TESTER
+
/**
* @brief Pointer to the device scanner.
*/
@@ -520,14 +549,8 @@ class TransportAdapterImpl : public TransportAdapter,
* @brief Pointer to the factory of connections initiated from client.
*/
ClientConnectionListener* client_connection_listener_;
-
-#ifdef TIME_TESTER
- /**
- * @brief Pointer to time metric observer
- */
- TMMetricObserver* metric_observer_;
-#endif // TIME_TESTER
};
+
} // namespace transport_adapter
} // namespace transport_manager
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 62fdb3fa2..4c38716f3 100644
--- a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
@@ -33,15 +33,12 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_IMPL_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_IMPL_H_
-#include <pthread.h>
-
#include <queue>
#include <map>
#include <list>
#include <algorithm>
#include "utils/timer_thread.h"
-#include "utils/rwlock.h"
#include "transport_manager/transport_manager.h"
#include "transport_manager/transport_manager_listener.h"
@@ -104,6 +101,12 @@ class TransportManagerImpl : public TransportManager,
virtual int Init();
/**
+ * Reinitializes transport manager
+ * @return Error code
+ */
+ virtual int Reinit();
+
+ /**
* @brief Start scanning for new devices.
*
* @return Code error.
@@ -250,12 +253,6 @@ class TransportManagerImpl : public TransportManager,
**/
void PostEvent(const TransportAdapterEvent& event);
- /**
- * @brief flag that indicates that thread is active
- * if it is false then threads exist main loop
- **/
- volatile bool all_thread_active_;
-
typedef std::list<TransportManagerListener*> TransportManagerListenerList;
/**
* @brief listener that would be called when TM's event happened.
@@ -263,11 +260,6 @@ class TransportManagerImpl : public TransportManager,
TransportManagerListenerList transport_manager_listener_;
/**
- * @brief Condition variable to wake up event
- **/
- pthread_cond_t device_listener_thread_wakeup_;
-
- /**
* @brief Flag that TM is initialized
*/
bool is_initialized_;
@@ -352,6 +344,9 @@ class TransportManagerImpl : public TransportManager,
unsigned char** frame);
void OnDeviceListUpdated(TransportAdapter* ta);
+ void DisconnectAllDevices();
+ void TerminateAllAdapters();
+ int InitAllAdapters();
static Connection convert(const ConnectionInternal& p);
};
// class ;
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h b/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h
index d1f485c9d..b90c504a4 100644
--- a/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h
+++ b/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file platform_usb_device.h
* \brief libusb PlatformUsbDevice class header file.
*
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
index fc6af46a4..7c1fbd455 100644
--- a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
+++ b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
@@ -49,7 +49,7 @@ class UsbConnection : public Connection {
UsbConnection(const DeviceUID& device_uid,
const ApplicationHandle& app_handle,
TransportAdapterController* controller,
- const UsbHandlerSptr& usb_handler, PlatformUsbDevice* device);
+ const UsbHandlerSptr usb_handler, PlatformUsbDevice* device);
bool Init();
virtual ~UsbConnection();
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h
index fd6e77013..215b66f6e 100644
--- a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h
+++ b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file usb_handler.h
* \brief libusb USB handler class header file.
*
@@ -36,16 +36,17 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_USB_HANDLER_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_USB_HANDLER_H_
-#include <pthread.h>
-
#include <libusb/libusb.h>
#include "transport_manager/transport_adapter/transport_adapter.h"
#include "transport_manager/usb/usb_control_transfer.h"
#include "transport_manager/usb/libusb/platform_usb_device.h"
-namespace transport_manager {
+#include "utils/threads/thread.h"
+
+class Thread;
+namespace transport_manager {
namespace transport_adapter {
class UsbHandler {
@@ -71,9 +72,16 @@ class UsbHandler {
friend void UsbTransferSequenceCallback(libusb_transfer* transfer);
private:
+ class UsbHandlerDelegate: public threads::ThreadDelegate {
+ public:
+ explicit UsbHandlerDelegate(UsbHandler* handler);
+ void threadMain() OVERRIDE;
+ private:
+ UsbHandler* handler_;
+ };
+
bool shutdown_requested_;
- // TODO(Eamakhov): change to threads::Thread usage
- pthread_t thread_;
+ threads::Thread* thread_;
friend class UsbDeviceListener;
std::list<class UsbDeviceListener*> usb_device_listeners_;
diff --git a/src/components/transport_manager/include/transport_manager/usb/qnx/platform_usb_device.h b/src/components/transport_manager/include/transport_manager/usb/qnx/platform_usb_device.h
index 939a8fcb3..ab35f862c 100644
--- a/src/components/transport_manager/include/transport_manager/usb/qnx/platform_usb_device.h
+++ b/src/components/transport_manager/include/transport_manager/usb/qnx/platform_usb_device.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file platform_usb_device.h
* \brief QNX PlatfromUsbDevice class header file.
*
diff --git a/src/components/transport_manager/include/transport_manager/usb/qnx/usb_connection.h b/src/components/transport_manager/include/transport_manager/usb/qnx/usb_connection.h
index 3a0d2f8a2..d55c887bd 100644
--- a/src/components/transport_manager/include/transport_manager/usb/qnx/usb_connection.h
+++ b/src/components/transport_manager/include/transport_manager/usb/qnx/usb_connection.h
@@ -36,7 +36,7 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_QNX_USB_CONNECTION_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_QNX_USB_CONNECTION_H_
-#include <pthread.h>
+#include "utils/lock.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/transport_adapter/connection.h"
@@ -51,7 +51,7 @@ class UsbConnection : public Connection {
UsbConnection(const DeviceUID& device_uid,
const ApplicationHandle& app_handle,
TransportAdapterController* controller,
- const UsbHandlerSptr& libusb_handler,
+ const UsbHandlerSptr libusb_handler,
PlatformUsbDevice* device);
bool Init();
@@ -82,13 +82,13 @@ class UsbConnection : public Connection {
unsigned char* in_buffer_;
void* out_buffer_;
-
+
usbd_urb* in_urb_;
usbd_urb* out_urb_;
std::list<protocol_handler::RawMessagePtr> out_messages_;
::protocol_handler::RawMessagePtr current_out_message_;
- pthread_mutex_t out_messages_mutex_;
+ sync_primitives::Lock out_messages_mutex_;
size_t bytes_sent_;
bool disconnecting_;
bool pending_in_transfer_;
diff --git a/src/components/transport_manager/include/transport_manager/usb/qnx/usb_handler.h b/src/components/transport_manager/include/transport_manager/usb/qnx/usb_handler.h
index 26b00087f..c33e0f236 100644
--- a/src/components/transport_manager/include/transport_manager/usb/qnx/usb_handler.h
+++ b/src/components/transport_manager/include/transport_manager/usb/qnx/usb_handler.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file usb_handler.h
* \brief QNX USB handler class header file.
*
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h b/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h
index 55fb028ef..b0d8c1e45 100644
--- a/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file usb_aoa_adapter.h
* \brief UsbAoaAdapter class header file.
*
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_connection_factory.h b/src/components/transport_manager/include/transport_manager/usb/usb_connection_factory.h
index ed0fda91e..ebd25bd37 100644
--- a/src/components/transport_manager/include/transport_manager/usb/usb_connection_factory.h
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_connection_factory.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file usb_connection_factory.h
* \brief UsbConnectionFactory class header file.
*
@@ -46,7 +46,7 @@ namespace transport_adapter {
class UsbConnectionFactory : public ServerConnectionFactory {
public:
UsbConnectionFactory(TransportAdapterController* controller);
- void SetUsbHandler(const UsbHandlerSptr& usb_handler);
+ void SetUsbHandler(const UsbHandlerSptr usb_handler);
protected:
virtual TransportAdapter::Error Init();
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h b/src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h
index 8c4f8a9d4..c701a86e0 100644
--- a/src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file aoa_common.h
* \brief Google AOA protocol header file.
*
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h b/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h
index 093722215..9efb7ba58 100644
--- a/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h
@@ -1,4 +1,4 @@
-/**
+/*
* \file usb_device_scanner.h
* \brief UsbDeviceScanner class header file.
*
@@ -38,8 +38,7 @@
#include <list>
-#include <pthread.h>
-
+#include "utils/lock.h"
#include "transport_manager/transport_adapter/device_scanner.h"
#include "transport_manager/usb/common.h"
@@ -69,7 +68,7 @@ class UsbDeviceScanner : public DeviceScanner, public UsbDeviceListener {
typedef std::list<PlatformUsbDevice*> Devices;
Devices devices_;
- pthread_mutex_t devices_mutex_;
+ sync_primitives::Lock devices_mutex_;
};
} // namespace
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 421104422..02224baf4 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file bluetooth_connection_factory.cc
* \brief BluetoothConnectionFactory class source file.
*
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_device.cc b/src/components/transport_manager/src/bluetooth/bluetooth_device.cc
index 1a47f6c7f..c8061a7ac 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_device.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_device.cc
@@ -33,6 +33,13 @@
#include "transport_manager/bluetooth/bluetooth_device.h"
+#include <bluetooth/bluetooth.h>
+#include <bluetooth/hci.h>
+#include <bluetooth/hci_lib.h>
+#include <bluetooth/sdp.h>
+#include <bluetooth/sdp_lib.h>
+#include <bluetooth/rfcomm.h>
+
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
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 547dc463b..29be3cd21 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file bluetooth_device_scanner.cc
* \brief BluetoothDeviceScanner class header file.
*
@@ -52,6 +52,7 @@
#include "transport_manager/bluetooth/bluetooth_device.h"
#include "utils/logger.h"
+#include "utils/threads/thread.h"
namespace transport_manager {
namespace transport_adapter {
@@ -117,44 +118,45 @@ BluetoothDeviceScanner::BluetoothDeviceScanner(
};
sdp_uuid128_create(&smart_device_link_service_uuid_,
smart_device_link_service_uuid_data);
- thread_ = threads::CreateThread("BT Device Scaner", new BluetoothDeviceScannerDelegate(this));
+ thread_ = threads::CreateThread("BT Device Scaner",
+ new BluetoothDeviceScannerDelegate(this));
}
BluetoothDeviceScanner::~BluetoothDeviceScanner() {
+ thread_->join();
+ delete thread_->delegate();
+ threads::DeleteThread(thread_);
}
bool BluetoothDeviceScanner::IsInitialised() const {
- return thread_->is_running();
+ return thread_ && thread_->is_running();
}
void BluetoothDeviceScanner::UpdateTotalDeviceList() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
DeviceVector devices;
devices.insert(devices.end(), paired_devices_with_sdl_.begin(),
paired_devices_with_sdl_.end());
devices.insert(devices.end(), found_devices_with_sdl_.begin(),
found_devices_with_sdl_.end());
controller_->SearchDeviceDone(devices);
- LOG4CXX_TRACE(logger_, "exit");
}
void BluetoothDeviceScanner::DoInquiry() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
const int device_id = hci_get_route(0);
if (device_id < 0) {
LOG4CXX_INFO(logger_, "HCI device is not available");
shutdown_requested_ = true;
controller_->SearchDeviceFailed(SearchDeviceError());
- LOG4CXX_TRACE(logger_, "exit. Condition: device_id < 0");
return;
}
int device_handle = hci_open_dev(device_id);
if (device_handle < 0) {
controller_->SearchDeviceFailed(SearchDeviceError());
- LOG4CXX_TRACE(logger_, "exit. Condition: device_handle < 0");
return;
}
@@ -195,6 +197,7 @@ void BluetoothDeviceScanner::DoInquiry() {
&found_devices_with_sdl_);
}
UpdateTotalDeviceList();
+ controller_->FindNewApplicationsRequest();
close(device_handle);
delete[] inquiry_info_list;
@@ -203,8 +206,6 @@ void BluetoothDeviceScanner::DoInquiry() {
LOG4CXX_DEBUG(logger_, "number_of_devices < 0");
controller_->SearchDeviceFailed(SearchDeviceError());
}
-
- LOG4CXX_TRACE(logger_, "exit");
}
void BluetoothDeviceScanner::CheckSDLServiceOnDevices(
@@ -371,7 +372,7 @@ bool BluetoothDeviceScanner::DiscoverSmartDeviceLinkRFCOMMChannels(
}
void BluetoothDeviceScanner::Thread() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
ready_ = true;
if (auto_repeat_search_) {
while (!shutdown_requested_) {
@@ -394,12 +395,10 @@ void BluetoothDeviceScanner::Thread() {
device_scan_requested_ = false;
}
}
-
- LOG4CXX_TRACE(logger_, "exit");
}
void BluetoothDeviceScanner::TimedWaitForDeviceScanRequest() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
if (auto_repeat_pause_sec_ == 0) {
LOG4CXX_TRACE(logger_, "exit. Condition: auto_repeat_pause_sec_ == 0");
@@ -417,26 +416,22 @@ void BluetoothDeviceScanner::TimedWaitForDeviceScanRequest() {
}
}
}
-
- LOG4CXX_TRACE(logger_, "exit");
}
TransportAdapter::Error BluetoothDeviceScanner::Init() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
if(!thread_->start()) {
LOG4CXX_ERROR(logger_, "Bluetooth device scanner thread start failed");
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter:Fail");
return TransportAdapter::FAIL;
}
LOG4CXX_INFO(logger_, "Bluetooth device scanner thread started");
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter:OK");
return TransportAdapter::OK;
}
void BluetoothDeviceScanner::Terminate() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
shutdown_requested_ = true;
- if (thread_->is_running()) {
+ if (thread_) {
{
sync_primitives::AutoLock auto_lock(device_scan_requested_lock_);
device_scan_requested_ = false;
@@ -445,36 +440,30 @@ void BluetoothDeviceScanner::Terminate() {
LOG4CXX_INFO(logger_,
"Waiting for bluetooth device scanner thread termination");
thread_->stop();
- LOG4CXX_INFO(logger_, "PASA Bluetooth device scanner thread joined");
+ LOG4CXX_INFO(logger_, "Bluetooth device scanner thread stopped");
}
- LOG4CXX_TRACE(logger_, "exit");
}
TransportAdapter::Error BluetoothDeviceScanner::Scan() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
if ((!IsInitialised()) || shutdown_requested_) {
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::BAD_STATE");
+ LOG4CXX_WARN(logger_, "BAD_STATE");
return TransportAdapter::BAD_STATE;
}
if (auto_repeat_pause_sec_ == 0) {
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
return TransportAdapter::OK;
}
TransportAdapter::Error ret = TransportAdapter::OK;
- {
- sync_primitives::AutoLock auto_lock(device_scan_requested_lock_);
- if (false == device_scan_requested_) {
- LOG4CXX_INFO(logger_, "Requesting device Scan");
- device_scan_requested_ = true;
- device_scan_requested_cv_.NotifyOne();
- } else {
- ret = TransportAdapter::BAD_STATE;
- LOG4CXX_INFO(logger_, "Device Scan is currently in progress");
- }
+ sync_primitives::AutoLock auto_lock(device_scan_requested_lock_);
+ if (!device_scan_requested_) {
+ LOG4CXX_TRACE(logger_, "Requesting device Scan");
+ device_scan_requested_ = true;
+ device_scan_requested_cv_.NotifyOne();
+ } else {
+ ret = TransportAdapter::BAD_STATE;
+ LOG4CXX_WARN(logger_, "BAD_STATE");
}
-
- LOG4CXX_TRACE(logger_, "exit with Error: " << ret);
return ret;
}
@@ -483,12 +472,10 @@ BluetoothDeviceScanner::BluetoothDeviceScannerDelegate::BluetoothDeviceScannerDe
: scanner_(scanner) {
}
-void BluetoothDeviceScanner::BluetoothDeviceScannerDelegate::threadMain()
-{
- LOG4CXX_TRACE_ENTER(logger_);
+void BluetoothDeviceScanner::BluetoothDeviceScannerDelegate::threadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
DCHECK(scanner_);
scanner_->Thread();
- LOG4CXX_TRACE_EXIT(logger_);
}
} // namespace transport_adapter
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
index ac1ccecfb..d6f9f2631 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
@@ -1,4 +1,4 @@
-/**
+/*
*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
@@ -60,7 +60,8 @@ BluetoothSocketConnection::~BluetoothSocketConnection() {
}
bool BluetoothSocketConnection::Establish(ConnectError** error) {
- LOG4CXX_TRACE(logger_, "enter. (#" << pthread_self() << "), error: " << error);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "error: " << error);
DeviceSptr device = controller()->FindDevice(device_handle());
BluetoothDevice* 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 7d60213b0..966c0f9b7 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file bluetooth_transport_adapter.cc
* \brief BluetoothTransportAdapter class source file.
*
@@ -65,7 +65,7 @@ BluetoothTransportAdapter::BluetoothTransportAdapter()
}
DeviceType BluetoothTransportAdapter::GetDeviceType() const {
- return "sdl-bluetooth";
+ return BLUETOOTH;
}
void BluetoothTransportAdapter::Store() const {
@@ -152,7 +152,7 @@ bool BluetoothTransportAdapter::Restore() {
if (result) {
LOG4CXX_TRACE(logger_, "exit with TRUE");
} else {
- LOG4CXX_TRACE(logger_, "exit with FALSE");
+ LOG4CXX_TRACE(logger_, "exit with FALSE");
}
return result;
}
diff --git a/src/components/transport_manager/src/tcp/dnssd_service_browser.cc b/src/components/transport_manager/src/tcp/dnssd_service_browser.cc
index 558058576..3571ac815 100644
--- a/src/components/transport_manager/src/tcp/dnssd_service_browser.cc
+++ b/src/components/transport_manager/src/tcp/dnssd_service_browser.cc
@@ -1,4 +1,4 @@
-/**
+/*
*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
@@ -33,37 +33,41 @@
#include <algorithm>
#include <map>
+#include "utils/logger.h"
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
#include "transport_manager/tcp/tcp_device.h"
#include "transport_manager/tcp/dnssd_service_browser.h"
-#include "utils/logger.h"
+
namespace transport_manager {
namespace transport_adapter {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
bool operator==(const DnssdServiceRecord& a, const DnssdServiceRecord& b) {
return a.name == b.name && a.type == b.type && a.interface == b.interface
- && a.protocol == b.protocol && a.domain_name == b.domain_name;
+ && a.protocol == b.protocol && a.domain_name == b.domain_name;
}
void DnssdServiceBrowser::Terminate() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
if (0 != avahi_threaded_poll_) {
avahi_threaded_poll_stop(avahi_threaded_poll_);
}
if (0 != avahi_service_browser_) {
avahi_service_browser_free(avahi_service_browser_);
+ avahi_service_browser_ = NULL;
}
if (0 != avahi_client_) {
avahi_client_free(avahi_client_);
+ avahi_client_ = NULL;
}
if (0 != avahi_threaded_poll_) {
avahi_threaded_poll_free(avahi_threaded_poll_);
+ avahi_threaded_poll_ = NULL;
}
- LOG4CXX_TRACE(logger_, "exit");
}
bool DnssdServiceBrowser::IsInitialised() const {
@@ -71,18 +75,16 @@ bool DnssdServiceBrowser::IsInitialised() const {
}
DnssdServiceBrowser::DnssdServiceBrowser(TransportAdapterController* controller)
- : controller_(controller),
- avahi_service_browser_(0),
- avahi_threaded_poll_(0),
- avahi_client_(0),
- service_records_(),
- mutex_(),
- initialised_(false) {
- pthread_mutex_init(&mutex_, 0);
+ : controller_(controller),
+ avahi_service_browser_(0),
+ avahi_threaded_poll_(0),
+ avahi_client_(0),
+ service_records_(),
+ mutex_(),
+ initialised_(false) {
}
DnssdServiceBrowser::~DnssdServiceBrowser() {
- pthread_mutex_destroy(&mutex_);
}
void DnssdServiceBrowser::OnClientConnected() {
@@ -91,7 +93,7 @@ void DnssdServiceBrowser::OnClientConnected() {
}
void DnssdServiceBrowser::OnClientFailure() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
const int avahi_errno = avahi_client_errno(avahi_client_);
if (avahi_errno == AVAHI_ERR_DISCONNECTED) {
LOG4CXX_DEBUG(logger_, "AvahiClient disconnected");
@@ -100,16 +102,16 @@ void DnssdServiceBrowser::OnClientFailure() {
LOG4CXX_ERROR(logger_,
"AvahiClient failure: " << avahi_strerror(avahi_errno));
}
- LOG4CXX_TRACE(logger_, "exit");
}
void AvahiClientCallback(AvahiClient* avahi_client,
AvahiClientState avahi_client_state, void* data) {
- LOG4CXX_TRACE(logger_,
- "enter. avahi_client " << avahi_client << "avahi_client_state " <<
- avahi_client_state << "data " << data);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "avahi_client " << avahi_client << ", avahi_client_state " << avahi_client_state << ", data " << data);
DnssdServiceBrowser* dnssd_service_browser =
- static_cast<DnssdServiceBrowser*>(data);
+ static_cast<DnssdServiceBrowser*>(data);
switch (avahi_client_state) {
case AVAHI_CLIENT_S_RUNNING:
@@ -121,10 +123,10 @@ void AvahiClientCallback(AvahiClient* avahi_client,
LOG4CXX_DEBUG(logger_, "avahi_client_state: AVAHI_CLIENT_FAILURE");
break;
default: {
- LOG4CXX_ERROR(logger_, "Unknown avahi_client_state: " << avahi_client_state);
+ LOG4CXX_ERROR(logger_,
+ "Unknown avahi_client_state: " << avahi_client_state);
}
}
- LOG4CXX_TRACE(logger_, "exit");
}
void AvahiServiceBrowserCallback(AvahiServiceBrowser* avahi_service_browser,
@@ -132,21 +134,21 @@ void AvahiServiceBrowserCallback(AvahiServiceBrowser* avahi_service_browser,
AvahiBrowserEvent event, const char* name,
const char* type, const char* domain,
AvahiLookupResultFlags flags, void* data) {
- LOG4CXX_TRACE(logger_, "enter. avahi_service_browser " << avahi_service_browser <<
- " interface " << interface << " protocol " << protocol <<
- " event " << event << " name " << name << " type " << type << " domain " << domain <<
- " flags " << flags << " data " << data);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "avahi_service_browser " << avahi_service_browser << " interface " << interface <<
+ " protocol " << protocol << " event " << event << " name " << name <<
+ " type " << type << " domain " << domain << " flags " << flags << " data " << data);
DnssdServiceBrowser* dnssd_service_browser =
- static_cast<DnssdServiceBrowser*>(data);
+ static_cast<DnssdServiceBrowser*>(data);
switch (event) {
case AVAHI_BROWSER_FAILURE:
LOG4CXX_ERROR(
logger_,
- "AvahiServiceBrowser failure: " << avahi_strerror(
- avahi_client_errno(
- avahi_service_browser_get_client(
- avahi_service_browser))));
+ "AvahiServiceBrowser failure: " << avahi_strerror(avahi_client_errno(
+ avahi_service_browser_get_client(avahi_service_browser))));
break;
case AVAHI_BROWSER_NEW:
@@ -163,6 +165,7 @@ void AvahiServiceBrowserCallback(AvahiServiceBrowser* avahi_service_browser,
case AVAHI_BROWSER_ALL_FOR_NOW:
LOG4CXX_DEBUG(logger_, "event: AVAHI_BROWSER_ALL_FOR_NOW");
+ break;
case AVAHI_BROWSER_CACHE_EXHAUSTED:
LOG4CXX_DEBUG(logger_, "event: AVAHI_BROWSER_CACHE_EXHAUSTED");
break;
@@ -171,33 +174,29 @@ void AvahiServiceBrowserCallback(AvahiServiceBrowser* avahi_service_browser,
}
void DnssdServiceBrowser::ServiceResolved(
- const DnssdServiceRecord& service_record) {
- LOG4CXX_TRACE(logger_, "enter");
- pthread_mutex_lock(&mutex_);
+ const DnssdServiceRecord& service_record) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock locker(mutex_);
ServiceRecords::iterator service_record_it = std::find(
- service_records_.begin(), service_records_.end(), service_record);
+ service_records_.begin(), service_records_.end(), service_record);
if (service_record_it != service_records_.end()) {
*service_record_it = service_record;
}
DeviceVector device_vector = PrepareDeviceVector();
controller_->SearchDeviceDone(device_vector);
- pthread_mutex_unlock(&mutex_);
- LOG4CXX_TRACE(logger_, "exit");
}
void DnssdServiceBrowser::ServiceResolveFailed(
- const DnssdServiceRecord& service_record) {
- LOG4CXX_TRACE(logger_, "enter");
- LOG4CXX_ERROR(logger_,
+ const DnssdServiceRecord& service_record) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
"AvahiServiceResolver failure for: " << service_record.name);
- pthread_mutex_lock(&mutex_);
+ sync_primitives::AutoLock locker(mutex_);
ServiceRecords::iterator service_record_it = std::find(
- service_records_.begin(), service_records_.end(), service_record);
+ service_records_.begin(), service_records_.end(), service_record);
if (service_record_it != service_records_.end()) {
service_records_.erase(service_record_it);
}
- pthread_mutex_unlock(&mutex_);
- LOG4CXX_TRACE(logger_, "exit");
}
void AvahiServiceResolverCallback(AvahiServiceResolver* avahi_service_resolver,
@@ -209,14 +208,16 @@ void AvahiServiceResolverCallback(AvahiServiceResolver* avahi_service_resolver,
const AvahiAddress* avahi_address,
uint16_t port, AvahiStringList* txt,
AvahiLookupResultFlags flags, void* data) {
- LOG4CXX_TRACE(logger_, "enter. avahi_service_resolver " << avahi_service_resolver <<
- " interface " << interface <<
- " protocol " << protocol << " event " << event << " name " << name << " type " << type <<
- " domain " << domain << " host_name " << host_name <<
- " avahi_address " << avahi_address << " port " << port << " txt " << txt << " flags " <<
- flags << " data " << data);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "avahi_service_resolver " << avahi_service_resolver << " interface " << interface <<
+ " protocol " << protocol << " event " << event << " name " << name <<
+ " type " << type << " domain " << domain << " host_name " << host_name <<
+ " avahi_address " << avahi_address << " port " << port <<
+ " txt " << txt << " flags " << flags << " data " << data);
DnssdServiceBrowser* dnssd_service_browser =
- static_cast<DnssdServiceBrowser*>(data);
+ static_cast<DnssdServiceBrowser*>(data);
DnssdServiceRecord service_record;
service_record.interface = interface;
@@ -239,62 +240,60 @@ void AvahiServiceResolverCallback(AvahiServiceResolver* avahi_service_resolver,
}
avahi_service_resolver_free(avahi_service_resolver);
- LOG4CXX_TRACE(logger_, "exit");
}
TransportAdapter::Error DnssdServiceBrowser::CreateAvahiClientAndBrowser() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
if (0 != avahi_service_browser_) {
avahi_service_browser_free(avahi_service_browser_);
+ avahi_service_browser_ = NULL;
}
if (0 != avahi_client_) {
avahi_client_free(avahi_client_);
+ avahi_client_ = NULL;
}
int avahi_error;
avahi_client_ = avahi_client_new(
- avahi_threaded_poll_get(avahi_threaded_poll_), AVAHI_CLIENT_NO_FAIL,
- AvahiClientCallback, this, &avahi_error);
+ avahi_threaded_poll_get(avahi_threaded_poll_), AVAHI_CLIENT_NO_FAIL,
+ AvahiClientCallback, this, &avahi_error);
if (0 == avahi_client_) {
- LOG4CXX_ERROR(logger_, "Failed to create AvahiClient: " << avahi_strerror(avahi_error));
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL");
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed to create AvahiClient: " << avahi_strerror(avahi_error));
return TransportAdapter::FAIL;
}
- pthread_mutex_lock(&mutex_);
+ mutex_.Acquire();
service_records_.clear();
- pthread_mutex_unlock(&mutex_);
+ mutex_.Release();
avahi_service_browser_ = avahi_service_browser_new(
- avahi_client_, AVAHI_IF_UNSPEC, /* TODO use only required iface */
- AVAHI_PROTO_INET, DNSSD_DEFAULT_SERVICE_TYPE, NULL, /* use default domain */
- static_cast<AvahiLookupFlags>(0), AvahiServiceBrowserCallback, this);
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
+ avahi_client_, AVAHI_IF_UNSPEC, /* TODO use only required iface */
+ AVAHI_PROTO_INET, DNSSD_DEFAULT_SERVICE_TYPE, NULL, /* use default domain */
+ static_cast<AvahiLookupFlags>(0), AvahiServiceBrowserCallback, this);
return TransportAdapter::OK;
}
TransportAdapter::Error DnssdServiceBrowser::Init() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
avahi_threaded_poll_ = avahi_threaded_poll_new();
if (0 == avahi_threaded_poll_) {
LOG4CXX_ERROR(logger_, "Failed to create AvahiThreadedPoll");
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL");
return TransportAdapter::FAIL;
}
const TransportAdapter::Error err = CreateAvahiClientAndBrowser();
if (err != TransportAdapter::OK) {
- LOG4CXX_TRACE(logger_, "exit with error " << err);
+ LOG4CXX_ERROR(logger_, "Error " << err);
return err;
}
const int poll_start_status = avahi_threaded_poll_start(avahi_threaded_poll_);
if (0 != poll_start_status) {
LOG4CXX_ERROR(logger_, "Failed to start AvahiThreadedPoll");
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL. Condition: 0 != poll_start_status");
return TransportAdapter::FAIL;
}
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
return TransportAdapter::OK;
}
@@ -305,8 +304,10 @@ TransportAdapter::Error DnssdServiceBrowser::Scan() {
void DnssdServiceBrowser::AddService(AvahiIfIndex interface,
AvahiProtocol protocol, const char* name,
const char* type, const char* domain) {
- LOG4CXX_TRACE(logger_, "enter: interface " << interface << " protocol " << protocol <<
- " name " << name << " type " << type << " domain " << domain);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "interface " << interface << " protocol " << protocol << " name " << name << " type " << type << " domain " << domain);
DnssdServiceRecord record;
record.interface = interface;
record.protocol = protocol;
@@ -314,25 +315,25 @@ void DnssdServiceBrowser::AddService(AvahiIfIndex interface,
record.name = name;
record.type = type;
- pthread_mutex_lock(&mutex_);
+ sync_primitives::AutoLock locker(mutex_);
if (service_records_.end()
== std::find(service_records_.begin(), service_records_.end(), record)) {
service_records_.push_back(record);
- avahi_service_resolver_new(
- avahi_client_, interface, protocol, name, type, domain,
- AVAHI_PROTO_INET, static_cast<AvahiLookupFlags>(0),
- AvahiServiceResolverCallback, this);
+ avahi_service_resolver_new(avahi_client_, interface, protocol, name, type,
+ domain, AVAHI_PROTO_INET,
+ static_cast<AvahiLookupFlags>(0),
+ AvahiServiceResolverCallback, this);
}
- pthread_mutex_unlock(&mutex_);
- LOG4CXX_TRACE(logger_, "exit");
}
void DnssdServiceBrowser::RemoveService(AvahiIfIndex interface,
AvahiProtocol protocol,
const char* name, const char* type,
const char* domain) {
- LOG4CXX_TRACE(logger_, "enter: interface " << interface << " protocol " << protocol <<
- " name " << name << " type " << type << " domain " << domain);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "interface " << interface << " protocol " << protocol << " name " << name << " type " << type << " domain " << domain);
DnssdServiceRecord record;
record.interface = interface;
record.protocol = protocol;
@@ -340,42 +341,38 @@ void DnssdServiceBrowser::RemoveService(AvahiIfIndex interface,
record.type = type;
record.domain_name = domain;
- pthread_mutex_lock(&mutex_);
+ sync_primitives::AutoLock locker(mutex_);
service_records_.erase(
- std::remove(service_records_.begin(), service_records_.end(), record),
- service_records_.end());
- pthread_mutex_unlock(&mutex_);
- LOG4CXX_TRACE(logger_, "exit");
+ std::remove(service_records_.begin(), service_records_.end(), record),
+ service_records_.end());
}
DeviceVector DnssdServiceBrowser::PrepareDeviceVector() const {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
std::map<uint32_t, TcpDevice*> devices;
for (ServiceRecords::const_iterator it = service_records_.begin();
- it != service_records_.end(); ++it) {
+ it != service_records_.end(); ++it) {
const DnssdServiceRecord& service_record = *it;
if (service_record.host_name.empty()) {
continue;
}
if (devices[service_record.addr] == 0) {
devices[service_record.addr] = new TcpDevice(service_record.addr,
- service_record.host_name);
+ service_record.host_name);
}
if (devices[service_record.addr] != 0) {
devices[service_record.addr]->AddDiscoveredApplication(
- service_record.port);
+ service_record.port);
}
}
DeviceVector device_vector;
device_vector.reserve(devices.size());
for (std::map<uint32_t, TcpDevice*>::const_iterator it = devices.begin();
- it != devices.end(); ++it) {
+ it != devices.end(); ++it) {
device_vector.push_back(DeviceSptr(it->second));
}
- LOG4CXX_TRACE(logger_, "exit");
return device_vector;
}
-} // namespace
-} // namespace
-
+} // 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 c0f39cc49..28a3c389d 100644
--- a/src/components/transport_manager/src/tcp/tcp_client_listener.cc
+++ b/src/components/transport_manager/src/tcp/tcp_client_listener.cc
@@ -53,7 +53,7 @@
#include <sstream>
#include "utils/logger.h"
-
+#include "utils/threads/thread.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/tcp/tcp_device.h"
#include "transport_manager/tcp/tcp_socket_connection.h"
@@ -66,35 +66,78 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
TcpClientListener::TcpClientListener(TransportAdapterController* controller,
const uint16_t port,
const bool enable_keepalive)
- : port_(port),
- enable_keepalive_(enable_keepalive),
- controller_(controller),
- thread_(threads::CreateThread("TcpClientListener", this)),
- socket_(-1),
- thread_stop_requested_(false) { }
+ : port_(port),
+ enable_keepalive_(enable_keepalive),
+ controller_(controller),
+ thread_(0),
+ socket_(-1),
+ thread_stop_requested_(false) {
+ thread_ = threads::CreateThread("TcpClientListener",
+ new ListeningThreadDelegate(this));
+}
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;
+ setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));
+
+ if (bind(socket_, reinterpret_cast<sockaddr*>(&server_address),
+ sizeof(server_address)) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "bind() failed");
+ return TransportAdapter::FAIL;
+ }
+
+ const int kBacklog = 128;
+ if (0 != listen(socket_, kBacklog)) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "listen() failed");
+ return TransportAdapter::FAIL;
+ }
return TransportAdapter::OK;
}
void TcpClientListener::Terminate() {
- LOG4CXX_TRACE(logger_, "enter");
- if (TransportAdapter::OK != StopListening()) {
- LOG4CXX_ERROR(logger_, "Cannot stop listening TCP");
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (socket_ == -1) {
+ LOG4CXX_WARN(logger_, "Socket has been closed");
+ return;
}
- LOG4CXX_TRACE(logger_, "exit");
+ 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");
+ }
+ socket_ = -1;
}
bool TcpClientListener::IsInitialised() const {
- return true;
+ return thread_;
}
TcpClientListener::~TcpClientListener() {
- LOG4CXX_INFO(logger_, "destructor");
+ LOG4CXX_AUTO_TRACE(logger_);
+ StopListening();
+ delete thread_->delegate();
+ threads::DeleteThread(thread_);
+ Terminate();
}
void SetKeepaliveOptions(const int fd) {
- LOG4CXX_TRACE(logger_, "enter. fd: " << fd);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "fd: " << fd);
int yes = 1;
int keepidle = 3; // 3 seconds to disconnection detecting
int keepcnt = 5;
@@ -108,7 +151,7 @@ void SetKeepaliveOptions(const int fd) {
setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &user_timeout,
sizeof(user_timeout));
#elif defined(__QNX__) // __linux__
- // TODO (KKolodiy): Out of order!
+ // TODO(KKolodiy): Out of order!
const int kMidLength = 4;
int mib[kMidLength];
@@ -130,23 +173,24 @@ void SetKeepaliveOptions(const int fd) {
mib[3] = TCPCTL_KEEPINTVL;
sysctl(mib, kMidLength, NULL, NULL, &keepintvl, sizeof(keepintvl));
- struct timeval tval = { 0 };
+ struct timeval tval = {0};
tval.tv_sec = keepidle;
setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &yes, sizeof(yes));
setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &tval, sizeof(tval));
#endif // __QNX__
- LOG4CXX_TRACE(logger_, "exit");
}
-void TcpClientListener::threadMain() {
- LOG4CXX_TRACE(logger_, "enter");
+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,
+ 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;
}
@@ -157,6 +201,7 @@ void TcpClientListener::threadMain() {
if (AF_INET != client_address.sin_family) {
LOG4CXX_DEBUG(logger_, "Address of connected client is invalid");
+ close(connection_fd);
continue;
}
@@ -169,99 +214,78 @@ void TcpClientListener::threadMain() {
SetKeepaliveOptions(connection_fd);
}
- TcpDevice* tcp_device = new TcpDevice(client_address.sin_addr.s_addr, device_name);
+ TcpDevice* tcp_device = new TcpDevice(client_address.sin_addr.s_addr,
+ device_name);
DeviceSptr device = controller_->AddDevice(tcp_device);
tcp_device = static_cast<TcpDevice*>(device.get());
const ApplicationHandle app_handle = tcp_device->AddIncomingApplication(
- connection_fd);
+ connection_fd);
TcpSocketConnection* connection(
- new TcpSocketConnection(device->unique_device_id(), app_handle,
- controller_));
+ new TcpSocketConnection(device->unique_device_id(), app_handle,
+ controller_));
connection->set_socket(connection_fd);
const TransportAdapter::Error error = connection->Start();
if (error != TransportAdapter::OK) {
delete connection;
}
}
- LOG4CXX_TRACE(logger_, "exit");
}
-TransportAdapter::Error TcpClientListener::StartListening() {
- LOG4CXX_TRACE(logger_, "enter");
- if (thread_->is_running()) {
- LOG4CXX_TRACE(logger_,
- "exit with TransportAdapter::BAD_STATE. Condition: thread_started_");
- return TransportAdapter::BAD_STATE;
- }
-
- socket_ = socket(AF_INET, SOCK_STREAM, 0);
-
- if (-1 == socket_) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create socket");
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL. Condition: -1 == socket_");
- return TransportAdapter::FAIL;
- }
-
+void TcpClientListener::StopLoop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ 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;
+ connect(byesocket, reinterpret_cast<sockaddr*>(&server_address),
+ sizeof(server_address));
+ shutdown(byesocket, SHUT_RDWR);
+ close(byesocket);
+}
- int optval = 1;
- setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));
-
- if (0 != bind(socket_, (sockaddr*) &server_address, sizeof(server_address))) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "bind() failed");
- LOG4CXX_TRACE(logger_,
- "exit with TransportAdapter::FAIL. Condition: 0 != bind(socket_, (sockaddr*) &server_address, sizeof(server_address))");
- return TransportAdapter::FAIL;
- }
-
- if (0 != listen(socket_, 128)) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "listen() failed");
- LOG4CXX_TRACE(logger_,
- "exit with TransportAdapter::FAIL. Condition: 0 != listen(socket_, 128)");
- return TransportAdapter::FAIL;
+TransportAdapter::Error TcpClientListener::StartListening() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (thread_->is_running()) {
+ LOG4CXX_WARN(logger_,
+ "TransportAdapter::BAD_STATE. Listener has already been started");
+ return TransportAdapter::BAD_STATE;
}
- if (thread_->start()) {
- LOG4CXX_DEBUG(logger_, "Tcp client listener thread started");
- } else {
+ if (!thread_->start()) {
LOG4CXX_ERROR(logger_, "Tcp client listener thread start failed");
return TransportAdapter::FAIL;
}
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
+ LOG4CXX_INFO(logger_, "Tcp client listener has started successfully");
return TransportAdapter::OK;
}
-bool TcpClientListener::exitThreadMain() {
- StopListening();
- return true;
+void TcpClientListener::ListeningThreadDelegate::exitThreadMain() {
+ parent_->StopLoop();
+}
+
+void TcpClientListener::ListeningThreadDelegate::threadMain() {
+ parent_->Loop();
+}
+
+TcpClientListener::ListeningThreadDelegate::ListeningThreadDelegate(
+ TcpClientListener* parent)
+ : parent_(parent) {
}
TransportAdapter::Error TcpClientListener::StopListening() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
if (!thread_->is_running()) {
- LOG4CXX_TRACE(logger_,
- "exit with TransportAdapter::BAD_STATE. Condition !thread_started_");
+ LOG4CXX_DEBUG(logger_, "TcpClientListener is not running now");
return TransportAdapter::BAD_STATE;
}
- 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;
- connect(byesocket, (sockaddr*)&server_address, sizeof(server_address));
- shutdown(byesocket, SHUT_RDWR);
- close(byesocket);
- LOG4CXX_DEBUG(logger_, "Tcp client listener thread terminated");
- close(socket_);
- socket_ = -1;
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
+ thread_->join();
+
+ LOG4CXX_INFO(logger_, "Tcp client listener has stopped successfully");
return TransportAdapter::OK;
}
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 69173a0e0..7c6c06ddc 100644
--- a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
+++ b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
@@ -1,6 +1,5 @@
-/**
- *
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +40,9 @@ namespace transport_adapter {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
-TcpConnectionFactory::TcpConnectionFactory(TransportAdapterController* controller)
- : controller_(controller) {
+TcpConnectionFactory::TcpConnectionFactory(
+ TransportAdapterController* controller)
+ : controller_(controller) {
}
TransportAdapter::Error TcpConnectionFactory::Init() {
@@ -50,19 +50,22 @@ TransportAdapter::Error TcpConnectionFactory::Init() {
}
TransportAdapter::Error TcpConnectionFactory::CreateConnection(
- const DeviceUID& device_uid, const ApplicationHandle& app_handle) {
- LOG4CXX_TRACE(logger_, "enter. DeviceUID: " << &device_uid << ", ApplicationHandle: " <<
- &app_handle);
+ const DeviceUID& device_uid, const ApplicationHandle& app_handle) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "DeviceUID: " << &device_uid << ", ApplicationHandle: " << &app_handle);
TcpServerOiginatedSocketConnection* connection(
- new TcpServerOiginatedSocketConnection(device_uid, app_handle,
- controller_));
- TransportAdapter::Error error = connection->Start();
- if (TransportAdapter::OK != error) {
- LOG4CXX_ERROR(logger_, "Transport adapter error " << error);
- delete connection;
+ new TcpServerOiginatedSocketConnection(device_uid, app_handle,
+ controller_));
+ controller_->ConnectionCreated(connection, device_uid, app_handle);
+ if (connection->Start() == TransportAdapter::OK) {
+ LOG4CXX_DEBUG(logger_, "TCP connection initialised");
+ return TransportAdapter::OK;
+ } else {
+ LOG4CXX_ERROR(logger_, "Could not initialise TCP connection");
+ return TransportAdapter::FAIL;
}
- LOG4CXX_TRACE(logger_, "exit with error " << error);
- return error;
}
void TcpConnectionFactory::Terminate() {
diff --git a/src/components/transport_manager/src/tcp/tcp_device.cc b/src/components/transport_manager/src/tcp/tcp_device.cc
index 2540c26ed..2dacd9e8a 100644
--- a/src/components/transport_manager/src/tcp/tcp_device.cc
+++ b/src/components/transport_manager/src/tcp/tcp_device.cc
@@ -1,4 +1,4 @@
-/**
+/*
*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
@@ -30,31 +30,34 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-
+#include "utils/logger.h"
#include "transport_manager/tcp/tcp_device.h"
-#include "utils/logger.h"
namespace transport_manager {
namespace transport_adapter {
+//CREATE_LOGGERPTR_LOCAL(logger_, "TransportManager")
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
TcpDevice::TcpDevice(const in_addr_t& in_addr, const std::string& name)
- :
- Device(name, name),
- in_addr_(in_addr),
- last_handle_(0) {
- pthread_mutex_init(&applications_mutex_, 0);
+ : Device(name, name),
+ applications_mutex_(),
+ in_addr_(in_addr),
+ last_handle_(0) {
+ LOG4CXX_AUTO_TRACE(logger_);
}
bool TcpDevice::IsSameAs(const Device* other) const {
- LOG4CXX_TRACE(logger_, "enter. Device: " << other);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Device: " << other);
const TcpDevice* other_tcp_device = static_cast<const TcpDevice*>(other);
if (other_tcp_device->in_addr_ == in_addr_) {
- LOG4CXX_TRACE(logger_,
- "exit with TRUE. Condition: other_tcp_device->in_addr_ == in_addr_");
+ LOG4CXX_TRACE(
+ logger_,
+ "exit with TRUE. Condition: other_tcp_device->in_addr_ == in_addr_");
return true;
} else {
LOG4CXX_TRACE(logger_, "exit with FALSE");
@@ -63,91 +66,88 @@ bool TcpDevice::IsSameAs(const Device* other) const {
}
ApplicationList TcpDevice::GetApplicationList() const {
- LOG4CXX_TRACE(logger_, "enter");
- pthread_mutex_lock(&applications_mutex_);
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock locker(applications_mutex_);
ApplicationList app_list;
for (std::map<ApplicationHandle, Application>::const_iterator it =
- applications_.begin(); it != applications_.end(); ++it) {
+ applications_.begin(); it != applications_.end(); ++it) {
app_list.push_back(it->first);
}
- pthread_mutex_unlock(&applications_mutex_);
- LOG4CXX_TRACE(logger_, "exit with app_list. It's size = " << app_list.size());
return app_list;
}
ApplicationHandle TcpDevice::AddIncomingApplication(int socket_fd) {
- LOG4CXX_TRACE(logger_, "enter. Socket_fd: " << socket_fd);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Socket_fd: " << socket_fd);
Application app;
app.incoming = true;
app.socket = socket_fd;
- app.port = 0; // this line removes compiler warning
- pthread_mutex_lock(&applications_mutex_);
+ app.port = 0; // this line removes compiler warning
+ sync_primitives::AutoLock locker(applications_mutex_);
const ApplicationHandle app_handle = ++last_handle_;
applications_[app_handle] = app;
- pthread_mutex_unlock(&applications_mutex_);
- LOG4CXX_TRACE(logger_, "exit with app_handle " << app_handle);
+ LOG4CXX_DEBUG(logger_, "App_handle " << app_handle);
return app_handle;
}
ApplicationHandle TcpDevice::AddDiscoveredApplication(int port) {
- LOG4CXX_TRACE(logger_, "enter. port " << port);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Port " << port);
Application app;
app.incoming = false;
app.socket = 0; // this line removes compiler warning
app.port = port;
- pthread_mutex_lock(&applications_mutex_);
+ sync_primitives::AutoLock locker(applications_mutex_);
const ApplicationHandle app_handle = ++last_handle_;
applications_[app_handle] = app;
- pthread_mutex_unlock(&applications_mutex_);
- LOG4CXX_TRACE(logger_, "exit with app_handle " << app_handle);
+ LOG4CXX_DEBUG(logger_, "App_handle " << app_handle);
return app_handle;
}
-
void TcpDevice::RemoveApplication(const ApplicationHandle app_handle) {
- LOG4CXX_TRACE(logger_, "enter. ApplicationHandle: " << app_handle);
- pthread_mutex_lock(&applications_mutex_);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "ApplicationHandle: " << app_handle);
+ sync_primitives::AutoLock locker(applications_mutex_);
applications_.erase(app_handle);
- pthread_mutex_unlock(&applications_mutex_);
- LOG4CXX_TRACE(logger_, "exit");
}
TcpDevice::~TcpDevice() {
- pthread_mutex_destroy(&applications_mutex_);
+ LOG4CXX_AUTO_TRACE(logger_);
}
int TcpDevice::GetApplicationSocket(const ApplicationHandle app_handle) const {
- LOG4CXX_TRACE(logger_, "enter. ApplicationHandle: " << app_handle);
- std::map<ApplicationHandle, Application>::const_iterator it = applications_.find(
- app_handle);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "ApplicationHandle: " << app_handle);
+ std::map<ApplicationHandle, Application>::const_iterator it = applications_
+ .find(app_handle);
if (applications_.end() == it) {
- LOG4CXX_TRACE(logger_, "exit with -1. Condition: applications_.end() == it");
+ LOG4CXX_WARN(logger_, "Application was not found");
return -1;
}
if (!it->second.incoming) {
- LOG4CXX_TRACE(logger_, "exit with -1. Condition: !it->second.incoming");
+ LOG4CXX_WARN(logger_, "Application is not incoming");
return -1;
}
- LOG4CXX_TRACE(logger_, "exit with socket " << it->second.socket);
+ LOG4CXX_DEBUG(logger_, "socket " << it->second.socket);
return it->second.socket;
}
int TcpDevice::GetApplicationPort(const ApplicationHandle app_handle) const {
- LOG4CXX_TRACE(logger_, "enter. ApplicationHandle: " << app_handle);
- std::map<ApplicationHandle, Application>::const_iterator it = applications_.find(
- app_handle);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "ApplicationHandle: " << app_handle);
+ std::map<ApplicationHandle, Application>::const_iterator it = applications_
+ .find(app_handle);
if (applications_.end() == it) {
- LOG4CXX_TRACE(logger_, "exit with -1. Condition: applications_.end() == it");
+ LOG4CXX_WARN(logger_, "Application was not found");
return -1;
}
if (it->second.incoming) {
- LOG4CXX_TRACE(logger_, "exit with -1. Condition: it->second.incoming");
+ LOG4CXX_DEBUG(logger_, "Application is incoming");
return -1;
}
- LOG4CXX_TRACE(logger_, "exit with port " << it->second.port);
+ LOG4CXX_DEBUG(logger_, "port " << it->second.port);
return it->second.port;
}
-
} // namespace transport_adapter
} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/tcp_socket_connection.cc b/src/components/transport_manager/src/tcp/tcp_socket_connection.cc
index 3b208d8a0..c5d0e88d8 100644
--- a/src/components/transport_manager/src/tcp/tcp_socket_connection.cc
+++ b/src/components/transport_manager/src/tcp/tcp_socket_connection.cc
@@ -1,4 +1,4 @@
-/**
+/*
*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
@@ -31,25 +31,27 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/tcp/tcp_socket_connection.h"
-#include "transport_manager/tcp/tcp_device.h"
-#include "utils/logger.h"
#include <memory.h>
#include <signal.h>
#include <errno.h>
+#include <unistd.h>
+
+#include "utils/logger.h"
+#include "utils/threads/thread.h"
+#include "transport_manager/tcp/tcp_device.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
namespace transport_manager {
namespace transport_adapter {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
-
TcpSocketConnection::TcpSocketConnection(const DeviceUID& device_uid,
- const ApplicationHandle& app_handle,
- TransportAdapterController* controller)
- : ThreadedSocketConnection(device_uid, app_handle, controller) {
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller)
+ : ThreadedSocketConnection(device_uid, app_handle, controller) {
}
TcpSocketConnection::~TcpSocketConnection() {
@@ -60,30 +62,32 @@ bool TcpSocketConnection::Establish(ConnectError** error) {
}
TcpServerOiginatedSocketConnection::TcpServerOiginatedSocketConnection(
- const DeviceUID& device_uid, const ApplicationHandle& app_handle,
- TransportAdapterController* controller)
- : ThreadedSocketConnection(device_uid, app_handle, controller) {
+ const DeviceUID& device_uid, const ApplicationHandle& app_handle,
+ TransportAdapterController* controller)
+ : ThreadedSocketConnection(device_uid, app_handle, controller) {
}
TcpServerOiginatedSocketConnection::~TcpServerOiginatedSocketConnection() {
}
bool TcpServerOiginatedSocketConnection::Establish(ConnectError** error) {
- LOG4CXX_TRACE(logger_, "enter. error " << error);
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(error);
+ LOG4CXX_DEBUG(logger_, "error " << error);
DeviceSptr device = controller()->FindDevice(device_handle());
if (!device.valid()) {
LOG4CXX_ERROR(logger_, "Device " << device_handle() << " not found");
*error = new ConnectError();
- LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: !device.valid()");
return false;
}
TcpDevice* tcp_device = static_cast<TcpDevice*>(device.get());
- int port;
- if (-1 == (port = tcp_device->GetApplicationPort(application_handle()))) {
- LOG4CXX_ERROR(logger_, "Application port for " << application_handle() << " not found");
+ const int port = tcp_device->GetApplicationPort(application_handle());
+ if (-1 == port) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Application port for " << application_handle() << " not found");
*error = new ConnectError();
- LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: port not found");
return false;
}
@@ -91,7 +95,6 @@ bool TcpServerOiginatedSocketConnection::Establish(ConnectError** error) {
if (socket < 0) {
LOG4CXX_ERROR(logger_, "Failed to create socket");
*error = new ConnectError();
- LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: failed to create socket");
return false;
}
@@ -100,21 +103,20 @@ bool TcpServerOiginatedSocketConnection::Establish(ConnectError** error) {
addr.sin_addr.s_addr = tcp_device->in_addr();
addr.sin_port = htons(port);
- LOG4CXX_INFO(logger_, "Connecting " << inet_ntoa(addr.sin_addr) << ":"
- << port);
+ LOG4CXX_DEBUG(logger_,
+ "Connecting " << inet_ntoa(addr.sin_addr) << ":" << port);
if (::connect(socket, (struct sockaddr*) &addr, sizeof(addr)) < 0) {
- LOG4CXX_ERROR(logger_, "Failed to connect for application "
- << application_handle() << ", error " << errno);
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed to connect for application " << application_handle() << ", error " << errno);
*error = new ConnectError();
- LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: failed to connect to application");
+ ::close(socket);
return false;
}
set_socket(socket);
- LOG4CXX_TRACE(logger_, "exit with TRUE");
return true;
}
} // namespace transport_adapter
} // namespace transport_manager
-
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 3747225a8..3998c02ab 100644
--- a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
+++ b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
@@ -1,5 +1,4 @@
-/**
- *
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -31,18 +30,19 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "transport_manager/tcp/tcp_transport_adapter.h"
+
#include <memory.h>
#include <signal.h>
#include <errno.h>
-#include <sstream>
-#include <cstdlib>
+#include <stdio.h>
-#include "resumption/last_state.h"
+#include <cstdlib>
+#include <sstream>
#include "utils/logger.h"
#include "utils/threads/thread_delegate.h"
-
-#include "transport_manager/tcp/tcp_transport_adapter.h"
+#include "resumption/last_state.h"
#include "transport_manager/tcp/tcp_client_listener.h"
#include "transport_manager/tcp/tcp_connection_factory.h"
#include "transport_manager/tcp/tcp_device.h"
@@ -57,36 +57,37 @@ namespace transport_adapter {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportAdapterImpl")
TcpTransportAdapter::TcpTransportAdapter(const uint16_t port)
- : TransportAdapterImpl(
+ : TransportAdapterImpl(
#ifdef AVAHI_SUPPORT
- new DnssdServiceBrowser(this),
+ new DnssdServiceBrowser(this),
#else
- NULL,
+ NULL,
#endif
- new TcpConnectionFactory(this),
- new TcpClientListener(this, port, false)) {
+ new TcpConnectionFactory(this),
+ new TcpClientListener(this, port, true)) {
}
TcpTransportAdapter::~TcpTransportAdapter() {
}
DeviceType TcpTransportAdapter::GetDeviceType() const {
- return "sdl-tcp";
+ return TCP;
}
void TcpTransportAdapter::Store() const {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
Json::Value tcp_adapter_dictionary;
Json::Value devices_dictionary;
DeviceList device_ids = GetDeviceList();
- for (DeviceList::const_iterator i = device_ids.begin(); i != device_ids.end(); ++i) {
+ for (DeviceList::const_iterator i = device_ids.begin(); i != device_ids.end();
+ ++i) {
DeviceUID device_id = *i;
DeviceSptr device = FindDevice(device_id);
- if (!device) { // device could have been disconnected
+ if (!device) { // device could have been disconnected
continue;
}
- utils::SharedPtr<TcpDevice> tcp_device =
- DeviceSptr::static_pointer_cast<TcpDevice>(device);
+ utils::SharedPtr<TcpDevice> tcp_device = DeviceSptr::static_pointer_cast<
+ TcpDevice>(device);
Json::Value device_dictionary;
device_dictionary["name"] = tcp_device->name();
struct in_addr address;
@@ -94,14 +95,16 @@ void TcpTransportAdapter::Store() const {
device_dictionary["address"] = std::string(inet_ntoa(address));
Json::Value applications_dictionary;
ApplicationList app_ids = tcp_device->GetApplicationList();
- for (ApplicationList::const_iterator j = app_ids.begin(); j != app_ids.end(); ++j) {
+ for (ApplicationList::const_iterator j = app_ids.begin();
+ j != app_ids.end(); ++j) {
ApplicationHandle app_handle = *j;
- if (FindEstablishedConnection(tcp_device->unique_device_id(), app_handle)) {
+ if (FindEstablishedConnection(tcp_device->unique_device_id(),
+ app_handle)) {
int port = tcp_device->GetApplicationPort(app_handle);
- if (port != -1) { // don't want to store incoming applications
+ if (port != -1) { // don't want to store incoming applications
Json::Value application_dictionary;
char port_record[12];
- sprintf(port_record, "%d", port);
+ snprintf(port_record, sizeof(port_record), "%d", port);
application_dictionary["port"] = std::string(port_record);
applications_dictionary.append(application_dictionary);
}
@@ -113,19 +116,18 @@ void TcpTransportAdapter::Store() const {
}
}
tcp_adapter_dictionary["devices"] = devices_dictionary;
- resumption::LastState::instance()->dictionary["TransportManager"]["TcpAdapter"] =
- tcp_adapter_dictionary;
- LOG4CXX_TRACE(logger_, "exit");
+ Json::Value& dictionary = resumption::LastState::instance()->dictionary;
+ dictionary["TransportManager"]["TcpAdapter"] = tcp_adapter_dictionary;
}
bool TcpTransportAdapter::Restore() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
bool errors_occurred = false;
- const Json::Value tcp_adapter_dictionary =
- resumption::LastState::instance()->dictionary["TransportManager"]["TcpAdapter"];
+ const Json::Value tcp_adapter_dictionary = resumption::LastState::instance()
+ ->dictionary["TransportManager"]["TcpAdapter"];
const Json::Value devices_dictionary = tcp_adapter_dictionary["devices"];
for (Json::Value::const_iterator i = devices_dictionary.begin();
- i != devices_dictionary.end(); ++i) {
+ i != devices_dictionary.end(); ++i) {
const Json::Value device_dictionary = *i;
std::string name = device_dictionary["name"].asString();
std::string address_record = device_dictionary["address"].asString();
@@ -133,9 +135,10 @@ bool TcpTransportAdapter::Restore() {
TcpDevice* tcp_device = new TcpDevice(address, name);
DeviceSptr device(tcp_device);
AddDevice(device);
- const Json::Value applications_dictionary = device_dictionary["applications"];
+ const Json::Value applications_dictionary =
+ device_dictionary["applications"];
for (Json::Value::const_iterator j = applications_dictionary.begin();
- j != applications_dictionary.end(); ++j) {
+ j != applications_dictionary.end(); ++j) {
const Json::Value application_dictionary = *j;
std::string port_record = application_dictionary["port"].asString();
int port = atoi(port_record.c_str());
@@ -146,11 +149,7 @@ bool TcpTransportAdapter::Restore() {
}
}
bool result = !errors_occurred;
- if (result) {
- LOG4CXX_TRACE(logger_, "exit with TRUE");
- } else {
- LOG4CXX_TRACE(logger_, "exit with FALSE");
- }
+ LOG4CXX_DEBUG(logger_, "result " << std::boolalpha << result);
return result;
}
diff --git a/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc b/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc
index 1e189ed10..67e41cec2 100644
--- a/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc
+++ b/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -36,7 +36,9 @@
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
+
#include "utils/logger.h"
+#include "utils/threads/thread.h"
#include "transport_manager/transport_adapter/threaded_socket_connection.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
@@ -46,197 +48,173 @@ namespace transport_adapter {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
ThreadedSocketConnection::ThreadedSocketConnection(
- const DeviceUID& device_id, const ApplicationHandle& app_handle,
- TransportAdapterController* controller)
- : read_fd_(-1), write_fd_(-1), controller_(controller),
- frames_to_send_(),
- frames_to_send_mutex_(),
- socket_(-1),
- terminate_flag_(false),
- unexpected_disconnect_(false),
- device_uid_(device_id),
- app_handle_(app_handle)
- {
- pthread_mutex_init(&frames_to_send_mutex_, 0);
+ const DeviceUID& device_id, const ApplicationHandle& app_handle,
+ TransportAdapterController* controller)
+ : read_fd_(-1),
+ write_fd_(-1),
+ controller_(controller),
+ frames_to_send_(),
+ frames_to_send_mutex_(),
+ socket_(-1),
+ terminate_flag_(false),
+ unexpected_disconnect_(false),
+ device_uid_(device_id),
+ app_handle_(app_handle),
+ thread_(NULL) {
+ const std::string thread_name = std::string("Socket ") + device_handle();
+ thread_ = threads::CreateThread(thread_name.c_str(),
+ new SocketConnectionDelegate(this));
}
ThreadedSocketConnection::~ThreadedSocketConnection() {
- terminate_flag_ = true;
- Notify();
- pthread_mutex_destroy(&frames_to_send_mutex_);
+ LOG4CXX_AUTO_TRACE(logger_);
+ Disconnect();
+ thread_->join();
+ delete thread_->delegate();
+ threads::DeleteThread(thread_);
+ if (-1 != read_fd_) {
+ close(read_fd_);
+ }
+ if (-1 != write_fd_) {
+ close(write_fd_);
+ }
}
void ThreadedSocketConnection::Abort() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
unexpected_disconnect_ = true;
terminate_flag_ = true;
- LOG4CXX_TRACE(logger_, "exit");
}
TransportAdapter::Error ThreadedSocketConnection::Start() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
int fds[2];
const int pipe_ret = pipe(fds);
if (0 == pipe_ret) {
- LOG4CXX_DEBUG(logger_, "pipe created(#" << pthread_self() << ")");
+ LOG4CXX_DEBUG(logger_, "pipe created");
read_fd_ = fds[0];
write_fd_ = fds[1];
} else {
- LOG4CXX_WARN(logger_, "pipe creation failed (#" << pthread_self() << ")");
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL");
+ LOG4CXX_ERROR(logger_, "pipe creation failed");
return TransportAdapter::FAIL;
}
const int fcntl_ret = fcntl(read_fd_, F_SETFL,
fcntl(read_fd_, F_GETFL) | O_NONBLOCK);
if (0 != fcntl_ret) {
- LOG4CXX_WARN(logger_, "fcntl failed (#" << pthread_self() << ")");
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL");
+ LOG4CXX_ERROR(logger_, "fcntl failed");
return TransportAdapter::FAIL;
}
- const std::string thread_name = std::string("Socket ") + device_handle();
- thread_ = threads::CreateThread(thread_name.c_str(), this);
-
if (!thread_->start()) {
- LOG4CXX_WARN(logger_, "thread creation failed (#" << pthread_self() << ")");
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL");
+ LOG4CXX_ERROR(logger_, "thread creation failed");
return TransportAdapter::FAIL;
}
- LOG4CXX_DEBUG(logger_, "thread created (#" << pthread_self() << ")");
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
+ LOG4CXX_INFO(logger_, "thread created");
return TransportAdapter::OK;
}
void ThreadedSocketConnection::Finalize() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
if (unexpected_disconnect_) {
- LOG4CXX_DEBUG(logger_, "unexpected_disconnect (#" << pthread_self() << ")");
+ LOG4CXX_DEBUG(logger_, "unexpected_disconnect");
controller_->ConnectionAborted(device_handle(), application_handle(),
CommunicationError());
} else {
- LOG4CXX_DEBUG(logger_, "not unexpected_disconnect (#" << pthread_self() << ")");
+ LOG4CXX_DEBUG(logger_, "not unexpected_disconnect");
controller_->ConnectionFinished(device_handle(), application_handle());
}
close(socket_);
- LOG4CXX_TRACE(logger_, "exit");
}
TransportAdapter::Error ThreadedSocketConnection::Notify() const {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
if (-1 == write_fd_) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_,
- "Failed to wake up connection thread for connection " << this);
+ LOG4CXX_ERROR_WITH_ERRNO(
+ logger_, "Failed to wake up connection thread for connection " << this);
LOG4CXX_TRACE(logger_, "exit with TransportAdapter::BAD_STATE");
return TransportAdapter::BAD_STATE;
}
uint8_t c = 0;
- if (1 == write(write_fd_, &c, 1)) {
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
- return TransportAdapter::OK;
- } else {
+ if (1 != write(write_fd_, &c, 1)) {
LOG4CXX_ERROR_WITH_ERRNO(
- logger_, "Failed to wake up connection thread for connection " << this);
- LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL");
+ logger_, "Failed to wake up connection thread for connection " << this);
return TransportAdapter::FAIL;
}
+ return TransportAdapter::OK;
}
TransportAdapter::Error ThreadedSocketConnection::SendData(
- ::protocol_handler::RawMessagePtr message) {
- LOG4CXX_TRACE(logger_, "enter");
- pthread_mutex_lock(&frames_to_send_mutex_);
+ ::protocol_handler::RawMessagePtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(frames_to_send_mutex_);
frames_to_send_.push(message);
- pthread_mutex_unlock(&frames_to_send_mutex_);
- TransportAdapter::Error error = Notify();
- LOG4CXX_TRACE(logger_, "exit with error" << error);
- return error;
+ return Notify();
}
TransportAdapter::Error ThreadedSocketConnection::Disconnect() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
terminate_flag_ = true;
- TransportAdapter::Error error = Notify();
- LOG4CXX_TRACE(logger_, "exit with error" << error);
- return error;
-}
-
-bool ThreadedSocketConnection::exitThreadMain() {
- terminate_flag_ = true;
- Notify();
- return true;
+ return Notify();
}
void ThreadedSocketConnection::threadMain() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
controller_->ConnectionCreated(this, device_uid_, app_handle_);
ConnectError* connect_error = NULL;
- if (Establish(&connect_error)) {
- LOG4CXX_DEBUG(logger_, "Connection established (#" << pthread_self() << ")");
- controller_->ConnectDone(device_handle(), application_handle());
- while (!terminate_flag_) {
- Transmit();
- }
- LOG4CXX_DEBUG(logger_, "Connection is to finalize (#" << pthread_self() << ")");
- Finalize();
- while (!frames_to_send_.empty()) {
- LOG4CXX_INFO(logger_, "removing message (#" << pthread_self() << ")");
- ::protocol_handler::RawMessagePtr message = frames_to_send_.front();
- frames_to_send_.pop();
- controller_->DataSendFailed(device_handle(), application_handle(),
- message, DataSendError());
- }
- controller_->DisconnectDone(device_handle(), application_handle());
- } else {
- LOG4CXX_ERROR(logger_, "Connection Establish failed (#" << pthread_self() << ")");
- controller_->ConnectFailed(device_handle(), application_handle(),
- *connect_error);
+ if (!Establish(&connect_error)) {
+ LOG4CXX_ERROR(logger_, "Connection Establish failed");
delete connect_error;
}
- if (-1 != read_fd_) {
- close(read_fd_);
+ LOG4CXX_DEBUG(logger_, "Connection established");
+ controller_->ConnectDone(device_handle(), application_handle());
+ while (!terminate_flag_) {
+ Transmit();
}
- if (-1 != write_fd_) {
- close(write_fd_);
+ LOG4CXX_DEBUG(logger_, "Connection is to finalize");
+ Finalize();
+ sync_primitives::AutoLock auto_lock(frames_to_send_mutex_);
+ while (!frames_to_send_.empty()) {
+ LOG4CXX_INFO(logger_, "removing message");
+ ::protocol_handler::RawMessagePtr message = frames_to_send_.front();
+ frames_to_send_.pop();
+ controller_->DataSendFailed(device_handle(), application_handle(),
+ message, DataSendError());
}
- LOG4CXX_TRACE(logger_, "exit");
}
void ThreadedSocketConnection::Transmit() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
- const nfds_t poll_fds_size = 2;
- pollfd poll_fds[poll_fds_size];
+ const nfds_t kPollFdsSize = 2;
+ pollfd poll_fds[kPollFdsSize];
poll_fds[0].fd = socket_;
- poll_fds[0].events = POLLIN | POLLPRI | (frames_to_send_.empty() ? 0 : POLLOUT);
+ poll_fds[0].events = POLLIN | POLLPRI
+ | (frames_to_send_.empty() ? 0 : POLLOUT);
poll_fds[1].fd = read_fd_;
poll_fds[1].events = POLLIN | POLLPRI;
- LOG4CXX_DEBUG(logger_, "poll (#" << pthread_self() << ") " << this);
- if (-1 == poll(poll_fds, poll_fds_size, -1)) {
+ LOG4CXX_DEBUG(logger_, "poll " << this);
+ if (-1 == poll(poll_fds, kPollFdsSize, -1)) {
LOG4CXX_ERROR_WITH_ERRNO(logger_, "poll failed for connection " << this);
Abort();
- LOG4CXX_TRACE(logger_, "exit. Condition: -1 == poll(poll_fds, poll_fds_size, -1)");
return;
}
- LOG4CXX_DEBUG(logger_, "poll is ok (#" << pthread_self() << ") " << this << " revents0:"
- <<
- std::hex << poll_fds[0].revents << " revents1:" << std::hex << poll_fds[1].revents);
+ LOG4CXX_DEBUG(
+ logger_,
+ "poll is ok " << this << " revents0: " << std::hex << poll_fds[0].revents <<
+ " revents1:" << std::hex << poll_fds[1].revents);
// error check
if (0 != (poll_fds[1].revents & (POLLERR | POLLHUP | POLLNVAL))) {
LOG4CXX_ERROR(logger_,
"Notification pipe for connection " << this << " terminated");
Abort();
- LOG4CXX_TRACE(logger_,
- "exit. Condition: 0 != (poll_fds[1].revents & (POLLERR | POLLHUP | POLLNVAL))");
return;
}
if (poll_fds[0].revents & (POLLERR | POLLHUP | POLLNVAL)) {
LOG4CXX_WARN(logger_, "Connection " << this << " terminated");
Abort();
- LOG4CXX_TRACE(logger_,
- "exit. Condition: poll_fds[0].revents & (POLLERR | POLLHUP | POLLNVAL");
return;
}
@@ -250,20 +228,18 @@ void ThreadedSocketConnection::Transmit() {
LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to clear notification pipe");
LOG4CXX_ERROR_WITH_ERRNO(logger_, "poll failed for connection " << this);
Abort();
- LOG4CXX_TRACE(logger_, "exit. Condition: (bytes_read < 0) && (EAGAIN != errno)");
return;
}
// send data if possible
if (!frames_to_send_.empty() && (poll_fds[0].revents | POLLOUT)) {
- LOG4CXX_DEBUG(logger_, "frames_to_send_ not empty() (#" << pthread_self() << ")");
+ LOG4CXX_DEBUG(logger_, "frames_to_send_ not empty() ");
// send data
const bool send_ok = Send();
if (!send_ok) {
- LOG4CXX_ERROR(logger_, "Send() failed (#" << pthread_self() << ")");
+ LOG4CXX_ERROR(logger_, "Send() failed ");
Abort();
- LOG4CXX_TRACE(logger_, "exit. Condition: !send_ok");
return;
}
}
@@ -272,17 +248,15 @@ void ThreadedSocketConnection::Transmit() {
if (poll_fds[0].revents & (POLLIN | POLLPRI)) {
const bool receive_ok = Receive();
if (!receive_ok) {
- LOG4CXX_ERROR(logger_, "Receive() failed (#" << pthread_self() << ")");
+ LOG4CXX_ERROR(logger_, "Receive() failed ");
Abort();
- LOG4CXX_TRACE(logger_, "exit. Condition: !receive_ok");
return;
}
}
- LOG4CXX_TRACE(logger_, "exit");
}
bool ThreadedSocketConnection::Receive() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
uint8_t buffer[4096];
ssize_t bytes_read = -1;
@@ -291,8 +265,8 @@ bool ThreadedSocketConnection::Receive() {
if (bytes_read > 0) {
LOG4CXX_DEBUG(
- logger_,
- "Received " << bytes_read << " bytes for connection " << this);
+ logger_,
+ "Received " << bytes_read << " bytes for connection " << this);
::protocol_handler::RawMessagePtr frame(
new protocol_handler::RawMessage(0, 0, buffer, bytes_read));
controller_->DataReceiveDone(device_handle(), application_handle(),
@@ -301,36 +275,33 @@ bool ThreadedSocketConnection::Receive() {
if (EAGAIN != errno && EWOULDBLOCK != errno) {
LOG4CXX_ERROR_WITH_ERRNO(logger_,
"recv() failed for connection " << this);
- LOG4CXX_TRACE(logger_,
- "exit with FALSE. Condition: EAGAIN != errno && EWOULDBLOCK != errno");
return false;
}
} else {
LOG4CXX_WARN(logger_, "Connection " << this << " closed by remote peer");
- LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: bytes_read >= 0");
return false;
}
} while (bytes_read > 0);
- LOG4CXX_TRACE(logger_, "exit with TRUE");
+
return true;
}
bool ThreadedSocketConnection::Send() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
FrameQueue frames_to_send;
- pthread_mutex_lock(&frames_to_send_mutex_);
+ frames_to_send_mutex_.Acquire();
std::swap(frames_to_send, frames_to_send_);
- pthread_mutex_unlock(&frames_to_send_mutex_);
+ frames_to_send_mutex_.Release();
size_t offset = 0;
while (!frames_to_send.empty()) {
- LOG4CXX_INFO(logger_, "frames_to_send is not empty" << pthread_self() << ")");
+ LOG4CXX_INFO(logger_, "frames_to_send is not empty");
::protocol_handler::RawMessagePtr frame = frames_to_send.front();
const ssize_t bytes_sent = ::send(socket_, frame->data() + offset,
frame->data_size() - offset, 0);
if (bytes_sent >= 0) {
- LOG4CXX_DEBUG(logger_, "bytes_sent >= 0" << pthread_self() << ")");
+ LOG4CXX_DEBUG(logger_, "bytes_sent >= 0");
offset += bytes_sent;
if (offset == frame->data_size()) {
frames_to_send.pop();
@@ -338,7 +309,7 @@ bool ThreadedSocketConnection::Send() {
controller_->DataSendDone(device_handle(), application_handle(), frame);
}
} else {
- LOG4CXX_DEBUG(logger_, "bytes_sent < 0" << pthread_self() << ")");
+ LOG4CXX_DEBUG(logger_, "bytes_sent < 0");
LOG4CXX_ERROR_WITH_ERRNO(logger_, "Send failed for connection " << this);
frames_to_send.pop();
offset = 0;
@@ -346,9 +317,24 @@ bool ThreadedSocketConnection::Send() {
DataSendError());
}
}
- LOG4CXX_TRACE(logger_, "exit with TRUE");
+
return true;
}
-} // namespace
-} // namespace
+ThreadedSocketConnection::SocketConnectionDelegate::SocketConnectionDelegate(
+ ThreadedSocketConnection* connection)
+ : connection_(connection) {
+}
+
+void ThreadedSocketConnection::SocketConnectionDelegate::threadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(connection_);
+ connection_->threadMain();
+}
+
+void ThreadedSocketConnection::SocketConnectionDelegate::exitThreadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
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 3330e93e3..170cb7b73 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,6 +43,16 @@ namespace transport_manager {
namespace transport_adapter {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+namespace {
+DeviceTypes devicesType = {
+ std::make_pair(AOA, std::string("USB")),
+ std::make_pair(PASA_AOA, std::string("USB")),
+ std::make_pair(MME, std::string("USB")),
+ std::make_pair(BLUETOOTH, std::string("BLUETOOTH")),
+ std::make_pair(PASA_BLUETOOTH, std::string("BLUETOOTH")),
+ std::make_pair(TCP, std::string("WIFI"))
+};
+}
TransportAdapterImpl::TransportAdapterImpl(
DeviceScanner* device_scanner,
@@ -53,56 +63,64 @@ TransportAdapterImpl::TransportAdapterImpl(
devices_(),
devices_mutex_(),
connections_(),
- connections_mutex_(),
- device_scanner_(device_scanner),
- server_connection_factory_(server_connection_factory),
- client_connection_listener_(client_connection_listener)
+ connections_lock_(),
#ifdef TIME_TESTER
- , metric_observer_(NULL)
+ metric_observer_(NULL),
#endif // TIME_TESTER
-{
- pthread_mutex_init(&devices_mutex_, 0);
- pthread_mutex_init(&connections_mutex_, 0);
+ device_scanner_(device_scanner),
+ server_connection_factory_(server_connection_factory),
+ client_connection_listener_(client_connection_listener) {
}
TransportAdapterImpl::~TransportAdapterImpl() {
+ Terminate();
+
+ if (device_scanner_) {
+ LOG4CXX_DEBUG(logger_, "Deleting device_scanner_ " << device_scanner_);
+ delete device_scanner_;
+ LOG4CXX_DEBUG(logger_, "device_scanner_ deleted.");
+ }
+ if (server_connection_factory_) {
+ LOG4CXX_DEBUG(logger_, "Deleting server_connection_factory " << server_connection_factory_);
+ delete server_connection_factory_;
+ LOG4CXX_DEBUG(logger_, "server_connection_factory deleted.");
+ }
+ if (client_connection_listener_) {
+ LOG4CXX_DEBUG(logger_, "Deleting client_connection_listener_ " << client_connection_listener_);
+ delete client_connection_listener_;
+ LOG4CXX_DEBUG(logger_, "client_connection_listener_ deleted.");
+ }
+}
+
+void TransportAdapterImpl::Terminate() {
if (device_scanner_) {
device_scanner_->Terminate();
LOG4CXX_DEBUG(logger_, "device_scanner_ " << device_scanner_ << " terminated.");
- delete device_scanner_;
- LOG4CXX_DEBUG(logger_, "device_scanner_ " << device_scanner_ << " deleted.");
}
if (server_connection_factory_) {
server_connection_factory_->Terminate();
LOG4CXX_DEBUG(logger_, "server_connection_factory " << server_connection_factory_ << " terminated.");
- delete server_connection_factory_;
- LOG4CXX_DEBUG(logger_, "server_connection_factory " << server_connection_factory_ << " deleted.");
}
if (client_connection_listener_) {
client_connection_listener_->Terminate();
LOG4CXX_DEBUG(logger_, "client_connection_listener_ " << client_connection_listener_ << " terminated.");
- delete client_connection_listener_;
- LOG4CXX_DEBUG(logger_, "client_connection_listener_ " << client_connection_listener_ << " deleted.");
}
- pthread_mutex_lock(&connections_mutex_);
ConnectionMap connections;
+ connections_lock_.AcquireForWriting();
std::swap(connections, connections_);
- pthread_mutex_unlock(&connections_mutex_);
+ connections_lock_.Release();
connections.clear();
LOG4CXX_DEBUG(logger_, "Connections deleted");
- pthread_mutex_lock(&devices_mutex_);
+ devices_mutex_.Acquire();
DeviceMap devices;
std::swap(devices, devices_);
- pthread_mutex_unlock(&devices_mutex_);
+ devices_mutex_.Release();
devices.clear();
LOG4CXX_DEBUG(logger_, "Devices deleted");
-
- pthread_mutex_destroy(&connections_mutex_);
- pthread_mutex_destroy(&devices_mutex_);
}
TransportAdapter::Error TransportAdapterImpl::Init() {
@@ -159,7 +177,7 @@ TransportAdapter::Error TransportAdapterImpl::Connect(
return BAD_STATE;
}
- pthread_mutex_lock(&connections_mutex_);
+ connections_lock_.AcquireForWriting();
const bool already_exists =
connections_.end() !=
connections_.find(std::make_pair(device_id, app_handle));
@@ -169,7 +187,7 @@ TransportAdapter::Error TransportAdapterImpl::Connect(
info.device_id = device_id;
info.state = ConnectionInfo::NEW;
}
- pthread_mutex_unlock(&connections_mutex_);
+ connections_lock_.Release();
if (already_exists) {
LOG4CXX_TRACE(logger_, "exit with ALREADY_EXISTS");
return ALREADY_EXISTS;
@@ -178,9 +196,9 @@ TransportAdapter::Error TransportAdapterImpl::Connect(
const TransportAdapter::Error err =
server_connection_factory_->CreateConnection(device_id, app_handle);
if (TransportAdapter::OK != err) {
- pthread_mutex_lock(&connections_mutex_);
+ connections_lock_.AcquireForWriting();
connections_.erase(std::make_pair(device_id, app_handle));
- pthread_mutex_unlock(&connections_mutex_);
+ connections_lock_.Release();
}
LOG4CXX_TRACE(logger_, "exit with error: " << err);
return err;
@@ -208,7 +226,7 @@ TransportAdapter::Error TransportAdapterImpl::Disconnect(
LOG4CXX_TRACE(logger_, "exit with BAD_STATE");
return BAD_STATE;
}
- Connection* connection = FindEstablishedConnection(device_id, app_handle);
+ ConnectionSPtr connection = FindEstablishedConnection(device_id, app_handle);
if (connection) {
TransportAdapter::Error err = connection->Disconnect();
LOG4CXX_TRACE(logger_, "exit with error: " << err);
@@ -228,21 +246,25 @@ TransportAdapter::Error TransportAdapterImpl::DisconnectDevice(
}
Error error = OK;
- pthread_mutex_lock(&connections_mutex_);
- for (ConnectionMap::iterator it = connections_.begin();
- it != connections_.end(); ++it) {
- ConnectionInfo& info = it->second;
- if (info.device_id == device_id &&
- info.state != ConnectionInfo::FINALISING) {
- if (OK != info.connection->Disconnect()) {
- error = FAIL;
- LOG4CXX_ERROR(logger_, "Error on disconnect" << error);
- }
+ std::vector<ConnectionInfo> to_disconnect;
+ connections_lock_.AcquireForReading();
+ for (ConnectionMap::const_iterator i = connections_.begin(); i != connections_.end(); ++i) {
+ ConnectionInfo info = i->second;
+ if (info.device_id == device_id && info.state != ConnectionInfo::FINALISING) {
+ to_disconnect.push_back(info);
}
}
- pthread_mutex_unlock(&connections_mutex_);
- LOG4CXX_TRACE(logger_, "exit with error " << error);
+ connections_lock_.Release();
+
+ for (std::vector<ConnectionInfo>::const_iterator j = to_disconnect.begin(); j != to_disconnect.end(); ++j) {
+ ConnectionInfo info = *j;
+ if (OK != info.connection->Disconnect()) {
+ error = FAIL;
+ LOG4CXX_ERROR(logger_, "Error on disconnect " << error);
+ }
+ }
+
return error;
}
@@ -256,7 +278,7 @@ TransportAdapter::Error TransportAdapterImpl::SendData(
return BAD_STATE;
}
- Connection* connection = FindEstablishedConnection(device_id, app_handle);
+ ConnectionSPtr connection = FindEstablishedConnection(device_id, app_handle);
if (connection) {
TransportAdapter::Error err = connection->SendData(data);
LOG4CXX_TRACE(logger_, "exit with error: " << err);
@@ -293,19 +315,23 @@ TransportAdapter::Error TransportAdapterImpl::StopClientListening() {
return BAD_STATE;
}
TransportAdapter::Error err = client_connection_listener_->StopListening();
+ for(DeviceMap::iterator it = devices_.begin();
+ it != devices_.end();
+ ++it) {
+ it->second->Stop();
+ }
LOG4CXX_TRACE(logger_, "exit with error: " << err);
return err;
}
DeviceList TransportAdapterImpl::GetDeviceList() const {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
DeviceList devices;
- pthread_mutex_lock(&devices_mutex_);
+ sync_primitives::AutoLock locker(devices_mutex_);
for (DeviceMap::const_iterator it = devices_.begin(); it != devices_.end();
++it) {
devices.push_back(it->first);
}
- pthread_mutex_unlock(&devices_mutex_);
LOG4CXX_TRACE(logger_, "exit with DeviceList. It's' size = " << devices.size());
return devices;
}
@@ -314,7 +340,7 @@ DeviceSptr TransportAdapterImpl::AddDevice(DeviceSptr device) {
LOG4CXX_TRACE(logger_, "enter. device: " << device);
DeviceSptr existing_device;
bool same_device_found = false;
- pthread_mutex_lock(&devices_mutex_);
+ devices_mutex_.Acquire();
for (DeviceMap::const_iterator i = devices_.begin(); i != devices_.end();
++i) {
existing_device = i->second;
@@ -327,7 +353,7 @@ DeviceSptr TransportAdapterImpl::AddDevice(DeviceSptr device) {
if (!same_device_found) {
devices_[device->unique_device_id()] = device;
}
- pthread_mutex_unlock(&devices_mutex_);
+ devices_mutex_.Release();
if (same_device_found) {
LOG4CXX_TRACE(logger_, "exit with TRUE. Condition: same_device_found");
return existing_device;
@@ -352,7 +378,7 @@ void TransportAdapterImpl::SearchDeviceDone(const DeviceVector& devices) {
DeviceSptr device = *it;
bool device_found = false;
- pthread_mutex_lock(&devices_mutex_);
+ devices_mutex_.Acquire();
for (DeviceMap::iterator it = devices_.begin(); it != devices_.end();
++it) {
DeviceSptr existing_device = it->second;
@@ -363,7 +389,7 @@ void TransportAdapterImpl::SearchDeviceDone(const DeviceVector& devices) {
break;
}
}
- pthread_mutex_unlock(&devices_mutex_);
+ devices_mutex_.Release();
if (!device_found) {
LOG4CXX_INFO(logger_, "Adding new device " << device->unique_device_id()
@@ -375,7 +401,7 @@ void TransportAdapterImpl::SearchDeviceDone(const DeviceVector& devices) {
new_devices[device->unique_device_id()] = device;
}
- pthread_mutex_lock(&connections_mutex_);
+ connections_lock_.AcquireForReading();
std::set<DeviceUID> connected_devices;
for (ConnectionMap::const_iterator it = connections_.begin();
it != connections_.end(); ++it) {
@@ -384,10 +410,10 @@ void TransportAdapterImpl::SearchDeviceDone(const DeviceVector& devices) {
connected_devices.insert(info.device_id);
}
}
- pthread_mutex_unlock(&connections_mutex_);
+ connections_lock_.Release();
DeviceMap all_devices = new_devices;
- pthread_mutex_lock(&devices_mutex_);
+ devices_mutex_.Acquire();
for (DeviceMap::iterator it = devices_.begin(); it != devices_.end(); ++it) {
DeviceSptr existing_device = it->second;
@@ -399,7 +425,7 @@ void TransportAdapterImpl::SearchDeviceDone(const DeviceVector& devices) {
}
}
devices_ = all_devices;
- pthread_mutex_unlock(&devices_mutex_);
+ devices_mutex_.Release();
for (TransportAdapterListenerList::iterator it = listeners_.begin();
it != listeners_.end(); ++it) {
@@ -453,24 +479,22 @@ bool TransportAdapterImpl::IsServerOriginatedConnectSupported() const {
}
bool TransportAdapterImpl::IsClientOriginatedConnectSupported() const {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_TRACE(logger_, "IsClientOriginatedConnectSupported");
return client_connection_listener_ != 0;
- LOG4CXX_TRACE(logger_, "exit");
}
void TransportAdapterImpl::ConnectionCreated(
- Connection* connection, const DeviceUID& device_id,
+ ConnectionSPtr connection, const DeviceUID& device_id,
const ApplicationHandle& app_handle) {
LOG4CXX_TRACE(logger_, "enter connection:" << connection << ", device_id: " << &device_id
<< ", app_handle: " << &app_handle);
- pthread_mutex_lock(&connections_mutex_);
+ connections_lock_.AcquireForReading();
ConnectionInfo& info = connections_[std::make_pair(device_id, app_handle)];
info.app_handle = app_handle;
info.device_id = device_id;
info.connection = connection;
info.state = ConnectionInfo::NEW;
- pthread_mutex_unlock(&connections_mutex_);
- LOG4CXX_TRACE(logger_, "exit");
+ connections_lock_.Release();
}
void TransportAdapterImpl::DeviceDisconnected(
@@ -488,42 +512,55 @@ void TransportAdapterImpl::DeviceDisconnected(
}
}
- pthread_mutex_lock(&connections_mutex_);
for (TransportAdapterListenerList::iterator it = listeners_.begin();
it != listeners_.end(); ++it) {
TransportAdapterListener* listener = *it;
listener->OnDisconnectDeviceDone(this, device_uid);
}
+
+ connections_lock_.AcquireForWriting();
for (ApplicationList::const_iterator i = app_list.begin(); i != app_list.end(); ++i) {
ApplicationHandle app_handle = *i;
connections_.erase(std::make_pair(device_uid, app_handle));
}
- pthread_mutex_unlock(&connections_mutex_);
+ connections_lock_.Release();
RemoveDevice(device_uid);
LOG4CXX_TRACE(logger_, "exit");
}
-void TransportAdapterImpl::DisconnectDone(
- const DeviceUID& device_handle, const ApplicationHandle& app_handle) {
- const DeviceUID device_uid = device_handle;
- const ApplicationHandle app_uid = app_handle;
- LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_uid << ", app_handle: " <<
- &app_uid);
- bool device_disconnected = true;
- pthread_mutex_lock(&connections_mutex_);
+bool TransportAdapterImpl::IsSingleApplication(const DeviceUID& device_uid,
+ const ApplicationHandle& app_uid) {
+ sync_primitives::AutoReadLock locker(connections_lock_);
for (ConnectionMap::const_iterator it = connections_.begin();
it != connections_.end(); ++it) {
const DeviceUID& current_device_id = it->first.first;
const ApplicationHandle& current_app_handle = it->first.second;
if (current_device_id == device_uid && current_app_handle != app_uid) {
- device_disconnected = false;
LOG4CXX_DEBUG(logger_,
"break. Condition: current_device_id == device_id && current_app_handle != app_handle");
- break;
+
+ return false;
}
}
- pthread_mutex_unlock(&connections_mutex_);
+ return true;
+}
+
+void TransportAdapterImpl::DisconnectDone(
+ const DeviceUID& device_handle, const ApplicationHandle& app_handle) {
+ const DeviceUID device_uid = device_handle;
+ const ApplicationHandle app_uid = app_handle;
+ LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_uid << ", app_handle: " <<
+ &app_uid);
+ DeviceSptr device = FindDevice(device_handle);
+ if (!device) {
+ LOG4CXX_WARN(logger_, "Device: uid " << &device_uid << " not found");
+ return;
+ }
+
+ bool device_disconnected = ToBeAutoDisconnected(device) &&
+ IsSingleApplication(device_uid, app_uid);
+
for (TransportAdapterListenerList::iterator it = listeners_.begin();
it != listeners_.end(); ++it) {
TransportAdapterListener* listener = *it;
@@ -532,9 +569,9 @@ void TransportAdapterImpl::DisconnectDone(
listener->OnDisconnectDeviceDone(this, device_uid);
}
}
- pthread_mutex_lock(&connections_mutex_);
+ connections_lock_.AcquireForWriting();
connections_.erase(std::make_pair(device_uid, app_uid));
- pthread_mutex_unlock(&connections_mutex_);
+ connections_lock_.Release();
if (device_disconnected) {
RemoveDevice(device_uid);
@@ -600,14 +637,13 @@ DeviceSptr TransportAdapterImpl::FindDevice(const DeviceUID& device_id) const {
LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id);
DeviceSptr ret;
LOG4CXX_DEBUG(logger_, "devices_.size() = " << devices_.size());
- pthread_mutex_lock(&devices_mutex_);
+ sync_primitives::AutoLock locker(devices_mutex_);
DeviceMap::const_iterator it = devices_.find(device_id);
if (it != devices_.end()) {
ret = it->second;
} else {
LOG4CXX_WARN(logger_, "Device " << device_id << " not found.");
}
- pthread_mutex_unlock(&devices_mutex_);
LOG4CXX_TRACE(logger_, "exit with DeviceSptr: " << ret);
return ret;
}
@@ -616,14 +652,14 @@ void TransportAdapterImpl::ConnectDone(const DeviceUID& device_id,
const ApplicationHandle& app_handle) {
LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", app_handle: " <<
&app_handle);
- pthread_mutex_lock(&connections_mutex_);
+ connections_lock_.AcquireForReading();
ConnectionMap::iterator it_conn =
connections_.find(std::make_pair(device_id, app_handle));
if (it_conn != connections_.end()) {
ConnectionInfo& info = it_conn->second;
info.state = ConnectionInfo::ESTABLISHED;
}
- pthread_mutex_unlock(&connections_mutex_);
+ connections_lock_.Release();
for (TransportAdapterListenerList::iterator it = listeners_.begin();
it != listeners_.end(); ++it) {
@@ -640,9 +676,9 @@ void TransportAdapterImpl::ConnectFailed(const DeviceUID& device_handle,
const ApplicationHandle app_uid = app_handle;
LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_uid << ", app_handle: " <<
&app_uid << ", error: " << &error);
- pthread_mutex_lock(&connections_mutex_);
+ connections_lock_.AcquireForWriting();
connections_.erase(std::make_pair(device_uid, app_uid));
- pthread_mutex_unlock(&connections_mutex_);
+ connections_lock_.Release();
for (TransportAdapterListenerList::iterator it = listeners_.begin();
it != listeners_.end(); ++it) {
(*it)->OnConnectFailed(this, device_uid, app_uid, error);
@@ -674,15 +710,14 @@ void TransportAdapterImpl::ConnectionFinished(
const DeviceUID& device_id, const ApplicationHandle& app_handle) {
LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", app_handle: " <<
&app_handle);
- pthread_mutex_lock(&connections_mutex_);
+ connections_lock_.AcquireForReading();
ConnectionMap::iterator it =
connections_.find(std::make_pair(device_id, app_handle));
if (it != connections_.end()) {
ConnectionInfo& info = it->second;
info.state = ConnectionInfo::FINALISING;
}
- pthread_mutex_unlock(&connections_mutex_);
- LOG4CXX_TRACE(logger_, "exit");
+ connections_lock_.Release();
}
void TransportAdapterImpl::ConnectionAborted(
@@ -732,12 +767,7 @@ std::string TransportAdapterImpl::DeviceName(const DeviceUID& device_id) const {
}
std::string TransportAdapterImpl::GetConnectionType() const {
- const std::string deviceType = GetDeviceType();
- std::string result("USB_serial_number");
- if ("sdl-tcp" == deviceType || "sdl-bluetooth" == deviceType) {
- result.assign("BTMAC");
- }
- return result;
+ return devicesType[GetDeviceType()];
}
#ifdef TIME_TESTER
@@ -763,12 +793,16 @@ bool TransportAdapterImpl::ToBeAutoConnected(DeviceSptr device) const {
return false;
}
-Connection* TransportAdapterImpl::FindEstablishedConnection(
+bool TransportAdapterImpl::ToBeAutoDisconnected(DeviceSptr device) const {
+ return true;
+}
+
+ConnectionSPtr TransportAdapterImpl::FindEstablishedConnection(
const DeviceUID& device_id, const ApplicationHandle& app_handle) const {
LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", app_handle: " <<
&app_handle);
- Connection* connection = NULL;
- pthread_mutex_lock(&connections_mutex_);
+ ConnectionSPtr connection;
+ connections_lock_.AcquireForReading();
ConnectionMap::const_iterator it =
connections_.find(std::make_pair(device_id, app_handle));
if (it != connections_.end()) {
@@ -777,7 +811,7 @@ Connection* TransportAdapterImpl::FindEstablishedConnection(
connection = info.connection;
}
}
- pthread_mutex_unlock(&connections_mutex_);
+ connections_lock_.Release();
LOG4CXX_TRACE(logger_, "exit with Connection: " << connection);
return connection;
}
@@ -820,10 +854,10 @@ TransportAdapter::Error TransportAdapterImpl::ConnectDevice(DeviceSptr device) {
}
void TransportAdapterImpl::RemoveDevice(const DeviceUID& device_handle) {
- LOG4CXX_TRACE(logger_, "enter. device_handle: " << &device_handle);
- pthread_mutex_lock(&devices_mutex_);
- DeviceMap::iterator i = devices_.find(
- device_handle); //ykazakov: there is no erase for const iterator on QNX
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Device_handle: " << &device_handle);
+ sync_primitives::AutoLock locker(devices_mutex_);
+ DeviceMap::iterator i = devices_.find(device_handle);
if (i != devices_.end()) {
DeviceSptr device = i->second;
if (!device->keep_on_disconnect()) {
@@ -835,11 +869,7 @@ void TransportAdapterImpl::RemoveDevice(const DeviceUID& device_handle) {
}
}
}
- pthread_mutex_unlock(&devices_mutex_);
- LOG4CXX_TRACE(logger_, "exit");
}
-
} // namespace transport_adapter
-
} // namespace transport_manager
diff --git a/src/components/transport_manager/src/transport_manager_default.cc b/src/components/transport_manager/src/transport_manager_default.cc
index ffd1b3d86..835c2c17e 100644
--- a/src/components/transport_manager/src/transport_manager_default.cc
+++ b/src/components/transport_manager/src/transport_manager_default.cc
@@ -43,7 +43,6 @@
#include "transport_manager/bluetooth/bluetooth_transport_adapter.h"
#endif
-// CUSTOMER_PASA
#if defined(USB_SUPPORT)
#include "transport_manager/usb/usb_aoa_adapter.h"
@@ -72,6 +71,8 @@ int TransportManagerDefault::Init() {
#endif // TIME_TESTER
AddTransportAdapter(ta);
#endif
+
+
uint16_t port = profile::Profile::instance()->transport_manager_tcp_adapter_port();
ta = new transport_adapter::TcpTransportAdapter(port);
#ifdef TIME_TESTER
@@ -81,7 +82,6 @@ int TransportManagerDefault::Init() {
#endif // TIME_TESTER
AddTransportAdapter(ta);
-// CUSTOMER_PASA
#if defined(USB_SUPPORT)
ta = new transport_adapter::UsbAoaAdapter();
diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc
index 0ee1d3304..6c3edd7b9 100644
--- a/src/components/transport_manager/src/transport_manager_impl.cc
+++ b/src/components/transport_manager/src/transport_manager_impl.cc
@@ -32,7 +32,6 @@
#include "transport_manager/transport_manager_impl.h"
-#include <pthread.h>
#include <stdint.h>
#include <cstring>
#include <queue>
@@ -70,22 +69,20 @@ TransportManagerImpl::Connection TransportManagerImpl::convert(
}
TransportManagerImpl::TransportManagerImpl()
- : all_thread_active_(false),
- device_listener_thread_wakeup_(),
- is_initialized_(false),
+ : is_initialized_(false),
#ifdef TIME_TESTER
metric_observer_(NULL),
#endif // TIME_TESTER
connection_id_counter_(0),
message_queue_("TM MessageQueue", this),
event_queue_("TM EventQueue", this) {
- LOG4CXX_INFO(logger_, "==============================================");
- pthread_cond_init(&device_listener_thread_wakeup_, NULL);
- LOG4CXX_DEBUG(logger_, "TransportManager object created");
+ LOG4CXX_TRACE(logger_, "TransportManager has created");
}
TransportManagerImpl::~TransportManagerImpl() {
LOG4CXX_DEBUG(logger_, "TransportManager object destroying");
+ message_queue_.Shutdown();
+ event_queue_.Shutdown();
for (std::vector<TransportAdapter*>::iterator it =
transport_adapters_.begin();
@@ -99,7 +96,6 @@ TransportManagerImpl::~TransportManagerImpl() {
delete it->second;
}
- pthread_cond_destroy(&device_listener_thread_wakeup_);
LOG4CXX_INFO(logger_, "TransportManager object destroyed");
}
@@ -226,18 +222,48 @@ int TransportManagerImpl::AddEventListener(TransportManagerListener* listener) {
return E_SUCCESS;
}
+void TransportManagerImpl::DisconnectAllDevices() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ for (DeviceInfoList::iterator i = device_list_.begin();
+ i != device_list_.end(); ++i) {
+ DeviceInfo& device = i->second;
+ DisconnectDevice(device.device_handle());
+ }
+}
+
+void TransportManagerImpl::TerminateAllAdapters() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ for (std::vector<TransportAdapter*>::iterator i = transport_adapters_.begin();
+ i != transport_adapters_.end(); ++i) {
+ (*i)->Terminate();
+ }
+}
+
+int TransportManagerImpl::InitAllAdapters() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ for (std::vector<TransportAdapter*>::iterator i = transport_adapters_.begin();
+ i != transport_adapters_.end(); ++i) {
+ if ((*i)->Init() != TransportAdapter::OK) {
+ return E_ADAPTERS_FAIL;
+ }
+ }
+ return E_SUCCESS;
+}
+
int TransportManagerImpl::Stop() {
- LOG4CXX_TRACE(logger_, "enter");
- if (!all_thread_active_) {
- LOG4CXX_TRACE(logger_,
- "exit with E_TM_IS_NOT_INITIALIZED. Condition: !all_thread_active_");
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!is_initialized_) {
+ LOG4CXX_WARN(logger_, "TransportManager is not initialized_");
return E_TM_IS_NOT_INITIALIZED;
}
- all_thread_active_ = false;
- pthread_cond_signal(&device_listener_thread_wakeup_);
+ message_queue_.Shutdown();
+ event_queue_.Shutdown();
- LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
+ DisconnectAllDevices();
+ TerminateAllAdapters();
+
+ is_initialized_ = false;
return E_SUCCESS;
}
@@ -390,12 +416,19 @@ int TransportManagerImpl::SearchDevices() {
int TransportManagerImpl::Init() {
LOG4CXX_TRACE(logger_, "enter");
- all_thread_active_ = true;
is_initialized_ = true;
LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
return E_SUCCESS;
}
+int TransportManagerImpl::Reinit() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DisconnectAllDevices();
+ TerminateAllAdapters();
+ int ret = InitAllAdapters();
+ return ret;
+}
+
int TransportManagerImpl::Visibility(const bool& on_off) const {
LOG4CXX_TRACE(logger_, "enter. On_off: " << &on_off);
TransportAdapter::Error ret;
@@ -478,10 +511,9 @@ void TransportManagerImpl::PostMessage(const ::protocol_handler::RawMessagePtr m
}
void TransportManagerImpl::PostEvent(const TransportAdapterEvent& event) {
- LOG4CXX_TRACE(logger_, "enter. TransportAdapterEvent: " << &event);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "TransportAdapterEvent: " << &event);
event_queue_.PostMessage(event);
- pthread_cond_signal(&device_listener_thread_wakeup_);
- LOG4CXX_TRACE(logger_, "exit");
}
void TransportManagerImpl::AddConnection(const ConnectionInternal& c) {
diff --git a/src/components/transport_manager/src/usb/libusb/platform_usb_device.cc b/src/components/transport_manager/src/usb/libusb/platform_usb_device.cc
index 103e03a4f..1ca1a54b3 100644
--- a/src/components/transport_manager/src/usb/libusb/platform_usb_device.cc
+++ b/src/components/transport_manager/src/usb/libusb/platform_usb_device.cc
@@ -1,4 +1,4 @@
-/**
+/*
*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
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 40891d351..b8096514b 100644
--- a/src/components/transport_manager/src/usb/libusb/usb_connection.cc
+++ b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
@@ -30,6 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <pthread.h>
#include <unistd.h>
#include <iomanip>
@@ -51,7 +52,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
UsbConnection::UsbConnection(const DeviceUID& device_uid,
const ApplicationHandle& app_handle,
TransportAdapterController* controller,
- const UsbHandlerSptr& usb_handler,
+ const UsbHandlerSptr usb_handler,
PlatformUsbDevice* device)
: device_uid_(device_uid),
app_handle_(app_handle),
diff --git a/src/components/transport_manager/src/usb/libusb/usb_handler.cc b/src/components/transport_manager/src/usb/libusb/usb_handler.cc
index eb0ffdb4d..776bb56c5 100644
--- a/src/components/transport_manager/src/usb/libusb/usb_handler.cc
+++ b/src/components/transport_manager/src/usb/libusb/usb_handler.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file usb_handler.cc
* \brief UsbHandler class source file.
*
@@ -39,7 +39,9 @@
#include "transport_manager/usb/common.h"
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "utils/macro.h"
#include "utils/logger.h"
+#include "utils/threads/thread.h"
namespace transport_manager {
namespace transport_adapter {
@@ -75,14 +77,16 @@ class UsbHandler::ControlTransferSequenceState {
UsbHandler::UsbHandler()
: shutdown_requested_(false),
- thread_(),
+ thread_(NULL),
usb_device_listeners_(),
devices_(),
transfer_sequences_(),
device_handles_to_close_(),
libusb_context_(NULL),
arrived_callback_handle_(),
- left_callback_handle_() {}
+ left_callback_handle_() {
+ thread_ = threads::CreateThread("UsbHandler", new UsbHandlerDelegate(this));
+}
UsbHandler::~UsbHandler() {
shutdown_requested_ = true;
@@ -91,12 +95,15 @@ UsbHandler::~UsbHandler() {
arrived_callback_handle_);
libusb_hotplug_deregister_callback(libusb_context_, left_callback_handle_);
}
- pthread_join(thread_, 0);
+ thread_->stop();
LOG4CXX_INFO(logger_, "UsbHandler thread finished");
if (libusb_context_) {
libusb_exit(libusb_context_);
libusb_context_ = 0;
}
+ thread_->join();
+ delete thread_->delegate();
+ threads::DeleteThread(thread_);
}
void UsbHandler::DeviceArrived(libusb_device* device_libusb) {
@@ -209,11 +216,6 @@ void UsbHandler::CloseDeviceHandle(libusb_device_handle* device_handle) {
device_handles_to_close_.push_back(device_handle);
}
-void* UsbHandlerThread(void* data) {
- static_cast<UsbHandler*>(data)->Thread();
- return 0;
-}
-
int ArrivedCallback(libusb_context* context, libusb_device* device,
libusb_hotplug_event event, void* data) {
LOG4CXX_TRACE(logger_, "enter. libusb device arrived (bus number "
@@ -286,19 +288,12 @@ TransportAdapter::Error UsbHandler::Init() {
return TransportAdapter::FAIL;
}
- const int thread_start_error =
- pthread_create(&thread_, 0, &UsbHandlerThread, this);
- if (0 != thread_start_error) {
- LOG4CXX_ERROR(logger_, "USB device scanner thread start failed, error code "
- << thread_start_error);
+ if (!thread_->start()) {
+ LOG4CXX_ERROR(logger_, "USB device scanner thread start failed, error code");
LOG4CXX_TRACE(logger_,
- "exit with TransportAdapter::FAIL. Condition: 0 !== thread_start_error");
+ "exit with TransportAdapter::FAIL.");
return TransportAdapter::FAIL;
}
- LOG4CXX_INFO(logger_, "UsbHandler thread started");
- pthread_setname_np(thread_, "UsbHandler" );
- LOG4CXX_TRACE(logger_,
- "exit with TransportAdapter::OK. Condition: 0 == thread_start_error");
return TransportAdapter::OK;
}
@@ -357,13 +352,13 @@ void UsbHandler::SubmitControlTransfer(
assert(transfer->Type() == UsbControlTransfer::VENDOR);
const libusb_request_type request_type = LIBUSB_REQUEST_TYPE_VENDOR;
- libusb_endpoint_direction endpoint_direction;
+ libusb_endpoint_direction endpoint_direction = LIBUSB_ENDPOINT_IN;
if (transfer->Direction() == UsbControlTransfer::IN) {
endpoint_direction = LIBUSB_ENDPOINT_IN;
} else if (transfer->Direction() == UsbControlTransfer::OUT) {
endpoint_direction = LIBUSB_ENDPOINT_OUT;
} else {
- assert(0);
+ NOTREACHED();
}
const uint8_t request = transfer->Request();
const uint16_t value = transfer->Value();
@@ -470,5 +465,16 @@ void UsbHandler::ControlTransferSequenceState::Finish() {
finished_ = true;
}
-} // namespace
-} // namespace
+UsbHandler::UsbHandlerDelegate::UsbHandlerDelegate(
+ UsbHandler* handler)
+ : handler_(handler) {
+}
+
+void UsbHandler::UsbHandlerDelegate::threadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(handler_);
+ handler_->Thread();
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/usb/qnx/platform_usb_device.cc b/src/components/transport_manager/src/usb/qnx/platform_usb_device.cc
index 0f35a16ae..132fe52ca 100644
--- a/src/components/transport_manager/src/usb/qnx/platform_usb_device.cc
+++ b/src/components/transport_manager/src/usb/qnx/platform_usb_device.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file platform_usb_device.cc
* \brief QNX PlatformUsbDevice class source file.
*
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 db3cac014..a3844b2e0 100644
--- a/src/components/transport_manager/src/usb/qnx/usb_connection.cc
+++ b/src/components/transport_manager/src/usb/qnx/usb_connection.cc
@@ -50,7 +50,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
UsbConnection::UsbConnection(const DeviceUID& device_uid,
const ApplicationHandle& app_handle,
TransportAdapterController* controller,
- const UsbHandlerSptr& libusb_handler,
+ const UsbHandlerSptr libusb_handler,
PlatformUsbDevice* device)
: device_uid_(device_uid),
app_handle_(app_handle),
@@ -60,6 +60,7 @@ UsbConnection::UsbConnection(const DeviceUID& device_uid,
in_pipe_(NULL),
out_pipe_(NULL),
in_buffer_(NULL),
+ out_buffer_(NULL),
in_urb_(NULL),
out_urb_(NULL),
out_messages_(),
@@ -69,7 +70,6 @@ UsbConnection::UsbConnection(const DeviceUID& device_uid,
disconnecting_(false),
pending_in_transfer_(false),
pending_out_transfer_(false) {
- pthread_mutex_init(&out_messages_mutex_, 0);
}
UsbConnection::~UsbConnection() {
@@ -89,8 +89,6 @@ UsbConnection::~UsbConnection() {
LOG4CXX_ERROR(logger_, "Failed to close pipe: " << close_pipe_rc);
}
}
-
- pthread_mutex_destroy(&out_messages_mutex_);
}
void InTransferCallback(usbd_urb* urb, usbd_pipe*, void* data) {
@@ -212,7 +210,7 @@ void UsbConnection::OnOutTransfer(usbd_urb* urb) {
}
}
- pthread_mutex_lock(&out_messages_mutex_);
+ sync_primitives::AutoLock locker(out_messages_mutex_);
if (error) {
LOG4CXX_ERROR(logger_, "USB out transfer failed");
@@ -234,14 +232,13 @@ void UsbConnection::OnOutTransfer(usbd_urb* urb) {
} else {
pending_out_transfer_ = false;
}
- pthread_mutex_unlock(&out_messages_mutex_);
}
TransportAdapter::Error UsbConnection::SendData(::protocol_handler::RawMessagePtr message) {
if (disconnecting_) {
return TransportAdapter::BAD_STATE;
}
- pthread_mutex_lock(&out_messages_mutex_);
+ sync_primitives::AutoLock locker(out_messages_mutex_);
if (current_out_message_.valid()) {
out_messages_.push_back(message);
} else {
@@ -251,13 +248,12 @@ TransportAdapter::Error UsbConnection::SendData(::protocol_handler::RawMessagePt
DataSendError());
}
}
- pthread_mutex_unlock(&out_messages_mutex_);
return TransportAdapter::OK;
}
void UsbConnection::Finalise() {
LOG4CXX_INFO(logger_, "Finalising");
- pthread_mutex_lock(&out_messages_mutex_);
+ sync_primitives::AutoLock locker(out_messages_mutex_);
disconnecting_ = true;
usbd_abort_pipe(in_pipe_);
usbd_abort_pipe(out_pipe_);
@@ -265,7 +261,6 @@ void UsbConnection::Finalise() {
it != out_messages_.end(); it = out_messages_.erase(it)) {
controller_->DataSendFailed(device_uid_, app_handle_, *it, DataSendError());
}
- pthread_mutex_unlock(&out_messages_mutex_);
while (pending_in_transfer_ || pending_out_transfer_) sched_yield();
}
diff --git a/src/components/transport_manager/src/usb/qnx/usb_handler.cc b/src/components/transport_manager/src/usb/qnx/usb_handler.cc
index 7ab36169b..d78b6c818 100644
--- a/src/components/transport_manager/src/usb/qnx/usb_handler.cc
+++ b/src/components/transport_manager/src/usb/qnx/usb_handler.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file usb_handler.cc
* \brief UsbHandler class source file.
*
diff --git a/src/components/transport_manager/src/usb/usb_aoa_adapter.cc b/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
index 464b9ea35..6363fb7bf 100644
--- a/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
+++ b/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
@@ -1,4 +1,4 @@
-/**
+/*
* \file usb_aoa_adapter.cpp
* \brief UsbAoaAdapter class source file.
*
@@ -56,7 +56,7 @@ UsbAoaAdapter::UsbAoaAdapter()
UsbAoaAdapter::~UsbAoaAdapter() {}
DeviceType UsbAoaAdapter::GetDeviceType() const {
- return "sdl-usb-aoa";
+ return PASA_AOA;
}
bool UsbAoaAdapter::IsInitialised() const {
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 d57391ebc..456247353 100644
--- a/src/components/transport_manager/src/usb/usb_connection_factory.cc
+++ b/src/components/transport_manager/src/usb/usb_connection_factory.cc
@@ -54,7 +54,7 @@ TransportAdapter::Error UsbConnectionFactory::Init() {
return TransportAdapter::OK;
}
-void UsbConnectionFactory::SetUsbHandler(const UsbHandlerSptr& usb_handler) {
+void UsbConnectionFactory::SetUsbHandler(const UsbHandlerSptr usb_handler) {
usb_handler_ = usb_handler;
}
diff --git a/src/components/transport_manager/src/usb/usb_device_scanner.cc b/src/components/transport_manager/src/usb/usb_device_scanner.cc
index bf9535941..dfc9f4697 100644
--- a/src/components/transport_manager/src/usb/usb_device_scanner.cc
+++ b/src/components/transport_manager/src/usb/usb_device_scanner.cc
@@ -47,7 +47,8 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
class AoaInitSequence : public UsbControlTransferSequence {
public:
AoaInitSequence();
- virtual ~AoaInitSequence() {}
+ virtual ~AoaInitSequence() {
+ }
private:
class AoaGetProtocolRequest;
@@ -56,7 +57,7 @@ class AoaInitSequence : public UsbControlTransferSequence {
};
void UsbDeviceScanner::OnDeviceArrived(PlatformUsbDevice* device) {
- LOG4CXX_TRACE(logger_, "enter. PlatformUsbDevice* " << device);
+ LOG4CXX_AUTO_TRACE(logger_);
if (IsAppleDevice(device)) {
SupportedDeviceFound(device);
} else {
@@ -66,13 +67,13 @@ void UsbDeviceScanner::OnDeviceArrived(PlatformUsbDevice* device) {
TurnIntoAccessoryMode(device);
}
}
- LOG4CXX_TRACE(logger_, "exit");
}
void UsbDeviceScanner::OnDeviceLeft(PlatformUsbDevice* device) {
- LOG4CXX_TRACE(logger_, "enter. PlatformUsbDevice " << device);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "PlatformUsbDevice " << device);
bool list_changed = false;
- pthread_mutex_lock(&devices_mutex_);
+ devices_mutex_.Acquire();
for (Devices::iterator it = devices_.begin(); it != devices_.end(); ++it) {
if (device == *it) {
devices_.erase(it);
@@ -80,24 +81,22 @@ void UsbDeviceScanner::OnDeviceLeft(PlatformUsbDevice* device) {
break;
}
}
- pthread_mutex_unlock(&devices_mutex_);
+ devices_mutex_.Release();
if (list_changed) {
UpdateList();
}
- LOG4CXX_TRACE(logger_, "exit");
}
UsbDeviceScanner::UsbDeviceScanner(TransportAdapterController* controller)
- : controller_(controller) {
- pthread_mutex_init(&devices_mutex_, 0);
+ : controller_(controller) {
}
UsbDeviceScanner::~UsbDeviceScanner() {
- pthread_mutex_destroy(&devices_mutex_);
}
class AoaInitSequence::AoaGetProtocolRequest : public UsbControlInTransfer {
- virtual ~AoaGetProtocolRequest() {}
+ virtual ~AoaGetProtocolRequest() {
+ }
virtual RequestType Type() const {
return VENDOR;
}
@@ -115,7 +114,7 @@ class AoaInitSequence::AoaGetProtocolRequest : public UsbControlInTransfer {
}
virtual bool OnCompleted(unsigned char* data) const {
const int protocol_version = data[1] << 8 | data[0];
- LOG4CXX_INFO(logger_, "AOA protocol version " << protocol_version);
+ LOG4CXX_DEBUG(logger_, "AOA protocol version " << protocol_version);
if (protocol_version == 0) {
// AOA protocol not supported
return false;
@@ -127,10 +126,14 @@ class AoaInitSequence::AoaGetProtocolRequest : public UsbControlInTransfer {
class AoaInitSequence::AoaSendIdString : public UsbControlOutTransfer {
public:
AoaSendIdString(uint16_t index, const char* string, uint16_t length)
- : index_(index), string_(string), length_(length) {}
+ : index_(index),
+ string_(string),
+ length_(length) {
+ }
private:
- virtual ~AoaSendIdString() {}
+ virtual ~AoaSendIdString() {
+ }
virtual RequestType Type() const {
return VENDOR;
}
@@ -155,7 +158,8 @@ class AoaInitSequence::AoaSendIdString : public UsbControlOutTransfer {
};
class AoaInitSequence::AoaTurnIntoAccessoryMode : public UsbControlOutTransfer {
- virtual ~AoaTurnIntoAccessoryMode() {}
+ virtual ~AoaTurnIntoAccessoryMode() {
+ }
virtual RequestType Type() const {
return VENDOR;
}
@@ -176,14 +180,15 @@ class AoaInitSequence::AoaTurnIntoAccessoryMode : public UsbControlOutTransfer {
}
};
-static char manufacturer[] = "Ford";
-static char model_name[] = "HMI";
-static char description[] = "Human machine interface";
+static char manufacturer[] = "SDL";
+static char model_name[] = "Core";
+static char description[] = "SmartDeviceLink Core Component USB";
static char version[] = "1.0";
-static char uri[] = "http://www.ford.com";
+static char uri[] = "http://www.smartdevicelink.org";
static char serial_num[] = "N000000";
-AoaInitSequence::AoaInitSequence() : UsbControlTransferSequence() {
+AoaInitSequence::AoaInitSequence()
+ : UsbControlTransferSequence() {
AddTransfer(new AoaGetProtocolRequest);
AddTransfer(new AoaSendIdString(0, manufacturer, sizeof(manufacturer)));
AddTransfer(new AoaSendIdString(1, model_name, sizeof(model_name)));
@@ -195,25 +200,26 @@ AoaInitSequence::AoaInitSequence() : UsbControlTransferSequence() {
}
void UsbDeviceScanner::TurnIntoAccessoryMode(PlatformUsbDevice* device) {
- LOG4CXX_TRACE(logger_, "enter. PlatformUsbDevice: " << device);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "PlatformUsbDevice: " << device);
GetUsbHandler()->StartControlTransferSequence(new AoaInitSequence, device);
- LOG4CXX_TRACE(logger_, "exit");
}
void UsbDeviceScanner::SupportedDeviceFound(PlatformUsbDevice* device) {
- LOG4CXX_TRACE(logger_, "enter PlatformUsbDevice: " << device);
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_TRACE(logger_, "PlatformUsbDevice: " << device);
- pthread_mutex_lock(&devices_mutex_);
+ devices_mutex_.Acquire();
devices_.push_back(device);
- pthread_mutex_unlock(&devices_mutex_);
- LOG4CXX_INFO(logger_, "USB device (bus number "
- << static_cast<int>(device->bus_number())
- << ", address "
- << static_cast<int>(device->address())
- << ") identified as: " << device->GetManufacturer()
- << ", " << device->GetProductName());
+ devices_mutex_.Release();
+ LOG4CXX_DEBUG(
+ logger_,
+ "USB device (bus number " << static_cast<int>(device->bus_number())
+ << ", address " << static_cast<int>(device->address())
+ << ") identified as: " << device->GetManufacturer()
+ << ", " << device->GetProductName()
+ << ", serial: " << device->GetSerialNumber());
UpdateList();
- LOG4CXX_TRACE(logger_, "exit");
}
TransportAdapter::Error UsbDeviceScanner::Init() {
@@ -225,30 +231,28 @@ TransportAdapter::Error UsbDeviceScanner::Scan() {
}
void UsbDeviceScanner::UpdateList() {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
DeviceVector device_vector;
- pthread_mutex_lock(&devices_mutex_);
+ devices_mutex_.Acquire();
for (Devices::const_iterator it = devices_.begin(); it != devices_.end();
- ++it) {
- const std::string device_name =
- (*it)->GetManufacturer() + " " + (*it)->GetProductName();
+ ++it) {
+ const std::string device_name = (*it)->GetManufacturer() + " "
+ + (*it)->GetProductName();
std::ostringstream oss;
oss << (*it)->GetManufacturer() << ":" << (*it)->GetProductName() << ":"
- << (*it)->GetSerialNumber() << ":"
- << static_cast<int>((*it)->bus_number()) << ":"
- << static_cast<int>((*it)->address());
+ << (*it)->GetSerialNumber();
const DeviceUID device_uid = oss.str();
DeviceSptr device(new UsbDevice(*it, device_name, device_uid));
device_vector.push_back(device);
}
- pthread_mutex_unlock(&devices_mutex_);
+ devices_mutex_.Release();
- LOG4CXX_INFO(logger_, "USB search done " << device_vector.size());
+ LOG4CXX_DEBUG(logger_, "USB search done " << device_vector.size());
controller_->SearchDeviceDone(device_vector);
- LOG4CXX_TRACE(logger_, "exit");
}
-void UsbDeviceScanner::Terminate() {}
+void UsbDeviceScanner::Terminate() {
+}
bool UsbDeviceScanner::IsInitialised() const {
return true;
diff --git a/src/components/transport_manager/test/CMakeLists.txt b/src/components/transport_manager/test/CMakeLists.txt
new file mode 100644
index 000000000..c38804e86
--- /dev/null
+++ b/src/components/transport_manager/test/CMakeLists.txt
@@ -0,0 +1,82 @@
+# 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.
+
+if(BUILD_TESTS)
+set(TM_TEST_DIR ${COMPONENTS_DIR}/transport_manager/test)
+
+include_directories(
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/smart_objects/include
+ ${COMPONENTS_DIR}/transport_manager/include
+ ${COMPONENTS_DIR}/utils/include
+ ${COMPONENTS_DIR}/include
+ ${COMPONENTS_DIR}/connection_handler/include
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${CMAKE_BINARY_DIR}
+)
+
+set(LIBRARIES
+ gmock
+ ConfigProfile
+ transport_manager
+ Utils
+ ConfigProfile
+ ProtocolLibrary
+ Resumption
+ jsoncpp
+)
+
+if (BUILD_USB_SUPPORT)
+ list(APPEND LIBRARIES Libusb-1.0.16)
+endif()
+
+if (BUILD_BT_SUPPORT)
+ list(APPEND LIBRARIES bluetooth)
+endif()
+
+if (BUILD_AVAHI_SUPPORT)
+ list(APPEND LIBRARIES avahi-client avahi-common)
+endif()
+
+set(SOURCES
+ ${TM_TEST_DIR}/transport_manager_default_test.cc
+ #${TM_TEST_DIR}/transport_manager_impl_test.cc
+ #${TM_TEST_DIR}/dnssd_service_browser_test.cc
+ ${TM_TEST_DIR}/transport_adapter_test.cc
+ #${TM_TEST_DIR}/transport_adapter_listener_test.cc
+ ${TM_TEST_DIR}/tcp_transport_adapter_test.cc
+ ${TM_TEST_DIR}/tcp_device_test.cc
+ #${TM_TEST_DIR}/tcp_client_listener_test.cc
+)
+
+create_test("transport_manager_test" "${SOURCES}" "${LIBRARIES}")
+file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+endif()
diff --git a/src/components/transport_manager/test/dnssd_service_browser_test.cc b/src/components/transport_manager/test/dnssd_service_browser_test.cc
new file mode 100644
index 000000000..6eb2ad45f
--- /dev/null
+++ b/src/components/transport_manager/test/dnssd_service_browser_test.cc
@@ -0,0 +1,147 @@
+/*
+ * 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 "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/tcp/dnssd_service_browser.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class MockTransportAdapterController : public TransportAdapterController {
+ public:
+ MOCK_METHOD1(AddDevice, DeviceSptr(DeviceSptr device));
+ MOCK_METHOD1(SearchDeviceDone, void(const DeviceVector& devices));
+ MOCK_METHOD1(SearchDeviceFailed, void(const SearchDeviceError& error));
+ MOCK_CONST_METHOD1(FindDevice, DeviceSptr(const DeviceUID& device_handle));
+ MOCK_METHOD3(ConnectionCreated,
+ void(ConnectionSPtr connection, const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
+ MOCK_METHOD2(ConnectDone, void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
+ MOCK_METHOD3(ConnectFailed, void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const ConnectError& error));
+ MOCK_METHOD2(ConnectionFinished, void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
+ MOCK_METHOD3(ConnectionAborted, void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const CommunicationError& error));
+ MOCK_METHOD2(DisconnectDone, void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
+ MOCK_METHOD3(DataReceiveDone,
+ void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD3(DataReceiveFailed, void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const DataReceiveError& error));
+ MOCK_METHOD3(DataSendDone,
+ void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD4(DataSendFailed,
+ void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const ::protocol_handler::RawMessagePtr message,
+ const DataSendError& error));
+ MOCK_METHOD0(FindNewApplicationsRequest, void());
+ MOCK_METHOD0(AckDevices, void());
+ MOCK_METHOD1(ApplicationListUpdated, void(const DeviceUID& device_handle));
+ MOCK_METHOD2(DeviceDisconnected, void(const DeviceUID& device_handle,
+ const DisconnectDeviceError& error));
+};
+
+TEST(DnssdServiceBrowser, DISABLED_Init) {
+ // Arrange
+ MockTransportAdapterController controller;
+ DnssdServiceBrowser dnssd_service_browser(&controller);
+ // Check values after creation. Nothing is initialized
+ EXPECT_TRUE(NULL == dnssd_service_browser.avahi_service_browser());
+ EXPECT_TRUE(NULL == dnssd_service_browser.avahi_threaded_poll());
+ EXPECT_TRUE(NULL == dnssd_service_browser.avahi_client());
+ // Act
+ const TransportAdapter::Error error = dnssd_service_browser.Init();
+ ASSERT_EQ(TransportAdapter::OK, error);
+
+ while (!dnssd_service_browser.IsInitialised()) {
+ sleep(0);
+ }
+ ASSERT_TRUE(dnssd_service_browser.IsInitialised());
+ // Check values are initialized and threaded poll started
+ EXPECT_FALSE(NULL == dnssd_service_browser.avahi_service_browser());
+ EXPECT_FALSE(NULL == dnssd_service_browser.avahi_threaded_poll());
+ EXPECT_FALSE(NULL == dnssd_service_browser.avahi_client());
+}
+
+TEST(DnssdServiceBrowser, DISABLED_IsInitialized_ExpectFalse) {
+ // Arrange
+ MockTransportAdapterController controller;
+ DnssdServiceBrowser dnssd_service_browser(&controller);
+ // Check
+ EXPECT_FALSE(dnssd_service_browser.IsInitialised());
+}
+
+TEST(DnssdServiceBrowser, DISABLED_Terminate_ExpectTerminated) {
+ // Arrange
+ MockTransportAdapterController controller;
+ DnssdServiceBrowser dnssd_service_browser(&controller);
+ // Init service browser and client
+ const TransportAdapter::Error error = dnssd_service_browser.Init();
+ ASSERT_EQ(TransportAdapter::OK, error);
+
+ while (!dnssd_service_browser.IsInitialised()) {
+ sleep(0);
+ }
+ ASSERT_TRUE(dnssd_service_browser.IsInitialised());
+ // Client & browser are initialized and successfully started
+ EXPECT_FALSE(NULL == dnssd_service_browser.avahi_service_browser());
+ EXPECT_FALSE(NULL == dnssd_service_browser.avahi_threaded_poll());
+ EXPECT_FALSE(NULL == dnssd_service_browser.avahi_client());
+ dnssd_service_browser.Terminate();
+ // Checks everything successfully terminated
+ EXPECT_TRUE(NULL == dnssd_service_browser.avahi_service_browser());
+ EXPECT_TRUE(NULL == dnssd_service_browser.avahi_threaded_poll());
+ EXPECT_TRUE(NULL == dnssd_service_browser.avahi_client());
+}
+
+TEST(DnssdServiceBrowser, DISABLED_Scan_ExpectNotSupported) {
+ // Arrange
+ MockTransportAdapterController controller;
+ DnssdServiceBrowser dnssd_service_browser(&controller);
+ // At this moment Scan() can only return NOT SUPPORTED value
+ EXPECT_EQ(TransportAdapter::NOT_SUPPORTED, dnssd_service_browser.Scan());
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/test/include/client_connection_listener_mock.h b/src/components/transport_manager/test/include/client_connection_listener_mock.h
new file mode 100644
index 000000000..009814f53
--- /dev/null
+++ b/src/components/transport_manager/test/include/client_connection_listener_mock.h
@@ -0,0 +1,62 @@
+/*
+ * 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_TRANSPORT_MANAGER_TEST_INCLUDE_CLIENT_CONNECTION_LISTENER_MOCK_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_CLIENT_CONNECTION_LISTENER_MOCK_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/client_connection_listener.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+class ClientConnectionListenerMock
+ : public ::transport_manager::transport_adapter::ClientConnectionListener {
+ public:
+ MOCK_METHOD0(
+ Init, ::transport_manager::transport_adapter::TransportAdapter::Error());
+ MOCK_METHOD0(Terminate, void());
+ MOCK_CONST_METHOD0(IsInitialised, bool());
+ MOCK_METHOD0(
+ StartListening,
+ ::transport_manager::transport_adapter::TransportAdapter::Error());
+ MOCK_METHOD0(
+ StopListening,
+ ::transport_manager::transport_adapter::TransportAdapter::Error());
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_CLIENT_CONNECTION_LISTENER_MOCK_H_
diff --git a/src/components/transport_manager/test/include/connection_mock.h b/src/components/transport_manager/test/include/connection_mock.h
new file mode 100644
index 000000000..9e35e9a00
--- /dev/null
+++ b/src/components/transport_manager/test/include/connection_mock.h
@@ -0,0 +1,56 @@
+/*
+ * 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_TRANSPORT_MANAGER_TEST_INCLUDE_CONNECTION_MOCK_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_CONNECTION_MOCK_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/connection.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using namespace ::transport_manager::transport_adapter;
+
+class ConnectionMock : public Connection {
+ public:
+ MOCK_METHOD1(SendData, TransportAdapter::Error(
+ ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD0(Disconnect, TransportAdapter::Error());
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_CONNECTION_MOCK_H_
diff --git a/src/components/transport_manager/test/include/device_mock.h b/src/components/transport_manager/test/include/device_mock.h
new file mode 100644
index 000000000..53a0ca53f
--- /dev/null
+++ b/src/components/transport_manager/test/include/device_mock.h
@@ -0,0 +1,70 @@
+/*
+ * 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_TRANSPORT_MANAGER_TEST_INCLUDE_DEVICE_MOCK_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_DEVICE_MOCK_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/device.h"
+#include "transport_manager/common.h"
+#include "transport_manager/tcp/tcp_device.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+class DeviceMock : public ::transport_manager::transport_adapter::Device {
+ public:
+ DeviceMock(const std::string& name, const std::string& unique_device_id)
+ : Device(name, unique_device_id) {}
+ MOCK_CONST_METHOD1(IsSameAs, bool(const Device* other_device));
+ MOCK_CONST_METHOD0(GetApplicationList, std::vector<int>());
+ MOCK_METHOD0(Stop, void());
+};
+
+class TCPDeviceMock : public ::transport_manager::transport_adapter::TcpDevice {
+ public:
+ TCPDeviceMock(const uint32_t& in_addr_t, const std::string& name)
+ : TcpDevice(in_addr_t, name) {}
+ MOCK_CONST_METHOD1(IsSameAs, bool(const Device* other_device));
+ MOCK_CONST_METHOD0(GetApplicationList, std::vector<int>());
+ MOCK_METHOD0(Stop, void());
+ MOCK_CONST_METHOD1(
+ GetApplicationPort,
+ int(const ::transport_manager::ApplicationHandle app_handle));
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_DEVICE_MOCK_H_
diff --git a/src/components/transport_manager/test/include/device_scanner_mock.h b/src/components/transport_manager/test/include/device_scanner_mock.h
new file mode 100644
index 000000000..ea98af7f2
--- /dev/null
+++ b/src/components/transport_manager/test/include/device_scanner_mock.h
@@ -0,0 +1,58 @@
+/*
+ * 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_TRANSPORT_MANAGER_TEST_INCLUDE_DEVICE_SCANNER_MOCK_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_DEVICE_SCANNER_MOCK_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/device_scanner.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+class DeviceScannerMock
+ : public ::transport_manager::transport_adapter::DeviceScanner {
+ public:
+ MOCK_METHOD0(
+ Init, ::transport_manager::transport_adapter::TransportAdapter::Error());
+ MOCK_METHOD0(
+ Scan, ::transport_manager::transport_adapter::TransportAdapter::Error());
+ MOCK_METHOD0(Terminate, void());
+ MOCK_CONST_METHOD0(IsInitialised, bool());
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_DEVICE_SCANNER_MOCK_H_
diff --git a/src/components/transport_manager/test/include/mock_application.h b/src/components/transport_manager/test/include/mock_application.h
new file mode 100644
index 000000000..7ec71ebb1
--- /dev/null
+++ b/src/components/transport_manager/test/include/mock_application.h
@@ -0,0 +1,80 @@
+/*
+ * mock_application.h
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MOCK_APPLICATION_H_
+#define MOCK_APPLICATION_H_
+
+#include <pthread.h>
+
+#include <sstream>
+#include <string>
+
+#include <transport_manager/common.h>
+#include <transport_manager/transport_manager.h>
+#include <transport_manager/transport_adapter/transport_adapter_impl.h>
+#include <transport_manager/transport_manager_impl.h>
+#include "mock_device_scanner.h"
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+class MockDevice;
+using ::transport_manager::ApplicationHandle;
+
+class MockApplication {
+ public:
+ const MockDevice *device;
+ ApplicationHandle handle;
+ pthread_t workerThread;
+ pthread_cond_t ready_cond;
+ pthread_mutex_t ready_mutex;
+ int sockfd;
+ bool active;
+ private:
+ std::string socket_name_;
+ public:
+ MockApplication(const MockDevice* device, ApplicationHandle id);
+ void Start();
+ void Stop();
+ const std::string &socket_name() const {
+ return socket_name_;
+ }
+};
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
+
+#endif /* MOCK_APPLICATION_H_ */
diff --git a/src/components/transport_manager/test/include/mock_connection.h b/src/components/transport_manager/test/include/mock_connection.h
new file mode 100644
index 000000000..8f6710706
--- /dev/null
+++ b/src/components/transport_manager/test/include/mock_connection.h
@@ -0,0 +1,69 @@
+/*
+ * \file mock_connection.h
+ * \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.
+ */
+
+#ifndef APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKCONNECTION_H_
+#define APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKCONNECTION_H_
+
+#include "transport_manager/common.h"
+#include "transport_manager/error.h"
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "transport_manager/transport_adapter/threaded_socket_connection.h"
+
+using ::transport_manager::ApplicationHandle;
+using ::transport_manager::DeviceHandle;
+using ::transport_manager::transport_adapter::Connection;
+using ::transport_manager::transport_adapter::TransportAdapterController;
+using ::transport_manager::ConnectError;
+using ::transport_manager::transport_adapter::ThreadedSocketConnection;
+using ::transport_manager::transport_adapter::TransportAdapter;
+namespace test {
+namespace components {
+namespace transport_manager {
+
+class MockTransportAdapter;
+
+class MockConnection : public ThreadedSocketConnection{
+ public:
+ MockConnection(const ::transport_manager::DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* adapter);
+ bool Establish(ConnectError **error);
+};
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
+
+#endif /* APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKCONNECTION_H_ */
diff --git a/src/components/transport_manager/test/include/mock_connection_factory.h b/src/components/transport_manager/test/include/mock_connection_factory.h
new file mode 100644
index 000000000..afead19cb
--- /dev/null
+++ b/src/components/transport_manager/test/include/mock_connection_factory.h
@@ -0,0 +1,69 @@
+/*
+ * \file mock_connection_factory.h
+ * \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.
+ */
+
+#ifndef APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKCONNECTIONFACTORY_H_
+#define APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKCONNECTIONFACTORY_H_
+
+#include "transport_manager/transport_adapter/server_connection_factory.h"
+
+using ::transport_manager::ApplicationHandle;
+using ::transport_manager::DeviceHandle;
+using ::transport_manager::transport_adapter::TransportAdapter;
+using ::transport_manager::transport_adapter::ServerConnectionFactory;
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+class MockTransportAdapter;
+
+class MockConnectionFactory : public ServerConnectionFactory {
+ public:
+ MockConnectionFactory(MockTransportAdapter *adapter);
+ TransportAdapter::Error Init() { return TransportAdapter::OK; }
+ TransportAdapter::Error CreateConnection(const ::transport_manager::DeviceUID& device_handle,
+ const ApplicationHandle& app_handle);
+ void Terminate() {}
+ bool IsInitialised() const { return true; }
+
+ private:
+ MockTransportAdapter *controller_;
+};
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
+
+#endif /* APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKCONNECTIONFACTORY_H_ */
diff --git a/src/components/transport_manager/test/include/mock_device.h b/src/components/transport_manager/test/include/mock_device.h
new file mode 100644
index 000000000..1225f851d
--- /dev/null
+++ b/src/components/transport_manager/test/include/mock_device.h
@@ -0,0 +1,82 @@
+/*
+ * \file mock_device.h
+ * \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.
+ */
+
+#ifndef APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKDEVICE_H_
+#define APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKDEVICE_H_
+
+#include "transport_manager/common.h"
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+#include <transport_manager/transport_adapter/transport_adapter_impl.h>
+#include <transport_manager/transport_manager_impl.h>
+#include "mock_device_scanner.h"
+#include "mock_application.h"
+
+using ::transport_manager::ApplicationList;
+using ::transport_manager::transport_adapter::Device;
+using ::transport_manager::transport_adapter::TransportAdapterController;
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+class MockDevice : public ::transport_manager::transport_adapter::Device {
+
+ pthread_mutex_t device_started_mutex;
+ std::vector<MockApplication> applications_;
+ int applications_cnt_;
+ TransportAdapterController *controller_;
+ public:
+ MockDevice(const std::string& name, const std::string& id,
+ TransportAdapterController * controller)
+ : Device(name, id),
+ applications_cnt_(0),
+ controller_(controller) {
+ }
+ const ApplicationHandle addApplication();
+ void Start();
+ void Stop();
+ bool IsSameAs(const Device* other) const;
+ ApplicationList GetApplicationList() const;
+ bool operator == (const MockDevice &other);
+};
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
+
+#endif /* APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKDEVICE_H_ */
diff --git a/src/components/transport_manager/test/include/mock_device_scanner.h b/src/components/transport_manager/test/include/mock_device_scanner.h
new file mode 100644
index 000000000..6ebae39a7
--- /dev/null
+++ b/src/components/transport_manager/test/include/mock_device_scanner.h
@@ -0,0 +1,76 @@
+/*
+ * \file mock_device_scanner.h
+ * \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.
+ */
+
+#ifndef APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKDEVICESCANNER_H_
+#define APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKDEVICESCANNER_H_
+
+#include "transport_manager/transport_adapter/device_scanner.h"
+
+using ::transport_manager::transport_adapter::TransportAdapter;
+using ::transport_manager::transport_adapter::DeviceScanner;
+using ::transport_manager::transport_adapter::DeviceVector;
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+class MockTransportAdapter;
+
+class MockDeviceScanner : public DeviceScanner {
+ public:
+ MockDeviceScanner(MockTransportAdapter *adapter);
+ void reset();
+ void AddDevice(const std::string& name, const std::string& unique_id, bool start = true);
+ void RemoveDevice(const std::string& name);
+ void fail_further_search() { is_search_failed_ = true; }
+
+ protected:
+ TransportAdapter::Error Init();
+ TransportAdapter::Error Scan();
+ void Terminate();
+ bool IsInitialised() const;
+
+ private:
+ MockTransportAdapter *controller_;
+ DeviceVector devices_;
+ bool is_initialized_;
+ bool is_search_failed_;
+};
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
+
+#endif /* APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKDEVICESCANNER_H_ */
diff --git a/src/components/transport_manager/test/include/mock_transport_adapter.h b/src/components/transport_manager/test/include/mock_transport_adapter.h
new file mode 100644
index 000000000..85f0da76d
--- /dev/null
+++ b/src/components/transport_manager/test/include/mock_transport_adapter.h
@@ -0,0 +1,62 @@
+/*
+ * \file mock_transport_adapter.h
+ * \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.
+ */
+
+#ifndef APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKDEVICEADAPTER_H_
+#define APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKDEVICEADAPTER_H_
+
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+
+using ::transport_manager::transport_adapter::TransportAdapterImpl;
+using ::transport_manager::transport_adapter::DeviceType;
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+class MockDeviceScanner;
+
+class MockTransportAdapter : public TransportAdapterImpl {
+ public:
+ MockTransportAdapter();
+ MockDeviceScanner* get_device_scanner() const;
+ DeviceType GetDeviceType() const { return DeviceType::UNKNOWN; }
+ void reset();
+};
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
+
+#endif /* APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_MOCKDEVICEADAPTER_H_ */
diff --git a/src/components/transport_manager/test/include/mock_transport_adapter_listener.h b/src/components/transport_manager/test/include/mock_transport_adapter_listener.h
new file mode 100644
index 000000000..5b68cadaa
--- /dev/null
+++ b/src/components/transport_manager/test/include/mock_transport_adapter_listener.h
@@ -0,0 +1,94 @@
+/*
+ * \file mock_transport_adapter_listener.h
+ * \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.
+ */
+
+#ifndef MOCK_transport_adapter_LISTENER_H_
+#define MOCK_transport_adapter_LISTENER_H_
+
+#include <gmock/gmock.h>
+
+#include "transport_manager/transport_adapter/transport_adapter_listener.h"
+
+using namespace transport_manager;
+using transport_manager::transport_adapter::TransportAdapter;
+using transport_manager::transport_adapter::TransportAdapterListener;
+
+namespace test {
+namespace components {
+namespace transport_manager {
+using namespace ::protocol_handler;
+
+class MockTransportAdapterListener : public TransportAdapterListener {
+ public:
+ MOCK_METHOD1(OnSearchDeviceDone,
+ void(const TransportAdapter* transport_adapter));
+ MOCK_METHOD0(AckDevices,void());
+ MOCK_METHOD2(OnSearchDeviceFailed,
+ void(const TransportAdapter* transport_adapter, const SearchDeviceError& error));
+ MOCK_METHOD1(OnFindNewApplicationsRequest,
+ void(const TransportAdapter* adapter));
+ MOCK_METHOD1(OnDeviceListUpdated,
+ void(const TransportAdapter* transport_adapter));
+ MOCK_METHOD3(OnConnectDone,
+ void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle));
+ MOCK_METHOD4(OnConnectFailed,
+ void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle, const ConnectError& error));
+ MOCK_METHOD4(OnUnexpectedDisconnect,
+ void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle, const CommunicationError& error));
+ MOCK_METHOD3(OnDisconnectDone,
+ void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle));
+ MOCK_METHOD4(OnDisconnectFailed,
+ void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle, const DisconnectError& error));
+ MOCK_METHOD2(OnDisconnectDeviceDone,
+ void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle));
+ MOCK_METHOD3(OnDisconnectDeviceFailed,
+ void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const DisconnectDeviceError& error));
+ MOCK_METHOD4(OnDataSendDone,
+ void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle, const RawMessagePtr data_container));
+ MOCK_METHOD5(OnDataSendFailed,
+ void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle, const RawMessagePtr data_container, const DataSendError& error));
+ MOCK_METHOD4(OnDataReceiveDone,
+ void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle, const RawMessagePtr data_container));
+ MOCK_METHOD4(OnDataReceiveFailed,
+ void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle, const DataReceiveError& error));
+ MOCK_METHOD3(OnCommunicationError,
+ void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle));
+ MOCK_METHOD3(OnConnectRequested, void(const TransportAdapter*, const DeviceUID&, const ApplicationHandle&));
+};
+
+}
+}
+}
+
+#endif /* MOCK_transport_adapter_LISTENER_H_ */
diff --git a/src/components/transport_manager/test/include/mock_transport_manager_listener.h b/src/components/transport_manager/test/include/mock_transport_manager_listener.h
new file mode 100644
index 000000000..9518e1a92
--- /dev/null
+++ b/src/components/transport_manager/test/include/mock_transport_manager_listener.h
@@ -0,0 +1,103 @@
+/*
+ * \file mock_transport_adapter_listener.h
+ * \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.
+ */
+
+#ifndef MOCK_TRANSPORT_MANAGER_LISTENER_H
+#define MOCK_TRANSPORT_MANAGER_LISTENER_H
+
+#include <gmock/gmock.h>
+
+#include "transport_manager/common.h"
+#include "transport_manager/info.h"
+#include "transport_manager/transport_adapter/transport_adapter.h"
+#include "transport_manager/transport_manager_listener.h"
+
+using ::transport_manager::ApplicationList;
+using ::transport_manager::ApplicationHandle;
+using ::transport_manager::transport_adapter::TransportAdapter;
+using ::transport_manager::SearchDeviceError;
+using ::transport_manager::ConnectionUID;
+using ::transport_manager::ConnectError;
+using ::transport_manager::DisconnectError;
+using ::transport_manager::DisconnectDeviceError;
+using ::transport_manager::DataSendError;
+using ::transport_manager::DataReceiveError;
+using ::transport_manager::CommunicationError;
+using ::transport_manager::DeviceInfo;
+using ::transport_manager::DeviceHandle;
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+class MockTransportManagerListener :
+ public ::transport_manager::TransportManagerListener {
+ public:
+ MOCK_METHOD1(OnDeviceListUpdated, void(const std::vector<DeviceInfo>&));
+ MOCK_METHOD0(OnFindNewApplicationsRequest, void());
+ MOCK_METHOD1(OnDeviceFound, void(const DeviceInfo &device_info));
+ MOCK_METHOD1(OnDeviceAdded, void(const DeviceInfo &device_info));
+ MOCK_METHOD1(OnDeviceRemoved, void(const DeviceInfo &device_info));
+ MOCK_METHOD0(OnNoDeviceFound, void());
+ MOCK_METHOD0(OnScanDevicesFinished, void());
+ MOCK_METHOD1(OnScanDevicesFailed, void(const SearchDeviceError& error));
+
+ MOCK_METHOD2(OnConnectionEstablished, void(const DeviceInfo& device_info,
+ const ConnectionUID &connection_id));
+ MOCK_METHOD2(OnConnectionFailed, void(const DeviceInfo& device_info,
+ const ConnectError& error));
+
+ MOCK_METHOD1(OnConnectionClosed, void(ConnectionUID connection_id));
+ MOCK_METHOD2(OnConnectionClosedFailure, void (ConnectionUID connection_id,
+ const DisconnectError& error));
+ MOCK_METHOD2(OnUnexpectedDisconnect, void (ConnectionUID connection_id,
+ const CommunicationError& error));
+ MOCK_METHOD2(OnDeviceConnectionLost, void (const DeviceHandle& device,
+ const DisconnectDeviceError& error));
+ MOCK_METHOD2(OnDisconnectFailed, void (const DeviceHandle& device,
+ const DisconnectDeviceError& error));
+
+ MOCK_METHOD1(OnTMMessageReceived, void(const RawMessagePtr data_container));
+ MOCK_METHOD2(OnTMMessageReceiveFailed, void(ConnectionUID connection_id,
+ const DataReceiveError& error));
+ MOCK_METHOD1(OnTMMessageSend, void(const RawMessagePtr message));
+ MOCK_METHOD2(OnTMMessageSendFailed, void(const DataSendError& error,
+ const RawMessagePtr message));
+};
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
+
+#endif /* MOCK_TRANSPORT_MANAGER_LISTENER_H */
diff --git a/src/components/transport_manager/test/include/raw_message_matcher.h b/src/components/transport_manager/test/include/raw_message_matcher.h
new file mode 100644
index 000000000..89f1cdd18
--- /dev/null
+++ b/src/components/transport_manager/test/include/raw_message_matcher.h
@@ -0,0 +1,75 @@
+/*
+ * \file raw_message_matcher.h
+ * \brief matcher RawMessagePtr
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef APPLINK_TEST_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_RAW_MESSAGE_MATCHER_H_
+#define APPLINK_TEST_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_RAW_MESSAGE_MATCHER_H_
+
+#include <gmock/gmock.h>
+
+#include "transport_manager/common.h"
+#include "protocol/common.h"
+
+using ::testing::Matcher;
+using ::testing::MatcherInterface;
+using ::testing::MatchResultListener;
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+using namespace ::protocol_handler;
+
+class RawMessageMatcher : public MatcherInterface<RawMessagePtr> {
+ public:
+ explicit RawMessageMatcher(RawMessagePtr ptr);
+
+ virtual bool MatchAndExplain(const RawMessagePtr ptr,
+ MatchResultListener* listener) const;
+ virtual void DescribeTo(::std::ostream* os) const;
+ virtual void DescribeNegationTo(::std::ostream* os) const;
+
+ private:
+ const RawMessagePtr ptr_;
+};
+
+inline const Matcher<RawMessagePtr> RawMessageEq(RawMessagePtr msg) {
+ return MakeMatcher(new RawMessageMatcher(msg));
+}
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
+
+#endif /* APPLINK_TEST_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_RAW_MESSAGE_MATCHER_H_ */
diff --git a/src/components/transport_manager/test/include/server_connection_factory_mock.h b/src/components/transport_manager/test/include/server_connection_factory_mock.h
new file mode 100644
index 000000000..cbf922e46
--- /dev/null
+++ b/src/components/transport_manager/test/include/server_connection_factory_mock.h
@@ -0,0 +1,57 @@
+/*
+ * 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_TRANSPORT_MANAGER_TEST_INCLUDE_SERVER_CONNECTION_FACTORY_MOCK_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_SERVER_CONNECTION_FACTORY_MOCK_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/server_connection_factory.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+class ServerConnectionFactoryMock : public ::transport_manager::transport_adapter::ServerConnectionFactory {
+ public:
+ MOCK_METHOD0(Init, ::transport_manager::transport_adapter::TransportAdapter::Error());
+ MOCK_METHOD0(Terminate, void());
+ MOCK_CONST_METHOD0(IsInitialised, bool());
+ MOCK_METHOD2(CreateConnection,
+ ::transport_manager::transport_adapter::TransportAdapter::Error(const std::string&,
+ const int& app_handle));
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_SERVER_CONNECTION_FACTORY_MOCK_H_
diff --git a/src/components/transport_manager/test/include/time_metric_observer_mock.h b/src/components/transport_manager/test/include/time_metric_observer_mock.h
new file mode 100644
index 000000000..5936f8c65
--- /dev/null
+++ b/src/components/transport_manager/test/include/time_metric_observer_mock.h
@@ -0,0 +1,55 @@
+/*
+ * 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_TRANSPORT_MANAGER_TEST_INCLUDE_TIME_METRIC_OBSERVER_MOCK_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TIME_METRIC_OBSERVER_MOCK_H_
+
+#include <string>
+#include "gmock/gmock.h"
+#include "transport_manager/time_metric_observer.h"
+#include "protocol/raw_message.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+class TMMetricObserverMock: public ::transport_manager::TMMetricObserver {
+ public:
+ MOCK_METHOD1(StartRawMsg,
+ void(const protocol_handler::RawMessage* ptr));
+ MOCK_METHOD1(StopRawMsg,
+ void(const protocol_handler::RawMessage* ptr));
+};
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TIME_METRIC_OBSERVER_MOCK_H_
diff --git a/src/components/transport_manager/test/include/transport_adapter_controller_mock.h b/src/components/transport_manager/test/include/transport_adapter_controller_mock.h
new file mode 100644
index 000000000..c0c7155e4
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_adapter_controller_mock.h
@@ -0,0 +1,92 @@
+/*
+ * 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_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_ADAPTER_CONTROLLER_MOCK_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_ADAPTER_CONTROLLER_MOCK_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+using namespace ::transport_manager::transport_adapter;
+
+class TransportAdapterControllerMock : public TransportAdapterController {
+ public:
+ MOCK_METHOD1(AddDevice, DeviceSptr(DeviceSptr device));
+ MOCK_METHOD1(SearchDeviceDone, void(DeviceVector device));
+ MOCK_METHOD1(ApplicationListUpdated,
+ ApplicationListUpdated(const DeviceUID& device_handle));
+ MOCK_METHOD0(FindNewApplicationsRequest, void());
+ MOCK_METHOD1(SearchDeviceFailed, void(const SearchDeviceError& error));
+ MOCK_CONST_METHOD1(FindDevice, DeviceSptr(const DeviceUID& device_handle));
+ MOCK_CONST_METHOD3(FindDevice, void(ConnectionSPtr connection,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
+ MOCK_METHOD2(ConnectDone, void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
+ MOCK_METHOD3(ConnectFailed, void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const ConnectError& error));
+ MOCK_METHOD2(ConnectionFinished, void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
+ MOCK_METHOD3(ConnectionAborted, void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const CommunicationError& error));
+ MOCK_METHOD2(DeviceDisconnected, void(const DeviceUID& device_handle,
+ const DisconnectDeviceError& error));
+ MOCK_METHOD2(DisconnectDone, void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
+ MOCK_METHOD3(DataReceiveDone,
+ void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD3(DataReceiveFailed, void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const DataReceiveError& error));
+ MOCK_METHOD3(DataSendDone, void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD3(DataReceiveFailed,
+ void(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ ::protocol_handler::RawMessagePtr message,
+ const DataSendError& error));
+};
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_ADAPTER_CONTROLLER_MOCK_H_
diff --git a/src/components/transport_manager/test/include/transport_adapter_listener_mock.h b/src/components/transport_manager/test/include/transport_adapter_listener_mock.h
new file mode 100644
index 000000000..88b5cf4b6
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_adapter_listener_mock.h
@@ -0,0 +1,123 @@
+/*
+ * 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_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_ADAPTER_LISTENER_MOCK_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_ADAPTER_LISTENER_MOCK_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/transport_adapter_listener.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using namespace transport_manager;
+using transport_adapter::TransportAdapter;
+using transport_adapter::TransportAdapterListener;
+
+class TransportAdapterListenerMock : public TransportAdapterListener {
+ public:
+ MOCK_METHOD1(OnSearchDeviceDone,
+ void(const TransportAdapter* transport_adapter));
+ MOCK_METHOD2(OnSearchDeviceFailed,
+ void(const TransportAdapter* transport_adapter,
+ const SearchDeviceError& error));
+ MOCK_METHOD1(OnDeviceListUpdated,
+ void(const TransportAdapter* transport_adapter));
+ MOCK_METHOD1(OnFindNewApplicationsRequest,
+ void(const TransportAdapter* transport_adapter));
+ MOCK_METHOD3(OnConnectDone,
+ void(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
+ MOCK_METHOD4(OnConnectFailed,
+ void(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const ConnectError& error));
+ MOCK_METHOD3(OnConnectRequested,
+ void(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
+ MOCK_METHOD4(OnUnexpectedDisconnect,
+ void(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const CommunicationError& error));
+ MOCK_METHOD3(OnDisconnectDone,
+ void(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
+ MOCK_METHOD4(OnDisconnectFailed,
+ void(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const DisconnectError& error));
+ MOCK_METHOD2(OnDisconnectDeviceDone,
+ void(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle));
+ MOCK_METHOD3(OnDisconnectDeviceFailed,
+ void(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const DisconnectDeviceError& error));
+ MOCK_METHOD4(OnDataSendDone,
+ void(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const ::protocol_handler::RawMessagePtr data_container));
+ MOCK_METHOD5(OnDataSendFailed,
+ void(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const ::protocol_handler::RawMessagePtr data_container,
+ const DataSendError& error));
+ MOCK_METHOD4(OnDataReceiveDone,
+ void(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const ::protocol_handler::RawMessagePtr data_container));
+ MOCK_METHOD4(OnDataReceiveFailed,
+ void(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const DataReceiveError& error));
+ MOCK_METHOD3(OnCommunicationError,
+ void(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_ADAPTER_LISTENER_MOCK_H_
diff --git a/src/components/transport_manager/test/include/transport_adapter_mock.h b/src/components/transport_manager/test/include/transport_adapter_mock.h
new file mode 100644
index 000000000..86e044d13
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_adapter_mock.h
@@ -0,0 +1,104 @@
+/*
+ * 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_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_ADAPTER_MOCK_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_ADAPTER_MOCK_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/transport_adapter.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+class TransportAdapterMock
+ : public ::transport_manager::transport_adapter::TransportAdapter {
+ public:
+ MOCK_CONST_METHOD0(GetDeviceType,
+ ::transport_manager::transport_adapter::DeviceType());
+ MOCK_CONST_METHOD0(GetConnectionType, ::transport_manager::ConnectionType());
+ MOCK_CONST_METHOD0(IsInitialised, bool());
+ MOCK_METHOD0(
+ Init, ::transport_manager::transport_adapter::TransportAdapter::Error());
+ MOCK_METHOD0(Terminate, void());
+ MOCK_METHOD1(
+ AddListener,
+ void(::transport_manager::transport_adapter::TransportAdapterListener*
+ listener));
+ MOCK_CONST_METHOD0(IsSearchDevicesSupported, bool());
+ MOCK_METHOD0(
+ SearchDevices,
+ ::transport_manager::transport_adapter::TransportAdapter::Error());
+ MOCK_CONST_METHOD0(IsServerOriginatedConnectSupported, bool());
+ MOCK_METHOD2(Connect,
+ ::transport_manager::transport_adapter::TransportAdapter::Error(
+ const ::transport_manager::DeviceUID& device_handle,
+ const ::transport_manager::ApplicationHandle& app_handle));
+ MOCK_METHOD1(ConnectDevice,
+ ::transport_manager::transport_adapter::TransportAdapter::Error(
+ const ::transport_manager::DeviceUID& device_handle));
+ MOCK_CONST_METHOD0(IsClientOriginatedConnectSupported, bool());
+ MOCK_METHOD0(
+ StartClientListening,
+ ::transport_manager::transport_adapter::TransportAdapter::Error());
+ MOCK_METHOD0(
+ StopClientListening,
+ ::transport_manager::transport_adapter::TransportAdapter::Error());
+ MOCK_METHOD2(Disconnect,
+ ::transport_manager::transport_adapter::TransportAdapter::Error(
+ const ::transport_manager::DeviceUID& device_handle,
+ const ::transport_manager::ApplicationHandle& app_handle));
+ MOCK_METHOD1(DisconnectDevice,
+ Error(const ::transport_manager::DeviceUID& device_handle));
+ MOCK_METHOD3(SendData,
+ ::transport_manager::transport_adapter::TransportAdapter::Error(
+ const ::transport_manager::DeviceUID& device_handle,
+ const ::transport_manager::ApplicationHandle& app_handle,
+ const protocol_handler::RawMessagePtr data));
+ MOCK_CONST_METHOD0(GetDeviceList, ::transport_manager::DeviceList());
+ MOCK_CONST_METHOD1(GetApplicationList,
+ ::transport_manager::ApplicationList(
+ const ::transport_manager::DeviceUID& device_handle));
+ MOCK_CONST_METHOD1(
+ DeviceName,
+ std::string(const ::transport_manager::DeviceUID& device_handle));
+
+#ifdef TIME_TESTER
+ MOCK_METHOD0(GetTimeMetricObserver, ::transport_manager::TMMetricObserver*());
+#endif // TIME_TESTER
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_ADAPTER_MOCK_H_
diff --git a/src/components/transport_manager/test/include/transport_manager_impl_mock.h b/src/components/transport_manager/test/include/transport_manager_impl_mock.h
new file mode 100644
index 000000000..bb73f1fa4
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager_impl_mock.h
@@ -0,0 +1,54 @@
+/*
+ * 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 APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_TRANSPORT_MANAGER_IMPL_MOCK_H_
+#define APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_TRANSPORT_MANAGER_IMPL_MOCK_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_manager_impl.h"
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+using namespace ::transport_manager;
+
+class TransportManagerImplMock : public TransportManagerImpl {
+ public:
+ MOCK_METHOD1(ReceiveEventFromDevice, int(const TransportAdapterEvent& event));
+};
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
+
+#endif // APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_TRANSPORT_MANAGER_IMPL_MOCK_H_
diff --git a/src/components/transport_manager/test/include/transport_manager_listener_mock.h b/src/components/transport_manager/test/include/transport_manager_listener_mock.h
new file mode 100644
index 000000000..29758159f
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager_listener_mock.h
@@ -0,0 +1,89 @@
+/*
+ * 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_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_LISTENER_MOCK_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_LISTENER_MOCK_H_
+
+#include <vector>
+#include <gmock/gmock.h>
+#include "transport_manager/transport_manager_listener.h"
+#include "protocol/raw_message.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using namespace transport_manager;
+using ::protocol_handler::RawMessage;
+using ::protocol_handler::RawMessagePtr;
+
+class TransportManagerListenerMock : public TransportManagerListener {
+ public:
+ MOCK_METHOD1(OnDeviceListUpdated, void(const std::vector<DeviceInfo>&));
+ MOCK_METHOD0(OnFindNewApplicationsRequest, void());
+ MOCK_METHOD1(OnDeviceFound, void(const DeviceInfo& device_info));
+ MOCK_METHOD1(OnDeviceAdded, void(const DeviceInfo& device_info));
+ MOCK_METHOD1(OnDeviceRemoved, void(const DeviceInfo& device_info));
+ MOCK_METHOD0(OnNoDeviceFound, void());
+ MOCK_METHOD0(OnScanDevicesFinished, void());
+ MOCK_METHOD1(OnScanDevicesFailed, void(const SearchDeviceError& error));
+
+ MOCK_METHOD2(OnConnectionEstablished,
+ void(const DeviceInfo& device_info,
+ const ConnectionUID& connection_id));
+ MOCK_METHOD2(OnConnectionFailed,
+ void(const DeviceInfo& device_info, const ConnectError& error));
+
+ MOCK_METHOD1(OnConnectionClosed, void(ConnectionUID connection_id));
+ MOCK_METHOD2(OnConnectionClosedFailure,
+ void(ConnectionUID connection_id, const DisconnectError& error));
+ MOCK_METHOD2(OnUnexpectedDisconnect, void(ConnectionUID connection_id,
+ const CommunicationError& error));
+ MOCK_METHOD2(OnDeviceConnectionLost,
+ void(const DeviceHandle& device,
+ const DisconnectDeviceError& error));
+ MOCK_METHOD2(OnDisconnectFailed, void(const DeviceHandle& device,
+ const DisconnectDeviceError& error));
+
+ MOCK_METHOD1(OnTMMessageReceived, void(const RawMessagePtr data_container));
+ MOCK_METHOD2(OnTMMessageReceiveFailed, void(ConnectionUID connection_id,
+ const DataReceiveError& error));
+ MOCK_METHOD1(OnTMMessageSend, void(const RawMessagePtr message));
+ MOCK_METHOD2(OnTMMessageSendFailed,
+ void(const DataSendError& error, const RawMessagePtr message));
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_LISTENER_MOCK_H_
diff --git a/src/components/transport_manager/test/include/transport_manager_mock.h b/src/components/transport_manager/test/include/transport_manager_mock.h
new file mode 100644
index 000000000..6593f992d
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager_mock.h
@@ -0,0 +1,87 @@
+/*
+ * 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 TEST_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_MOCK_H_
+#define TEST_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_MOCK_H_
+
+#include <gmock/gmock.h>
+#include <string>
+#include "transport_manager/transport_manager.h"
+#include "transport_manager/transport_adapter/transport_adapter_event.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using ::transport_manager::DeviceHandle;
+using ::transport_manager::ConnectionUID;
+using ::transport_manager::transport_adapter::TransportAdapter;
+using ::transport_manager::TransportAdapterEvent;
+using ::transport_manager::TransportManagerListener;
+/*
+ * MOCK implementation of ::transport_manager::TransportManager interface
+ */
+class TransportManagerMock: public ::transport_manager::TransportManager {
+ public:
+ MOCK_METHOD0(Init,
+ int());
+ MOCK_METHOD0(Reinit,
+ int());
+ MOCK_METHOD0(SearchDevices,
+ int());
+ MOCK_METHOD1(ConnectDevice,
+ int(const DeviceHandle &));
+ MOCK_METHOD1(DisconnectDevice,
+ int(const DeviceHandle &));
+ MOCK_METHOD1(Disconnect,
+ int(const ConnectionUID &));
+ MOCK_METHOD1(DisconnectForce,
+ int(const ConnectionUID &));
+ MOCK_METHOD1(SendMessageToDevice,
+ int(const ::protocol_handler::RawMessagePtr));
+ MOCK_METHOD1(ReceiveEventFromDevice,
+ int(const TransportAdapterEvent&));
+ MOCK_METHOD1(AddTransportAdapter,
+ int(TransportAdapter *));
+ MOCK_METHOD1(AddEventListener,
+ int(TransportManagerListener *));
+ MOCK_METHOD0(Stop,
+ int());
+ MOCK_METHOD1(RemoveDevice,
+ int(const DeviceHandle &));
+ MOCK_CONST_METHOD1(Visibility,
+ int(const bool &));
+};
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+#endif // TEST_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_MOCK_H_
diff --git a/src/components/transport_manager/test/mock_application.cc b/src/components/transport_manager/test/mock_application.cc
new file mode 100644
index 000000000..72f99cb74
--- /dev/null
+++ b/src/components/transport_manager/test/mock_application.cc
@@ -0,0 +1,147 @@
+/*
+ * 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 <pthread.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+
+#include "include/mock_application.h"
+#include "include/mock_device.h"
+
+namespace {
+
+struct workerData {
+ int sockfd;
+};
+
+void *applicationWorker(void *p) {
+ workerData *data = static_cast<workerData*>(p);
+ char *buf = new char[2 * 1024 * 1024];
+ ssize_t len;
+
+ while (true) {
+ len = recv(data->sockfd, buf, 2 * 1024 * 1024, 0);
+ if (len == 0)
+ break;
+ send(data->sockfd, buf, len, 0);
+ }
+ delete[] buf;
+ delete data;
+ return NULL;
+}
+
+void * applicationListener(void *p) {
+ using test::components::transport_manager::MockApplication;
+ MockApplication *app = static_cast<MockApplication*>(p);
+
+ unlink(app->socket_name().c_str());
+
+ app->sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (app->sockfd == -1) {
+ // TODO: indicate error
+ return NULL;
+ }
+ sockaddr_un my_addr;
+ memset(&my_addr, 0, sizeof(my_addr));
+ strcpy(my_addr.sun_path, app->socket_name().c_str());
+ my_addr.sun_family = AF_UNIX;
+ int res = bind(app->sockfd, reinterpret_cast<sockaddr*>(&my_addr),
+ sizeof(my_addr));
+ if (res == -1) {
+ return NULL;
+ }
+
+ res = listen(app->sockfd, 5);
+ if (res == -1) {
+ return NULL;
+ }
+
+ pthread_mutex_lock(&app->ready_mutex);
+ app->active = true;
+ pthread_cond_signal(&app->ready_cond);
+ pthread_mutex_unlock(&app->ready_mutex);
+
+ while (app->active) {
+ socklen_t addr_size;
+ sockaddr peer_addr;
+
+ int peer_socket = accept(app->sockfd, &peer_addr, &addr_size);
+ if (peer_socket != -1) {
+ pthread_t t;
+ workerData* data = new workerData();
+ data->sockfd = peer_socket;
+ pthread_create(&t, NULL, &applicationWorker, data);
+ }
+ }
+
+ unlink(app->socket_name().c_str());
+
+ return NULL;
+}
+}
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+MockApplication::MockApplication(const MockDevice *device, ApplicationHandle id)
+ : device(device),
+ handle(id),
+ workerThread(0),
+ sockfd(-1),
+ active(false) {
+ std::ostringstream oss;
+ oss << "mockDevice" << device->unique_device_id() << "-" << id;
+ socket_name_ = oss.str();
+}
+
+void MockApplication::Start() {
+
+ pthread_cond_init(&ready_cond, NULL);
+ pthread_mutex_init(&ready_mutex, NULL);
+
+ pthread_mutex_lock(&ready_mutex);
+ pthread_create(&workerThread, NULL, &applicationListener, this);
+ pthread_cond_wait(&ready_cond, &ready_mutex);
+ pthread_mutex_unlock(&ready_mutex);
+}
+
+void MockApplication::Stop() {
+ active = false;
+ shutdown(sockfd, SHUT_RDWR);
+ close(sockfd);
+ pthread_join(workerThread, NULL);
+}
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
diff --git a/src/components/transport_manager/test/mock_connection.cc b/src/components/transport_manager/test/mock_connection.cc
new file mode 100644
index 000000000..8f385764a
--- /dev/null
+++ b/src/components/transport_manager/test/mock_connection.cc
@@ -0,0 +1,78 @@
+/*
+ * 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 <cstring>
+
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sstream>
+#include "transport_manager/common.h"
+#include "include/mock_connection.h"
+
+#include <algorithm>
+
+#include "include/mock_transport_adapter.h"
+
+using ::transport_manager::transport_adapter::TransportAdapterController;
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+MockConnection::MockConnection(const ::transport_manager::DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller)
+ : ThreadedSocketConnection(device_handle, app_handle, controller) {
+}
+
+bool MockConnection::Establish(ConnectError **error) {
+ int peer_sock = socket(AF_UNIX, SOCK_STREAM, 0);
+ sockaddr_un my_addr;
+ memset(&my_addr, 0, sizeof(my_addr));
+ std::ostringstream iss;
+ iss << "mockDevice" << device_handle() << "-" << application_handle();
+ strcpy(my_addr.sun_path, iss.str().c_str());
+ my_addr.sun_family = AF_UNIX;
+ int res = ::connect(peer_sock, reinterpret_cast<sockaddr*>(&my_addr),
+ sizeof(my_addr));
+ if (res != -1) {
+ set_socket(peer_sock);
+ return true;
+ }
+ *error = new ConnectError();
+ return false;
+}
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
+
diff --git a/src/components/transport_manager/test/mock_connection_factory.cc b/src/components/transport_manager/test/mock_connection_factory.cc
new file mode 100644
index 000000000..392ad7951
--- /dev/null
+++ b/src/components/transport_manager/test/mock_connection_factory.cc
@@ -0,0 +1,63 @@
+/*
+ * 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 "include/mock_connection.h"
+#include "include/mock_connection_factory.h"
+
+#include <algorithm>
+
+#include "include/mock_device.h"
+#include "include/mock_transport_adapter.h"
+
+using ::transport_manager::transport_adapter::DeviceSptr;
+using ::transport_manager::ConnectError;
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+MockConnectionFactory::MockConnectionFactory(MockTransportAdapter *controller)
+ : controller_(controller) {}
+
+TransportAdapter::Error MockConnectionFactory::CreateConnection(
+ const ::transport_manager::DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) {
+
+ MockConnection *conn = new MockConnection(device_handle, app_handle, controller_);
+ conn->Start();
+ return TransportAdapter::OK;
+}
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
diff --git a/src/components/transport_manager/test/mock_device.cc b/src/components/transport_manager/test/mock_device.cc
new file mode 100644
index 000000000..8e346e9d5
--- /dev/null
+++ b/src/components/transport_manager/test/mock_device.cc
@@ -0,0 +1,85 @@
+/*
+ * 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 "include/mock_device.h"
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+const ApplicationHandle MockDevice::addApplication() {
+ MockApplication app(this, applications_cnt_++);
+ app.device = this;
+ app.active = false;
+ applications_.push_back(app);
+ return app.handle;
+}
+
+void MockDevice::Start() {
+ for (std::vector<MockApplication>::iterator it = applications_.begin();
+ it != applications_.end();
+ ++it) {
+ it->Start();
+ }
+}
+
+void MockDevice::Stop() {
+ for (std::vector<MockApplication>::iterator it = applications_.begin();
+ it != applications_.end();
+ ++it) {
+ it->Stop();
+ }
+}
+
+bool MockDevice::IsSameAs(const Device* other) const {
+ return unique_device_id() == other->unique_device_id();
+}
+
+static ApplicationHandle get_handle(const MockApplication& app) {
+ return app.handle;
+}
+
+ApplicationList MockDevice::GetApplicationList() const {
+ ApplicationList rc(applications_.size());
+ std::transform(
+ applications_.begin(), applications_.end(), rc.begin(),
+ &get_handle);
+ return rc;
+}
+
+bool MockDevice::operator ==(const MockDevice& other) {
+ return IsSameAs(&other);
+}
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
diff --git a/src/components/transport_manager/test/mock_device_scanner.cc b/src/components/transport_manager/test/mock_device_scanner.cc
new file mode 100644
index 000000000..a24316266
--- /dev/null
+++ b/src/components/transport_manager/test/mock_device_scanner.cc
@@ -0,0 +1,103 @@
+/*
+ * 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 "include/mock_device_scanner.h"
+#include "include/mock_transport_adapter.h"
+#include "include/mock_device.h"
+
+using ::transport_manager::SearchDeviceError;
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+MockDeviceScanner::MockDeviceScanner(MockTransportAdapter *controller)
+ : controller_(controller),
+ is_initialized_(false),
+ is_search_failed_(false) {
+}
+
+TransportAdapter::Error MockDeviceScanner::Init() {
+ is_initialized_ = true;
+ return TransportAdapter::OK;
+}
+
+TransportAdapter::Error MockDeviceScanner::Scan() {
+ if (is_search_failed_) {
+ controller_->SearchDeviceFailed(SearchDeviceError());
+ } else {
+ controller_->SearchDeviceDone(devices_);
+ }
+ return TransportAdapter::OK;
+}
+
+void MockDeviceScanner::Terminate() {
+}
+
+void MockDeviceScanner::reset() {
+ is_search_failed_ = false;
+ for (DeviceVector::iterator it = devices_.begin();
+ it != devices_.end();
+ ++it) {
+ static_cast<MockDevice*>(it->get())->Stop();
+ }
+ devices_.clear();
+}
+
+bool MockDeviceScanner::IsInitialised() const {
+ return is_initialized_;
+}
+
+void MockDeviceScanner::AddDevice(const std::string& name,
+ const std::string& unique_id, bool start) {
+ MockDevice* dev = new MockDevice(name, unique_id, controller_);
+ dev->addApplication();
+ if (start) {
+ dev->Start();
+ }
+ devices_.push_back(dev);
+}
+
+void MockDeviceScanner::RemoveDevice(const std::string& name) {
+ for (DeviceVector::iterator t = devices_.begin(); t != devices_.end(); ++t) {
+ if ((*t)->name() == name) {
+ devices_.erase(t);
+ break;
+ }
+ }
+}
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
+
+// vim: set ts=2 sw=2 et:
diff --git a/src/components/transport_manager/test/mock_transport_adapter.cc b/src/components/transport_manager/test/mock_transport_adapter.cc
new file mode 100644
index 000000000..8612ca363
--- /dev/null
+++ b/src/components/transport_manager/test/mock_transport_adapter.cc
@@ -0,0 +1,57 @@
+/*
+ * 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 "include/mock_connection.h"
+#include "include/mock_device.h"
+#include "include/mock_transport_adapter.h"
+#include "include/mock_device_scanner.h"
+#include "include/mock_connection_factory.h"
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+MockTransportAdapter::MockTransportAdapter()
+ : TransportAdapterImpl(new MockDeviceScanner(this),
+ new MockConnectionFactory(this), NULL) {}
+
+void MockTransportAdapter::reset() {
+ get_device_scanner()->reset();
+}
+
+MockDeviceScanner* MockTransportAdapter::get_device_scanner() const {
+ return static_cast<MockDeviceScanner*>(device_scanner_);
+}
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
diff --git a/src/components/transport_manager/test/raw_message_matcher.cc b/src/components/transport_manager/test/raw_message_matcher.cc
new file mode 100644
index 000000000..289009d0c
--- /dev/null
+++ b/src/components/transport_manager/test/raw_message_matcher.cc
@@ -0,0 +1,65 @@
+/*
+ * 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 "include/raw_message_matcher.h"
+//#include "../../include/protocol/raw_message.h"
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+RawMessageMatcher::RawMessageMatcher(RawMessagePtr ptr)
+ : ptr_(ptr) {}
+
+bool RawMessageMatcher::MatchAndExplain(const RawMessagePtr msg,
+ MatchResultListener* listener) const {
+ if (msg->data_size() != ptr_->data_size()) {
+ return ::std::equal(msg->data(), msg->data() + msg->data_size(), ptr_->data());
+ } else
+ return false;
+}
+
+void RawMessageMatcher::DescribeTo(::std::ostream* os) const {
+ *os << "data_ is " ;
+ ::std::ostream_iterator<unsigned char> out(*os);
+ ::std::copy(ptr_->data(), ptr_->data() + ptr_->data_size(), out);
+}
+
+void RawMessageMatcher::DescribeNegationTo(::std::ostream* os) const {
+ *os << "data_ is not " ;
+ ::std::ostream_iterator<unsigned char> out(*os);
+ ::std::copy(ptr_->data(), ptr_->data() + ptr_->data_size(), out);
+}
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
diff --git a/src/components/transport_manager/test/smartDeviceLink_test.ini b/src/components/transport_manager/test/smartDeviceLink_test.ini
new file mode 100644
index 000000000..40aeb5a01
--- /dev/null
+++ b/src/components/transport_manager/test/smartDeviceLink_test.ini
@@ -0,0 +1,55 @@
+ ; The INI-file consists of different chapters.
+; Each chapter begins with the line containing
+; the name in square brackets. Syntax:
+; [chapter]
+; The chapters consists of a set of items with a
+; assinged value. The syntax is:
+; item=value
+; All white spaces an second encounters of chapters
+; or items will be ignored.
+; Remarks start with semicolon or star as first character.
+; It is alowed for names of chapters and items to
+; contain semicolon and star. Possible syntax is:
+; [ chapter ] ;Remark
+; item = value ;Remark
+
+[HMI]
+LaunchHMI = false
+LinkToWebHMI = "HMI/index.html"
+ServerAddress = 127.0.0.1
+ServerPort = 8087
+VideoStreamingPort = 5050
+AudioStreamingPort = 5080
+
+[MAIN]
+SDLVersion =
+LogsEnabled = false
+; Contains .json/.ini files
+AppConfigFolder =
+; Contains output files, e.g. .wav
+AppStorageFolder = storage
+; Contains resourses, e.g. audio8bit.wav
+AppResourceFolder =
+
+
+UseLastState = true
+
+
+[Resumption]
+
+# Timeout in milliseconds for resumption Application HMILevel
+# and resolving conflicts in case if multiple applications initiate resumption
+ApplicationResumingTimeout = 3000
+
+# Timeout in milliseconds for periodical saving resumption persistent data
+AppSavePersistentDataTimeout = 10000
+
+# Timeout in seconds to store hmi_level for media app before ign_off
+ResumptionDelayBeforeIgn = 30;
+
+# Timeout in seconds to restore hmi_level for media app after sdl run
+ResumptionDelayAfterIgn = 30;
+
+# Resumption ctrl uses JSON if UseDBForResumption=false for store data otherwise uses DB
+UseDBForResumption = false
+
diff --git a/src/components/transport_manager/test/tcp_client_listener_test.cc b/src/components/transport_manager/test/tcp_client_listener_test.cc
new file mode 100644
index 000000000..916f8bac5
--- /dev/null
+++ b/src/components/transport_manager/test/tcp_client_listener_test.cc
@@ -0,0 +1,101 @@
+/*
+ * 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 "include/transport_adapter_mock.h"
+#include "transport_manager/tcp/tcp_client_listener.h"
+#include "include/transport_manager_mock.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/transport_adapter/device.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using ::testing::Return;
+using namespace ::transport_manager;
+using namespace ::transport_manager::transport_adapter;
+
+class MockTransportAdapterController: public TransportAdapterController {
+public:
+ MOCK_METHOD1(AddDevice,DeviceSptr(DeviceSptr device));
+ MOCK_METHOD0(AckDevices,void());
+ MOCK_METHOD1(SearchDeviceDone, void(const DeviceVector& devices));
+ MOCK_METHOD1(SearchDeviceFailed, void(const SearchDeviceError& error));
+ MOCK_CONST_METHOD1(FindDevice, DeviceSptr(const DeviceUID& device_handle));
+ MOCK_METHOD3(ConnectionCreated, void(ConnectionSPtr connection, const DeviceUID& device_handle, const ApplicationHandle& app_handle));
+ MOCK_METHOD2(ConnectDone, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle));
+ MOCK_METHOD3(ConnectFailed, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle, const ConnectError& error));
+ MOCK_METHOD2(ConnectionFinished, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle));
+ MOCK_METHOD3(ConnectionAborted,void(const DeviceUID& device_handle, const ApplicationHandle& app_handle, const CommunicationError& error));
+ MOCK_METHOD2(DisconnectDone, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle));
+ MOCK_METHOD3(DataReceiveDone, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle, const ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD3(DataReceiveFailed, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle, const DataReceiveError& error));
+ MOCK_METHOD3(DataSendDone, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle, const ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD4(DataSendFailed, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle, const ::protocol_handler::RawMessagePtr message, const DataSendError& error));
+ MOCK_METHOD0(FindNewApplicationsRequest, void());
+ MOCK_METHOD1(ApplicationListUpdated, void(const DeviceUID& device_handle));
+ MOCK_METHOD2(DeviceDisconnected, void (const DeviceUID& device_handle,const DisconnectDeviceError& error));
+};
+
+class TcpClientListenerTest : public ::testing::Test {
+ public:
+ TcpClientListenerTest()
+ : port_(0),
+ enable_keep_alive_(false),
+ tcp_client_listener_(&adapter_controller_mock_, port_, enable_keep_alive_) {}
+
+ protected:
+ uint16_t port_;
+ bool enable_keep_alive_;
+ MockTransportAdapterController adapter_controller_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_F(TcpClientListenerTest, IsInitialised) {
+ EXPECT_TRUE(tcp_client_listener_.IsInitialised());
+}
+
+TEST_F(TcpClientListenerTest, Init) {
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_.Init());
+}
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
diff --git a/src/components/transport_manager/test/tcp_device_test.cc b/src/components/transport_manager/test/tcp_device_test.cc
new file mode 100644
index 000000000..961ebe695
--- /dev/null
+++ b/src/components/transport_manager/test/tcp_device_test.cc
@@ -0,0 +1,105 @@
+/*
+ * 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 "transport_manager/tcp/tcp_device.h"
+#include "transport_manager/transport_adapter/device.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using namespace ::transport_manager;
+using namespace ::transport_manager::transport_adapter;
+
+class TestDevice : public Device {
+ public:
+ TestDevice(const uint32_t& in_addr, const std::string& name)
+ : Device(name, name), in_addr_(in_addr) {}
+ bool IsSameAs(const Device* other_device) const { return true; }
+ ApplicationList GetApplicationList() const {
+ ApplicationList app_list;
+ return app_list;
+ }
+ const uint32_t in_addr_;
+};
+
+TEST(TcpDeviceTest, CompareWithOtherTCPDevice) {
+ uint32_t in_addr = 10;
+ std::string name = "tcp_device";
+ TcpDevice test_tcp_device(in_addr, name);
+ TcpDevice other(in_addr, "other");
+
+ EXPECT_TRUE(test_tcp_device.IsSameAs(&other));
+}
+
+TEST(TcpDeviceTest, CompareWithOtherNotTCPDevice) {
+ uint32_t in_addr = 10;
+ std::string name = "tcp_device";
+ TcpDevice test_tcp_device(in_addr, name);
+ TestDevice other(in_addr, "other");
+
+ EXPECT_FALSE(test_tcp_device.IsSameAs(&other));
+}
+
+TEST(TcpDeviceTest, AddApplications) {
+ uint32_t in_addr = 1;
+ std::string name = "tcp_device";
+
+ TcpDevice test_tcp_device(in_addr, name);
+
+ // App will be with socket = 0, incoming = false;
+ int port = 12345;
+
+ EXPECT_EQ(1, test_tcp_device.AddDiscoveredApplication(port));
+
+ // App.incoming = true; app.port = 0;
+ int socket = 10;
+ EXPECT_EQ(2, test_tcp_device.AddIncomingApplication(socket));
+
+ ApplicationList applist = test_tcp_device.GetApplicationList();
+ ASSERT_EQ(2u, applist.size());
+ EXPECT_EQ(1, applist[0]);
+ EXPECT_EQ(2, applist[1]);
+
+ // Because incoming = false
+ EXPECT_EQ(-1, test_tcp_device.GetApplicationSocket(applist[0]));
+ EXPECT_EQ(10, test_tcp_device.GetApplicationSocket(applist[1]));
+
+ EXPECT_EQ(port, test_tcp_device.GetApplicationPort(applist[0]));
+ // Because incoming = true
+ EXPECT_EQ(-1, test_tcp_device.GetApplicationPort(applist[1]));
+}
+
+} // 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
new file mode 100644
index 000000000..d849d94d4
--- /dev/null
+++ b/src/components/transport_manager/test/tcp_transport_adapter_test.cc
@@ -0,0 +1,358 @@
+/*
+ * 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 "transport_manager/tcp/tcp_transport_adapter.h"
+#include "transport_manager/transport_adapter/connection.h"
+#include "config_profile/profile.h"
+#include "resumption/last_state.h"
+#include "protocol/raw_message.h"
+#include "include/transport_adapter_listener_mock.h"
+#include "include/device_mock.h"
+#include "include/connection_mock.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using ::testing::Return;
+using ::testing::_;
+
+using namespace ::protocol_handler;
+using namespace ::transport_manager;
+using namespace transport_manager::transport_adapter;
+
+class TestTCPTransportAdapter : public TcpTransportAdapter {
+ public:
+ TestTCPTransportAdapter(uint16_t port) : TcpTransportAdapter(port) {
+ ::profile::Profile::instance()->config_file_name(
+ "smartDeviceLink_test.ini");
+ }
+ MOCK_CONST_METHOD2(FindEstablishedConnection,
+ ConnectionSPtr(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
+
+ MOCK_CONST_METHOD1(FindDevice, DeviceSptr(const DeviceUID& device_handle));
+ MOCK_METHOD2(Connect,
+ TransportAdapter::Error(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle));
+ void CallStore() { Store(); }
+ bool CallRestore() { return Restore(); }
+};
+
+class TcpAdapterTest : public ::testing::Test {
+ protected:
+ static void SetUpTestCase() {
+ ::profile::Profile::instance()->config_file_name(
+ "smartDeviceLink_test.ini");
+ }
+ virtual void SetUp() {
+ resumption::LastState::instance()->dictionary = Json::Value();
+ }
+
+ virtual void TearDown() { resumption::LastState::destroy(); }
+
+ const uint32_t port = 12345;
+ const std::string string_port = "12345";
+};
+
+TEST_F(TcpAdapterTest, DISABLED_StoreDataWithOneDeviceAndOneApplication) {
+ // Prepare
+ TestTCPTransportAdapter transport_adapter(port);
+ std::string uniq_id = "unique_device_name";
+ utils::SharedPtr<TCPDeviceMock> mockdev = new TCPDeviceMock(port, uniq_id);
+ transport_adapter.AddDevice(mockdev);
+
+ std::vector<std::string> devList = transport_adapter.GetDeviceList();
+ ASSERT_EQ(1u, devList.size());
+ EXPECT_EQ(uniq_id, devList[0]);
+
+ const int app_handle = 1;
+ std::vector<int> intList = {app_handle};
+ EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+
+ ConnectionSPtr mock_connection = new ConnectionMock();
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
+ EXPECT_CALL(transport_adapter, FindEstablishedConnection(uniq_id, app_handle))
+ .WillOnce(Return(mock_connection));
+
+ EXPECT_CALL(*mockdev, GetApplicationPort(app_handle)).WillOnce(Return(port));
+
+ transport_adapter.CallStore();
+
+ // Check that value is saved
+ Json::Value& tcp_dict = resumption::LastState::instance()
+ ->dictionary["TransportManager"]["TcpAdapter"];
+
+ ASSERT_TRUE(tcp_dict.isObject());
+ ASSERT_FALSE(tcp_dict["devices"].isNull());
+ ASSERT_FALSE(tcp_dict["devices"][0]["applications"].isNull());
+ ASSERT_FALSE(tcp_dict["devices"][0]["address"].isNull());
+ EXPECT_EQ(1u, tcp_dict["devices"][0]["applications"].size());
+ EXPECT_EQ(string_port,
+ tcp_dict["devices"][0]["applications"][0]["port"].asString());
+ EXPECT_EQ(uniq_id, tcp_dict["devices"][0]["name"].asString());
+}
+
+TEST_F(TcpAdapterTest, DISABLED_StoreDataWithSeveralDevicesAndOneApplication) {
+ // Prepare
+ TestTCPTransportAdapter transport_adapter(port);
+ const uint32_t count_dev = 10;
+ utils::SharedPtr<TCPDeviceMock> 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 TCPDeviceMock(port, uniq_id[i]);
+ EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false));
+ transport_adapter.AddDevice(mockdev[i]);
+ }
+
+ std::vector<std::string> devList = transport_adapter.GetDeviceList();
+ ASSERT_EQ(count_dev, devList.size());
+ EXPECT_EQ(uniq_id[0], devList[0]);
+
+ const int app_handle = 1;
+ std::vector<int> intList = {app_handle};
+
+ ConnectionSPtr mock_connection = new ConnectionMock();
+ for (uint32_t i = 0; i < count_dev; i++) {
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i]))
+ .WillOnce(Return(mockdev[i]));
+ EXPECT_CALL(*(mockdev[i]), GetApplicationList()).WillOnce(Return(intList));
+
+ EXPECT_CALL(transport_adapter,
+ FindEstablishedConnection(uniq_id[i], app_handle))
+ .WillOnce(Return(mock_connection));
+
+ EXPECT_CALL(*(mockdev[i]), GetApplicationPort(app_handle))
+ .WillOnce(Return(port));
+ }
+ transport_adapter.CallStore();
+
+ // Check that values are saved
+ Json::Value& tcp_dict = resumption::LastState::instance()
+ ->dictionary["TransportManager"]["TcpAdapter"];
+ ASSERT_TRUE(tcp_dict.isObject());
+ ASSERT_FALSE(tcp_dict["devices"].isNull());
+ for (uint32_t i = 0; i < count_dev; i++) {
+ ASSERT_FALSE(tcp_dict["devices"][i]["applications"].isNull());
+ ASSERT_FALSE(tcp_dict["devices"][i]["address"].isNull());
+ EXPECT_EQ(1u, tcp_dict["devices"][i]["applications"].size());
+ EXPECT_EQ(string_port,
+ tcp_dict["devices"][i]["applications"][0]["port"].asString());
+ EXPECT_EQ(uniq_id[i], tcp_dict["devices"][i]["name"].asString());
+ }
+}
+
+TEST_F(TcpAdapterTest, DISABLED_StoreDataWithSeveralDevicesAndSeveralApplications) {
+ // Prepare
+ TestTCPTransportAdapter transport_adapter(port);
+ const uint32_t count_dev = 10;
+
+ utils::SharedPtr<TCPDeviceMock> 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 TCPDeviceMock(port, uniq_id[i]);
+ EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false));
+ transport_adapter.AddDevice(mockdev[i]);
+ }
+
+ std::vector<std::string> devList = transport_adapter.GetDeviceList();
+ ASSERT_EQ(count_dev, devList.size());
+ EXPECT_EQ(uniq_id[0], devList[0]);
+
+ const uint32_t connection_count = 3;
+ const int app_handle[connection_count] = {1, 2, 3};
+ 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 ConnectionMock();
+ for (uint32_t i = 0; i < count_dev; i++) {
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i]))
+ .WillOnce(Return(mockdev[i]));
+ EXPECT_CALL(*(mockdev[i]), GetApplicationList()).WillOnce(Return(intList));
+
+ for (uint32_t j = 0; j < connection_count; j++) {
+ EXPECT_CALL(transport_adapter,
+ FindEstablishedConnection(uniq_id[i], app_handle[j]))
+ .WillOnce(Return(mock_connection));
+ EXPECT_CALL(*(mockdev[i]), GetApplicationPort(app_handle[j]))
+ .WillOnce(Return(int_port[j]));
+ }
+ }
+ transport_adapter.CallStore();
+
+ // Check that value is saved
+ Json::Value& tcp_dict = resumption::LastState::instance()
+ ->dictionary["TransportManager"]["TcpAdapter"];
+
+ ASSERT_TRUE(tcp_dict.isObject());
+ ASSERT_FALSE(tcp_dict["devices"].isNull());
+ for (uint32_t i = 0; i < count_dev; i++) {
+ ASSERT_FALSE(tcp_dict["devices"][i]["applications"].isNull());
+ ASSERT_FALSE(tcp_dict["devices"][i]["address"].isNull());
+ for (uint32_t j = 0; j < intList.size(); j++) {
+ EXPECT_EQ(ports[j],
+ tcp_dict["devices"][i]["applications"][j]["port"].asString());
+ EXPECT_EQ(uniq_id[i], tcp_dict["devices"][i]["name"].asString());
+ }
+ }
+}
+
+TEST_F(TcpAdapterTest, StoreData_ConnectionNotExist_DataNotStored) {
+ // Prepare
+ TestTCPTransportAdapter transport_adapter(port);
+ std::string uniq_id = "unique_device_name";
+ utils::SharedPtr<TCPDeviceMock> mockdev = new TCPDeviceMock(port, uniq_id);
+ transport_adapter.AddDevice(mockdev);
+
+ std::vector<std::string> devList = transport_adapter.GetDeviceList();
+ ASSERT_EQ(1u, devList.size());
+ EXPECT_EQ(uniq_id, devList[0]);
+ std::vector<int> intList = {};
+ EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
+ EXPECT_CALL(transport_adapter, FindEstablishedConnection(uniq_id, _))
+ .Times(0);
+ EXPECT_CALL(*mockdev, GetApplicationPort(_)).Times(0);
+ transport_adapter.CallStore();
+
+ // Check that value is not saved
+ Json::Value& tcp_dict =
+ resumption::LastState::instance()
+ ->dictionary["TransportManager"]["TcpAdapter"]["devices"];
+ ASSERT_TRUE(tcp_dict.isNull());
+}
+
+TEST_F(TcpAdapterTest, RestoreData_DataNotStored) {
+ Json::Value& tcp_adapter_dictionary =
+ resumption::LastState::instance()
+ ->dictionary["TransportManager"]["TcpAdapter"];
+ tcp_adapter_dictionary = Json::Value();
+ TestTCPTransportAdapter transport_adapter(port);
+ EXPECT_CALL(transport_adapter, Connect(_, _)).Times(0);
+ EXPECT_TRUE(transport_adapter.CallRestore());
+}
+
+TEST_F(TcpAdapterTest, DISABLED_StoreDataWithOneDevice_RestoreData) {
+ TestTCPTransportAdapter transport_adapter(port);
+ std::string uniq_id = "unique_device_name";
+ utils::SharedPtr<TCPDeviceMock> mockdev = new TCPDeviceMock(port, uniq_id);
+ transport_adapter.AddDevice(mockdev);
+
+ std::vector<std::string> devList = transport_adapter.GetDeviceList();
+ ASSERT_EQ(1u, devList.size());
+ EXPECT_EQ(uniq_id, devList[0]);
+
+ const int app_handle = 1;
+ std::vector<int> intList = {app_handle};
+ EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+
+ ConnectionSPtr mock_connection = new ConnectionMock();
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
+ EXPECT_CALL(transport_adapter, FindEstablishedConnection(uniq_id, app_handle))
+ .WillOnce(Return(mock_connection));
+
+ EXPECT_CALL(*mockdev, GetApplicationPort(app_handle)).WillOnce(Return(port));
+
+ transport_adapter.CallStore();
+
+ EXPECT_CALL(transport_adapter, Connect(uniq_id, app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+
+ EXPECT_TRUE(transport_adapter.CallRestore());
+
+ devList = transport_adapter.GetDeviceList();
+ ASSERT_EQ(1u, devList.size());
+ EXPECT_EQ(uniq_id, devList[0]);
+}
+
+TEST_F(TcpAdapterTest, DISABLED_StoreDataWithSeveralDevices_RestoreData) {
+ TestTCPTransportAdapter transport_adapter(port);
+ const uint32_t count_dev = 10;
+
+ utils::SharedPtr<TCPDeviceMock> 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 TCPDeviceMock(port, uniq_id[i]);
+ EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false));
+ transport_adapter.AddDevice(mockdev[i]);
+ }
+
+ std::vector<std::string> devList = transport_adapter.GetDeviceList();
+ ASSERT_EQ(count_dev, devList.size());
+ EXPECT_EQ(uniq_id[0], devList[0]);
+
+ const int app_handle = 1;
+ std::vector<int> intList = {app_handle};
+
+ ConnectionSPtr mock_connection = new ConnectionMock();
+ for (uint32_t i = 0; i < count_dev; i++) {
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i]))
+ .WillOnce(Return(mockdev[i]));
+ EXPECT_CALL(*(mockdev[i]), GetApplicationList()).WillOnce(Return(intList));
+
+ EXPECT_CALL(transport_adapter,
+ FindEstablishedConnection(uniq_id[i], app_handle))
+ .WillOnce(Return(mock_connection));
+
+ EXPECT_CALL(*(mockdev[i]), GetApplicationPort(app_handle))
+ .WillOnce(Return(port));
+ }
+ transport_adapter.CallStore();
+
+ for (uint32_t i = 0; i < count_dev; i++) {
+ EXPECT_CALL(transport_adapter, Connect(uniq_id[i], app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+ }
+
+ EXPECT_TRUE(transport_adapter.CallRestore());
+
+ devList = transport_adapter.GetDeviceList();
+ ASSERT_EQ(count_dev, devList.size());
+ for (uint32_t i = 0; i < count_dev; i++) {
+ EXPECT_EQ(uniq_id[i], devList[i]);
+ }
+}
+
+} // 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
new file mode 100644
index 000000000..4d0ff4ec2
--- /dev/null
+++ b/src/components/transport_manager/test/transport_adapter_listener_test.cc
@@ -0,0 +1,224 @@
+/*
+ * 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 "include/transport_adapter_mock.h"
+#include "transport_manager/transport_adapter/transport_adapter_listener_impl.h"
+#include "include/transport_manager_mock.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using ::testing::Return;
+using namespace ::transport_manager;
+
+class TransportAdapterListenerTest : public ::testing::Test {
+ public:
+ TransportAdapterListenerTest()
+ : app_handle(1),
+ dev_id("device_id"),
+ transport_listener(&tr_mock, &adapter_mock) {}
+
+ protected:
+ const int app_handle;
+ const std::string dev_id;
+ TransportManagerMock tr_mock;
+ TransportAdapterMock adapter_mock;
+ TransportAdapterListenerImpl transport_listener;
+};
+
+MATCHER_P4(IsEvent, eventType, adapter, dev_id, app_id, "") {
+ TransportAdapterEvent event = arg;
+ return event.application_id == app_id && event.device_uid == dev_id &&
+ event.event_type == eventType && event.transport_adapter == adapter;
+}
+
+MATCHER_P5(IsEvent, eventType, adapter, dev_id, app_id, data, "") {
+ TransportAdapterEvent event = arg;
+ return event.application_id == app_id && event.device_uid == dev_id &&
+ event.event_type == eventType && event.transport_adapter == adapter &&
+ event.event_data == data;
+}
+
+TEST_F(TransportAdapterListenerTest, OnCommunicationError) {
+ EXPECT_CALL(
+ tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_COMMUNICATION_ERROR,
+ &adapter_mock, dev_id, app_handle))).WillOnce(Return(E_SUCCESS));
+ transport_listener.OnCommunicationError(&adapter_mock, dev_id, app_handle);
+}
+
+TEST_F(TransportAdapterListenerTest, OnConnectDone) {
+ EXPECT_CALL(tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_DONE,
+ &adapter_mock, dev_id, app_handle)))
+ .WillOnce(Return(E_SUCCESS));
+ transport_listener.OnConnectDone(&adapter_mock, dev_id, app_handle);
+}
+
+TEST_F(TransportAdapterListenerTest, OnConnectFailed) {
+ ConnectError er;
+
+ EXPECT_CALL(tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_FAIL,
+ &adapter_mock, dev_id, app_handle)))
+ .WillOnce(Return(E_SUCCESS));
+ transport_listener.OnConnectFailed(&adapter_mock, dev_id, app_handle, er);
+}
+
+TEST_F(TransportAdapterListenerTest, OnDataReceiveDone) {
+ ::protocol_handler::RawMessagePtr data_container;
+
+ EXPECT_CALL(tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE,
+ &adapter_mock, dev_id, app_handle, data_container)))
+ .WillOnce(Return(E_SUCCESS));
+ transport_listener.OnDataReceiveDone(&adapter_mock, dev_id, app_handle,
+ data_container);
+}
+
+TEST_F(TransportAdapterListenerTest, OnDataReceiveFailed) {
+ DataReceiveError err;
+
+ EXPECT_CALL(tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_FAIL,
+ &adapter_mock, dev_id, app_handle)))
+ .WillOnce(Return(E_SUCCESS));
+ transport_listener.OnDataReceiveFailed(&adapter_mock, dev_id, app_handle,
+ err);
+}
+
+TEST_F(TransportAdapterListenerTest, OnDataSendDone) {
+ unsigned char data[3] = {0x20, 0x07, 0x01};
+ ::protocol_handler::RawMessagePtr data_container =
+ new ::protocol_handler::RawMessage(1, 1, data, 3);
+
+ EXPECT_CALL(tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_DONE,
+ &adapter_mock, dev_id, app_handle, data_container)))
+ .WillOnce(Return(E_SUCCESS));
+ transport_listener.OnDataSendDone(&adapter_mock, dev_id, app_handle,
+ data_container);
+}
+
+TEST_F(TransportAdapterListenerTest, OnDataSendFailed) {
+ unsigned char data[3] = {0x20, 0x07, 0x01};
+ ::protocol_handler::RawMessagePtr data_container =
+ new ::protocol_handler::RawMessage(1, 1, data, 3);
+ DataSendError err;
+
+ EXPECT_CALL(tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_FAIL,
+ &adapter_mock, dev_id, app_handle, data_container)))
+ .WillOnce(Return(E_SUCCESS));
+ transport_listener.OnDataSendFailed(&adapter_mock, dev_id, app_handle,
+ data_container, err);
+}
+
+TEST_F(TransportAdapterListenerTest, OnDeviceListUpdated) {
+ EXPECT_CALL(
+ tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ &adapter_mock, "", 0))).WillOnce(Return(E_SUCCESS));
+ transport_listener.OnDeviceListUpdated(&adapter_mock);
+}
+
+TEST_F(TransportAdapterListenerTest, OnDisconnectDeviceDone) {
+ EXPECT_CALL(
+ tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_DONE,
+ &adapter_mock, dev_id, app_handle))).WillOnce(Return(E_SUCCESS));
+ transport_listener.OnDisconnectDone(&adapter_mock, dev_id, app_handle);
+}
+
+TEST_F(TransportAdapterListenerTest, OnDisconnectFailed) {
+ DisconnectError err;
+
+ EXPECT_CALL(
+ tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_FAIL,
+ &adapter_mock, dev_id, app_handle))).WillOnce(Return(E_SUCCESS));
+ transport_listener.OnDisconnectFailed(&adapter_mock, dev_id, app_handle, err);
+}
+
+TEST_F(TransportAdapterListenerTest, OnFindNewApplicationsRequest) {
+ EXPECT_CALL(tr_mock, ReceiveEventFromDevice(IsEvent(
+ TransportAdapterListenerImpl::EventTypeEnum::
+ ON_FIND_NEW_APPLICATIONS_REQUEST,
+ &adapter_mock, "", 0))).WillOnce(Return(E_SUCCESS));
+ transport_listener.OnFindNewApplicationsRequest(&adapter_mock);
+}
+
+TEST_F(TransportAdapterListenerTest, OnSearchDeviceDone) {
+ EXPECT_CALL(tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE,
+ &adapter_mock, "", 0))).WillOnce(Return(E_SUCCESS));
+ transport_listener.OnSearchDeviceDone(&adapter_mock);
+}
+
+TEST_F(TransportAdapterListenerTest, OnSearchDeviceFailed) {
+ SearchDeviceError er;
+
+ EXPECT_CALL(tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL,
+ &adapter_mock, "", 0))).WillOnce(Return(E_SUCCESS));
+ transport_listener.OnSearchDeviceFailed(&adapter_mock, er);
+}
+
+TEST_F(TransportAdapterListenerTest, OnUnexpectedDisconnect) {
+ CommunicationError err;
+
+ EXPECT_CALL(
+ tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
+ &adapter_mock, dev_id, app_handle))).WillOnce(Return(E_SUCCESS));
+ transport_listener.OnUnexpectedDisconnect(&adapter_mock, dev_id, app_handle,
+ err);
+}
+
+} // 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
new file mode 100644
index 000000000..679cd9064
--- /dev/null
+++ b/src/components/transport_manager/test/transport_adapter_test.cc
@@ -0,0 +1,743 @@
+/*
+ * 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 "include/device_scanner_mock.h"
+#include "include/client_connection_listener_mock.h"
+#include "include/server_connection_factory_mock.h"
+#include "include/device_mock.h"
+#include "include/connection_mock.h"
+#include "include/transport_adapter_listener_mock.h"
+
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "transport_manager/transport_adapter/transport_adapter_listener.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/transport_adapter/connection.h"
+#include "config_profile/profile.h"
+#include "protocol/raw_message.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using ::testing::Return;
+using ::testing::_;
+
+using namespace ::transport_manager;
+using namespace ::protocol_handler;
+
+
+class TestTransportAdapter : public TransportAdapterImpl {
+ public:
+ TestTransportAdapter(DeviceScanner* device_scanner,
+ ServerConnectionFactory* server_connection_factory,
+ ClientConnectionListener* client_connection_listener)
+ : TransportAdapterImpl(device_scanner, server_connection_factory,
+ client_connection_listener) {
+ }
+
+ ConnectionSPtr FindStatedConnection(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) {
+ return this->FindEstablishedConnection(device_handle, app_handle);
+ }
+ virtual ~TestTransportAdapter(){};
+
+ virtual DeviceType GetDeviceType() const { return UNKNOWN; }
+
+ MOCK_CONST_METHOD0(Store, void());
+ MOCK_METHOD0(Restore, bool());
+};
+
+class TransportAdapterTest : public ::testing::Test {
+ protected:
+ virtual void SetUp() {
+ dev_id = "device_id";
+ uniq_id = "unique_device_id";
+ app_handle = 1;
+ }
+
+ static void SetUpTestCase() {
+ ::profile::Profile::instance()->config_file_name(
+ "smartDeviceLink_test.ini");
+ }
+
+ std::string dev_id;
+ std::string uniq_id;
+ int app_handle;
+};
+
+TEST_F(TransportAdapterTest, Init) {
+ DeviceScannerMock* dev_mock = new DeviceScannerMock();
+ ClientConnectionListenerMock* clientMock = new ClientConnectionListenerMock();
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(dev_mock, serverMock, clientMock);
+
+ EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, transport_adapter.Init());
+
+ // Expect terminate because at the end of test transport_adapter will be
+ // destroyed. That will call Terminate() for connections and device scanner.
+ EXPECT_CALL(*dev_mock, Terminate());
+ EXPECT_CALL(*clientMock, Terminate());
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, SearchDevices_WithoutScanner) {
+ ClientConnectionListenerMock* clientMock = new ClientConnectionListenerMock();
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(NULL, serverMock, clientMock);
+
+ EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, transport_adapter.Init());
+
+ EXPECT_EQ(TransportAdapter::NOT_SUPPORTED, transport_adapter.SearchDevices());
+
+ EXPECT_CALL(*clientMock, Terminate());
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, SearchDevices_DeviceNotInitialized) {
+ DeviceScannerMock* dev_mock = new DeviceScannerMock();
+ TestTransportAdapter transport_adapter(dev_mock, NULL, NULL);
+
+ EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ EXPECT_CALL(*dev_mock, IsInitialised()).WillRepeatedly(Return(false));
+ EXPECT_CALL(*dev_mock, Scan()).Times(0);
+ EXPECT_EQ(TransportAdapter::BAD_STATE, transport_adapter.SearchDevices());
+ EXPECT_CALL(*dev_mock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, SearchDevices_DeviceInitialized) {
+ DeviceScannerMock* dev_mock = new DeviceScannerMock();
+ TestTransportAdapter transport_adapter(dev_mock, NULL, NULL);
+
+ EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ EXPECT_CALL(*dev_mock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*dev_mock, Scan()).WillRepeatedly(Return(TransportAdapter::OK));
+ EXPECT_EQ(TransportAdapter::OK, transport_adapter.SearchDevices());
+
+ EXPECT_CALL(*dev_mock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, SearchDeviceDone_DeviceExisting) {
+ TestTransportAdapter transport_adapter(NULL, NULL, NULL);
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+
+ utils::SharedPtr<DeviceMock> mockdev = new DeviceMock(dev_id, uniq_id);
+ transport_adapter.AddDevice(mockdev);
+
+ std::vector<utils::SharedPtr<Device>> devList;
+ devList.push_back(mockdev);
+
+ EXPECT_CALL(*mockdev, IsSameAs(_)).WillOnce(Return(true));
+ transport_adapter.SearchDeviceDone(devList);
+}
+
+TEST_F(TransportAdapterTest, SearchDeviceFailed) {
+ TestTransportAdapter transport_adapter(NULL, NULL, NULL);
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ TransportAdapterListenerMock mock_listener;
+ transport_adapter.AddListener(&mock_listener);
+
+ SearchDeviceError er;
+ EXPECT_CALL(mock_listener, OnSearchDeviceFailed(_, _));
+ transport_adapter.SearchDeviceFailed(er);
+}
+
+TEST_F(TransportAdapterTest, AddDevice) {
+ TestTransportAdapter transport_adapter(NULL, NULL, NULL);
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+
+
+ TransportAdapterListenerMock mock_listener;
+ transport_adapter.AddListener(&mock_listener);
+
+ DeviceMock* mockdev = new DeviceMock(dev_id, uniq_id);
+
+ EXPECT_CALL(mock_listener, OnDeviceListUpdated(_));
+ transport_adapter.AddDevice(mockdev);
+}
+
+TEST_F(TransportAdapterTest, Connect_ServerNotSupported) {
+ ClientConnectionListenerMock* clientMock = new ClientConnectionListenerMock();
+ TestTransportAdapter transport_adapter(NULL, NULL, clientMock);
+
+ EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ int app_handle = 1;
+
+ TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
+ EXPECT_EQ(TransportAdapter::NOT_SUPPORTED, res);
+
+ EXPECT_CALL(*clientMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, Connect_ServerNotInitialized) {
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(NULL, serverMock, NULL);
+
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(false));
+ EXPECT_CALL(*serverMock, CreateConnection(dev_id, app_handle)).Times(0);
+ TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
+ EXPECT_EQ(TransportAdapter::BAD_STATE, res);
+
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, Connect_Success) {
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(NULL, serverMock, NULL);
+
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*serverMock, CreateConnection(dev_id, app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+ TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, Connect_DeviceAddedTwice) {
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(NULL, serverMock, NULL);
+
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*serverMock, CreateConnection(dev_id, app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+ TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ TransportAdapter::Error newres =
+ transport_adapter.Connect(dev_id, app_handle);
+ EXPECT_EQ(TransportAdapter::ALREADY_EXISTS, newres);
+
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, ConnectDevice_ServerNotAdded_DeviceAdded) {
+ TestTransportAdapter transport_adapter(NULL, NULL, NULL);
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+
+
+ DeviceMock* mockdev = new DeviceMock(dev_id, uniq_id);
+ transport_adapter.AddDevice(mockdev);
+
+ std::vector<std::string> devList = transport_adapter.GetDeviceList();
+ ASSERT_EQ(1u, devList.size());
+ EXPECT_EQ(uniq_id, devList[0]);
+
+ int app_handle = 1;
+ std::vector<int> intList = {app_handle};
+ EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+
+ TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
+ EXPECT_EQ(TransportAdapter::FAIL, res);
+}
+
+TEST_F(TransportAdapterTest, ConnectDevice_DeviceNotAdded) {
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(NULL, serverMock, NULL);
+
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ std::string uniq_id = "unique_device_id";
+
+ EXPECT_CALL(*serverMock, IsInitialised()).Times(0);
+ EXPECT_CALL(*serverMock, CreateConnection(_, _)).Times(0);
+ TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
+ EXPECT_EQ(TransportAdapter::BAD_PARAM, res);
+
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, ConnectDevice_DeviceAdded) {
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(NULL, serverMock, NULL);
+
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+
+
+ DeviceMock* mockdev = new DeviceMock(dev_id, uniq_id);
+ transport_adapter.AddDevice(mockdev);
+
+ std::vector<std::string> devList = transport_adapter.GetDeviceList();
+ ASSERT_EQ(1u, devList.size());
+ EXPECT_EQ(uniq_id, devList[0]);
+
+
+ int app_handle = 1;
+ std::vector<int> intList = {app_handle};
+ EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+ TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) {
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(NULL, serverMock, NULL);
+
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+
+
+ DeviceMock* mockdev = new DeviceMock(dev_id, uniq_id);
+ transport_adapter.AddDevice(mockdev);
+
+ std::vector<std::string> devList = transport_adapter.GetDeviceList();
+ ASSERT_EQ(1u, devList.size());
+ EXPECT_EQ(uniq_id, devList[0]);
+
+
+ int app_handle = 1;
+ std::vector<int> intList = {app_handle};
+ EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+ TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ // Try to connect device second time
+
+ EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle)).Times(0);
+ TransportAdapter::Error newres = transport_adapter.ConnectDevice(uniq_id);
+ EXPECT_EQ(TransportAdapter::OK, newres);
+
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, Disconnect_ConnectDoneSuccess) {
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(NULL, serverMock, NULL);
+
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*serverMock, CreateConnection(dev_id, app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+ TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ ConnectionMock* mock_connection = new ConnectionMock();
+ transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
+
+ EXPECT_CALL(transport_adapter, Store());
+ transport_adapter.ConnectDone(dev_id, app_handle);
+
+ EXPECT_CALL(*mock_connection, Disconnect())
+ .WillOnce(Return(TransportAdapter::OK));
+ TransportAdapter::Error new_res =
+ transport_adapter.Disconnect(dev_id, app_handle);
+ EXPECT_EQ(TransportAdapter::OK, new_res);
+
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) {
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(NULL, serverMock, NULL);
+
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ DeviceMock* mockdev = new DeviceMock(dev_id, uniq_id);
+ transport_adapter.AddDevice(mockdev);
+
+ std::vector<std::string> devList = transport_adapter.GetDeviceList();
+ ASSERT_EQ(1u, devList.size());
+ EXPECT_EQ(uniq_id, devList[0]);
+
+
+ std::vector<int> intList = {app_handle};
+ EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+ TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ ConnectionMock* mock_connection = new ConnectionMock();
+ transport_adapter.ConnectionCreated(mock_connection, uniq_id, app_handle);
+
+ EXPECT_CALL(*mock_connection, Disconnect())
+ .WillOnce(Return(TransportAdapter::OK));
+
+ TransportAdapter::Error new_res = transport_adapter.DisconnectDevice(uniq_id);
+ EXPECT_EQ(TransportAdapter::OK, new_res);
+
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, DeviceDisconnected) {
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(NULL, serverMock, NULL);
+
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ TransportAdapterListenerMock mock_listener;
+ transport_adapter.AddListener(&mock_listener);
+
+ DeviceMock* mockdev = new DeviceMock(dev_id, uniq_id);
+ EXPECT_CALL(mock_listener, OnDeviceListUpdated(_));
+ transport_adapter.AddDevice(mockdev);
+
+ std::vector<std::string> devList = transport_adapter.GetDeviceList();
+ ASSERT_EQ(1u, devList.size());
+ EXPECT_EQ(uniq_id, devList[0]);
+
+ std::vector<int> intList = {app_handle};
+ EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+ TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ ConnectionMock* mock_connection = new ConnectionMock();
+ transport_adapter.ConnectionCreated(mock_connection, uniq_id, app_handle);
+
+ EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+ EXPECT_CALL(mock_listener, OnUnexpectedDisconnect(&transport_adapter, uniq_id,
+ app_handle, _));
+ EXPECT_CALL(mock_listener,
+ OnDisconnectDeviceDone(&transport_adapter, uniq_id));
+ EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter));
+ DisconnectDeviceError error;
+ transport_adapter.DeviceDisconnected(uniq_id, error);
+
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, AbortedConnectSuccess) {
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(NULL, serverMock, NULL);
+
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*serverMock, CreateConnection(dev_id, app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+ TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ TransportAdapterListenerMock mock_listener;
+ transport_adapter.AddListener(&mock_listener);
+
+ CommunicationError ce;
+ EXPECT_CALL(mock_listener, OnUnexpectedDisconnect(_, dev_id, app_handle, _));
+ transport_adapter.ConnectionAborted(dev_id, app_handle, ce);
+
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, SendData) {
+ DeviceScannerMock* dev_mock = new DeviceScannerMock();
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(dev_mock, serverMock, NULL);
+
+ EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*serverMock, CreateConnection(dev_id, app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+ TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ ConnectionMock* mock_connection = new ConnectionMock();
+ transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
+
+ EXPECT_CALL(transport_adapter, Store());
+ transport_adapter.ConnectDone(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);
+
+ EXPECT_CALL(*mock_connection, SendData(kMessage))
+ .WillOnce(Return(TransportAdapter::OK));
+ res = transport_adapter.SendData(dev_id, app_handle, kMessage);
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ EXPECT_CALL(*dev_mock, Terminate());
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, SendData_ConnectionNotEstablished) {
+ DeviceScannerMock* dev_mock = new DeviceScannerMock();
+ ClientConnectionListenerMock* clientMock = new ClientConnectionListenerMock();
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(dev_mock, serverMock, clientMock);
+
+ EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*serverMock, CreateConnection(dev_id, app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+ TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ ConnectionMock* mock_connection = new ConnectionMock();
+ 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);
+
+ EXPECT_CALL(*mock_connection, SendData(kMessage)).Times(0);
+ res = transport_adapter.SendData(dev_id, app_handle, kMessage);
+ EXPECT_EQ(TransportAdapter::BAD_PARAM, res);
+
+ EXPECT_CALL(*dev_mock, Terminate());
+ EXPECT_CALL(*clientMock, Terminate());
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, StartClientListening_ClientNotInitialized) {
+ DeviceScannerMock* dev_mock = new DeviceScannerMock();
+ ClientConnectionListenerMock* clientMock = new ClientConnectionListenerMock();
+ TestTransportAdapter transport_adapter(dev_mock, NULL, clientMock);
+
+ EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ EXPECT_CALL(*clientMock, IsInitialised()).WillOnce(Return(false));
+ EXPECT_CALL(*clientMock, StartListening()).Times(0);
+
+ TransportAdapter::Error res = transport_adapter.StartClientListening();
+ EXPECT_EQ(TransportAdapter::BAD_STATE, res);
+
+ EXPECT_CALL(*dev_mock, Terminate());
+ EXPECT_CALL(*clientMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, StartClientListening) {
+ DeviceScannerMock* dev_mock = new DeviceScannerMock();
+ ClientConnectionListenerMock* clientMock = new ClientConnectionListenerMock();
+ TestTransportAdapter transport_adapter(dev_mock, NULL, clientMock);
+
+ EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ EXPECT_CALL(*clientMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*clientMock, StartListening())
+ .WillOnce(Return(TransportAdapter::OK));
+
+ TransportAdapter::Error res = transport_adapter.StartClientListening();
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ EXPECT_CALL(*dev_mock, Terminate());
+ EXPECT_CALL(*clientMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, StopClientListening_Success) {
+ DeviceScannerMock* dev_mock = new DeviceScannerMock();
+ ClientConnectionListenerMock* clientMock = new ClientConnectionListenerMock();
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(dev_mock, serverMock, clientMock);
+
+ EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*serverMock, CreateConnection(dev_id, app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+ TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ EXPECT_CALL(*clientMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*clientMock, StopListening())
+ .WillOnce(Return(TransportAdapter::OK));
+
+ res = transport_adapter.StopClientListening();
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ EXPECT_CALL(*dev_mock, Terminate());
+ EXPECT_CALL(*clientMock, Terminate());
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, FindNewApplicationsRequest) {
+ DeviceScannerMock* dev_mock = new DeviceScannerMock();
+ ClientConnectionListenerMock* clientMock = new ClientConnectionListenerMock();
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(dev_mock, serverMock, clientMock);
+
+ EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ TransportAdapterListenerMock mock_listener;
+ transport_adapter.AddListener(&mock_listener);
+
+ EXPECT_CALL(mock_listener, OnFindNewApplicationsRequest(&transport_adapter));
+ transport_adapter.FindNewApplicationsRequest();
+
+ EXPECT_CALL(*dev_mock, Terminate());
+ EXPECT_CALL(*clientMock, Terminate());
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+TEST_F(TransportAdapterTest, GetDeviceAndApplicationLists) {
+ TestTransportAdapter transport_adapter(NULL, NULL, NULL);
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ DeviceMock* mockdev = new DeviceMock(dev_id, uniq_id);
+ transport_adapter.AddDevice(mockdev);
+
+ std::vector<std::string> devList = transport_adapter.GetDeviceList();
+ ASSERT_EQ(1u, devList.size());
+ EXPECT_EQ(uniq_id, devList[0]);
+
+ int app_handle = 1;
+ std::vector<int> intList = {app_handle};
+ EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+ std::vector<int> res = transport_adapter.GetApplicationList(uniq_id);
+ ASSERT_EQ(1u, res.size());
+ EXPECT_EQ(intList[0], res[0]);
+
+}
+
+TEST_F(TransportAdapterTest, FindEstablishedConnection) {
+ ServerConnectionFactoryMock* serverMock = new ServerConnectionFactoryMock();
+ TestTransportAdapter transport_adapter(NULL, serverMock, NULL);
+
+ EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
+ EXPECT_CALL(*serverMock, CreateConnection(dev_id, app_handle))
+ .WillOnce(Return(TransportAdapter::OK));
+ TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
+ EXPECT_EQ(TransportAdapter::OK, res);
+
+ ConnectionSPtr mock_connection = new ConnectionMock();
+ transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
+
+ EXPECT_CALL(transport_adapter, Store());
+ transport_adapter.ConnectDone(dev_id, app_handle);
+
+ ConnectionSPtr conn =
+ transport_adapter.FindStatedConnection(dev_id, app_handle);
+ EXPECT_EQ(mock_connection, conn);
+
+ EXPECT_CALL(*serverMock, Terminate());
+}
+
+} // 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
new file mode 100644
index 000000000..4e0bd9484
--- /dev/null
+++ b/src/components/transport_manager/test/transport_manager_default_test.cc
@@ -0,0 +1,46 @@
+/*
+ * 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 "transport_manager/transport_manager.h"
+#include "transport_manager/transport_manager_default.h"
+
+namespace test {
+namespace test_transport_manager_instance {
+TEST(TestTransportManagerDefault, CreateOnlyInstance) {
+ transport_manager::TransportManager* instance =
+ transport_manager::TransportManagerDefault::instance();
+ ASSERT_EQ(instance, transport_manager::TransportManagerDefault::instance());
+ transport_manager::TransportManagerDefault::destroy();
+}
+
+} // namespace test
+} // namespace test_transport_manager_instance
diff --git a/src/components/transport_manager/test/transport_manager_impl_test.cc b/src/components/transport_manager/test/transport_manager_impl_test.cc
new file mode 100644
index 000000000..8ee1d7088
--- /dev/null
+++ b/src/components/transport_manager/test/transport_manager_impl_test.cc
@@ -0,0 +1,717 @@
+/*
+ * 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 "protocol/raw_message.h"
+#include "transport_manager/common.h"
+#include "transport_manager/transport_manager_impl.h"
+
+#include "include/transport_adapter_mock.h"
+#include "include/transport_manager_listener_mock.h"
+#include "include/transport_adapter_listener_mock.h"
+#include "include/time_metric_observer_mock.h"
+
+#include "transport_manager/transport_adapter/transport_adapter_event.h"
+
+using ::testing::_;
+using ::testing::AtLeast;
+using ::testing::Return;
+
+using ::protocol_handler::RawMessage;
+using ::protocol_handler::RawMessagePtr;
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using namespace ::transport_manager;
+
+class TransportManagerTest : public TransportManagerImpl {
+ public:
+ void TestHandle(TransportAdapterEvent test_event) { Handle(test_event); }
+};
+
+class TransportManagerImplTest : public ::testing::Test {
+ protected:
+ virtual void SetUp() {
+ tm.Init();
+ mock_adapter = new TransportAdapterMock();
+ tm_listener = new TransportManagerListenerMock();
+
+ EXPECT_EQ(E_SUCCESS, tm.AddEventListener(tm_listener));
+ EXPECT_CALL(*mock_adapter, AddListener(_));
+ EXPECT_CALL(*mock_adapter, IsInitialised()).WillOnce(Return(true));
+ EXPECT_EQ(::transport_manager::E_SUCCESS,
+ tm.AddTransportAdapter(mock_adapter));
+
+ device_handle_ = 1;
+ connection_key_ = 1;
+ mac_address_ = "MA:CA:DR:ES:S";
+ error_ = new 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_ =
+ new RawMessage(connection_key_, version_protocol_, data, kSize);
+ }
+
+ virtual void TearDown() { delete tm_listener; }
+
+ void HandleDeviceListUpdated();
+ void HandleConnection();
+ void HandleSendDone();
+ void HandleSendFailed();
+ void HandleSearchDone();
+ void HandleSearchFail();
+ void HandleFindNewApplicationsRequest();
+ void HandleConnectionFailed();
+ void HandleConnectionClosed();
+ void HandleDisconnectionFailed();
+ void HandleReceiveDone();
+
+ TransportManagerTest tm;
+ TransportAdapterMock* mock_adapter;
+
+ TransportManagerListenerMock* tm_listener;
+
+ const ApplicationHandle application_id = 1;
+
+ // count of connections
+ ConnectionUID connection_key_;
+ RawMessagePtr test_message_;
+ DeviceHandle device_handle_;
+ std::string mac_address_;
+
+ DeviceList dev;
+ BaseErrorPtr error_;
+};
+
+void TransportManagerImplTest::HandleDeviceListUpdated() {
+ int type = static_cast<int>(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED);
+ const DeviceInfo dev_info(device_handle_, mac_address_, "TestDeviceName",
+ "BTMAC");
+
+ TransportAdapterEvent test_event(type, mock_adapter, dev_info.mac_address(),
+ application_id, test_message_, error_);
+ dev.push_back(dev_info.mac_address());
+ std::vector<DeviceInfo> vector_dev_info;
+ std::vector<DeviceInfo>::iterator it = vector_dev_info.begin();
+ vector_dev_info.insert(it, dev_info);
+
+ EXPECT_CALL(*mock_adapter, GetDeviceList())
+ .Times(AtLeast(1))
+ .WillRepeatedly(Return(dev));
+ EXPECT_CALL(*mock_adapter, DeviceName(dev_info.mac_address()))
+ .Times(AtLeast(1))
+ .WillRepeatedly(Return(dev_info.name()));
+ EXPECT_CALL(*mock_adapter, GetConnectionType())
+ .Times(AtLeast(1))
+ .WillRepeatedly(Return(dev_info.connection_type()));
+
+ EXPECT_CALL(*tm_listener, OnDeviceFound(dev_info));
+ EXPECT_CALL(*tm_listener, OnDeviceAdded(dev_info));
+ EXPECT_CALL(*tm_listener, OnDeviceListUpdated(vector_dev_info));
+
+ tm.TestHandle(test_event);
+ dev.pop_back();
+}
+
+void TransportManagerImplTest::HandleConnection() {
+ int type = static_cast<int>(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_DONE);
+ const DeviceInfo dev_info(device_handle_, mac_address_, "TestDeviceName",
+ "BTMAC");
+
+ TransportAdapterEvent test_event(type, mock_adapter, dev_info.mac_address(),
+ application_id, test_message_, error_);
+
+ EXPECT_CALL(*mock_adapter, DeviceName(dev_info.mac_address()))
+ .WillOnce(Return(dev_info.name()));
+ EXPECT_CALL(*mock_adapter, GetConnectionType())
+ .WillOnce(Return(dev_info.connection_type()));
+
+ EXPECT_CALL(*tm_listener, OnConnectionEstablished(dev_info, connection_key_));
+
+ tm.TestHandle(test_event);
+}
+
+void TransportManagerImplTest::HandleConnectionFailed() {
+ int type = static_cast<int>(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_FAIL);
+
+ const DeviceInfo dev_info(device_handle_, mac_address_, "TestDeviceName",
+ "BTMAC");
+
+ TransportAdapterEvent test_event(type, mock_adapter, dev_info.mac_address(),
+ application_id, test_message_, error_);
+
+ EXPECT_CALL(*mock_adapter, DeviceName(dev_info.mac_address()))
+ .WillOnce(Return(dev_info.name()));
+ EXPECT_CALL(*mock_adapter, GetConnectionType())
+ .WillOnce(Return(dev_info.connection_type()));
+
+ EXPECT_CALL(*tm_listener, OnConnectionFailed(dev_info, _));
+
+ tm.TestHandle(test_event);
+}
+
+void TransportManagerImplTest::HandleSendDone() {
+ int type = static_cast<int>(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_DONE);
+ TransportAdapterEvent test_event(type, mock_adapter, mac_address_,
+ application_id, test_message_, error_);
+
+ EXPECT_CALL(*tm_listener, OnTMMessageSend(test_message_));
+
+ tm.TestHandle(test_event);
+}
+
+void TransportManagerImplTest::HandleReceiveDone() {
+ int type = static_cast<int>(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE);
+ TransportAdapterEvent test_event(type, mock_adapter, mac_address_,
+ application_id, test_message_, error_);
+
+ EXPECT_CALL(*tm_listener, OnTMMessageReceived(test_message_));
+
+ tm.TestHandle(test_event);
+}
+
+void TransportManagerImplTest::HandleSendFailed() {
+ int type = static_cast<int>(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_FAIL);
+
+ TransportAdapterEvent test_event(type, mock_adapter, mac_address_,
+ application_id, test_message_, error_);
+
+ tm.TestHandle(test_event);
+}
+
+void TransportManagerImplTest::HandleSearchDone() {
+ int type = static_cast<int>(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE);
+
+ TransportAdapterEvent test_event(type, mock_adapter, mac_address_,
+ application_id, test_message_, error_);
+
+ EXPECT_CALL(*tm_listener, OnScanDevicesFinished());
+
+ tm.TestHandle(test_event);
+}
+
+void TransportManagerImplTest::HandleSearchFail() {
+ int type = static_cast<int>(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL);
+
+ TransportAdapterEvent test_event(type, mock_adapter, mac_address_,
+ application_id, test_message_, error_);
+
+ EXPECT_CALL(*tm_listener, OnScanDevicesFailed(_));
+
+ tm.TestHandle(test_event);
+}
+
+void TransportManagerImplTest::HandleFindNewApplicationsRequest() {
+ int type = static_cast<int>(TransportAdapterListenerImpl::EventTypeEnum::
+ ON_FIND_NEW_APPLICATIONS_REQUEST);
+
+ TransportAdapterEvent test_event(type, mock_adapter, mac_address_,
+ application_id, test_message_, error_);
+
+ EXPECT_CALL(*tm_listener, OnFindNewApplicationsRequest());
+
+ tm.TestHandle(test_event);
+}
+
+void TransportManagerImplTest::HandleConnectionClosed() {
+ int type = static_cast<int>(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_DONE);
+
+ TransportAdapterEvent test_event(type, mock_adapter, mac_address_,
+ application_id, test_message_, error_);
+
+ EXPECT_CALL(*tm_listener, OnConnectionClosed(application_id));
+
+ tm.TestHandle(test_event);
+}
+
+void TransportManagerImplTest::HandleDisconnectionFailed() {
+ int type = static_cast<int>(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_FAIL);
+
+ TransportAdapterEvent test_event(type, mock_adapter, mac_address_,
+ application_id, test_message_, error_);
+
+ EXPECT_CALL(*tm_listener, OnDisconnectFailed(device_handle_, _));
+
+ tm.TestHandle(test_event);
+}
+
+TEST(TransportManagerTest, SearchDevices_AdaptersNotAdded) {
+ TransportManagerTest tm;
+ tm.Init();
+
+ EXPECT_EQ(E_SUCCESS, tm.SearchDevices());
+}
+
+TEST(TransportManagerTest, AddTransportAdapter) {
+ TransportManagerTest tm;
+ tm.Init();
+
+ TransportAdapterMock* mock_adapter = new TransportAdapterMock();
+ TransportManagerListenerMock* tm_listener =
+ new TransportManagerListenerMock();
+
+ EXPECT_EQ(E_SUCCESS, tm.AddEventListener(tm_listener));
+ EXPECT_CALL(*mock_adapter, AddListener(_));
+ EXPECT_CALL(*mock_adapter, IsInitialised()).WillOnce(Return(false));
+ EXPECT_CALL(*mock_adapter, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_EQ(::transport_manager::E_SUCCESS,
+ tm.AddTransportAdapter(mock_adapter));
+}
+
+TEST_F(TransportManagerImplTest, AddTransportAdapterSecondTime) {
+ EXPECT_EQ(E_ADAPTER_EXISTS, tm.AddTransportAdapter(mock_adapter));
+}
+
+TEST_F(TransportManagerImplTest, ConnectDevice) {
+ HandleDeviceListUpdated();
+ EXPECT_CALL(*mock_adapter, ConnectDevice(mac_address_))
+ .WillOnce(Return(TransportAdapter::OK));
+ EXPECT_EQ(E_SUCCESS, tm.ConnectDevice(device_handle_));
+}
+
+TEST_F(TransportManagerImplTest, ConnectDevice_DeviceNotHandled) {
+ EXPECT_CALL(*mock_adapter, ConnectDevice(mac_address_)).Times(0);
+ EXPECT_EQ(E_INVALID_HANDLE, tm.ConnectDevice(device_handle_));
+}
+
+TEST_F(TransportManagerImplTest, ConnectDevice_DeviceNotConnected) {
+ HandleDeviceListUpdated();
+ EXPECT_CALL(*mock_adapter, ConnectDevice(mac_address_))
+ .WillOnce(Return(TransportAdapter::FAIL));
+ EXPECT_EQ(E_INTERNAL_ERROR, tm.ConnectDevice(device_handle_));
+}
+
+TEST_F(TransportManagerImplTest, DisconnectDevice) {
+ HandleDeviceListUpdated();
+ EXPECT_CALL(*mock_adapter, ConnectDevice(mac_address_))
+ .WillOnce(Return(TransportAdapter::OK));
+ EXPECT_EQ(E_SUCCESS, tm.ConnectDevice(device_handle_));
+
+ EXPECT_CALL(*mock_adapter, DisconnectDevice(mac_address_))
+ .WillOnce(Return(TransportAdapter::OK));
+
+ EXPECT_EQ(E_SUCCESS, tm.DisconnectDevice(device_handle_));
+}
+
+TEST_F(TransportManagerImplTest, DisconnectDevice_ConnectionFailed) {
+ HandleDeviceListUpdated();
+ EXPECT_CALL(*mock_adapter, ConnectDevice(mac_address_))
+ .WillOnce(Return(TransportAdapter::FAIL));
+ EXPECT_EQ(E_INTERNAL_ERROR, tm.ConnectDevice(device_handle_));
+
+ EXPECT_CALL(*mock_adapter, DisconnectDevice(mac_address_))
+ .WillOnce(Return(TransportAdapter::FAIL));
+
+ EXPECT_EQ(E_INTERNAL_ERROR, tm.DisconnectDevice(device_handle_));
+}
+
+TEST_F(TransportManagerImplTest, DisconnectDevice_DeviceNotConnected) {
+ EXPECT_CALL(*mock_adapter, DisconnectDevice(mac_address_)).Times(0);
+ EXPECT_EQ(E_INVALID_HANDLE, tm.DisconnectDevice(device_handle_));
+}
+
+TEST_F(TransportManagerImplTest, Disconnect) {
+ // Arrange
+ HandleConnection();
+
+ EXPECT_CALL(*mock_adapter, Disconnect(mac_address_, application_id))
+ .WillOnce(Return(TransportAdapter::OK));
+ // Assert
+ EXPECT_EQ(E_SUCCESS, tm.Disconnect(connection_key_));
+}
+
+TEST_F(TransportManagerImplTest, Disconnect_DisconnectionFailed) {
+ // Arrange
+ HandleConnection();
+
+ EXPECT_CALL(*mock_adapter, Disconnect(mac_address_, application_id))
+ .WillOnce(Return(TransportAdapter::FAIL));
+ // Assert
+ EXPECT_EQ(E_INTERNAL_ERROR, tm.Disconnect(connection_key_));
+}
+
+TEST_F(TransportManagerImplTest, Disconnect_ConnectionNotExist) {
+ EXPECT_CALL(*mock_adapter, Disconnect(mac_address_, application_id)).Times(0);
+ // Assert
+ EXPECT_EQ(E_INVALID_HANDLE, tm.Disconnect(connection_key_));
+}
+
+TEST_F(TransportManagerImplTest, Disconnect_ConnectionDoesNotExists) {
+ // Arrange
+ HandleDeviceListUpdated();
+
+ EXPECT_CALL(*mock_adapter, ConnectDevice(mac_address_))
+ .WillRepeatedly(Return(TransportAdapter::OK));
+ EXPECT_EQ(E_SUCCESS, tm.ConnectDevice(device_handle_));
+
+ EXPECT_CALL(*mock_adapter, Disconnect(mac_address_, application_id))
+ .WillRepeatedly(Return(TransportAdapter::OK));
+ // Assert
+ EXPECT_EQ(E_INVALID_HANDLE, tm.Disconnect(connection_key_));
+}
+
+TEST_F(TransportManagerImplTest, DisconnectForce) {
+ // Arrange
+ HandleConnection();
+
+ EXPECT_CALL(*mock_adapter, Disconnect(mac_address_, application_id))
+ .WillRepeatedly(Return(TransportAdapter::OK));
+ // Assert
+ EXPECT_EQ(E_SUCCESS, tm.DisconnectForce(connection_key_));
+}
+
+TEST_F(TransportManagerImplTest, DisconnectForce_) {
+ // Arrange
+ HandleConnection();
+
+ EXPECT_CALL(*mock_adapter, Disconnect(mac_address_, application_id))
+ .WillRepeatedly(Return(TransportAdapter::OK));
+ // Assert
+ EXPECT_EQ(E_SUCCESS, tm.DisconnectForce(connection_key_));
+}
+
+TEST_F(TransportManagerImplTest, SearchDevices_DeviceConnected) {
+ HandleDeviceListUpdated();
+
+ EXPECT_CALL(*mock_adapter, SearchDevices())
+ .WillOnce(Return(TransportAdapter::OK));
+ EXPECT_EQ(E_SUCCESS, tm.SearchDevices());
+
+ HandleSearchDone();
+}
+
+TEST_F(TransportManagerImplTest, SearchDevices_DeviceNotFound) {
+ HandleDeviceListUpdated();
+
+ EXPECT_CALL(*mock_adapter, SearchDevices())
+ .WillOnce(Return(TransportAdapter::FAIL));
+ EXPECT_EQ(E_ADAPTERS_FAIL, tm.SearchDevices());
+}
+
+TEST_F(TransportManagerImplTest, SearchDevices_AdapterNotSupported) {
+ HandleDeviceListUpdated();
+
+ EXPECT_CALL(*mock_adapter, SearchDevices())
+ .WillOnce(Return(TransportAdapter::NOT_SUPPORTED));
+ EXPECT_EQ(E_ADAPTERS_FAIL, tm.SearchDevices());
+}
+
+TEST_F(TransportManagerImplTest, SearchDevices_AdapterWithBadState) {
+ HandleDeviceListUpdated();
+
+ EXPECT_CALL(*mock_adapter, SearchDevices())
+ .WillOnce(Return(TransportAdapter::BAD_STATE));
+ EXPECT_EQ(E_ADAPTERS_FAIL, tm.SearchDevices());
+}
+
+TEST_F(TransportManagerImplTest, SendMessageToDevice) {
+ // Arrange
+ HandleConnection();
+
+ EXPECT_CALL(*mock_adapter,
+ SendData(mac_address_, application_id, test_message_))
+ .WillOnce(Return(TransportAdapter::OK));
+
+ EXPECT_EQ(E_SUCCESS, tm.SendMessageToDevice(test_message_));
+ testing::Mock::AsyncVerifyAndClearExpectations(10000);
+}
+
+TEST_F(TransportManagerImplTest, SendMessageToDevice_SendingFailed) {
+ // Arrange
+ HandleConnection();
+
+ TMMetricObserverMock* mock_metric_observer = new TMMetricObserverMock();
+ tm.SetTimeMetricObserver(mock_metric_observer);
+ EXPECT_CALL(*mock_metric_observer, StartRawMsg(_));
+
+ EXPECT_CALL(*mock_adapter,
+ SendData(mac_address_, application_id, test_message_))
+ .WillOnce(Return(TransportAdapter::FAIL));
+
+ EXPECT_CALL(*tm_listener, OnTMMessageSendFailed(_, test_message_));
+ EXPECT_EQ(E_SUCCESS, tm.SendMessageToDevice(test_message_));
+
+ EXPECT_CALL(*mock_metric_observer, StopRawMsg(_)).Times(0);
+
+ delete mock_metric_observer;
+ testing::Mock::AsyncVerifyAndClearExpectations(10000);
+}
+
+TEST_F(TransportManagerImplTest, SendMessageToDevice_StartTimeObserver) {
+ // Arrange
+ HandleConnection();
+
+ TMMetricObserverMock* mock_metric_observer = new TMMetricObserverMock();
+ tm.SetTimeMetricObserver(mock_metric_observer);
+ EXPECT_CALL(*mock_adapter,
+ SendData(mac_address_, application_id, test_message_))
+ .WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(*mock_metric_observer, StartRawMsg(_));
+
+ EXPECT_EQ(E_SUCCESS, tm.SendMessageToDevice(test_message_));
+ delete mock_metric_observer;
+ testing::Mock::AsyncVerifyAndClearExpectations(10000);
+}
+
+TEST_F(TransportManagerImplTest, SendMessageToDevice_SendDone) {
+ // Arrange
+ HandleConnection();
+
+ TMMetricObserverMock* mock_metric_observer = new TMMetricObserverMock();
+ tm.SetTimeMetricObserver(mock_metric_observer);
+ EXPECT_CALL(*mock_adapter,
+ SendData(mac_address_, application_id, test_message_))
+ .WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(*mock_metric_observer, StartRawMsg(_));
+
+ EXPECT_EQ(E_SUCCESS, tm.SendMessageToDevice(test_message_));
+
+ EXPECT_CALL(*mock_metric_observer, StopRawMsg(_));
+ HandleSendDone();
+
+ delete mock_metric_observer;
+ testing::Mock::AsyncVerifyAndClearExpectations(10000);
+}
+
+TEST_F(TransportManagerImplTest, SendMessageFailed_GetHandleSendFailed) {
+ // Arrange
+ HandleConnection();
+
+ TMMetricObserverMock* mock_metric_observer = new TMMetricObserverMock();
+ tm.SetTimeMetricObserver(mock_metric_observer);
+ EXPECT_CALL(*mock_metric_observer, StartRawMsg(_));
+
+ EXPECT_CALL(*mock_adapter,
+ SendData(mac_address_, application_id, test_message_))
+ .WillOnce(Return(TransportAdapter::FAIL));
+
+ EXPECT_CALL(*tm_listener, OnTMMessageSendFailed(_, test_message_));
+ EXPECT_EQ(E_SUCCESS, tm.SendMessageToDevice(test_message_));
+
+ EXPECT_CALL(*mock_metric_observer, StopRawMsg(_));
+
+ HandleSendFailed();
+ delete mock_metric_observer;
+ testing::Mock::AsyncVerifyAndClearExpectations(10000);
+}
+
+TEST_F(TransportManagerImplTest, RemoveDevice_DeviceWasAdded) {
+ // Arrange
+ HandleDeviceListUpdated();
+ EXPECT_CALL(*mock_adapter, ConnectDevice(mac_address_))
+ .WillOnce(Return(TransportAdapter::OK));
+ EXPECT_EQ(E_SUCCESS, tm.ConnectDevice(device_handle_));
+
+ // Assert
+ EXPECT_EQ(E_SUCCESS, tm.RemoveDevice(device_handle_));
+}
+
+TEST_F(TransportManagerImplTest, SetVisibilityOn_StartClientListening) {
+ EXPECT_CALL(*mock_adapter, StartClientListening())
+ .WillOnce(Return(TransportAdapter::OK));
+ EXPECT_EQ(::transport_manager::E_SUCCESS, tm.Visibility(true));
+}
+
+TEST_F(TransportManagerImplTest, SetVisibilityOff_StopClientListening) {
+ EXPECT_CALL(*mock_adapter, StopClientListening())
+ .WillOnce(Return(TransportAdapter::OK));
+ EXPECT_EQ(::transport_manager::E_SUCCESS, tm.Visibility(false));
+}
+
+TEST_F(TransportManagerImplTest, StopTransportManager) {
+ HandleDeviceListUpdated();
+ EXPECT_CALL(*mock_adapter, ConnectDevice(mac_address_))
+ .WillRepeatedly(Return(TransportAdapter::OK));
+ EXPECT_EQ(E_SUCCESS, tm.ConnectDevice(device_handle_));
+
+ EXPECT_CALL(*mock_adapter, DisconnectDevice(mac_address_))
+ .WillRepeatedly(Return(TransportAdapter::OK));
+
+ EXPECT_CALL(*mock_adapter, Terminate());
+ EXPECT_EQ(E_SUCCESS, tm.Stop());
+}
+
+TEST_F(TransportManagerImplTest, Reinit) {
+ EXPECT_CALL(*mock_adapter, Terminate());
+ EXPECT_CALL(*mock_adapter, Init()).WillOnce(Return(TransportAdapter::OK));
+ EXPECT_EQ(E_SUCCESS, tm.Reinit());
+}
+
+TEST_F(TransportManagerImplTest, Reinit_InitAdapterFailed) {
+ EXPECT_CALL(*mock_adapter, Terminate());
+ EXPECT_CALL(*mock_adapter, Init()).WillOnce(Return(TransportAdapter::FAIL));
+ EXPECT_EQ(E_ADAPTERS_FAIL, tm.Reinit());
+}
+
+TEST_F(TransportManagerImplTest, UpdateDeviceList_AddNewDevice) {
+ const DeviceInfo dev_info(device_handle_, mac_address_, "TestDeviceName",
+ "BTMAC");
+
+ dev.push_back(dev_info.mac_address());
+ std::vector<DeviceInfo> vector_dev_info;
+ std::vector<DeviceInfo>::iterator it = vector_dev_info.begin();
+ vector_dev_info.insert(it, dev_info);
+
+ EXPECT_CALL(*mock_adapter, GetDeviceList()).WillOnce(Return(dev));
+ EXPECT_CALL(*mock_adapter, DeviceName(dev_info.mac_address()))
+ .WillOnce(Return(dev_info.name()));
+ EXPECT_CALL(*mock_adapter, GetConnectionType())
+ .WillOnce(Return(dev_info.connection_type()));
+ EXPECT_CALL(*tm_listener, OnDeviceAdded(dev_info));
+
+ tm.UpdateDeviceList(mock_adapter);
+ dev.pop_back();
+}
+
+TEST_F(TransportManagerImplTest, UpdateDeviceList_RemoveDevice) {
+ const DeviceInfo dev_info(device_handle_, mac_address_, "TestDeviceName",
+ "BTMAC");
+
+ dev.push_back(dev_info.mac_address());
+ std::vector<DeviceInfo> vector_dev_info;
+ std::vector<DeviceInfo>::iterator it = vector_dev_info.begin();
+ vector_dev_info.insert(it, dev_info);
+
+ ::testing::InSequence seq;
+ EXPECT_CALL(*mock_adapter, GetDeviceList()).WillOnce(Return(dev));
+ EXPECT_CALL(*mock_adapter, GetConnectionType())
+ .WillOnce(Return(dev_info.connection_type()));
+ EXPECT_CALL(*mock_adapter, DeviceName(dev_info.mac_address()))
+ .WillOnce(Return(dev_info.name()));
+ EXPECT_CALL(*tm_listener, OnDeviceAdded(dev_info));
+ tm.UpdateDeviceList(mock_adapter);
+ dev.pop_back();
+
+ // Device list is empty now
+ EXPECT_CALL(*mock_adapter, GetDeviceList()).WillOnce(Return(dev));
+ EXPECT_CALL(*tm_listener, OnDeviceRemoved(dev_info));
+ tm.UpdateDeviceList(mock_adapter);
+}
+
+/*
+ * Tests which check correct handling and receiving events
+ */
+TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceDone) {
+ int type = static_cast<int>(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE);
+
+ TransportAdapterEvent test_event(type, mock_adapter, mac_address_,
+ application_id, test_message_, error_);
+
+ EXPECT_CALL(*tm_listener, OnScanDevicesFinished());
+
+ tm.ReceiveEventFromDevice(test_event);
+ testing::Mock::AsyncVerifyAndClearExpectations(10000);
+}
+
+TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceFail) {
+ int type = static_cast<int>(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL);
+
+ TransportAdapterEvent test_event(type, mock_adapter, mac_address_,
+ application_id, test_message_, error_);
+
+ EXPECT_CALL(*tm_listener, OnScanDevicesFailed(_));
+
+ tm.ReceiveEventFromDevice(test_event);
+ testing::Mock::AsyncVerifyAndClearExpectations(10000);
+}
+
+TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_DeviceListUpdated) {
+ int type = static_cast<int>(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED);
+ const DeviceInfo dev_info(device_handle_, mac_address_, "TestDeviceName",
+ "BTMAC");
+
+ TransportAdapterEvent test_event(type, mock_adapter, dev_info.mac_address(),
+ application_id, test_message_, error_);
+ dev.push_back(dev_info.mac_address());
+ std::vector<DeviceInfo> vector_dev_info;
+ std::vector<DeviceInfo>::iterator it = vector_dev_info.begin();
+ vector_dev_info.insert(it, dev_info);
+
+ EXPECT_CALL(*mock_adapter, GetDeviceList())
+ .Times(AtLeast(1))
+ .WillRepeatedly(Return(dev));
+ EXPECT_CALL(*mock_adapter, DeviceName(dev_info.mac_address()))
+ .Times(AtLeast(1))
+ .WillRepeatedly(Return(dev_info.name()));
+ EXPECT_CALL(*mock_adapter, GetConnectionType())
+ .Times(AtLeast(1))
+ .WillRepeatedly(Return(dev_info.connection_type()));
+
+ EXPECT_CALL(*tm_listener, OnDeviceFound(dev_info));
+ EXPECT_CALL(*tm_listener, OnDeviceAdded(dev_info));
+ EXPECT_CALL(*tm_listener, OnDeviceListUpdated(vector_dev_info));
+
+ tm.ReceiveEventFromDevice(test_event);
+ dev.pop_back();
+ testing::Mock::AsyncVerifyAndClearExpectations(10000);
+}
+
+TEST_F(TransportManagerImplTest, CheckEvents) {
+ HandleDeviceListUpdated();
+ HandleConnection();
+ HandleSendDone();
+ HandleSendFailed();
+ HandleSearchDone();
+ HandleSearchFail();
+ HandleFindNewApplicationsRequest();
+ HandleConnectionFailed();
+ HandleConnectionClosed();
+
+ HandleDisconnectionFailed();
+}
+
+TEST_F(TransportManagerImplTest, CheckReceiveEvent) {
+ HandleConnection();
+ HandleReceiveDone();
+}
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/transport_manager/test/transport_manager_instance_test.cc b/src/components/transport_manager/test/transport_manager_instance_test.cc
new file mode 100644
index 000000000..b5a251ba5
--- /dev/null
+++ b/src/components/transport_manager/test/transport_manager_instance_test.cc
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+
+/*
+ Tests transport manager functionality with single device adapter that behaves correctly and single client
+ Following sequence is tested:
+ - TM created and runned
+ - TM client registered as listener
+ - TM client requests device scaning
+ - single device was returned to TM client with onDeviceListUpdated callback
+ - TM client calls "connect" on found device
+ - device adapter sends onApplicationConnected
+ - TM client receives onApplicationConnected
+ - device adapter sends three data parts that represents single frame
+ - TM client receives single frame with onFrameReceived callback
+ - TM client calls sendFrame with some frame data and user data
+ - TM client receives onFrameSendCompleted
+ - TM client calls DisconnectDevice
+ - TM client receives onApplicationDisconnected
+ */
+
+#include <stddef.h>
+#include <stdio.h>
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+
+#include "../../include/transport_manager/transport_manager.h"
+#include "../include/transport_manager/transport_adapter/transport_adapter.h"
+#include "../include/transport_manager/common.h"
+#include "../include/transport_manager/transport_manager_impl.h"
+#include "../include/transport_manager/transport_manager_default.h"
+#include "../../connection_handler/include/connection_handler/connection_handler.h"
+
+
+namespace test{
+namespace test_transport_manager_instance {
+TEST(test_transport_manager_instance, test_transport_manager_instance)
+{
+ transport_manager::TransportManager *Instance = transport_manager::TransportManagerDefault::instance();
+ ASSERT_EQ(Instance, transport_manager::TransportManagerDefault::instance());
+}
+
+}}
diff --git a/src/components/transport_manager/test/transport_manager_test.cc b/src/components/transport_manager/test/transport_manager_test.cc
new file mode 100644
index 000000000..551931788
--- /dev/null
+++ b/src/components/transport_manager/test/transport_manager_test.cc
@@ -0,0 +1,394 @@
+/*
+ * 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 <pthread.h>
+
+#include "protocol/common.h"
+#include "transport_manager/info.h"
+#include "transport_manager/common.h"
+#include "transport_manager/transport_manager_impl.h"
+
+#include "include/raw_message_matcher.h"
+#include "include/mock_transport_adapter.h"
+#include "include/mock_device.h"
+#include "include/mock_transport_manager_listener.h"
+#include "transport_manager/transport_manager_listener_empty.h"
+
+//for instance test
+#include "transport_manager/transport_manager.h"
+#include "transport_manager/transport_adapter/transport_adapter.h"
+#include "transport_manager/transport_manager_default.h"
+#include "connection_handler/connection_handler.h"
+
+using ::testing::_;
+using ::testing::AtLeast;
+
+using ::transport_manager::ApplicationHandle;
+using ::transport_manager::DeviceHandle;
+using ::transport_manager::TransportManager;
+using ::transport_manager::TransportManagerImpl;
+using ::transport_manager::DeviceUID;
+using ::transport_manager::DeviceInfo;
+
+namespace test {
+namespace components {
+namespace transport_manager {
+
+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 TransportManagerTest : public ::testing::Test {
+ public:
+ volatile bool one_thread;
+ pthread_t thread_id;
+ static pthread_mutex_t test_mutex;
+ static pthread_cond_t test_cond;
+ int number;
+
+ protected:
+ static TransportManagerImpl *tm;
+ static MockTransportAdapter *mock_adapter;
+ static MockTransportManagerListener *tm_listener;
+
+ static void SetUpTestCase() {
+ pthread_mutex_init(&test_mutex, NULL);
+ pthread_cond_init(&test_cond, NULL);
+ mock_adapter = new MockTransportAdapter();
+ mock_adapter->Init();
+ //TransportManagerAttr cfg{0};
+ tm = new TransportManagerImpl();
+
+ tm_listener = new MockTransportManagerListener();
+ tm->AddEventListener(tm_listener);
+ tm->AddTransportAdapter(mock_adapter);
+ tm->Init();
+ }
+
+ static void TearDownTestCase() {
+ tm->Stop();
+ delete tm_listener;
+ pthread_cond_destroy(&test_cond);
+ pthread_mutex_destroy(&test_mutex);
+ }
+
+ virtual void SetUp() {
+ one_thread = false;
+ thread_id = pthread_self();
+ mock_adapter->reset();
+ pthread_mutex_lock(&test_mutex);
+ }
+
+ virtual void TearDown() { pthread_mutex_unlock(&test_mutex); }
+
+ 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;
+ }
+};
+
+TransportManagerImpl *TransportManagerTest::tm;
+
+class MyTransportListener
+ : public ::transport_manager::TransportManagerListenerEmpty {
+ public:
+ explicit MyTransportListener(TransportManagerTest *test)
+ : TransportManagerListenerEmpty(),
+ connection(0),
+ device_handle(0),
+ test(test) {}
+ ConnectionUID connection;
+ DeviceHandle device_handle;
+ void OnConnectionEstablished(const DeviceInfo &device,
+ const ConnectionUID &connection_id) {
+ connection = connection_id;
+
+ pthread_mutex_lock(&test->test_mutex);
+ pthread_cond_signal(&test->test_cond);
+ pthread_mutex_unlock(&test->test_mutex);
+ }
+
+ void OnDeviceFound(const DeviceInfo &device_info) {
+ device_handle = device_info.device_handle();
+ }
+
+ void OnScanDevicesFinished() {
+ pthread_mutex_lock(&test->test_mutex);
+ pthread_cond_signal(&test->test_cond);
+ pthread_mutex_unlock(&test->test_mutex);
+ }
+
+ void OnTMMessageReceived(const RawMessagePtr message) {
+ static int count = 0;
+ if (++count == 100) {
+ pthread_mutex_lock(&test->test_mutex);
+ pthread_cond_signal(&test->test_cond);
+ pthread_mutex_unlock(&test->test_mutex);
+ }
+ }
+
+ void OnTMMessageSend(const RawMessagePtr message) {
+ }
+
+ private:
+ TransportManagerTest *test;
+};
+
+pthread_mutex_t TransportManagerTest::test_mutex;
+pthread_cond_t TransportManagerTest::test_cond;
+
+MockTransportAdapter *TransportManagerTest::mock_adapter = NULL;
+MockTransportManagerListener *TransportManagerTest::tm_listener = NULL;
+
+
+
+TEST_F(TransportManagerTest, ScanDeviceFailed) {
+
+ //assert
+ EXPECT_CALL(*tm_listener, OnDeviceFound(_)).Times(0);
+ EXPECT_CALL(*tm_listener, OnScanDevicesFailed(_)).WillOnce(
+ SignalTest(this));
+
+ //act
+ mock_adapter->get_device_scanner()->fail_further_search();
+ tm->SearchDevices();
+
+ //assert
+ EXPECT_TRUE(waitCond(1));
+
+ //act
+ mock_adapter->get_device_scanner()->reset();
+}
+
+TEST_F(TransportManagerTest, ScanDeviceNoFound) {
+
+ //assert
+ EXPECT_CALL(*tm_listener, OnScanDevicesFailed(_)).Times(0);
+ EXPECT_CALL(*tm_listener, OnDeviceFound(_)).Times(0);
+ EXPECT_CALL(*tm_listener, OnScanDevicesFinished()).WillOnce(SignalTest(this));
+
+ EXPECT_CALL(*tm_listener, OnDeviceListUpdated(_));
+
+ //act
+ tm->SearchDevices();
+
+ //assert
+ EXPECT_TRUE(waitCond(1));
+
+ //act
+ mock_adapter->get_device_scanner()->reset();
+}
+
+TEST_F(TransportManagerTest, ScanDeviceDone) {
+
+ //assert
+ EXPECT_CALL(*tm_listener, OnScanDevicesFailed(_)).Times(0);
+ EXPECT_CALL(*tm_listener, OnDeviceFound(_));
+ EXPECT_CALL(*tm_listener, OnScanDevicesFinished()).WillOnce(SignalTest(this));
+
+ //added to fixed warnings
+ EXPECT_CALL(*tm_listener, OnDeviceAdded(_)).Times(3);
+ EXPECT_CALL(*tm_listener, OnDeviceListUpdated(_));
+ EXPECT_CALL(*tm_listener, OnDeviceRemoved(_)).Times(3);
+
+ //act
+ mock_adapter->get_device_scanner()->AddDevice("TestDevice", "MA:CA:DR:ES:S");
+ tm->SearchDevices();
+
+ //assert
+ EXPECT_TRUE(waitCond(1));
+
+ //act
+ mock_adapter->get_device_scanner()->reset();
+}
+
+TEST_F(TransportManagerTest, ScanManyDeviceDone) {
+
+
+ //assert
+ EXPECT_CALL(*tm_listener, OnScanDevicesFailed(_)).Times(0);
+ EXPECT_CALL(*tm_listener, OnDeviceFound(_)).Times(2);
+ EXPECT_CALL(*tm_listener, OnScanDevicesFinished()).WillOnce(SignalTest(this));
+
+ //assert
+ EXPECT_CALL(*tm_listener, OnDeviceListUpdated(_));
+ //act
+ mock_adapter->get_device_scanner()->AddDevice("TestDevice1",
+ "MA:CA:DR:ES:S1");
+ mock_adapter->get_device_scanner()->AddDevice("TestDevice2",
+ "MA:CA:DR:ES:S2");
+ tm->SearchDevices();
+
+ //assert
+ EXPECT_TRUE(waitCond(1));
+
+ //act
+ mock_adapter->get_device_scanner()->reset();
+}
+
+
+TEST_F(TransportManagerTest, ConnectAddDeviceCannotFailConnection) {
+
+ //arrange
+ const DeviceInfo kInfo(1, "MA:CA:DR:ES:S", "TestDeviceName", "BTMAC");
+ const ConnectionUID kConnection = 1;
+
+ //assert
+ EXPECT_CALL(*tm_listener, OnDeviceFound(_));
+ EXPECT_CALL(*tm_listener, OnScanDevicesFinished());
+
+ EXPECT_CALL(*tm_listener, OnDeviceAdded(_));
+ EXPECT_CALL(*tm_listener, OnDeviceListUpdated(_));
+
+ //act
+ MyTransportListener *myListener = new MyTransportListener(this);
+ mock_adapter->get_device_scanner()->AddDevice(kInfo.name(),
+ kInfo.mac_address());
+ tm->AddEventListener(myListener);
+ tm->SearchDevices();
+
+ //assert
+ EXPECT_TRUE(waitCond(10));
+
+ EXPECT_CALL(*tm_listener, OnConnectionFailed(_, _)).Times(0);
+ EXPECT_CALL(*tm_listener, OnConnectionEstablished(kInfo, kConnection));
+
+ //act
+ tm->ConnectDevice(kInfo.device_handle());
+
+ //assert
+ EXPECT_TRUE(waitCond(10));
+
+ //act
+ mock_adapter->get_device_scanner()->reset();
+}
+
+
+//TODO{ALeshin}: APPLINK-10846
+//TEST_F(TransportManagerTest, ConnectDeviceSendReciveMessage) {
+
+// //arrange
+// const ConnectionUID kConnection = 1;
+// const int kTimes = 99; // Times of send message //if kTimes>99 OnTMMessageSend will fail
+// const unsigned int kVersionProtocol = 1;
+
+
+// //assert
+// EXPECT_CALL(*tm_listener, OnTMMessageSendFailed(_, _)).Times(0);
+// EXPECT_CALL(*tm_listener, OnTMMessageReceiveFailed(_, _)).Times(0);
+// EXPECT_CALL(*tm_listener, OnConnectionClosed(kConnection)).Times(0);
+
+// EXPECT_CALL(*tm_listener, OnTMMessageSend(_)).Times(kTimes);
+// EXPECT_CALL(*tm_listener, OnTMMessageReceived(_)).Times(kTimes);
+
+// //act
+// const unsigned int kSize = 12;
+// unsigned char data[kSize] = {0x20, 0x07, 0x01, 0x00, 0x00, 0x00,
+// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+// for (int i = 0; i < kTimes; ++i) {
+// const RawMessagePtr kMessage =
+// new RawMessage(kConnection, kVersionProtocol, data, kSize);
+// tm->SendMessageToDevice(kMessage);
+// usleep(1000);
+// }
+
+// //assert
+// EXPECT_TRUE(waitCond(10));
+
+// //act
+// mock_adapter->get_device_scanner()->reset();
+//}
+
+//TODO{ALeshin}: APPLINK-10846
+//TEST_F(TransportManagerTest, ConnectAddDeviceCannotFailClose) {
+
+// //arrange
+// const DeviceInfo kInfo(1, "MA:CA:DR:ES:S", "TestDeviceName", "BTMAC");
+// const ConnectionUID kConnection = 1;
+
+// //assert
+// EXPECT_CALL(*tm_listener, OnDeviceFound(_));
+// EXPECT_CALL(*tm_listener, OnScanDevicesFinished());
+// EXPECT_CALL(*tm_listener, OnDeviceListUpdated(_));
+
+
+// //act
+// MyTransportListener *myListener = new MyTransportListener(this);
+// mock_adapter->get_device_scanner()->AddDevice(kInfo.name(),
+// kInfo.mac_address());
+// tm->AddEventListener(myListener);
+// tm->SearchDevices();
+
+// //assert
+// EXPECT_TRUE(waitCond(10));
+
+// EXPECT_CALL(*tm_listener, OnConnectionClosedFailure(_, _)).Times(0);
+// EXPECT_CALL(*tm_listener, OnDisconnectFailed(kInfo.device_handle(), _))
+// .Times(0);
+// EXPECT_CALL(*tm_listener, OnConnectionClosed(kConnection)).WillOnce(SignalTest(this));
+
+// //act
+// tm->DisconnectDevice(kInfo.device_handle());
+
+// //assert
+// EXPECT_TRUE(waitCond(10));
+
+// //act
+// tm->Stop();
+// delete myListener;
+// mock_adapter->get_device_scanner()->reset();
+//}
+
+
+} // namespace transport_manager
+} // namespace components
+} // namespace test
+
+
+namespace test{
+namespace test_transport_manager_instance {
+TEST(testTransportManager, CreateOnlyInstance)
+{
+ transport_manager::TransportManager *Instance = transport_manager::TransportManagerDefault::instance();
+ ASSERT_EQ(Instance, transport_manager::TransportManagerDefault::instance());
+ delete Instance;
+}
+}}
diff --git a/src/components/utils/CMakeLists.txt b/src/components/utils/CMakeLists.txt
index bbb74dc1e..3ebabe904 100644
--- a/src/components/utils/CMakeLists.txt
+++ b/src/components/utils/CMakeLists.txt
@@ -1,56 +1,96 @@
-set(UtilsIncludeDir ${CMAKE_SOURCE_DIR}/src/components/utils/include)
+# 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.
+
+
+set(UTILS_INCLUDE_DIR ${COMPONENTS_DIR}/utils/include)
+set(UTILS_SRC_DIR ${COMPONENTS_DIR}/utils/src)
include_directories (
- ./include
- ../config_profile/include
- ../media_manager/include/
- ../protocol_handler/include/
+ ${UTILS_INCLUDE_DIR}
+ ${COMPONENTS_DIR}/config_profile/include
+ ${COMPONENTS_DIR}/media_manager/include
+ ${COMPONENTS_DIR}/protocol_handler/include
${LOG4CXX_INCLUDE_DIRECTORY}
)
set (SOURCES
- ./src/bitstream.cc
- ./src/conditional_variable_posix.cc
- ./src/file_system.cc
- ./src/threads/posix_thread.cc
- ./src/threads/thread_manager.cc
- ./src/threads/thread_validator.cc
- ./src/lock_posix.cc
- ./src/rwlock_posix.cc
- ./src/date_time.cc
- ./src/signals_linux.cc
- ./src/system.cc
- ./src/resource_usage.cc
- ./src/appenders_loader.cc
+ ${UTILS_SRC_DIR}/bitstream.cc
+ ${UTILS_SRC_DIR}/conditional_variable_posix.cc
+ ${UTILS_SRC_DIR}/file_system.cc
+ ${UTILS_SRC_DIR}/threads/posix_thread.cc
+ ${UTILS_SRC_DIR}/threads/thread_delegate.cc
+ ${UTILS_SRC_DIR}/threads/thread_validator.cc
+ ${UTILS_SRC_DIR}/threads/async_runner.cc
+ ${UTILS_SRC_DIR}/lock_posix.cc
+ ${UTILS_SRC_DIR}/rwlock_posix.cc
+ ${UTILS_SRC_DIR}/date_time.cc
+ ${UTILS_SRC_DIR}/signals_linux.cc
+ ${UTILS_SRC_DIR}/system.cc
+ ${UTILS_SRC_DIR}/resource_usage.cc
+ ${UTILS_SRC_DIR}/appenders_loader.cc
+ ${UTILS_SRC_DIR}/gen_hash.cc
)
if(ENABLE_LOG)
list(APPEND SOURCES
- ./src/push_log.cc
- ./src/log_message_loop_thread.cc
- ./src/logger_status.cc
+ ${UTILS_SRC_DIR}/push_log.cc
+ ${UTILS_SRC_DIR}/log_message_loop_thread.cc
+ ${UTILS_SRC_DIR}/logger_status.cc
+ ${UTILS_SRC_DIR}/auto_trace.cc
+ ${UTILS_SRC_DIR}/logger.cc
)
endif()
if (BUILD_BACKTRACE_SUPPORT)
list(APPEND SOURCES
- ./src/back_trace.cc
+ ${UTILS_SRC_DIR}/back_trace.cc
)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
list(APPEND SOURCES
- ./src/threads/pulse_thread_delegate.cc
+ ${UTILS_SRC_DIR}/threads/pulse_thread_delegate.cc
)
endif()
add_library("Utils" SHARED ${SOURCES})
+if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ list(APPEND LIBRARIES dl)
+endif()
+
+
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})
- target_link_libraries("Utils" ${LIBRARIES})
ADD_DEPENDENCIES(Utils install-3rd_party_logger)
endif()
@@ -58,6 +98,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries("Utils" pthread ${RTLIB})
endif()
+target_link_libraries("Utils" ${LIBRARIES})
+
if(BUILD_TESTS)
add_subdirectory(test)
endif()
diff --git a/src/components/utils/include/utils/back_trace.h b/src/components/utils/include/utils/back_trace.h
index 7f8912faf..f2410e36b 100644
--- a/src/components/utils/include/utils/back_trace.h
+++ b/src/components/utils/include/utils/back_trace.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -61,10 +61,10 @@ class Backtrace {
// Captured symbols in order from topmost stack frame to last captured
std::vector<std::string> CallStack() const;
- threads::Thread::Id ThreadId() const;
+ threads::PlatformThreadHandle ThreadId() const;
private:
- threads::Thread::Id thread_id_;
+ threads::PlatformThreadHandle thread_id_;
std::vector<void*> backtrace_;
};
diff --git a/src/components/utils/include/utils/bitstream.h b/src/components/utils/include/utils/bitstream.h
index cba15abd8..9bf41d187 100644
--- a/src/components/utils/include/utils/bitstream.h
+++ b/src/components/utils/include/utils/bitstream.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/utils/include/utils/file_system.h b/src/components/utils/include/utils/file_system.h
index d68ec484f..a132837ca 100644
--- a/src/components/utils/include/utils/file_system.h
+++ b/src/components/utils/include/utils/file_system.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -234,6 +234,32 @@ const std::string ConvertPathForURL(const std::string& path);
*/
bool CreateFile(const std::string& path);
+/**
+ * @brief Get modification time of file
+ * @param path Path to file
+ * @return Modification time in nanoseconds
+ */
+uint64_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
+*/
+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
+*/
+bool MoveFile(const std::string& src,
+ const std::string& dst);
void remove_directory_content(const std::string& directory_name);
} // namespace file_system
diff --git a/src/components/utils/include/utils/gen_hash.h b/src/components/utils/include/utils/gen_hash.h
new file mode 100644
index 000000000..e4102d36d
--- /dev/null
+++ b/src/components/utils/include/utils/gen_hash.h
@@ -0,0 +1,50 @@
+/*
+ * 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_UTILS_INCLUDE_UTILS_GEN_HASH_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_GEN_HASH_H_
+
+#include <string>
+
+namespace utils {
+
+/**
+ * @brief generate random alphanumeric string of specified length
+ * @param size length of random string
+ * @return random string
+ */
+
+const std::string gen_hash(size_t size);
+
+} // namespace utils
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_GEN_HASH_H_
diff --git a/src/components/utils/include/utils/helpers.h b/src/components/utils/include/utils/helpers.h
new file mode 100644
index 000000000..e616dd56c
--- /dev/null
+++ b/src/components/utils/include/utils/helpers.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_HELPERS_H
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_HELPERS_H
+
+/**
+ * These helpers allows to simplify compare strategy between some objects.
+ * Suppose user has some enum with value E with some numbers of possible values
+ * enum E {V1, V2, V3, V5};
+ * So we want to know if some user-input value is belong to one of the enum's subset.
+ * Usually user has to do next routine
+ *
+ * E input_value = V3;
+ * if (input_value == V1 || input_value == V2 || input_value == V3) {
+ * do_some_stuff_here;
+ * }
+ *
+ * How it suppose to be with these helpers methods:
+ *
+ * E input_value = V3;
+ * if (Compare<E, EQ, ONE>(input_value, V1, V2, V3)) {
+ * do_some_stuff;
+ * }
+ *
+ * Also User is able to easily change compare startegy by using some set of
+ * predefined startegies.
+ */
+namespace helpers {
+
+ template<typename T>
+ bool EQ (T what, T to) {
+ return what == to;
+ }
+
+ template<typename T>
+ bool NEQ (T what, T to) {
+ return !EQ<T>(what, to);
+ }
+
+ template<class U = bool>
+ bool ALL (U what, U to) {
+ return what && to;
+ }
+
+ template<class U = bool>
+ bool ONE (U what, U to) {
+ return what || to;
+ }
+
+ template <typename T,
+ bool (*CompareType)(T ,T),
+ bool (*CmpStrategy)(bool ,bool)>
+ bool Compare (T what, T to) {
+ return CompareType(what, to);
+ }
+
+ template <typename T,
+ bool (*CompareType)(T ,T),
+ bool (*CmpStrategy)(bool, bool)>
+ bool Compare(T what, T to, T to1) {
+ return CmpStrategy(Compare<T, CompareType, CmpStrategy>(what, to),
+ Compare<T, CompareType, CmpStrategy>(what, to1));
+ }
+
+ template <typename T,
+ bool (*CompareType)(T ,T),
+ bool (*CmpStrategy)(bool, bool)>
+ bool Compare(T what, T to, T to1, T to2) {
+ return CmpStrategy(Compare<T, CompareType, CmpStrategy>(what, to, to1),
+ Compare<T, CompareType, CmpStrategy>(what, to2));
+ }
+
+ template <typename T,
+ bool (*CompareType)(T ,T),
+ bool (*CmpStrategy)(bool, bool)>
+ bool Compare(T what, T to, T to1, T to2, T to3) {
+ return CmpStrategy(Compare<T, CompareType, CmpStrategy>(what, to, to1, to2),
+ Compare<T, CompareType, CmpStrategy>(what, to3));
+ }
+
+ template <typename T,
+ bool (*CompareType)(T ,T),
+ bool (*CmpStrategy)(bool, bool)>
+ bool Compare(T what, T to, T to1, T to2, T to3, T to4) {
+ return CmpStrategy(Compare<T, CompareType, CmpStrategy>(what, to, to1, to2, to3),
+ Compare<T, CompareType, CmpStrategy>(what, to4));
+ }
+}
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_HELPERS_H
diff --git a/src/components/utils/include/utils/log_message_loop_thread.h b/src/components/utils/include/utils/log_message_loop_thread.h
index b23a246e1..87b6c7e53 100644
--- a/src/components/utils/include/utils/log_message_loop_thread.h
+++ b/src/components/utils/include/utils/log_message_loop_thread.h
@@ -37,6 +37,7 @@
#include <queue>
#include <log4cxx/logger.h>
+#include "utils/macro.h"
#include "utils/threads/message_loop_thread.h"
#include "utils/singleton.h"
diff --git a/src/components/utils/include/utils/resource_usage.h b/src/components/utils/include/utils/resource_usage.h
index a8fa4aa7d..ff90b2c22 100644
--- a/src/components/utils/include/utils/resource_usage.h
+++ b/src/components/utils/include/utils/resource_usage.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -38,6 +38,7 @@
#include <sys/procfs.h>
#endif
+#include "utils/macro.h"
#include <string>
#include <iostream>
@@ -120,6 +121,16 @@ class Resources {
private:
+#ifdef BUILD_TESTS
+ friend class ResourceUsagePrivateTest;
+ FRIEND_TEST(ResourceUsagePrivateTest, ReadStatFileTest);
+ FRIEND_TEST(ResourceUsagePrivateTest, GetProcInfoTest);
+ FRIEND_TEST(ResourceUsagePrivateTest, GetMemInfoTest);
+ FRIEND_TEST(ResourceUsagePrivateTest, GetStatPathTest_FileExists);
+ FRIEND_TEST(ResourceUsagePrivateTest, GetStatPathTest_ReadFile);
+ FRIEND_TEST(ResourceUsagePrivateTest, GetProcPathTest);
+#endif
+
/*
* @brief reads /proc/PID/stat file on linux
* do not work on QNX ( return false, output wan't be changed )
diff --git a/src/components/utils/include/utils/signals.h b/src/components/utils/include/utils/signals.h
index 28e8afd9d..6c9183630 100644
--- a/src/components/utils/include/utils/signals.h
+++ b/src/components/utils/include/utils/signals.h
@@ -1,41 +1,49 @@
/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SIGNALS_H_
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SIGNALS_H_
+#ifdef __QNXNTO__
+typedef void (*sighandler_t) (int);
+#else
+#include <signal.h>
+#endif
+
namespace utils {
-bool SubscribeToTerminateSignal(void (*func)(int32_t p));
-bool ResetSubscribeToTerminateSignal();
+
+bool SubscribeToTerminateSignal(sighandler_t func);
+bool SubscribeToFaultSignal(sighandler_t func);
+
} // namespace utils
#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SIGNALS_H_
diff --git a/src/components/utils/include/utils/singleton.h b/src/components/utils/include/utils/singleton.h
index d7b625e0a..fff7294d1 100644
--- a/src/components/utils/include/utils/singleton.h
+++ b/src/components/utils/include/utils/singleton.h
@@ -28,7 +28,7 @@
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
-*/
+ */
#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SINGLETON_H_
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SINGLETON_H_
@@ -111,18 +111,24 @@ class Singleton {
static T** instance_pointer();
static Deleter* deleter();
+
+ static sync_primitives::Lock lock_;
};
+
+template<typename T, class Deleter>
+sync_primitives::Lock Singleton<T, Deleter>::lock_;
+
+
template<typename T, class Deleter>
T* Singleton<T, Deleter>::instance() {
- static sync_primitives::Lock lock;
T* local_instance;
atomic_pointer_assign(local_instance, *instance_pointer());
memory_barrier();
if (!local_instance) {
- lock.Acquire();
+ lock_.Acquire();
local_instance = *instance_pointer();
if (!local_instance) {
local_instance = new T();
@@ -130,7 +136,7 @@ T* Singleton<T, Deleter>::instance() {
atomic_pointer_assign(*instance_pointer(), local_instance);
deleter()->grab(local_instance);
}
- lock.Release();
+ lock_.Release();
}
return local_instance;
@@ -138,14 +144,13 @@ T* Singleton<T, Deleter>::instance() {
template<typename T, class Deleter>
void Singleton<T, Deleter>::destroy() {
- static sync_primitives::Lock lock;
T* local_instance;
atomic_pointer_assign(local_instance, *instance_pointer());
memory_barrier();
if (local_instance) {
- lock.Acquire();
+ lock_.Acquire();
local_instance = *instance_pointer();
if (local_instance) {
atomic_pointer_assign(*instance_pointer(), 0);
@@ -153,7 +158,7 @@ void Singleton<T, Deleter>::destroy() {
delete local_instance;
deleter()->grab(0);
}
- lock.Release();
+ lock_.Release();
}
}
diff --git a/src/components/utils/include/utils/stl_utils.h b/src/components/utils/include/utils/stl_utils.h
index f525c6429..70fbadbd5 100644
--- a/src/components/utils/include/utils/stl_utils.h
+++ b/src/components/utils/include/utils/stl_utils.h
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -44,14 +44,15 @@ template<class T>
class StlCollectionDeleter {
public:
typedef T Collection;
- StlCollectionDeleter(T* collection): collection_(collection) {
+ StlCollectionDeleter(T* collection)
+ : collection_(collection) {
DCHECK(collection_);
}
~StlCollectionDeleter() {
- for (typename Collection::iterator i = collection_->begin(),
- end = collection_->end();
- i != end; ++i) {
+ for (typename Collection::iterator i = collection_->begin(), end =
+ collection_->end(); i != end; ++i) {
delete *i;
+ *i = NULL;
}
}
private:
@@ -62,20 +63,22 @@ template<class T>
class StlMapDeleter {
public:
typedef T Collection;
- StlMapDeleter(T* collection): collection_(collection) {
+ StlMapDeleter(T* collection)
+ : collection_(collection) {
DCHECK(collection_);
}
~StlMapDeleter() {
- for (typename Collection::iterator i = collection_->begin(),
- end = collection_->end();
- i != end; ++i) {
+ for (typename Collection::iterator i = collection_->begin(), end =
+ collection_->end(); i != end; ++i) {
delete i->second;
+ i->second = NULL;
}
+
}
private:
Collection* collection_;
};
-} // namespace utils
+} // namespace utils
-#endif /* SRC_COMPONENTS_UTILS_INCLUDE_UTILS_STL_UTILS_H_ */
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_STL_UTILS_H_
diff --git a/src/components/utils/include/utils/system.h b/src/components/utils/include/utils/system.h
index 16bdc0367..3b34d7852 100644
--- a/src/components/utils/include/utils/system.h
+++ b/src/components/utils/include/utils/system.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -76,6 +76,9 @@ class System {
*/
bool Execute(bool wait);
+ std::string command() const;
+ std::vector<std::string> argv() const;
+
private:
/**
* Command for executing
diff --git a/src/components/utils/include/utils/threads/pulse_thread_delegate.h b/src/components/utils/include/utils/threads/pulse_thread_delegate.h
index bb109bde9..207b64caa 100644
--- a/src/components/utils/include/utils/threads/pulse_thread_delegate.h
+++ b/src/components/utils/include/utils/threads/pulse_thread_delegate.h
@@ -57,7 +57,7 @@ class PulseThreadDelegate : public ThreadDelegate {
*/
PulseThreadDelegate();
virtual void threadMain();
- virtual bool exitThreadMain();
+ virtual void exitThreadMain();
protected:
/**
@@ -86,7 +86,7 @@ class PulseThreadDelegate : public ThreadDelegate {
private:
enum {PULSE_CODE = _PULSE_CODE_MINAVAIL + 1};
- bool run_;
+ volatile bool run_;
int chid_;
int coid_;
};
diff --git a/src/components/utils/include/utils/threads/thread_validator.h b/src/components/utils/include/utils/threads/thread_validator.h
index def1994b7..dc2d138e2 100644
--- a/src/components/utils/include/utils/threads/thread_validator.h
+++ b/src/components/utils/include/utils/threads/thread_validator.h
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -67,8 +67,9 @@ class SingleThreadSimpleValidator {
// This method should be called in every public method
// of classes being checked for absence of concurrent access
void AssertRunningOnCreationThread() const;
+ PlatformThreadHandle creation_thread_id() const;
private:
- const Thread::Id creation_thread_id_;
+ const PlatformThreadHandle creation_thread_id_;
};
@@ -91,13 +92,13 @@ class SingleThreadValidator {
// Must be called prior to transferring object being validated to
// another thread or when passing it back
- void PassToThread(Thread::Id thread_id) const;
+ void PassToThread(PlatformThreadHandle thread_id) const;
// This method should be called in every public method
// of classes being checked for absence of unintended concurrent
// access
void AssertRunningOnValidThread() const;
private:
- mutable Thread::Id owning_thread_id_;
+ mutable PlatformThreadHandle owning_thread_id_;
};
} // namespace threads
diff --git a/src/components/utils/src/appenders_loader.cc b/src/components/utils/src/appenders_loader.cc
index cbbd03906..9741bd1b8 100644
--- a/src/components/utils/src/appenders_loader.cc
+++ b/src/components/utils/src/appenders_loader.cc
@@ -39,7 +39,7 @@ namespace utils {
AppendersLoader appenders_loader;
AppendersLoader::AppendersLoader() {
- handle_ = dlopen("libappenders.so", RTLD_LAZY | RTLD_NODELETE);
+ handle_ = dlopen("libappenders.so", RTLD_LAZY);
}
AppendersLoader::~AppendersLoader() {
diff --git a/src/components/utils/src/back_trace.cc b/src/components/utils/src/back_trace.cc
index 23b1b4d1e..f49c60b46 100644
--- a/src/components/utils/src/back_trace.cc
+++ b/src/components/utils/src/back_trace.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -89,7 +89,7 @@ vector<string> Backtrace::CallStack() const {
return callstack;
}
-Thread::Id Backtrace::ThreadId() const {
+threads::PlatformThreadHandle Backtrace::ThreadId() const {
return thread_id_;
}
diff --git a/src/components/utils/src/bitstream.cc b/src/components/utils/src/bitstream.cc
index c616b1ae4..ae353b44c 100644
--- a/src/components/utils/src/bitstream.cc
+++ b/src/components/utils/src/bitstream.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/utils/src/conditional_variable_posix.cc b/src/components/utils/src/conditional_variable_posix.cc
index a89f8cab6..2928cac9d 100644
--- a/src/components/utils/src/conditional_variable_posix.cc
+++ b/src/components/utils/src/conditional_variable_posix.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -83,14 +83,29 @@ void ConditionalVariable::Broadcast() {
}
-void ConditionalVariable::Wait(AutoLock& auto_lock) {
+bool ConditionalVariable::Wait(Lock& lock) {
+ lock.AssertTakenAndMarkFree();
+ int32_t 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();
int32_t wait_status = pthread_cond_wait(&cond_var_,
&lock.mutex_);
lock.AssertFreeAndMarkTaken();
- if (wait_status != 0)
+ if (wait_status != 0) {
LOG4CXX_ERROR(logger_, "Failed to wait for conditional variable");
+ return false;
+ }
+ return true;
}
ConditionalVariable::WaitStatus ConditionalVariable::WaitFor(
@@ -104,7 +119,6 @@ ConditionalVariable::WaitStatus ConditionalVariable::WaitFor(
(milliseconds % kMillisecondsPerSecond) * kNanosecondsPerMillisecond;
wait_interval.tv_sec += wait_interval.tv_nsec / kNanosecondsPerSecond;
wait_interval.tv_nsec %= kNanosecondsPerSecond;
-
Lock& lock = auto_lock.GetLock();
lock.AssertTakenAndMarkFree();
int32_t timedwait_status = pthread_cond_timedwait(&cond_var_,
@@ -129,7 +143,6 @@ ConditionalVariable::WaitStatus ConditionalVariable::WaitFor(
LOG4CXX_ERROR(logger_, "Failed to timewait for conditional variable timedwait_status: " << timedwait_status);
}
}
-
return wait_status;
}
diff --git a/src/components/utils/src/date_time.cc b/src/components/utils/src/date_time.cc
index f19095164..42a199e0f 100644
--- a/src/components/utils/src/date_time.cc
+++ b/src/components/utils/src/date_time.cc
@@ -1,49 +1,50 @@
/*
-* 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 <sys/time.h>
#include <stdint.h>
#include "utils/date_time.h"
+
namespace date_time {
-TimevalStruct DateTime::getCurrentTime() {
- TimevalStruct currentTime;
- timezone timeZone;
+ TimevalStruct DateTime::getCurrentTime() {
+ TimevalStruct currentTime;
+ timezone timeZone;
- gettimeofday(&currentTime, &timeZone);
+ gettimeofday(&currentTime, &timeZone);
- return currentTime;
-}
+ return currentTime;
+ }
int64_t date_time::DateTime::getSecs(const TimevalStruct &time) {
return static_cast<int64_t>(time.tv_sec);
@@ -100,3 +101,11 @@ TimeCompare date_time::DateTime::compareTime(const TimevalStruct &time1, const T
}
} // 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);
+}
diff --git a/src/components/utils/src/file_system.cc b/src/components/utils/src/file_system.cc
index 64e021a6f..f9e3bb2db 100644
--- a/src/components/utils/src/file_system.cc
+++ b/src/components/utils/src/file_system.cc
@@ -325,10 +325,12 @@ std::vector<std::string> file_system::ListFiles(
}
closedir(directory);
+
+ }
+
#ifdef __QNXNTO__
- delete[] direntbuffer;
+ delete[] direntbuffer;
#endif
- }
return listFiles;
}
@@ -410,3 +412,39 @@ bool file_system::CreateFile(const std::string& path) {
return true;
}
}
+
+
+uint64_t file_system::GetFileModificationTime(const std::string& path) {
+ struct stat info;
+ stat(path.c_str(), &info);
+#ifndef __QNXNTO__
+ return static_cast<uint64_t>(info.st_mtim.tv_nsec);
+#else
+ return static_cast<uint64_t>(info.st_mtime);
+#endif
+}
+
+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);
+ return false;
+ }
+ return true;
+}
+
+bool file_system::MoveFile(const std::string& src,
+ const std::string& dst) {
+ if (!CopyFile(src, dst)) {
+ return false;
+ }
+ if (!DeleteFile(src)) {
+ DeleteFile(dst);
+ return false;
+ }
+ return true;
+}
diff --git a/src/components/utils/src/gen_hash.cc b/src/components/utils/src/gen_hash.cc
new file mode 100644
index 000000000..6ac5c217c
--- /dev/null
+++ b/src/components/utils/src/gen_hash.cc
@@ -0,0 +1,53 @@
+/*
+ * 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/gen_hash.h"
+
+#include <cstdlib>
+
+namespace utils {
+
+const std::string gen_hash(size_t size) {
+ static const char symbols[] = "0123456789"
+ "abcdefghijklmnopqrstuvwxyz"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ static const size_t capacity = sizeof(symbols) - 1;
+
+ std::string hash(size, '\0');
+ for (std::string::iterator i = hash.begin(); i != hash.end(); ++i) {
+ int index = std::rand() % capacity;
+ *i = symbols[index];
+ }
+ return hash;
+}
+
+} // namespace utils
diff --git a/src/components/utils/src/lock_posix.cc b/src/components/utils/src/lock_posix.cc
index f75b7ee9e..d2837708f 100644
--- a/src/components/utils/src/lock_posix.cc
+++ b/src/components/utils/src/lock_posix.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -34,6 +34,8 @@
#include <errno.h>
#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
#include "utils/logger.h"
@@ -43,11 +45,11 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
Lock::Lock()
#ifndef NDEBUG
- : lock_taken_(0),
- is_mutex_recursive_(false)
+ : lock_taken_(0),
+ is_mutex_recursive_(false)
#endif // NDEBUG
{
- int32_t status = pthread_mutex_init(&mutex_, NULL);
+ const int32_t status = pthread_mutex_init(&mutex_, NULL);
if (status != 0) {
LOG4CXX_ERROR(logger_, "Failed to initialize mutex");
}
@@ -55,8 +57,8 @@ Lock::Lock()
Lock::Lock(bool is_mutex_recursive)
#ifndef NDEBUG
- : lock_taken_(0),
- is_mutex_recursive_(is_mutex_recursive)
+ : lock_taken_(0),
+ is_mutex_recursive_(is_mutex_recursive)
#endif // NDEBUG
{
int32_t status;
@@ -67,6 +69,7 @@ Lock::Lock(bool is_mutex_recursive)
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
status = pthread_mutex_init(&mutex_, &attr);
+ pthread_mutexattr_destroy(&attr);
} else {
status = pthread_mutex_init(&mutex_, NULL);
}
@@ -79,54 +82,41 @@ Lock::Lock(bool is_mutex_recursive)
Lock::~Lock() {
#ifndef NDEBUG
if (lock_taken_ > 0) {
- LOG4CXX_ERROR(logger_, "Destroying non-released mutex");
+ 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");
+ LOG4CXX_ERROR(logger_, "Failed to destroy mutex " << &mutex_ << ": " << strerror(status));
}
}
void Lock::Acquire() {
- int32_t status = pthread_mutex_lock(&mutex_);
+ const int32_t status = pthread_mutex_lock(&mutex_);
if (status != 0) {
- LOG4CXX_ERROR(logger_, "Failed to acquire mutex");
+ LOG4CXX_ERROR(logger_, "Failed to acquire mutex " << &mutex_ << ": " << strerror(status));
+ } else {
+ AssertFreeAndMarkTaken();
}
- AssertFreeAndMarkTaken();
}
void Lock::Release() {
AssertTakenAndMarkFree();
- int32_t status = pthread_mutex_unlock(&mutex_);
+ const int32_t status = pthread_mutex_unlock(&mutex_);
if (status != 0) {
- LOG4CXX_ERROR(logger_, "Failed to unlock mutex");
+ LOG4CXX_ERROR(logger_, "Failed to unlock mutex" << &mutex_ << ": " << strerror(status));
}
}
bool Lock::Try() {
- bool ackquired = false;
-#ifndef NDEBUG
- if ((lock_taken_ > 0) && !is_mutex_recursive_) {
- LOG4CXX_ERROR(logger_, "Trying to lock already taken not recurcive mutex");
- }
-#endif
- switch(pthread_mutex_trylock(&mutex_)) {
- case 0: {
- ackquired = true;
+ const int32_t status = pthread_mutex_trylock(&mutex_);
+ if (status == 0) {
#ifndef NDEBUG
- lock_taken_++;
+ lock_taken_++;
#endif
- } break;
- case EBUSY: {
- ackquired = false;
- } break;
- default: {
- ackquired = false;
- LOG4CXX_ERROR(logger_, "Failed to try lock the mutex");
- }
+ return true;
}
- return ackquired;
+ return false;
}
#ifndef NDEBUG
@@ -146,5 +136,4 @@ void Lock::AssertTakenAndMarkFree() {
}
#endif
-
-} // namespace sync_primitives
+} // namespace sync_primitives
diff --git a/src/components/utils/src/logger_status.cc b/src/components/utils/src/logger_status.cc
index be341b9ad..ea9dfa3f2 100644
--- a/src/components/utils/src/logger_status.cc
+++ b/src/components/utils/src/logger_status.cc
@@ -34,6 +34,6 @@
namespace logger {
-LoggerStatus logger_status = LoggerThreadNotCreated;
+volatile LoggerStatus logger_status = LoggerThreadNotCreated;
} // namespace logger
diff --git a/src/components/utils/src/resource_usage.cc b/src/components/utils/src/resource_usage.cc
index aaa9c1b4a..62c8d25b8 100644
--- a/src/components/utils/src/resource_usage.cc
+++ b/src/components/utils/src/resource_usage.cc
@@ -124,6 +124,8 @@ bool Resources::GetProcInfo(Resources::PidStats& output) {
if (0 >= fd) {
LOG4CXX_ERROR(logger_, "Failed open process proc file : " << GetProcPath() <<
"; error no : " << strerror( errno ) );
+
+ close(fd);
return false;
}
devctl(fd, DCMD_PROC_INFO, &output, sizeof(output), 0);
@@ -148,14 +150,14 @@ bool Resources::GetMemInfo(Resources::MemInfo &output) {
std::string as_path = GetStatPath();
struct stat st;
struct _dir* proc_dir = 0;
- struct dirent* proc_entry = 0;
if (0 == (proc_dir = opendir(proc))) {
LOG4CXX_ERROR(logger_, "Unable to access to " << proc);
result = false;
return result;
}
- if (0 == (proc_entry = readdir(proc_dir))) {
+ if (0 == readdir(proc_dir)) {
LOG4CXX_ERROR(logger_, "Unable to read : " << proc_dir);
+ closedir(proc_dir);
result = false;
return result;
}
diff --git a/src/components/utils/src/rwlock_posix.cc b/src/components/utils/src/rwlock_posix.cc
index 7cc850b25..08edb8cb0 100644
--- a/src/components/utils/src/rwlock_posix.cc
+++ b/src/components/utils/src/rwlock_posix.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,22 +49,44 @@ RWLock::~RWLock() {
}
}
-void RWLock::AcquireForReading() {
+bool RWLock::AcquireForReading() {
if (pthread_rwlock_rdlock(&rwlock_) != 0) {
LOG4CXX_ERROR(logger_, "Failed to acquire rwlock for reading");
+ return false;
}
+ return true;
}
-void RWLock::AcquireForWriting() {
+bool RWLock::TryAcquireForReading() {
+ if (pthread_rwlock_tryrdlock(&rwlock_) != 0) {
+ LOG4CXX_ERROR(logger_, "Failed to acquire rwlock for reading");
+ return false;
+ }
+ return true;
+}
+
+bool RWLock::AcquireForWriting() {
if (pthread_rwlock_wrlock(&rwlock_) != 0) {
LOG4CXX_ERROR(logger_, "Failed to acquire rwlock for writing");
+ return false;
+ }
+ return true;
+}
+
+bool RWLock::TryAcquireForWriting() {
+ if (pthread_rwlock_trywrlock(&rwlock_) != 0) {
+ LOG4CXX_ERROR(logger_, "Failed to acquire rwlock for writing");
+ return false;
}
+ return true;
}
-void RWLock::Release() {
+bool RWLock::Release() {
if (pthread_rwlock_unlock(&rwlock_) != 0) {
LOG4CXX_ERROR(logger_, "Failed to release rwlock");
+ return false;
}
+ return true;
}
} // namespace sync_primitives
diff --git a/src/components/utils/src/signals_linux.cc b/src/components/utils/src/signals_linux.cc
index 3ded6a587..2e598d1b0 100644
--- a/src/components/utils/src/signals_linux.cc
+++ b/src/components/utils/src/signals_linux.cc
@@ -1,54 +1,63 @@
/*
-* 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 <csignal>
#include <cstdlib>
#include <stdint.h>
+#include "utils/signals.h"
+
namespace utils {
-bool SubscribeToTerminateSignal(void (*func)(int32_t p)) {
+bool SubscribeToTerminateSignal(sighandler_t func) {
struct sigaction act;
act.sa_handler = func;
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
- return (sigaction(SIGINT, &act, NULL) == 0)
- && (sigaction(SIGTERM, &act, NULL) == 0);
+ bool sigint_subscribed = (sigaction(SIGINT, &act, NULL) == 0);
+ bool sigterm_subscribed = (sigaction(SIGTERM, &act, NULL) == 0);
+
+ return sigint_subscribed && sigterm_subscribed;
}
-bool ResetSubscribeToTerminateSignal() {
- void (*prev_func)(int32_t p);
- prev_func = signal(SIGINT, SIG_DFL);
- return (SIG_ERR != prev_func);
+bool SubscribeToFaultSignal(sighandler_t func) {
+ struct sigaction act;
+ act.sa_handler = func;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = SA_RESETHAND; // we only want to catch SIGSEGV once to flush logger queue
+
+ bool sigsegv_subscribed = (sigaction(SIGSEGV, &act, NULL) == 0);
+
+ return sigsegv_subscribed;
}
} // namespace utils
diff --git a/src/components/utils/src/system.cc b/src/components/utils/src/system.cc
index ee90315db..70659419a 100644
--- a/src/components/utils/src/system.cc
+++ b/src/components/utils/src/system.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -42,6 +42,7 @@
#include <algorithm>
#include <functional>
#include <cstring>
+#include <iostream>
#include "utils/logger.h"
#include "utils/system.h"
@@ -66,15 +67,23 @@ System::System(const std::string& file, const std::string& command)
argv_.push_back(command);
}
-bool System::Execute() {
- return Execute(false);
-}
-
System& System::Add(const std::string& arg) {
argv_.push_back(arg);
return *this;
}
+std::string System::command() const {
+ return command_;
+}
+
+std::vector<std::string> System::argv() const {
+ return argv_;
+}
+
+bool System::Execute() {
+ return Execute(false);
+}
+
#ifdef __QNX__
bool System::Execute(bool wait) {
@@ -89,7 +98,7 @@ bool System::Execute(bool wait) {
if (ret == -1) {
LOG4CXX_ERROR(logger_, "Can't execute command: " << command_
- << " Errno is: " << std::strerror(errno));
+ << " Errno is: " << std::strerror(errno));
return false;
}
diff --git a/src/components/utils/src/threads/posix_thread.cc b/src/components/utils/src/threads/posix_thread.cc
index 3f7e006ec..3972a40eb 100644
--- a/src/components/utils/src/threads/posix_thread.cc
+++ b/src/components/utils/src/threads/posix_thread.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,125 +31,168 @@
*/
#include <errno.h>
-
#include <limits.h>
#include <stddef.h>
#include <signal.h>
-#include "utils/atomic.h"
+#ifdef BUILD_TESTS
+// Temporary fix for UnitTest until APPLINK-9987 is resolved
+#include <unistd.h>
+#endif
+
#include "utils/threads/thread.h"
-#include "utils/threads/thread_manager.h"
-#include "utils/logger.h"
#include "pthread.h"
-
+#include "utils/atomic.h"
+#include "utils/threads/thread_delegate.h"
+#include "utils/logger.h"
#ifndef __QNXNTO__
- const int EOK = 0;
+const int EOK = 0;
#endif
#if defined(OS_POSIX)
- const size_t THREAD_NAME_SIZE = 15;
+const size_t THREAD_NAME_SIZE = 15;
#endif
namespace threads {
CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
-namespace {
-
-static void* threadFunc(void* arg) {
- LOG4CXX_INFO(logger_, "Thread #" << pthread_self() << " started successfully");
- threads::Thread* thread = static_cast<threads::Thread*>(arg);
- threads::ThreadDelegate* delegate = thread->delegate();
- delegate->threadMain();
- thread->set_running(false);
- MessageQueue<ThreadManager::ThreadDesc>& threads = ::threads::ThreadManager::instance()->threads_to_terminate;
- if (!threads.IsShuttingDown()) {
- LOG4CXX_INFO(logger_, "Pushing thread #" << pthread_self() << " to join queue");
- ThreadManager::ThreadDesc desc = { pthread_self(), delegate };
- threads.push(desc);
- }
- LOG4CXX_INFO(logger_, "Thread #" << pthread_self() << " exited successfully");
- return NULL;
-}
+size_t Thread::kMinStackSize = PTHREAD_STACK_MIN; /* Ubuntu : 16384 ; QNX : 256; */
+void Thread::cleanup(void* arg) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Thread* thread = reinterpret_cast<Thread*>(arg);
+ sync_primitives::AutoLock auto_lock(thread->state_lock_);
+ thread->isThreadRunning_ = false;
+ thread->state_cond_.Broadcast();
}
-size_t Thread::kMinStackSize = PTHREAD_STACK_MIN; /* Ubuntu : 16384 ; QNX : 256; */
+void* Thread::threadFunc(void* arg) {
+ // 0 - state_lock unlocked
+ // stopped = 0
+ // running = 0
+ // finalized = 0
+ // 4 - state_lock unlocked
+ // stopped = 1
+ // running = 1
+ // finalized = 0
+ // 5 - state_lock unlocked
+ // stopped = 1
+ // running = 1
+ // finalized = 1
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
+ LOG4CXX_DEBUG(logger_,
+ "Thread #" << pthread_self() << " started successfully");
+
+ threads::Thread* thread = reinterpret_cast<Thread*>(arg);
+ DCHECK(thread);
+
+ pthread_cleanup_push(&cleanup, thread);
+
+ thread->state_lock_.Acquire();
+ thread->state_cond_.Broadcast();
+
+ while (!thread->finalized_) {
+ LOG4CXX_DEBUG(logger_, "Thread #" << pthread_self() << " iteration");
+ thread->run_cond_.Wait(thread->state_lock_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Thread #" << pthread_self() << " execute. " << "stopped_ = " << thread->stopped_ << "; finalized_ = " << thread->finalized_);
+ if (!thread->stopped_ && !thread->finalized_) {
+ thread->isThreadRunning_ = true;
+ pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+ pthread_testcancel();
+
+ thread->state_lock_.Release();
+ thread->delegate_->threadMain();
+ thread->state_lock_.Acquire();
+
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
+ thread->isThreadRunning_ = false;
+ }
+ thread->state_cond_.Broadcast();
+ LOG4CXX_DEBUG(logger_,
+ "Thread #" << pthread_self() << " finished iteration");
+ }
-/*
-void ThreadBase::set_name(const std::string name) {
- std::string trimname = name.erase(15);
- if(pthread_setname_np(thread_handle_, trimname.c_str()) != EOK) {
- LOG4CXX_WARN(logger_, "Couldn't set pthread name \""
- << trimname
- << "\", error code "
- << pthread_result
- << " ("
- << strerror(pthread_result)
- << ")");
- }
+ thread->state_lock_.Release();
+ pthread_cleanup_pop(1);
+
+ LOG4CXX_DEBUG(logger_,
+ "Thread #" << pthread_self() << " exited successfully");
+ return NULL;
}
-*/
-
-void Thread::SetNameForId(const Id& thread_id, const std::string& name) {
- std::string nm = name;
- std::string& trimname = nm.size() > 15 ? nm.erase(15) : nm;
- const int rc = pthread_setname_np(thread_id.id_, trimname.c_str());
- if(rc == EOK) {
- LOG4CXX_WARN(logger_, "Couldn't set pthread name \""
- << trimname
- << "\", error code "
- << rc
- << " ("
- << strerror(rc)
- << ")");
+
+void Thread::SetNameForId(const PlatformThreadHandle& thread_id,
+ std::string name) {
+ if (name.size() > THREAD_NAME_SIZE)
+ name.erase(THREAD_NAME_SIZE);
+ const int rc = pthread_setname_np(thread_id, name.c_str());
+ if (rc != EOK) {
+ LOG4CXX_WARN(
+ logger_,
+ "Couldn't set pthread name \"" << name << "\", error code " << rc << " (" << strerror(rc) << ")");
}
}
Thread::Thread(const char* name, ThreadDelegate* delegate)
- : name_(name ? name : "undefined"),
- delegate_(delegate),
- thread_handle_(0),
- thread_options_(),
- isThreadRunning_(0) {
-}
-
-ThreadDelegate* Thread::delegate() const {
- return delegate_;
+ : name_(name ? name : "undefined"),
+ delegate_(delegate),
+ handle_(0),
+ thread_options_(),
+ isThreadRunning_(0),
+ stopped_(false),
+ finalized_(false),
+ thread_created_(false) {
}
bool Thread::start() {
- return startWithOptions(thread_options_);
+ return start(thread_options_);
}
-Thread::Id Thread::CurrentId() {
- return Id(pthread_self());
+PlatformThreadHandle Thread::CurrentId() {
+ return pthread_self();
}
-bool Thread::startWithOptions(const ThreadOptions& options) {
- LOG4CXX_TRACE_ENTER(logger_);
+bool Thread::start(const ThreadOptions& options) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ // 1 - state_lock locked
+ // stopped = 0
+ // running = 0
+
if (!delegate_) {
- NOTREACHED();
- LOG4CXX_ERROR(logger_, "NULL delegate");
- LOG4CXX_TRACE_EXIT(logger_);
+ LOG4CXX_ERROR(logger_,
+ "Cannot start thread " << name_ << ": delegate is NULL");
+ // 0 - state_lock unlocked
return false;
}
+ if (isThreadRunning_) {
+ LOG4CXX_TRACE(
+ logger_,
+ "EXIT thread "<< name_ << " #" << handle_ << " is already running");
+ return true;
+ }
+
thread_options_ = options;
pthread_attr_t attributes;
int pthread_result = pthread_attr_init(&attributes);
if (pthread_result != EOK) {
- LOG4CXX_WARN(logger_,"Couldn't init pthread attributes. Error code = "
- << pthread_result << "(\"" << strerror(pthread_result) << "\")");
+ LOG4CXX_WARN(
+ logger_,
+ "Couldn't init pthread attributes. Error code = " << pthread_result << " (\"" << strerror(pthread_result) << "\")");
}
if (!thread_options_.is_joinable()) {
pthread_result = pthread_attr_setdetachstate(&attributes, PTHREAD_CREATE_DETACHED);
if (pthread_result != EOK) {
- LOG4CXX_WARN(logger_,"Couldn't set detach state attribute.. Error code = "
- << pthread_result << "(\"" << strerror(pthread_result) << "\")");
+ LOG4CXX_WARN(
+ logger_,
+ "Couldn't set detach state attribute. Error code = " << pthread_result << " (\"" << strerror(pthread_result) << "\")");
thread_options_.is_joinable(false);
}
}
@@ -158,72 +201,88 @@ bool Thread::startWithOptions(const ThreadOptions& options) {
if (stack_size >= Thread::kMinStackSize) {
pthread_result = pthread_attr_setstacksize(&attributes, stack_size);
if (pthread_result != EOK) {
- LOG4CXX_WARN(logger_,"Couldn't set stacksize = " << stack_size <<
- ". Error code = " << pthread_result << "(\""
- << strerror(pthread_result) << "\")");
+ LOG4CXX_WARN(
+ logger_,
+ "Couldn't set stacksize = " << stack_size << ". Error code = " << pthread_result << " (\"" << strerror(pthread_result) << "\")");
}
}
+ else {
+ ThreadOptions thread_options_temp(Thread::kMinStackSize, thread_options_.is_joinable());
+ thread_options_ = thread_options_temp;
+ }
- pthread_result = pthread_create(&thread_handle_, &attributes, threadFunc, this);
- isThreadRunning_ = (pthread_result == EOK);
- if (!isThreadRunning_) {
- LOG4CXX_WARN(logger_, "Couldn't create thread. Error code = "
- << pthread_result << "(\"" << strerror(pthread_result) << "\")");
- } else {
- LOG4CXX_INFO(logger_,"Created thread: " << name_);
- SetNameForId(Id(thread_handle_), name_);
+ if (!thread_created_) {
+ // state_lock 1
+ pthread_result = pthread_create(&handle_, &attributes, threadFunc, this);
+ if (pthread_result == EOK) {
+ LOG4CXX_DEBUG(logger_, "Created thread: " << name_);
+ SetNameForId(handle_, name_);
+ // state_lock 0
+ // possible concurrencies: stop and threadFunc
+ state_cond_.Wait(auto_lock);
+ thread_created_ = true;
+ } else {
+ LOG4CXX_ERROR(
+ logger_,
+ "Couldn't create thread " << name_ << ". Error code = " << pthread_result << " (\"" << strerror(pthread_result) << "\")");
+ }
}
- LOG4CXX_TRACE_EXIT(logger_);
- return isThreadRunning_;
+ stopped_ = false;
+ run_cond_.NotifyOne();
+ LOG4CXX_DEBUG(
+ logger_,
+ "Thread " << name_ << " #" << handle_ << " started. pthread_result = " << pthread_result);
+ pthread_attr_destroy(&attributes);
+ return pthread_result == EOK;
}
void Thread::stop() {
- LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(state_lock_);
- if (!atomic_post_clr(&isThreadRunning_))
- {
- return;
- }
+ stopped_ = true;
- if (delegate_ && !delegate_->exitThreadMain()) {
- if (thread_handle_ != pthread_self()) {
- LOG4CXX_WARN(logger_, "Cancelling thread #" << thread_handle_);
- const int pthread_result = pthread_cancel(thread_handle_);
- if (pthread_result != EOK) {
- LOG4CXX_WARN(logger_,
- "Couldn't cancel thread (#" << thread_handle_ << " \"" << name_ <<
- "\") from thread #" << pthread_self() << ". Error code = "
- << pthread_result << " (\"" << strerror(pthread_result) << "\")");
- }
- } else {
- LOG4CXX_ERROR(logger_,
- "Couldn't cancel the same thread (#" << thread_handle_
- << "\"" << name_ << "\")");
- }
+ LOG4CXX_DEBUG(logger_, "Stopping thread #" << handle_
+ << " \"" << name_ << " \"");
+
+ if (delegate_ && isThreadRunning_) {
+ delegate_->exitThreadMain();
}
- LOG4CXX_TRACE_EXIT(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "Stopped thread #" << handle_ << " \"" << name_ << " \"");
}
-bool Thread::Id::operator==(const Thread::Id& other) const {
- return pthread_equal(id_, other.id_) != 0;
-}
+void Thread::join() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(!pthread_equal(pthread_self(), handle_));
-std::ostream& operator<<(std::ostream& os, const Thread::Id& thread_id) {
- char name[32];
- if(pthread_getname_np(thread_id.Handle(), name, 32) == 0) {
- os << name;
+ stop();
+
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ run_cond_.NotifyOne();
+ if (isThreadRunning_) {
+ if (!pthread_equal(pthread_self(), handle_)) {
+ state_cond_.Wait(auto_lock);
+ }
}
- return os;
+}
+
+Thread::~Thread() {
+ finalized_ = true;
+ stopped_ = true;
+ join();
+ pthread_join(handle_, NULL);
}
Thread* CreateThread(const char* name, ThreadDelegate* delegate) {
- return new Thread(name, delegate);
+ Thread* thread = new Thread(name, delegate);
+ delegate->set_thread(thread);
+ return thread;
}
void DeleteThread(Thread* thread) {
delete thread;
}
-
} // namespace threads
diff --git a/src/components/utils/src/threads/pulse_thread_delegate.cc b/src/components/utils/src/threads/pulse_thread_delegate.cc
index 8c580bea8..68db5dcbe 100644
--- a/src/components/utils/src/threads/pulse_thread_delegate.cc
+++ b/src/components/utils/src/threads/pulse_thread_delegate.cc
@@ -91,7 +91,7 @@ void PulseThreadDelegate::threadMain() {
Finalize();
}
-bool PulseThreadDelegate::exitThreadMain() {
+void PulseThreadDelegate::exitThreadMain() {
run_ = false;
LOG4CXX_TRACE(logger_, "Disconnecting from QNX channel " << chid_);
@@ -109,8 +109,6 @@ bool PulseThreadDelegate::exitThreadMain() {
else {
LOG4CXX_WARN(logger_, "Failed to destroy QNX channel " << chid_);
}
-
- return true;
}
} // namespace threads
diff --git a/src/components/utils/src/threads/thread_delegate.cc b/src/components/utils/src/threads/thread_delegate.cc
index 13271166f..1436ea337 100644
--- a/src/components/utils/src/threads/thread_delegate.cc
+++ b/src/components/utils/src/threads/thread_delegate.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -40,7 +40,7 @@
namespace threads {
ThreadDelegate::~ThreadDelegate() {
- if(thread_) {
+ if (thread_) {
thread_->set_delegate(NULL);
}
}
@@ -60,4 +60,4 @@ void ThreadDelegate::set_thread(Thread *thread) {
thread_ = thread;
}
-}
+} // namespace threads
diff --git a/src/components/utils/src/threads/thread_validator.cc b/src/components/utils/src/threads/thread_validator.cc
index 5e9c88a7c..99b812c45 100644
--- a/src/components/utils/src/threads/thread_validator.cc
+++ b/src/components/utils/src/threads/thread_validator.cc
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,7 @@ SingleThreadSimpleValidator::~SingleThreadSimpleValidator() {
}
void SingleThreadSimpleValidator::AssertRunningOnCreationThread() const {
- Thread::Id current_id = Thread::CurrentId();
+ PlatformThreadHandle current_id = Thread::CurrentId();
if (creation_thread_id_ != current_id) {
LOG4CXX_ERROR(logger_, "Single-threaded object created at thread "
<< creation_thread_id_
@@ -60,6 +60,11 @@ void SingleThreadSimpleValidator::AssertRunningOnCreationThread() const {
}
}
+PlatformThreadHandle SingleThreadSimpleValidator::creation_thread_id() const
+{
+ return creation_thread_id_;
+}
+
SingleThreadValidator::SingleThreadValidator()
: owning_thread_id_(Thread::CurrentId()){
@@ -68,12 +73,12 @@ SingleThreadValidator::SingleThreadValidator()
SingleThreadValidator::~SingleThreadValidator() {
}
-void SingleThreadValidator::PassToThread(Thread::Id thread_id) const {
+void SingleThreadValidator::PassToThread(PlatformThreadHandle thread_id) const {
owning_thread_id_ = thread_id;
}
void SingleThreadValidator::AssertRunningOnValidThread() const {
- Thread::Id current_id = Thread::CurrentId();
+ PlatformThreadHandle current_id = Thread::CurrentId();
if (owning_thread_id_ != current_id) {
LOG4CXX_ERROR(logger_, "Single-threaded object owned by thread "
<< owning_thread_id_
diff --git a/src/components/utils/test/CMakeLists.txt b/src/components/utils/test/CMakeLists.txt
index a9ed5acda..d194f7628 100644
--- a/src/components/utils/test/CMakeLists.txt
+++ b/src/components/utils/test/CMakeLists.txt
@@ -1,17 +1,113 @@
+# 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.
+
+if(BUILD_TESTS)
+
include_directories (
+ ${JSONCPP_INCLUDE_DIRECTORY}
${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/include
- ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/gtest/include)
+ ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/gtest/include
+ ${COMPONENTS_DIR}/utils/include/utils
+ ${COMPONENTS_DIR}/include/utils
+ ${COMPONENTS_DIR}/rpc_base/include
+ ${COMPONENTS_DIR}/utils/test/include
+)
set(testSources
- main.cc
+ messagemeter_test.cc
file_system_test.cc
- date_time_test.cc)
+ #date_time_test.cc
+ system_test.cc
+ signals_linux_test.cc
+ thread_validator_test.cc
+ conditional_variable_test.cc
+ #message_queue_test.cc
+ resource_usage_test.cc
+ bitstream_test.cc
+ prioritized_queue_test.cc
+ data_accessor_test.cc
+ lock_posix_test.cc
+ singleton_test.cc
+ #posix_thread_test.cc
+ stl_utils_test.cc
+ #timer_thread_test.cc
+ rwlock_posix_test.cc
+ async_runner_test.cc
+ #shared_ptr_test.cc
+ #scope_guard_test.cc
+ #atomic_object_test.cc
+)
set(testLibraries
gmock
- gtest
- Utils)
+ Utils
+ Policy
+)
+
+include_directories(${COMPONENTS_DIR}/policy/src/policy/policy_table/table_struct_ext)
+
+if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ # --- Tests for QDB Wrapper
+ list (APPEND testSources
+ # ./qdb_wrapper/sql_database_test.cc
+ # ./qdb_wrapper/sql_query_test.cc
+ )
+ file(COPY qdbserver.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+ file(COPY test-qdb.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+ file(COPY policy.sql DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+else ()
+ # --- Tests for SQLite Wrapper
+ find_package(Sqlite3 REQUIRED)
+ list (APPEND testSources
+ # ./sqlite_wrapper/sql_database_test.cc
+ # ./sqlite_wrapper/sql_query_test.cc
+ # generated_code_with_sqlite_test.cc
+
+ # TODO{ALeshin} APPLINK-11132 AssertTrue in SetUpTestCase() return false
+ #policy_manager_impl_stress_test.cc
+ )
+ list (APPEND testLibraries sqlite3)
+endif()
+
+if (ENABLE_LOG)
+ list(APPEND testSources auto_trace_test.cc)
+ list(APPEND testSources log_message_loop_thread_test.cc)
+endif()
+
+if (BUILD_BACKTRACE_SUPPORT)
+ list(APPEND testSources back_trace_test.cc)
+endif()
+
+file(COPY testscript.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-add_executable(utils_test ${testSources})
-target_link_libraries(utils_test ${testLibraries})
+create_test("utils_test" "${testSources}" "${testLibraries}")
+endif()
diff --git a/src/components/utils/test/async_runner_test.cc b/src/components/utils/test/async_runner_test.cc
new file mode 100644
index 000000000..e0db33bb9
--- /dev/null
+++ b/src/components/utils/test/async_runner_test.cc
@@ -0,0 +1,141 @@
+/*
+ * 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 <ctime>
+#include "lock.h"
+#include "threads/async_runner.h"
+#include "utils/conditional_variable.h"
+
+#include "gtest/gtest.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+using namespace sync_primitives;
+using namespace threads;
+
+namespace {
+uint32_t check_value = 0;
+}
+
+// ThreadDelegate successor
+class TestThreadDelegate : public ThreadDelegate {
+ public:
+ void threadMain() {
+ ++check_value;
+ }
+};
+
+class AsyncRunnerTest : public ::testing::Test {
+ public:
+ AsyncRunnerTest()
+ : kDelegatesNum_(1),
+ asr_pt_(NULL) {
+ CreateAsyncRunner();
+ CreateThreadsArray();
+ }
+
+ ~AsyncRunnerTest() {
+ DeleteAsyncRunner();
+ DeleteThreadsArray();
+ }
+
+ protected:
+ Lock test_lock_;
+ uint32_t kDelegatesNum_;
+ ConditionalVariable cond_var_;
+ TestThreadDelegate **delegates_;
+ AsyncRunner *asr_pt_;
+
+ void CreateThreadsArray() {
+ srand(std::time(NULL));
+ kDelegatesNum_ = (rand() % 20 + 1);
+ delegates_ = new TestThreadDelegate*[kDelegatesNum_];
+ }
+
+ void DeleteThreadsArray() {
+ delete[] delegates_;
+ }
+
+ void CreateAsyncRunner() {
+ asr_pt_ = new AsyncRunner("test");
+ }
+ void DeleteAsyncRunner() {
+ delete asr_pt_;
+ }
+};
+
+TEST_F(AsyncRunnerTest, ASyncRunManyDelegates_ExpectSuccessfulAllDelegatesRun) {
+ AutoLock lock(test_lock_);
+ // Clear global value before test
+ check_value = 0;
+ // Create Delegates and run
+ for (unsigned int i = 0; i < kDelegatesNum_; ++i) {
+ delegates_[i] = new TestThreadDelegate();
+ asr_pt_->AsyncRun(delegates_[i]);
+ }
+ // Wait for 2 secs. Give this time to delegates to be run
+ cond_var_.WaitFor(lock, 2000);
+ // Expect all delegates run successfully
+ EXPECT_EQ(kDelegatesNum_, check_value);
+}
+
+//TODO(VVeremjova) APPLINK-12834 Sometimes delegates do not run
+TEST_F(AsyncRunnerTest, DISABLED_RunManyDelegatesAndStop_ExpectSuccessfulDelegatesStop) {
+ AutoLock lock(test_lock_);
+ // Clear global value before test
+ check_value = 0;
+ // Create Delegates
+ for (unsigned int i = 0; i < kDelegatesNum_; ++i) {
+ delegates_[i] = new TestThreadDelegate();
+ }
+ // Wait for 2 secs
+ cond_var_.WaitFor(lock, 2000);
+ // Run created delegates
+ for (unsigned int i = 0; i < kDelegatesNum_; ++i) {
+ if (kDelegatesNum_ > 1) {
+ if (i == kDelegatesNum_ / 2) {
+ asr_pt_->Stop();
+ }
+ }
+ asr_pt_->AsyncRun(delegates_[i]);
+ }
+ // Expect 3 delegates run successlully. The other stopped.
+ EXPECT_EQ(kDelegatesNum_ / 2, check_value);
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
+
diff --git a/src/components/utils/test/atomic_object_test.cc b/src/components/utils/test/atomic_object_test.cc
new file mode 100644
index 000000000..2072b955e
--- /dev/null
+++ b/src/components/utils/test/atomic_object_test.cc
@@ -0,0 +1,55 @@
+/*
+ * 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 utils {
+
+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);
+}
+
+} // utils
+} // test
diff --git a/src/components/utils/test/auto_trace_test.cc b/src/components/utils/test/auto_trace_test.cc
new file mode 100644
index 000000000..a53f4aa1e
--- /dev/null
+++ b/src/components/utils/test/auto_trace_test.cc
@@ -0,0 +1,102 @@
+/*
+ * 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/auto_trace.h"
+#include "logger.h"
+#include <fstream>
+
+namespace test {
+namespace components {
+namespace utils {
+
+using namespace ::logger;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "AutoTraceTestLog");
+
+void Preconditions() {
+ //delete file with previous logs
+ const char* file_name = "AutoTraceTestLogFile.log";
+ std::remove(file_name);
+}
+
+void InitLogger() {
+ INIT_LOGGER("log4cxx.properties");
+}
+
+void CreateDeleteAutoTrace(const std::string & testlog) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, testlog);
+}
+
+bool CheckTraceInFile(const std::string & testlog) {
+
+ bool isLogFound = false;
+ std::string line;
+
+ std::ifstream file_log("AutoTraceTestLogFile.log");
+
+ if (file_log.is_open()) {
+ while (getline(file_log, line)) {
+ std::size_t found = line.find(testlog);
+ std::size_t founddebug = line.find("DEBUG");
+ if ((found != std::string::npos) && (founddebug != std::string::npos)) {
+ isLogFound = true;
+ break;
+ }
+ }
+ file_log.close();
+ } else {
+ std::cout << "file cannot be opened \n";
+ }
+ return isLogFound;
+}
+
+void DeinitLogger() {
+ DEINIT_LOGGER();
+}
+
+//TODO(VVeremjova) APPLINK-12832 Logger does not write debug information in file
+TEST(AutoTraceTest, DISABLED_Basic) {
+ const std::string testlog =
+ "Test trace is working!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
+ Preconditions();
+ InitLogger();
+ CreateDeleteAutoTrace(testlog);
+ DeinitLogger();
+
+ ASSERT_TRUE(CheckTraceInFile(testlog));
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/test/main.cc b/src/components/utils/test/back_trace_test.cc
index edfc998db..12d5df81f 100644
--- a/src/components/policy/test/main.cc
+++ b/src/components/utils/test/back_trace_test.cc
@@ -30,9 +30,24 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "utils/back_trace.h"
-int main(int argc, char** argv) {
- testing::InitGoogleMock(&argc, argv);
- return RUN_ALL_TESTS();
+namespace test {
+namespace components {
+namespace utils {
+
+using namespace ::utils;
+
+TEST(BackTraceTest, CallStackShouldNotBeEmpty) {
+
+ //arrange
+ Backtrace newtrace = Backtrace();
+ std::vector < std::string > symbols = newtrace.CallStack();
+ //assert
+ ASSERT_FALSE(symbols.empty());
}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/bitstream_test.cc b/src/components/utils/test/bitstream_test.cc
new file mode 100644
index 000000000..07a80bde0
--- /dev/null
+++ b/src/components/utils/test/bitstream_test.cc
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <unistd.h>
+#include "gtest/gtest.h"
+#include "utils/macro.h"
+#include "utils/bitstream.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+using ::utils::BitStream;
+
+TEST(BitstreamTest, CreateBitstream_WithDataWithDatasize_BitStreamIsGood) {
+
+ //arrange
+ uint8_t data = 10;
+ size_t bits = 2;
+ BitStream bs(&data, bits);
+
+ //assert
+ EXPECT_TRUE(bs.IsGood());
+}
+
+TEST(BitstreamTest, ExtractBitstreamInUint8_ExtractAllData_BitStreamIsGoodDataExtractedCorrectly) {
+
+ //arrange
+ uint8_t data = 10;
+ size_t bits = 2;
+ BitStream bs(&data, bits);
+
+ uint8_t extract_data = 0;
+ Extract(&bs, &extract_data);
+
+ //assert
+ EXPECT_TRUE(bs.IsGood());
+
+ EXPECT_EQ(data, extract_data);
+}
+
+TEST(BitstreamTest, ExtractBitstreamInUint8_WithDataWithZeroSize_BitStreamIsBad) {
+
+ //arrange
+ uint8_t data = 10;
+ size_t bits = 0;
+ BitStream bs(&data, bits);
+
+ uint8_t extract_data = 0;
+ Extract(&bs, &extract_data);
+
+ //assert
+ EXPECT_TRUE(bs.IsBad());
+}
+
+TEST(BitstreamTest, ExtractBitstreamInUint32_WithDatasizeEq4_BitStreamIsGoodDataExtractedCorrectly) {
+
+ //arrange
+ uint8_t data = 10;
+ size_t bits = 4;
+ BitStream bs(&data, bits);
+
+ uint32_t extract_data = 0;
+ Extract(&bs, &extract_data);
+
+ //assert
+ EXPECT_TRUE(bs.IsGood());
+
+}
+
+TEST(BitstreamTest, ExtractBitstreamInUint32_DatasizeLess4_BitStreamIsBad) {
+
+ //arrange
+ uint8_t data = 10;
+ size_t bits = 3;
+ BitStream bs(&data, bits);
+
+ uint32_t extract_data = 0;
+ Extract(&bs, &extract_data);
+
+ //assert
+ EXPECT_TRUE(bs.IsBad());
+
+}
+
+TEST(BitstreamTest, ExtractFullBitstream_WithDataWithDatasize_BitStreamIsGood) {
+
+ //arrange
+ uint8_t data = 10;
+ size_t bits = 8;
+ BitStream bs(&data, bits);
+
+ uint8_t extract_data = 0;
+
+ Extract(&bs, &extract_data, bits);
+
+ //assert
+ EXPECT_TRUE(bs.IsGood());
+
+ EXPECT_EQ(data, extract_data);
+}
+
+TEST(BitstreamTest, ExtractBitstreamInString_WithDataWithDatasize_BitStreamIsGood) {
+
+ //arrange
+ uint8_t data = 10;
+ size_t bits = 2;
+ BitStream bs(&data, bits);
+
+ std::string strdata = "";
+ size_t length = strdata.length();
+
+ Extract(&bs, &strdata, length);
+
+ //assert
+ EXPECT_TRUE(bs.IsGood());
+}
+
+TEST(BitstreamTest, CreateBitstream_NoDataZeroDatasize_BitStreamIsGood) {
+
+ //arrange
+ uint8_t *data = NULL;
+ size_t bits = 0;
+ BitStream bs(data, bits);
+
+ //assert
+ EXPECT_TRUE(bs.IsGood());
+}
+
+TEST(BitstreamTest, CreateBitstream_NoDataWithUpperboundDataSize_BitStreamIsGood) {
+
+ //arrange
+ uint8_t *data = NULL;
+ size_t bits = 65535;
+ BitStream bs(data, bits);
+
+ //assert
+ EXPECT_TRUE(bs.IsGood());
+}
+
+TEST(BitstreamTest, CreateBitstream_WithUpperboundDataWithLessDataSize_BitStreamIsGood) {
+
+ //arrange
+ uint8_t data = 255;
+ size_t bits = sizeof(char);
+ BitStream bs(&data, bits);
+
+ //assert
+ EXPECT_TRUE(bs.IsGood());
+}
+
+TEST(BitstreamTest, ExtractBitstream_WithUpperboundDataWithLessDataSize_BitStreamIsGood) {
+
+ //arrange
+ uint8_t data = 255;
+ size_t bits = sizeof(char);
+ BitStream bs(&data, bits);
+
+ uint8_t extract_data = 0;
+ Extract(&bs, &extract_data, bits);
+
+ //assert
+ EXPECT_TRUE(bs.IsGood());
+}
+
+TEST(BitstreamTest, ExtractBitstream_WithUpperboundDataWithZeroDataSize_BitStreamIsGood) {
+
+ //arrange
+ uint8_t data = 255;
+ size_t bits = 0;
+ BitStream bs(&data, bits);
+
+ uint8_t extract_data = 0;
+ Extract(&bs, &extract_data, bits);
+
+ //assert
+ EXPECT_TRUE(bs.IsGood());
+}
+
+TEST(BitstreamTest, ExtractBitstream_WithDataMarkedBad_ExpectIsBad) {
+
+ //arrange
+ uint8_t data = 255;
+ size_t bits = sizeof(int);
+ BitStream bs(&data, bits);
+ //assert
+ EXPECT_TRUE(bs.IsGood());
+ //act
+ bs.MarkBad();
+
+ //assert
+ EXPECT_TRUE(bs.IsBad());
+ //act
+ Extract(&bs, &data, bits);
+ //arrange
+ EXPECT_TRUE(bs.IsBad());
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/conditional_variable_test.cc b/src/components/utils/test/conditional_variable_test.cc
new file mode 100644
index 000000000..a898732ff
--- /dev/null
+++ b/src/components/utils/test/conditional_variable_test.cc
@@ -0,0 +1,132 @@
+/*
+ * 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 <pthread.h>
+#include <iostream>
+
+#include "lock.h"
+#include "macro.h"
+
+#include "gtest/gtest.h"
+#include "utils/conditional_variable.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+class ConditionalVariableTest : public ::testing::Test {
+ public:
+ ConditionalVariableTest()
+ : test_value_("initialized"),
+ counter_(0) {
+ }
+ void check_counter();
+ void task_one();
+
+ static void* check_counter_helper(void *context) {
+ (reinterpret_cast<ConditionalVariableTest *>(context))->check_counter();
+ return NULL;
+ }
+
+ static void* task_one_helper(void *context) {
+ (reinterpret_cast<ConditionalVariableTest *>(context))->task_one();
+ return NULL;
+ }
+ protected:
+ std::string test_value_;
+ sync_primitives::ConditionalVariable cond_var_;
+ sync_primitives::Lock test_mutex_;
+ unsigned counter_;
+};
+
+// Defines threads behaviour which depends on counter value
+void ConditionalVariableTest::check_counter() {
+ sync_primitives::AutoLock test_lock(test_mutex_);
+ if (counter_ <= 1) {
+ counter_++;
+ cond_var_.Wait(test_mutex_); // Mutex unlock & Thread sleeps until Notification
+ }
+ else if(counter_ == 2) { // Checking for equal 2 in this specific case. Because we were waiting for 2 threads to be finished
+ cond_var_.Broadcast(); // Notify All threads waiting on conditional variable
+ }
+}
+
+// Tasks for threads to begin with
+void ConditionalVariableTest::task_one() {
+ sync_primitives::AutoLock test_lock(test_mutex_);
+ test_value_ = "changed by thread 1";
+ cond_var_.NotifyOne(); // Notify At least one thread waiting on conditional variable
+ test_value_ = "changed again by thread 1";
+}
+
+TEST_F(ConditionalVariableTest, CheckNotifyOne_OneThreadNotified_ExpectSuccessful) {
+ pthread_t thread1;
+ sync_primitives::AutoLock test_lock(test_mutex_);
+ test_value_ = "changed by main thread";
+ const bool thread_created = pthread_create(&thread1,
+ NULL,
+ &ConditionalVariableTest::task_one_helper,
+ this);
+ ASSERT_FALSE(thread_created) << "thread1 is not created!";
+ test_value_ = "changed twice by main thread";
+ cond_var_.WaitFor(test_lock, 2000);
+ std::string last_value("changed again by thread 1");
+ EXPECT_EQ(last_value, test_value_);
+}
+
+TEST_F(ConditionalVariableTest, CheckBroadcast_AllThreadsNotified_ExpectSuccessful) {
+ pthread_t thread1;
+ pthread_t thread2;
+ bool thread_created = pthread_create(&thread1,
+ NULL,
+ &ConditionalVariableTest::check_counter_helper,
+ this);
+ ASSERT_FALSE(thread_created) << "thread1 is not created!";
+ thread_created = pthread_create(&thread2,
+ NULL,
+ &ConditionalVariableTest::check_counter_helper,
+ this);
+ ASSERT_FALSE(thread_created) << "thread2 is not created!";
+ check_counter();
+ EXPECT_EQ(2u, counter_);
+}
+
+TEST_F(ConditionalVariableTest, CheckWaitForWithTimeout1sec_ThreadBlockedForTimeout_ExpectSuccessfulWakeUp) {
+ sync_primitives::AutoLock test_lock(test_mutex_);
+ sync_primitives::ConditionalVariable::WaitStatus wait_st = cond_var_.WaitFor(test_lock, 1000);
+ EXPECT_EQ(sync_primitives::ConditionalVariable::kTimeout, wait_st);
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
+
diff --git a/src/components/utils/test/data_accessor_test.cc b/src/components/utils/test/data_accessor_test.cc
new file mode 100644
index 000000000..105ec8517
--- /dev/null
+++ b/src/components/utils/test/data_accessor_test.cc
@@ -0,0 +1,140 @@
+/*
+ * 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/data_accessor.h"
+#include "utils/lock.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+TEST(DataAccessorTest, CreateDataAccessor) {
+
+ //arrange
+ int test_value = 10;
+ sync_primitives::Lock testSet_lock_;
+ DataAccessor<int> testdata(test_value, testSet_lock_);
+ int data_from_testdata = testdata.GetData();
+
+ //assert
+ EXPECT_EQ(test_value, data_from_testdata);
+}
+
+TEST(DataAccessorTest, CreateDataAccessor_MutexIsLocked_CannotLockItAgain) {
+
+ //arrange
+ int test_value = 10;
+ sync_primitives::Lock testSet_lock_;
+ DataAccessor<int> testdata(test_value, testSet_lock_);
+
+ //assert
+ EXPECT_FALSE(testSet_lock_.Try());
+}
+
+TEST(DataAccessorTest, CopyDataAccessor_GetDataFromDataAccessors) {
+
+ //arrange
+ int test_value = 10;
+ sync_primitives::Lock testSet_lock_;
+ DataAccessor<int> testdata(test_value, testSet_lock_);
+ DataAccessor<int> testdata_copy(testdata);
+
+ int data_from_testdata = testdata.GetData();
+ int data_from_testdata_copy = testdata_copy.GetData();
+
+ //assert
+ EXPECT_EQ(data_from_testdata, data_from_testdata_copy);
+
+ EXPECT_FALSE(testSet_lock_.Try());
+}
+
+TEST(DataAccessorTest,ChangedDataInDataAccessor_ChangeData_DataInDataAccessorIsChanged) {
+
+ //arrange
+ int test_value = 10;
+ sync_primitives::Lock testSet_lock_;
+ DataAccessor<int> testdata(test_value, testSet_lock_);
+ test_value = 0;
+
+ int data_from_testdata_after_change = testdata.GetData();
+
+ //assert
+ EXPECT_EQ(test_value, data_from_testdata_after_change);
+}
+
+TEST(DataAccessorTest, DeleteDataAccessor_CreatedOneDeleteOneThread_MutexIsUnlocked) {
+
+ //arrange
+ int test_value = 10;
+ sync_primitives::Lock testSet_lock_;
+ {
+ DataAccessor<int> testdata(test_value, testSet_lock_);
+
+ //assert
+ EXPECT_FALSE(testSet_lock_.Try());
+ }
+ //assert
+
+ EXPECT_TRUE(testSet_lock_.Try());
+
+ testSet_lock_.Release();
+
+}
+
+TEST(DataAccessorTest, DeleteDataAccessor_CreatedThreadAndCopyDeleteBothThreads_MutexIsUnlocked) {
+
+ //arrange
+ int test_value = 10;
+ sync_primitives::Lock testSet_lock_;
+ {
+ DataAccessor<int> testdata(test_value, testSet_lock_);
+ {
+ DataAccessor<int> testdata_copy(testdata);
+
+ //assert
+ EXPECT_FALSE(testSet_lock_.Try());
+ }
+ //assert
+ EXPECT_FALSE(testSet_lock_.Try());
+
+ }
+
+ //assert
+ EXPECT_TRUE(testSet_lock_.Try());
+ testSet_lock_.Release();
+
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/date_time_test.cc b/src/components/utils/test/date_time_test.cc
index ddcf679a1..db2b10182 100644
--- a/src/components/utils/test/date_time_test.cc
+++ b/src/components/utils/test/date_time_test.cc
@@ -1,128 +1,402 @@
/*
-* 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 <unistd.h>
+ * 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 "gmock/gmock.h"
-
#include "utils/date_time.h"
-namespace test {
-namespace components {
-namespace utils {
+namespace test {
+namespace components {
+namespace utils {
+using namespace date_time;
TEST(DateTimeTest, GetCurrentTime) {
+
+ //arrange
const TimevalStruct time1 = date_time::DateTime::getCurrentTime();
+
+ //assert
ASSERT_NE(0, time1.tv_sec);
ASSERT_GE(time1.tv_usec, 0);
+ //act
const TimevalStruct time2 = date_time::DateTime::getCurrentTime();
+
+ //assert
ASSERT_NE(0, time2.tv_sec);
ASSERT_GE(time2.tv_usec, 0);
- ASSERT_GE(time2.tv_sec, time1.tv_sec);
+ ASSERT_GE(time2.tv_sec, time1.tv_sec);
+}
+
+TEST(DateTimeTest, GetSecs) {
+ //arrange
+ TimevalStruct time;
+ time.tv_sec = 1;
+ time.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECONDS;
+
+ //assert
+ ASSERT_EQ(1, date_time::DateTime::getSecs(time));
}
TEST(DateTimeTest, GetmSecs) {
+ //arrange
TimevalStruct time;
- time.tv_sec = 1;
+ time.tv_sec = 1;
time.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECONDS;
- ASSERT_EQ(time.tv_sec * date_time::DateTime::MILLISECONDS_IN_SECOND +
- time.tv_usec / date_time::DateTime::MICROSECONDS_IN_MILLISECONDS,
- date_time::DateTime::getmSecs(time));
+ int64_t expect_value = time.tv_sec
+ * date_time::DateTime::MILLISECONDS_IN_SECOND
+ + time.tv_usec / date_time::DateTime::MICROSECONDS_IN_MILLISECONDS;
+ //assert
+ ASSERT_EQ(expect_value, date_time::DateTime::getmSecs(time));
}
TEST(DateTimeTest, GetuSecs) {
+ //arrange
TimevalStruct time;
- time.tv_sec = 3;
+ time.tv_sec = 3;
time.tv_usec = 4;
- ASSERT_EQ(time.tv_sec * date_time::DateTime::MILLISECONDS_IN_SECOND *
- date_time::DateTime::MICROSECONDS_IN_MILLISECONDS + time.tv_usec,
- date_time::DateTime::getuSecs(time));
+ int64_t expect_value = time.tv_sec
+ * date_time::DateTime::MILLISECONDS_IN_SECOND
+ * date_time::DateTime::MICROSECONDS_IN_MILLISECONDS + time.tv_usec;
+ //assert
+ ASSERT_EQ(expect_value, date_time::DateTime::getuSecs(time));
}
TEST(DateTimeTest, GetuSecsmSecs) {
+ //arrange
TimevalStruct time;
- time.tv_sec = 5;
+ time.tv_sec = 5;
time.tv_usec = 6;
- ASSERT_EQ( date_time::DateTime::getmSecs(time),
- date_time::DateTime::getuSecs(time) / date_time::DateTime::MICROSECONDS_IN_MILLISECONDS);
+ int64_t expect_value = date_time::DateTime::getuSecs(time)
+ / date_time::DateTime::MICROSECONDS_IN_MILLISECONDS;
+
+ //assert
+ ASSERT_EQ(expect_value, date_time::DateTime::getmSecs(time));
}
TEST(DateTimeTest, CalculateTimeSpan) {
+ //arrange
const TimevalStruct time = date_time::DateTime::getCurrentTime();
const uint32_t sleep_time_mSec = 10;
usleep(sleep_time_mSec * date_time::DateTime::MICROSECONDS_IN_MILLISECONDS);
- ASSERT_GE(date_time::DateTime::calculateTimeSpan(time),
- sleep_time_mSec);
+ //assert
+ ASSERT_GE(date_time::DateTime::calculateTimeSpan(time), sleep_time_mSec);
}
TEST(DateTimeTest, CalculateTimeDiff) {
+
+ //arrange
TimevalStruct time1;
- time1.tv_sec = 1;
+ time1.tv_sec = 1;
time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECONDS;
TimevalStruct time2;
- time2.tv_sec = 3;
+ time2.tv_sec = 3;
time2.tv_usec = 4 * date_time::DateTime::MICROSECONDS_IN_MILLISECONDS;
//time2 to time1
TimevalStruct diff1;
- diff1.tv_sec = time2.tv_sec - time1.tv_sec;
+ 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;
- ASSERT_EQ(mSecDiff,
- date_time::DateTime::calculateTimeDiff(time2, time1));
+ //assert
+ ASSERT_EQ(mSecDiff, date_time::DateTime::calculateTimeDiff(time2, time1));
//time1 to time2
TimevalStruct diff2;
- diff2.tv_sec = time1.tv_sec - time2.tv_sec;
+ 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);
- ASSERT_EQ(mSecDiff2,
- date_time::DateTime::calculateTimeDiff(time1, time2));
+ //assert
+ ASSERT_EQ(mSecDiff2, date_time::DateTime::calculateTimeDiff(time1, time2));
+}
+
+TEST(DateTimeTest, CalculateEqualTimeDiff) {
+ TimevalStruct time1;
+ time1.tv_sec = 1;
+ time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECONDS;
+
+ TimevalStruct time2;
+ time2.tv_sec = 1;
+ time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECONDS;
+
+ ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time2, time1));
+ ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time1, time2));
+}
+
+TEST(DateTimeTest, compareTime) {
+
+ //arrange
+ TimevalStruct time1;
+ time1.tv_sec = 1;
+ time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECONDS;
+
+ TimevalStruct time2;
+ time2.tv_sec = 2;
+ time2.tv_usec = 4 * date_time::DateTime::MICROSECONDS_IN_MILLISECONDS;
+
+ //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));
+
+ //act
+ TimevalStruct time3 = date_time::DateTime::Sub(time2, time1);
+
+ //assert
+ ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time1, time3));
+}
+
+TEST(DateTimeTest, GetSecs_UsecConvertedInSec) {
+ //arrange
+ TimevalStruct time1;
+ time1.tv_sec = 0;
+ time1.tv_usec = date_time::DateTime::MICROSECONDS_IN_SECOND;
+
+ //assert
+ ASSERT_EQ(1, date_time::DateTime::getSecs(time1));
+}
+
+TEST(DateTimeTest, compareTime_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_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));
+}
+
+TEST(DateTimeTest, compareLessTime_UsecConvertedInSec) {
+ //arrange
+ TimevalStruct time1;
+ time1.tv_sec = 1;
+ time1.tv_usec = 0;
+
+ TimevalStruct time2;
+ time2.tv_sec = 0;
+ time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+
+ //assert
+ ASSERT_TRUE(date_time::DateTime::Less(time1, time2));
+}
+
+TEST(DateTimeTest, compareGreaterTime_UsecConvertedInSec) {
+ //arrange
+ TimevalStruct time1;
+ time1.tv_sec = 1;
+ time1.tv_usec = 0;
+
+ TimevalStruct time2;
+ time2.tv_sec = 0;
+ time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+
+ //assert
+ ASSERT_TRUE(date_time::DateTime::Greater(time2, time1));
+}
+
+TEST(DateTimeTest, CalculateTimeSub_UsecConvertedInSec) {
+ //arrange
+ TimevalStruct time1;
+ time1.tv_sec = 1;
+ time1.tv_usec = 0;
+
+ TimevalStruct time2;
+ time2.tv_sec = 0;
+ time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+
+ TimevalStruct time3 = date_time::DateTime::Sub(time2, time1);
+
+ //assert
+ ASSERT_EQ(EQUAL, date_time::DateTime::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;
+
+ //assert
+ ASSERT_EQ(3000, date_time::DateTime::calculateTimeDiff(time2, time1));
+ ASSERT_EQ(3000, date_time::DateTime::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;
+
+ //assert
+ ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time2, time1));
+ ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time1, time2));
+}
+
+TEST(DateTimeTest, CalculateEqualTimeSub_UsecConvertedInSec) {
+ //arrange
+ TimevalStruct time1;
+ time1.tv_sec = 3;
+ time1.tv_usec = 0;
+
+ TimevalStruct time2;
+ time2.tv_sec = 2;
+ time2.tv_usec = 1 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+
+ 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));
+}
+
+TEST(DateTimeTest, AddMilliseconds_SetMillisecondMultiplesSecond_ExpectChangeTime) {
+ TimevalStruct time1;
+ time1.tv_sec = 3;
+ time1.tv_usec = 0;
+ uint32_t milliseconds = 7000;
+ date_time::DateTime::AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(10, time1.tv_sec);
+ ASSERT_EQ(0, time1.tv_usec);
+}
+
+TEST(DateTimeTest, AddMilliseconds_SetMillisecondNotMultiplesSecond_ExpectChangeTime) {
+ TimevalStruct time1;
+ 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);
+}
+
+TEST(DateTimeTest, AddMilliseconds_SetMilliSecondLessThenSeconds_ExpectChangeTime) {
+ TimevalStruct time1;
+ 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);
+}
+
+TEST(DateTimeTest, AddMilliseconds_SetMillisecondEqualNull_ExpectNotChangeTime) {
+ TimevalStruct time1;
+ 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);
+}
+
+TEST(DateTimeTest, AddMilliseconds_SetOverlowMicrosecond_ExpectChangeTime) {
+ TimevalStruct time1;
+ 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);
+}
+
+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_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));
+}
+
+
} // namespace utils
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/file_system_test.cc b/src/components/utils/test/file_system_test.cc
index abf09735b..4e36608f9 100644
--- a/src/components/utils/test/file_system_test.cc
+++ b/src/components/utils/test/file_system_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,82 +30,1145 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "gmock/gmock.h"
+#include <algorithm>
+#include <fstream>
+#include "gtest/gtest.h"
#include "utils/file_system.h"
-namespace test {
-namespace components {
-namespace utils {
+namespace test {
+namespace components {
+namespace utils {
-TEST(FileSystemTest, CommonFileSystemTest) {
- // Directory creation
- ASSERT_FALSE(file_system::DirectoryExists("./Test directory"));
+using namespace file_system;
- file_system::CreateDirectory("./Test directory");
+TEST(FileSystemTest, CreateDeleteDirectory) {
- ASSERT_TRUE(file_system::DirectoryExists("./Test directory"));
+ ASSERT_FALSE(DirectoryExists("./Test directory"));
+ // Directory creation
+ CreateDirectory("./Test directory");
- ASSERT_TRUE(file_system::IsDirectory("./Test directory"));
+ EXPECT_TRUE(DirectoryExists("./Test directory"));
+ EXPECT_TRUE(IsDirectory("./Test directory"));
+ // Directory removing
+ EXPECT_TRUE(RemoveDirectory("./Test directory", false));
+ EXPECT_FALSE(DirectoryExists("./Test directory"));
+}
+
+TEST(FileSystemTest, CreateDirectoryTwice) {
+ ASSERT_FALSE(DirectoryExists("./Test directory"));
+ // Directory creation
+ CreateDirectory("./Test directory");
+
+ EXPECT_TRUE(DirectoryExists("./Test directory"));
+ EXPECT_TRUE(IsDirectory("./Test directory"));
+
+ // Create directory second time
+ CreateDirectory("./Test directory");
+ EXPECT_TRUE(DirectoryExists("./Test directory"));
+
+ // Directory removing
+ EXPECT_TRUE(RemoveDirectory("./Test directory", false));
+ //try delete directory again
+ EXPECT_FALSE(RemoveDirectory("./Test directory", false));
+ EXPECT_FALSE(DirectoryExists("./Test directory"));
+}
+
+TEST(FileSystemTest,DeleteDirectoryRecursively) {
+ ASSERT_FALSE(DirectoryExists("./Test directory"));
+ // Create directories
+ CreateDirectory("./Test directory");
+ CreateDirectory("./Test directory/Test directory 2");
+
+ // Create file inside directory
+ EXPECT_TRUE(CreateFile("./Test directory/test file"));
+
+ EXPECT_FALSE(RemoveDirectory("./Test directory", false));
+ EXPECT_TRUE(DirectoryExists("./Test directory"));
+ EXPECT_TRUE(IsDirectory("./Test directory"));
+
+ EXPECT_TRUE(RemoveDirectory("./Test directory", true));
+ EXPECT_FALSE(DirectoryExists("./Test directory"));
+}
+
+TEST(FileSystemTest, CreateDirectoryRecursivelyDeleteRecursively) {
+ ASSERT_FALSE(DirectoryExists("./Test directory"));
+ // Create directories recursively
+ CreateDirectoryRecursively(
+ "./Test directory/Test directory 2/Test directory 3");
+
+ EXPECT_TRUE(DirectoryExists("./Test directory"));
+ EXPECT_TRUE(IsDirectory("./Test directory"));
+
+ EXPECT_TRUE(DirectoryExists("./Test directory/Test directory 2"));
+ EXPECT_TRUE(IsDirectory("./Test directory/Test directory 2"));
+
+ EXPECT_TRUE(
+ DirectoryExists("./Test directory/Test directory 2/Test directory 3"));
+ EXPECT_TRUE(
+ IsDirectory("./Test directory/Test directory 2/Test directory 3"));
+
+ // Delete recursively
+ EXPECT_TRUE(RemoveDirectory("./Test directory", true));
+ EXPECT_FALSE(DirectoryExists("./Test directory"));
+ EXPECT_FALSE(DirectoryExists("./Test directory/Test directory 2"));
+ EXPECT_FALSE(
+ DirectoryExists("./Test directory/Test directory 2/Test directory 3"));
+}
+
+TEST(FileSystemTest, TwiceCreateDirectoryRecursivelyDeleteRecursivelyOnce) {
+ ASSERT_FALSE(DirectoryExists("./Test directory"));
+ // Create directories recursively
+ EXPECT_TRUE(
+ CreateDirectoryRecursively(
+ "./Test directory/Test directory 2/Test directory 3"));
+
+ // Check that all directories are created
+ EXPECT_TRUE(DirectoryExists("./Test directory"));
+ EXPECT_TRUE(IsDirectory("./Test directory"));
+
+ EXPECT_TRUE(DirectoryExists("./Test directory/Test directory 2"));
+ EXPECT_TRUE(IsDirectory("./Test directory/Test directory 2"));
+
+ EXPECT_TRUE(
+ DirectoryExists("./Test directory/Test directory 2/Test directory 3"));
+ EXPECT_TRUE(
+ IsDirectory("./Test directory/Test directory 2/Test directory 3"));
+
+ // Create directories recursively second time
+ EXPECT_TRUE(
+ CreateDirectoryRecursively(
+ "./Test directory/Test directory 2/Test directory 3"));
+
+ EXPECT_TRUE(DirectoryExists("./Test directory"));
+
+ EXPECT_TRUE(DirectoryExists("./Test directory/Test directory 2"));
+
+ EXPECT_TRUE(
+ DirectoryExists("./Test directory/Test directory 2/Test directory 3"));
+
+ // Delete recursively
+ EXPECT_TRUE(RemoveDirectory("./Test directory", true));
+ EXPECT_FALSE(DirectoryExists("./Test directory"));
+ // Delete recursively again is impossible
+ EXPECT_FALSE(RemoveDirectory("./Test directory", true));
+
+ EXPECT_FALSE(DirectoryExists("./Test directory"));
+ EXPECT_FALSE(DirectoryExists("./Test directory/Test directory 2"));
+ EXPECT_FALSE(
+ DirectoryExists("./Test directory/Test directory 2/Test directory 3"));
+}
+
+TEST(FileSystemTest, CreateDeleteFile) {
+ ASSERT_FALSE(FileExists("./test file"));
// File creation
- ASSERT_FALSE(file_system::FileExists("./Test directory/test file"));
+ EXPECT_TRUE(CreateFile("./test file"));
+ EXPECT_FALSE(IsDirectory("./test file"));
- std::vector<unsigned char> data;
- data.push_back('t');
- data.push_back('e');
- data.push_back('s');
- data.push_back('t');
+ // Delete file
+ EXPECT_TRUE(DeleteFile("./test file"));
+ //try delete file again
+ EXPECT_FALSE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, CheckIsDirectory) {
+ ASSERT_FALSE(DirectoryExists("./Test directory"));
+ // Create directory and check that IsDirectory=true
+ CreateDirectory("./Test directory");
+ EXPECT_TRUE(IsDirectory("./Test directory"));
+
+ // Delete directory and check, that IsDirectory=false
+ EXPECT_TRUE(RemoveDirectory("./Test directory", false));
+ EXPECT_FALSE(DirectoryExists("./Test directory"));
+ EXPECT_FALSE(IsDirectory("./Test directory"));
+
+ // Create file and check that IsDirectory=false
+ ASSERT_FALSE(FileExists("./test file"));
+ EXPECT_TRUE(CreateFile("./test file"));
+ EXPECT_FALSE(IsDirectory("./test file"));
+
+ // Delete file and check that IsDirectory=false
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+ EXPECT_FALSE(IsDirectory("./test file"));
+}
+
+TEST(FileSystemTest, CreateFileTwice) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ // Create file first time
+ EXPECT_TRUE(CreateFile("./test file"));
+ EXPECT_TRUE(FileExists("./test file"));
+
+ // Create file second time
+ EXPECT_TRUE(CreateFile("./test file"));
+ EXPECT_TRUE(FileExists("./test file"));
+
+ // Delete file
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, CreateOpenCloseFileStream) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ // Create and open file
+ std::ofstream* test_file = Open("./test file");
+ EXPECT_TRUE(test_file->is_open());
+ Close(test_file);
+ EXPECT_FALSE(test_file->is_open());
+ delete test_file;
+
+ EXPECT_TRUE(FileExists("./test file"));
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, CreateAndOpenFileStreamTwice) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ // Create and open file
+ std::ofstream* test_file = Open("./test file");
+ EXPECT_TRUE(test_file->is_open());
+ Close(test_file);
+ EXPECT_FALSE(test_file->is_open());
+ delete test_file;
+
+ EXPECT_TRUE(FileExists("./test file"));
+
+ // Create file second time
+ EXPECT_TRUE(CreateFile("./test file"));
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
- ASSERT_TRUE(file_system::Write("./Test directory/test file", data));
+TEST(FileSystemTest, OpenFileWriteInFileStream) {
+ ASSERT_FALSE(FileExists("./test file"));
- ASSERT_TRUE(file_system::FileExists("./Test directory/test file"));
+ // Create and open file
+ std::ofstream* test_file = Open("./test file");
+ EXPECT_TRUE(test_file->is_open());
- ASSERT_FALSE(file_system::IsDirectory("./Test directory/test file"));
+ // Write data in file
+ uint32_t data_size = 4;
+ uint8_t* data = new uint8_t[data_size];
+ for (uint i = 0; i < data_size; ++i) {
+ data[i] = i;
+ }
+ EXPECT_TRUE(Write(test_file, data, data_size));
+ Close(test_file);
+ EXPECT_FALSE(test_file->is_open());
+ delete test_file;
// Read data from file
- std::vector<unsigned char> result;
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
- ASSERT_TRUE(file_system::ReadBinaryFile("./Test directory/test file",
- result));
- ASSERT_FALSE(result.empty());
+// Check data
+ for (uint i = 0; i < data_size; ++i) {
+ EXPECT_EQ(data[i], result[i]);
+ }
+ delete data;
- // list files
- ASSERT_TRUE(file_system::Write("./Test directory/test file 2", data));
+ // Delete file
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
- std::vector<std::string> list;
- list = file_system::ListFiles("./Test directory");
+TEST(FileSystemTest, CannotWriteInClosedFileStream) {
+ ASSERT_FALSE(FileExists("./test file"));
- ASSERT_FALSE(list.empty());
- std::sort(list.begin(), list.end());
- ASSERT_EQ("test file", list[0]);
- ASSERT_EQ("test file 2", list[1]);
+ // Create and open file
+ std::ofstream* test_file = Open("./test file");
+ EXPECT_TRUE(test_file->is_open());
+ Close(test_file);
+ EXPECT_FALSE(test_file->is_open());
+
+ // Write data in file
+ uint32_t data_size = 4;
+ uint8_t* data = new uint8_t[data_size];
+ for (uint i = 0; i < data_size; ++i) {
+ data[i] = i;
+ }
+ EXPECT_TRUE(Write(test_file, data, data_size));
+
+ delete data;
+ delete test_file;
+
+ // Read data from file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_TRUE(result.empty());
// Delete file
- ASSERT_TRUE(file_system::FileExists("./Test directory/test file 2"));
- ASSERT_TRUE(file_system::DeleteFile("./Test directory/test file 2"));
- ASSERT_FALSE(file_system::FileExists("./Test directory/test file 2"));
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, CreateWriteInFileStream_CreateFileAgain_FileRewritten) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ // Create and open file
+ std::ofstream* test_file = Open("./test file");
+ EXPECT_TRUE(test_file->is_open());
+
+ // Write data in file
+ uint32_t data_size = 4;
+ uint8_t* data = new uint8_t[data_size];
+ for (uint i = 0; i < data_size; ++i) {
+ data[i] = i;
+ }
+ EXPECT_TRUE(Write(test_file, data, data_size));
+
+ Close(test_file);
+ delete test_file;
+
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+
+ delete data;
+ EXPECT_TRUE(CreateFile("./test file"));
+
+ // Now file is empty
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_TRUE(result.empty());
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, CreateFileStream_WriteInFile_FileStreamNotClosed) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ // Create and open file
+ std::ofstream* test_file = Open("./test file");
+ EXPECT_TRUE(test_file->is_open());
+
+ // Write data in file
+ uint32_t data_size = 4;
+ std::vector < uint8_t > data;
+ for (uint i = 0; i < data_size; ++i) {
+ data.push_back(i);
+ }
+ // Write data in file
+ EXPECT_TRUE(Write("./test file", data));
+ EXPECT_TRUE(test_file->is_open());
+
+ // Close filestream
+ Close(test_file);
+ delete test_file;
+
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, CreateFileStream_WriteInFileWriteInFileStream_FileIncludeLastData) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ // Create and open file
+ std::ofstream* test_file = Open("./test file");
+ EXPECT_TRUE(test_file->is_open());
+
+ // Write data in file
+ uint32_t data_size = 4;
+ std::vector < uint8_t > data;
+ for (uint i = 0; i < data_size; ++i) {
+ data.push_back(i);
+ }
+ // Write data in file
+ EXPECT_TRUE(Write("./test file", data));
+
+ EXPECT_TRUE(test_file->is_open());
+
+ // Write in filestream
+ uint8_t* data_2 = new uint8_t[data_size];
+ for (uint i = 0; i < data_size; ++i) {
+ data_2[i] = i + data_size;
+ }
+ EXPECT_TRUE(Write(test_file, data_2, data_size));
+ // Close filestream
+ Close(test_file);
+
+ delete test_file;
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+
+ // Check data
+ EXPECT_EQ(result.size(), data_size);
+ for (uint i = 0; i < data_size; ++i) {
+ EXPECT_NE(data[i], result[i]);
+ EXPECT_EQ(data_2[i], result[i]);
+ }
+
+ delete data_2;
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, WriteInFilestreamTwice_FileRewritten) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ // Create and open file
+ std::ofstream* test_file = Open("./test file");
+ EXPECT_TRUE(test_file->is_open());
+
+ // Open file second time
+ std::ofstream* test_file_2 = Open("./test file");
+ EXPECT_TRUE(test_file_2->is_open());
+
+ uint32_t data_size = 4;
+ uint8_t* data = new uint8_t[data_size];
+ for (uint i = 0; i < data_size; ++i) {
+ data[i] = i;
+ }
+ uint8_t* data_2 = new uint8_t[data_size];
+ for (uint i = 0; i < data_size; ++i) {
+ data_2[i] = i + 4;
+ }
+
+ // Write data in file
+ EXPECT_TRUE(Write(test_file, data, data_size));
+
+ EXPECT_TRUE(Write(test_file_2, data_2, data_size));
+
+ Close(test_file);
+ Close(test_file_2);
+
+ EXPECT_FALSE(test_file->is_open());
+ EXPECT_FALSE(test_file_2->is_open());
+
+ delete test_file;
+ delete test_file_2;
+ // Check file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+ // Check data
+ for (uint i = 0; i < data_size; ++i) {
+ EXPECT_NE(data[i], result[i]);
+ EXPECT_EQ(data_2[i], result[i]);
+ }
+
+ delete data;
+ delete data_2;
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, WriteInFilestreamConsequentially_FileRewritten) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ // Create and open file
+ std::ofstream* test_file = Open("./test file");
+ EXPECT_TRUE(test_file->is_open());
+
+ uint32_t data_size = 4;
+ uint8_t* data = new uint8_t[data_size];
+ for (uint i = 0; i < data_size; ++i) {
+ data[i] = i;
+ }
+
+ // Write data in file
+ EXPECT_TRUE(Write(test_file, data, data_size));
+
+ Close(test_file);
+ EXPECT_FALSE(test_file->is_open());
+
+ // Open file second time
+ std::ofstream* test_file_2 = Open("./test file");
+ EXPECT_TRUE(test_file_2->is_open());
+
+ // Write second time
+ uint8_t* data_2 = new uint8_t[data_size];
+ for (uint i = 0; i < data_size; ++i) {
+ data_2[i] = i + 4;
+ }
+ EXPECT_TRUE(Write(test_file_2, data_2, data_size));
+
+ Close(test_file_2);
+ EXPECT_FALSE(test_file_2->is_open());
+
+ delete test_file;
+ delete test_file_2;
+ // Check file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+
+ // Check data
+ EXPECT_EQ(result.size(), data_size);
+ for (uint i = 0; i < data_size; ++i) {
+ EXPECT_NE(data[i], result[i]);
+ EXPECT_EQ(data_2[i], result[i]);
+ }
+
+ delete data;
+ delete data_2;
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, CreateFileTwiceWriteInFileTwice) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ // Create and open file
+ EXPECT_TRUE(CreateFile("./test file"));
+ EXPECT_TRUE(FileExists("./test file"));
+
+ uint32_t data_size = 4;
+ std::vector < uint8_t > data;
+ for (uint i = 0; i < data_size; ++i) {
+ data.push_back(i);
+ }
+
+ // Write data in file
+ EXPECT_TRUE(Write("./test file", data));
+ // Create file second time
+ EXPECT_TRUE(CreateFile("./test file"));
+ EXPECT_TRUE(CreateFile("./test file"));
+
+ std::vector < uint8_t > data_2;
+ for (uint i = 0; i < data_size; ++i) {
+ data_2.push_back(i + data_size);
+ }
+
+ // Write data in file
+ EXPECT_TRUE(Write("./test file", data_2));
+
+ // Check file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+
+ EXPECT_EQ(data_2, result);
+ EXPECT_EQ(result.size(), data_size);
+ // Check data
+ for (uint i = 0; i < data_size; ++i) {
+ EXPECT_NE(data[i], result[i]);
+ EXPECT_EQ(data_2[i], result[i]);
+ }
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, WriteInFileTwiceFileRewritten) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ // Create and open file
+ EXPECT_TRUE(CreateFile("./test file"));
+ EXPECT_TRUE(FileExists("./test file"));
+
+ // Write data in file
+ uint32_t data_size = 4;
+ std::vector < uint8_t > data;
+ for (uint i = 0; i < data_size; ++i) {
+ data.push_back(i);
+ }
+ EXPECT_TRUE(Write("./test file", data));
+
+ // Write data to file again
+ std::vector < uint8_t > data_2;
+ for (uint i = 0; i < data_size; ++i) {
+ data_2.push_back(i + data_size);
+ }
+ EXPECT_TRUE(Write("./test file", data_2));
+
+ // Check file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+
+ // Check data
+ EXPECT_EQ(data_size, result.size());
+ for (uint i = 0; i < data_size; ++i) {
+ EXPECT_NE(data[i], result[i]);
+ EXPECT_EQ(data_2[i], result[i]);
+ }
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, WriteDataInTheEndOfFile) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ EXPECT_TRUE(CreateFile("./test file"));
+ EXPECT_TRUE(FileExists("./test file"));
+
+ int32_t data_size = 4;
+ std::vector < uint8_t > data;
+ for (int i = 0; i < data_size; ++i) {
+ data.push_back(i);
+ }
+
+ // Write data in file
+ EXPECT_TRUE(Write("./test file", data));
+
+ // Write in file second time
+ std::vector < uint8_t > data_2;
+ for (int i = 0; i < data_size; ++i) {
+ data_2.push_back(i + data_size);
+ }
+
+ // Write data in file
+ EXPECT_TRUE(Write("./test file", data_2, std::ios_base::app));
+
+ // Check file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+
+ std::vector < uint8_t > data_check;
+ for (int i = 0; i < 2 * data_size; ++i) {
+ data_check.push_back(i);
+ }
+
+ // Check data
+ EXPECT_EQ(data_check.size(), result.size());
+ for (int i = 0; i < 2 * data_size; ++i) {
+ EXPECT_EQ(data_check[i], result[i]);
+ }
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, WriteInFileStream_WriteInFileInTheEndOfFile_FileIncludeBothData) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ // Create and open file
+ std::ofstream* test_file = Open("./test file");
+ EXPECT_TRUE(test_file->is_open());
- // Delete empty directory
- file_system::CreateDirectory("./Test directory/Empty directory");
+ // Write data in file
+ uint32_t data_size = 4;
+ std::vector < uint8_t > data;
+ for (uint i = 0; i < data_size; ++i) {
+ data.push_back(i);
+ }
+ // Write data in file
+ EXPECT_TRUE(Write("./test file", data));
+ EXPECT_TRUE(test_file->is_open());
- ASSERT_TRUE(file_system::DirectoryExists(
- "./Test directory/Empty directory"));
- ASSERT_TRUE(file_system::RemoveDirectory(
- "./Test directory/Empty directory", false));
- ASSERT_FALSE(file_system::DirectoryExists(
- "./Test directory/Empty directory"));
+ // Close filestream
+ Close(test_file);
- ASSERT_FALSE(file_system::RemoveDirectory("./Test directory", false));
- ASSERT_TRUE(file_system::DirectoryExists("./Test directory"));
+ delete test_file;
+ // Write in file second time
+ std::vector < uint8_t > data_2;
+ for (uint i = 0; i < data_size; ++i) {
+ data_2.push_back(i + data_size);
+ }
- // Delete directory recursively
- file_system::CreateDirectory("./Test directory/Test directory 2");
- ASSERT_TRUE(file_system::Write(
- "./Test directory/Test directory 2/test file 2", data));
- ASSERT_TRUE(file_system::RemoveDirectory("./Test directory", true));
+ // Write data in file
+ EXPECT_TRUE(Write("./test file", data_2, std::ios_base::app));
- ASSERT_FALSE(file_system::DirectoryExists("./Test directory"));
+ // Check file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+
+ std::vector < uint8_t > data_check;
+ for (uint i = 0; i < 2 * data_size; ++i) {
+ data_check.push_back(i);
+ }
+
+ // Check data
+ EXPECT_EQ(data_check.size(), result.size());
+ for (uint i = 0; i < 2 * data_size; ++i) {
+ EXPECT_EQ(data_check[i], result[i]);
+ }
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, OpenFileStreamForRead_WriteInFileStream) {
+ ASSERT_FALSE(FileExists("./test file"));
+ // File creation
+ EXPECT_TRUE(CreateFile("./test file"));
+ std::ofstream* test_file = Open("./test file", std::ios_base::in);
+ EXPECT_TRUE(test_file->is_open());
+
+ // Write data in file
+ uint32_t data_size = 4;
+ uint8_t* data = new uint8_t[data_size];
+ for (uint i = 0; i < data_size; ++i) {
+ data[i] = i;
+ }
+
+ EXPECT_TRUE(Write(test_file, data, data_size));
+
+ Close(test_file);
+ EXPECT_FALSE(test_file->is_open());
+
+ // Read data from file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+
+ // Check data
+ for (uint i = 0; i < data_size; ++i) {
+ EXPECT_EQ(data[i], result[i]);
+ }
+
+ delete data;
+ delete test_file;
+
+ EXPECT_TRUE(FileExists("./test file"));
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, WriteFileNotExists) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ unsigned char tmp[] = { 't', 'e', 's', 't' };
+ std::vector<unsigned char> data(tmp, tmp + 4);
+ EXPECT_TRUE(Write("./test file", data));
+ // File now exists
+ ASSERT_TRUE(FileExists("./test file"));
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, WriteFileReadFile) {
+ ASSERT_FALSE(FileExists("./test file"));
+ EXPECT_TRUE(CreateFile("./test file"));
+
+ unsigned char tmp[] = { 't', 'e', 's', 't' };
+ std::vector<unsigned char> data(tmp, tmp + 4);
+ EXPECT_TRUE(Write("./test file", data));
+
+ // Read data from file
+ std::string result;
+ std::string check = "test";
+ EXPECT_TRUE(ReadFile("./test file", result));
+ EXPECT_NE(0u, result.size());
+ EXPECT_EQ(check, result);
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, WriteBinaryDataReadBinaryFile) {
+ ASSERT_FALSE(FileExists("./test file"));
+ EXPECT_TRUE(CreateFile("./test file"));
+
+ uint8_t tmp[] = { 1, 2, 3, 4};
+ std::vector<uint8_t> data(tmp, tmp + 4);
+ EXPECT_TRUE(WriteBinaryFile("./test file", data));
+
+ // Read data from file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+ EXPECT_EQ(data, result);
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+}
+
+TEST(FileSystemTest, WriteBinaryDataTwice_FileRewritten) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ EXPECT_TRUE(CreateFile("./test file"));
+ EXPECT_TRUE(FileExists("./test file"));
+
+ int32_t data_size = 4;
+ std::vector < uint8_t > data;
+ for (int i = 0; i < data_size; ++i) {
+ data.push_back(i);
+ }
+ // Write data in file
+ EXPECT_TRUE(WriteBinaryFile("./test file", data));
+
+ // Write in file second time
+ std::vector < uint8_t > data_2;
+ for (int i = 0; i < data_size; ++i) {
+ data_2.push_back(i + data_size);
+ }
+
+ // Write data in file
+ EXPECT_TRUE(WriteBinaryFile("./test file", data_2));
+
+ // Check file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+
+ // Check data
+ EXPECT_EQ(data_2.size(), result.size());
+ for (int i = 0; i < data_size; ++i) {
+ EXPECT_EQ(data_2[i], result[i]);
+ }
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, WriteBinaryDataFileNotExists) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ int32_t data_size = 4;
+ std::vector < uint8_t > data;
+ for (int i = 0; i < data_size; ++i) {
+ data.push_back(i);
+ }
+
+ EXPECT_TRUE(WriteBinaryFile("./test file", data));
+ ASSERT_TRUE(FileExists("./test file"));
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, WriteDataAsBinaryData) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ unsigned char tmp[] = { 't', 'e', 's', 't' };
+ std::vector<unsigned char> data(tmp, tmp + 4);
+ EXPECT_TRUE(WriteBinaryFile("./test file", data));
+ ASSERT_TRUE(FileExists("./test file"));
+
+ // Check file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+
+ EXPECT_EQ(data.size(), result.size());
+
+ for (uint i = 0; i < result.size(); ++i) {
+ EXPECT_EQ(data[i], result[i]);
+ }
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, WriteEmptyData) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ std::vector<unsigned char> data;
+ EXPECT_TRUE(Write("./test file", data));
+ ASSERT_TRUE(FileExists("./test file"));
+
+ // Check file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_TRUE(result.empty());
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, WriteEmptyDataAsBinaryData) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ // Write empty data
+ std::vector<unsigned char> data;
+ EXPECT_TRUE(WriteBinaryFile("./test file", data));
+ ASSERT_TRUE(FileExists("./test file"));
+
+ // Check file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_TRUE(result.empty());
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, WriteBinaryData_WriteDataInTheEndOfFile) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ // Write binary file
+ unsigned char tmp[] = { 't', 'e', 's', 't' };
+ std::vector<unsigned char> data(tmp, tmp + 4);
+ EXPECT_TRUE(WriteBinaryFile("./test file", data));
+ ASSERT_TRUE(FileExists("./test file"));
+
+ // Write in file second time
+ int32_t data_size = 4;
+ std::vector < uint8_t > data_2;
+ for (int i = 0; i < data_size; ++i) {
+ data_2.push_back(i);
+ }
+
+ // Write data in file
+ EXPECT_TRUE(Write("./test file", data_2, std::ios_base::app));
+
+ // Check file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+
+ // Prepare data for check
+ data.insert(data.end(), data_2.begin(), data_2.end());
+
+ // Compare data
+ EXPECT_EQ(data.size(), result.size());
+ for (uint i = 0; i < result.size(); ++i) {
+ EXPECT_EQ(data[i], result[i]);
+ }
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, CreateFile_WriteDataWithFlagOpenForReading) {
+ ASSERT_FALSE(FileExists("./test file"));
+ EXPECT_TRUE(CreateFile("./test file"));
+ // Write data in file
+ int32_t data_size = 4;
+ std::vector < uint8_t > data;
+ for (int i = 0; i < data_size; ++i) {
+ data.push_back(i);
+ }
+ EXPECT_TRUE(Write("./test file", data, std::ios_base::in));
+ EXPECT_TRUE(FileExists("./test file"));
+
+ // Check file
+ std::vector < uint8_t > result;
+ EXPECT_TRUE(ReadBinaryFile("./test file", result));
+ EXPECT_FALSE(result.empty());
+
+ // Compare data
+ EXPECT_EQ(data.size(), result.size());
+ for (uint i = 0; i < result.size(); ++i) {
+ EXPECT_EQ(data[i], result[i]);
+ }
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, FileDoesNotCreated_WriteFileWithFlagOpenForReadingIsImpossible) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ // Write data in file is impossible
+ int32_t data_size = 4;
+ std::vector < uint8_t > data;
+ for (int i = 0; i < data_size; ++i) {
+ data.push_back(i);
+ }
+ EXPECT_FALSE(Write("./test file", data, std::ios_base::in));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, WriteFileGetSize) {
+ ASSERT_FALSE(FileExists("./test file"));
+ EXPECT_TRUE(CreateFile("./test file"));
+ EXPECT_EQ(0, 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_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, CreateFileCheckDefaultAccess) {
+ // File creation
+ ASSERT_FALSE(FileExists("./test file"));
+ EXPECT_TRUE(CreateFile("./test file"));
+
+ // Check accesses
+ EXPECT_TRUE(IsAccessible("./test file", R_OK));
+ EXPECT_TRUE(IsAccessible("./test file", W_OK));
+ EXPECT_TRUE(IsReadingAllowed("./test file"));
+ EXPECT_TRUE(IsWritingAllowed("./test file"));
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, GetFileModificationTime) {
+ ASSERT_FALSE(FileExists("./test file"));
+
+ EXPECT_TRUE(CreateFile("./test file"));
+
+ uint64_t modif_time = GetFileModificationTime("./test file");
+ EXPECT_LE(0ul, modif_time);
+
+ std::vector < uint8_t > data(1, 1);
+ EXPECT_TRUE(WriteBinaryFile("./test file", data));
+
+ EXPECT_LE(0ul, GetFileModificationTime("./test file"));
+ EXPECT_LE(modif_time, GetFileModificationTime("./test file"));
+
+ EXPECT_TRUE(DeleteFile("./test file"));
+ EXPECT_FALSE(FileExists("./test file"));
+}
+
+TEST(FileSystemTest, ListFiles) {
+ ASSERT_FALSE(DirectoryExists("./Test directory"));
+ CreateDirectory("./Test directory");
+
+ std::vector < std::string > list;
+ list = ListFiles("./Test directory");
+ EXPECT_TRUE(list.empty());
+
+ EXPECT_TRUE(CreateFile("./Test directory/test file"));
+ EXPECT_TRUE(CreateFile("./Test directory/test file 2"));
+
+ list = ListFiles("./Test directory");
+ EXPECT_FALSE(list.empty());
+
+ std::sort(list.begin(), list.end());
+ EXPECT_EQ("test file", list[0]);
+ EXPECT_EQ("test file 2", list[1]);
+
+ EXPECT_TRUE(RemoveDirectory("./Test directory", true));
+ EXPECT_FALSE(DirectoryExists("./Test directory"));
+
+ EXPECT_FALSE(FileExists("./Test directory/test file"));
+ EXPECT_FALSE(FileExists("./Test directory/test file 2"));
+}
+
+TEST(FileSystemTest, ListFilesIncludeSubdirectory) {
+ ASSERT_FALSE(DirectoryExists("./Test directory"));
+ CreateDirectoryRecursively("./Test directory/Test directory 2/");
+
+ std::vector < std::string > list;
+ list = ListFiles("./Test directory");
+ EXPECT_FALSE(list.empty());
+ EXPECT_EQ(1u, list.size());
+ EXPECT_EQ("Test directory 2", list[0]);
+
+ EXPECT_TRUE(RemoveDirectory("./Test directory", true));
+ EXPECT_FALSE(DirectoryExists("./Test directory"));
+}
+
+TEST(FileSystemTest, ListFilesDoesNotIncludeFilesInSubdirectory) {
+ ASSERT_FALSE(DirectoryExists("./Test directory"));
+ CreateDirectoryRecursively("./Test directory/Test directory 2/");
+
+ std::vector < std::string > list;
+ list = ListFiles("./Test directory");
+ EXPECT_FALSE(list.empty());
+
+ EXPECT_TRUE(CreateFile("./Test directory/Test directory 2/test file"));
+ EXPECT_TRUE(CreateFile("./Test directory/Test directory 2/test file 2"));
+
+ list = ListFiles("./Test directory");
+ EXPECT_FALSE(list.empty());
+
+ std::sort(list.begin(), list.end());
+ EXPECT_EQ("Test directory 2", list[0]);
+ EXPECT_EQ(1u, list.size());
+
+ EXPECT_TRUE(RemoveDirectory("./Test directory", true));
+ EXPECT_FALSE(DirectoryExists("./Test directory"));
+}
+
+TEST(FileSystemTest, GetAvailableDiskSpace) {
+
+ // Get available disk space before directory with file creaction and after
+ uint64_t available_space = GetAvailableDiskSpace(".");
+ EXPECT_NE(0u, available_space);
+ ASSERT_FALSE(DirectoryExists("./Test directory"));
+ CreateDirectory("./Test directory");
+
+ unsigned char tmp[] = { 't', 'e', 's', 't' };
+ std::vector<unsigned char> data(tmp, tmp + 4);
+ EXPECT_TRUE(Write("./Test directory/test file", data));
+
+ EXPECT_GE(available_space, GetAvailableDiskSpace("."));
+ EXPECT_TRUE(RemoveDirectory("./Test directory"));
+ EXPECT_FALSE(DirectoryExists("./Test directory"));
+}
+
+TEST(FileSystemTest, ConvertPathForURL) {
+ std::string path = "./Test directory";
+ EXPECT_NE(path, ConvertPathForURL(path));
+ std::string path_brackets = "./Test_directory_with(brackets)";
+ EXPECT_NE(path_brackets, ConvertPathForURL(path));
+ std::string another_path = "./Test_directory/new_directory_without_spaces";
+ EXPECT_EQ(another_path, ConvertPathForURL(another_path));
+}
+
+TEST(FileSystemTest, DirectorySize) {
+ ASSERT_FALSE(DirectoryExists("./Test directory"));
+ CreateDirectory("./Test directory");
+ EXPECT_TRUE(DirectoryExists("./Test directory"));
+ // Get size of empty directory
+ EXPECT_EQ(0u, DirectorySize("./Test directory"));
+ EXPECT_TRUE(CreateFile("./Test directory/test file"));
+
+ // Get size of nonempty directory with empty file
+ EXPECT_EQ(0u, DirectorySize("./Test directory"));
+
+ unsigned char tmp[] = { 't', 'e', 's', 't' };
+ std::vector<unsigned char> data(tmp, tmp + 4);
+
+ EXPECT_TRUE(Write("./Test directory/test file", data));
+ // Get size of nonempty directory with nonempty file
+ EXPECT_NE(0u, DirectorySize("./Test directory"));
+
+ EXPECT_TRUE(DeleteFile("./Test directory/test file"));
+ EXPECT_EQ(0u, DirectorySize("./Test directory"));
+ EXPECT_TRUE(RemoveDirectory("./Test directory"));
+ EXPECT_FALSE(DirectoryExists("./Test directory"));
+}
+
+TEST(FileSystemTest, DeleteAllContentInDirectory) {
+ ASSERT_FALSE(DirectoryExists("./Test directory"));
+ CreateDirectory("./Test directory");
+
+ // Create files in directory
+ EXPECT_TRUE(CreateFile("./Test directory/test file"));
+ EXPECT_TRUE(CreateFile("./Test directory/test file 2"));
+
+ EXPECT_TRUE(FileExists("./Test directory/test file"));
+ EXPECT_TRUE(FileExists("./Test directory/test file 2"));
+
+ EXPECT_TRUE(DirectoryExists("./Test directory"));
+
+ // Create subdirectories
+ CreateDirectoryRecursively(
+ "./Test directory/Test directory 2/Test directory 3");
+
+ EXPECT_TRUE(DirectoryExists("./Test directory/Test directory 2"));
+ EXPECT_TRUE(
+ DirectoryExists("./Test directory/Test directory 2/Test directory 3"));
+
+ remove_directory_content("./Test directory");
+
+ // Directory does not include files and subdirectories
+ EXPECT_FALSE(FileExists("./Test directory/test file"));
+ EXPECT_FALSE(FileExists("./Test directory/test file 2"));
+
+ EXPECT_FALSE(
+ DirectoryExists("./Test directory/Test directory 2/Test directory 3"));
+ EXPECT_FALSE(DirectoryExists("./Test directory/Test directory 2"));
+
+ std::vector < std::string > list;
+ list = ListFiles("./Test directory");
+ EXPECT_TRUE(list.empty());
+
+ EXPECT_TRUE(DirectoryExists("./Test directory"));
+
+ EXPECT_TRUE(RemoveDirectory("./Test directory", true));
+ EXPECT_FALSE(DirectoryExists("./Test directory"));
}
+
} // namespace utils
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/lock_posix_test.cc b/src/components/utils/test/lock_posix_test.cc
new file mode 100644
index 000000000..9b0d9533b
--- /dev/null
+++ b/src/components/utils/test/lock_posix_test.cc
@@ -0,0 +1,123 @@
+/*
+ * 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 {
+
+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
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/log4cxx.properties b/src/components/utils/test/log4cxx.properties
new file mode 100644
index 000000000..0ba34d0ad
--- /dev/null
+++ b/src/components/utils/test/log4cxx.properties
@@ -0,0 +1,11 @@
+log4j.appender.AutoTraceTestLogFile=org.apache.log4j.FileAppender
+log4j.appender.AutoTraceTestLogFile.File=AutoTraceTestLogFile.log
+log4j.appender.AutoTraceTestLogFile.append=true
+log4j.appender.AutoTraceTestLogFile.DatePattern='.' yyyy-MM-dd HH-mm
+log4j.appender.AutoTraceTestLogFile.ImmediateFlush=true
+log4j.appender.AutoTraceTestLogFile.layout=org.apache.log4j.PatternLayout
+log4j.appender.AutoTraceTestLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %F:%L %M: %m%n
+
+
+# All SmartDeviceLinkCore logs
+log4j.rootLogger=ALL, AutoTraceTestLogFile \ No newline at end of file
diff --git a/src/components/utils/test/log_message_loop_thread_test.cc b/src/components/utils/test/log_message_loop_thread_test.cc
new file mode 100644
index 000000000..789bf62f4
--- /dev/null
+++ b/src/components/utils/test/log_message_loop_thread_test.cc
@@ -0,0 +1,96 @@
+/*
+ * 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 "gmock/gmock.h"
+#include "utils/log_message_loop_thread.h"
+#include "utils/logger_status.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+using namespace ::logger;
+using ::testing::_;
+
+TEST(LogMessageLoopThread,CreateLogMessageSingleton) {
+ //if logger_status is LoggerThreadNotCreated or LoggerThreadCreated,
+ // creation of singleton will be impossible
+ logger::logger_status = CreatingLoggerThread;
+
+ LogMessageLoopThread *instance_1 = LogMessageLoopThread::instance();
+ LogMessageLoopThread *instance_2 = LogMessageLoopThread::instance();
+
+ //assert
+ EXPECT_EQ(instance_1, instance_2);
+
+ LogMessageLoopThread::destroy();
+
+ EXPECT_FALSE(LogMessageLoopThread::exists());
+ logger::logger_status = LoggerThreadNotCreated;
+}
+
+TEST(LogMessageLoopThread, DestroyLogMessage_loggerStatusDeletingLogger) {
+ logger::logger_status = CreatingLoggerThread;
+ LogMessageLoopThread::instance();
+
+ //assert
+ EXPECT_EQ(CreatingLoggerThread, logger::logger_status);
+
+ //act
+ LogMessageLoopThread::destroy();
+
+ //assert
+ EXPECT_EQ(DeletingLoggerThread, logger::logger_status);
+
+ logger::logger_status = LoggerThreadNotCreated;
+}
+
+class MockLogMessageTest : public LogMessageHandler {
+ public:
+ MOCK_CONST_METHOD1(Handle, void(const LogMessage message));
+};
+
+TEST(LogMessageLoopThread, HandleNeverCalled) {
+ logger::logger_status = CreatingLoggerThread;
+
+ MockLogMessageTest mmock;
+ EXPECT_CALL(mmock,Handle(_)).Times(0);
+ LogMessageLoopThread::instance();
+
+ LogMessageLoopThread::destroy();
+ logger::logger_status = LoggerThreadNotCreated;
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/main.cc b/src/components/utils/test/main.cc
deleted file mode 100644
index 59fa20e8b..000000000
--- a/src/components/utils/test/main.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "gmock/gmock.h"
-
-int main(int argc, char** argv) {
- testing::InitGoogleMock(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
diff --git a/src/components/utils/test/message_queue_test.cc b/src/components/utils/test/message_queue_test.cc
new file mode 100644
index 000000000..8ce7196b0
--- /dev/null
+++ b/src/components/utils/test/message_queue_test.cc
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <unistd.h>
+#include "gtest/gtest.h"
+#include "utils/message_queue.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+using ::utils::MessageQueue;
+
+class MessageQueueTest : public testing::Test {
+ public:
+ MessageQueueTest()
+ : test_val_1("Hello,"),
+ test_val_2("Beautiful "),
+ test_val_3("World!"),
+ test_line(""),
+ check_value(false) {
+ }
+ void add_one_element_to_queue();
+ void extract_from_queue();
+ void add_three_elements_to_queue();
+ void ShutDownQueue();
+
+ static void* add_one_element_to_queue_helper(void *context);
+ static void* extract_from_queue_helper(void *context);
+ static void* add_three_elements_to_queue_helper(void *context);
+ static void* ShutDownQueue_helper(void *context);
+
+ protected:
+ MessageQueue<std::string> test_queue;
+ std::string test_val_1;
+ std::string test_val_2;
+ std::string test_val_3;
+ std::string test_line;
+ bool check_value;
+};
+
+// Thread function - adds 1 element1 to the queue
+void MessageQueueTest::add_one_element_to_queue() {
+ test_queue.push(test_val_1);
+ pthread_exit(NULL);
+}
+
+// Thread function - removes 1 element from beginning of queue
+void MessageQueueTest::extract_from_queue() {
+ test_queue.wait();
+ test_queue.pop(test_line);
+ pthread_exit(NULL);
+}
+
+// Thread function - adds 3 elements to the queue
+void MessageQueueTest::add_three_elements_to_queue() {
+ test_queue.push(test_val_1);
+ test_queue.push(test_val_2);
+ test_queue.push(test_val_3);
+ pthread_exit(NULL);
+}
+
+// Thread function - adds 3 elements to the queue
+void MessageQueueTest::ShutDownQueue() {
+ check_value = true;
+ test_queue.Shutdown();
+ pthread_exit(NULL);
+}
+
+void* MessageQueueTest::add_one_element_to_queue_helper(void *context) {
+ (reinterpret_cast<MessageQueueTest *>(context))->add_one_element_to_queue();
+ return NULL;
+}
+void* MessageQueueTest::extract_from_queue_helper(void *context) {
+ (reinterpret_cast<MessageQueueTest *>(context))->extract_from_queue();
+ return NULL;
+}
+void* MessageQueueTest::add_three_elements_to_queue_helper(void *context) {
+ (reinterpret_cast<MessageQueueTest *>(context))->add_three_elements_to_queue();
+ return NULL;
+}
+void* MessageQueueTest::ShutDownQueue_helper(void *context) {
+ (reinterpret_cast<MessageQueueTest *>(context))->ShutDownQueue();
+ return NULL;
+}
+
+TEST_F(MessageQueueTest, DefaultCtorTest_ExpectEmptyQueueCreated) {
+ bool test_value = true;
+ // Check if the queue is empty
+ ASSERT_EQ(test_value, test_queue.empty());
+}
+
+TEST_F(MessageQueueTest, MessageQueuePushThreeElementsTest_ExpectThreeElementsAdded) {
+ pthread_t thread1;
+ pthread_create(&thread1, NULL, &MessageQueueTest::add_three_elements_to_queue_helper, this);
+ pthread_join(thread1, NULL);
+ // check if 3 elements were added successfully
+ ASSERT_EQ(3u, test_queue.size());
+}
+
+TEST_F(MessageQueueTest, NotEmptyMessageQueueResetTest_ExpectEmptyQueue) {
+ // Adding some elements to queue
+ test_queue.push(test_val_1);
+ test_queue.push(test_val_2);
+ test_queue.push(test_val_3);
+ // Resetting queue
+ test_queue.Reset();
+ // Check if queue is empty
+ ASSERT_TRUE(test_queue.empty());
+ // Check the size of queue after reset
+ ASSERT_EQ(0u, test_queue.size());
+}
+
+TEST_F(MessageQueueTest, MessageQueuePopOneElementTest_ExpectOneElementRemovedFromQueue) {
+ pthread_t thread1;
+ pthread_t thread2;
+ // Creating threads with thread function mentioned above
+ pthread_create(&thread1, NULL, &MessageQueueTest::add_one_element_to_queue_helper, this);
+ pthread_create(&thread2, NULL, &MessageQueueTest::extract_from_queue_helper, this);
+ // Primary thread waits until thread 2 to be finished
+ pthread_join(thread2, NULL);
+ // Check if first element was removed successfully
+ ASSERT_EQ(test_val_1, test_line);
+ // Check the size of queue after 1 element was removed
+ ASSERT_EQ(0u, test_queue.size());
+}
+
+TEST_F(MessageQueueTest, MessageQueueShutdownTest_ExpectMessageQueueWillBeShutDown) {
+ pthread_t thread1;
+ // Creating thread with thread function mentioned above
+ pthread_create(&thread1, NULL, &MessageQueueTest::ShutDownQueue_helper, this);
+ // Primary thread sleeps until thread1 will make queue shutdown
+ test_queue.wait();
+ check_value = true;
+ ASSERT_TRUE(check_value);
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/messagemeter_test.cc b/src/components/utils/test/messagemeter_test.cc
index 45375e4ed..6c13ab345 100644
--- a/src/components/utils/test/messagemeter_test.cc
+++ b/src/components/utils/test/messagemeter_test.cc
@@ -79,7 +79,7 @@ class MessageMeterTest: public ::testing::TestWithParam<TimePair> {
void TearDown() OVERRIDE {
}
::utils::MessageMeter<int> meter;
- TimevalStruct time_range {0, 0};
+ TimevalStruct time_range = {0, 0};
int64_t time_range_msecs;
int usecs;
int id1, id2, id3;
diff --git a/src/components/utils/test/policy.sql b/src/components/utils/test/policy.sql
new file mode 100644
index 000000000..406579f6b
--- /dev/null
+++ b/src/components/utils/test/policy.sql
@@ -0,0 +1,295 @@
+BEGIN TRANSACTION;
+ CREATE TABLE IF NOT EXISTS `device`(
+ `id` VARCHAR(100) PRIMARY KEY NOT NULL,
+ `hardware` VARCHAR(45),
+ `firmware_rev` VARCHAR(45),
+ `os` VARCHAR(45),
+ `os_version` VARCHAR(45),
+ `carrier` VARCHAR(45),
+ `max_number_rfcom_ports` INTEGER ,
+ `connection_type` VARCHAR(45),
+ `unpaired` BOOL
+ );
+ CREATE TABLE IF NOT EXISTS `usage_and_error_count`(
+ `count_of_iap_buffer_full` INTEGER,
+ `count_sync_out_of_memory` INTEGER,
+ `count_of_sync_reboots` INTEGER
+ );
+ INSERT OR IGNORE INTO `usage_and_error_count` (
+ `count_of_iap_buffer_full`, `count_sync_out_of_memory`,
+ `count_of_sync_reboots`) VALUES (0, 0, 0);
+ CREATE TABLE IF NOT EXISTS `module_meta`(
+ `ccpu_version` VARCHAR(45),
+ `language` VARCHAR(45),
+ `wers_country_code` VARCHAR(45),
+ `pt_exchanged_at_odometer_x` INTEGER NOT NULL DEFAULT 0,
+ `pt_exchanged_x_days_after_epoch` INTEGER NOT NULL DEFAULT 0,
+ `ignition_cycles_since_last_exchange` INTEGER NOT NULL DEFAULT 0,
+ `vin` VARCHAR(45),
+ `flag_update_required` BOOL NOT NULL
+ );
+ INSERT OR IGNORE INTO `module_meta` (`pt_exchanged_at_odometer_x`,
+ `pt_exchanged_x_days_after_epoch`, `ignition_cycles_since_last_exchange`,
+ `flag_update_required`)
+ VALUES (0, 0, 0, 0);
+ CREATE TABLE IF NOT EXISTS `module_config`(
+ `preloaded_pt` BOOL NOT NULL,
+ `is_first_run` BOOL NOT NULL,
+ `exchange_after_x_ignition_cycles` INTEGER NOT NULL,
+ `exchange_after_x_kilometers` INTEGER NOT NULL,
+ `exchange_after_x_days` INTEGER NOT NULL,
+ `timeout_after_x_seconds` INTEGER NOT NULL,
+ `vehicle_make` VARCHAR(45),
+ `vehicle_model` VARCHAR(45),
+ `vehicle_year` VARCHAR(4)
+ );
+ INSERT OR IGNORE INTO `module_config` (`preloaded_pt`, `is_first_run`,
+ `exchange_after_x_ignition_cycles`, `exchange_after_x_kilometers`,
+ `exchange_after_x_days`, `timeout_after_x_seconds`)
+ VALUES(1, 1, 0, 0, 0, 0);
+ CREATE TABLE IF NOT EXISTS `functional_group`(
+ `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ `user_consent_prompt` TEXT UNIQUE ON CONFLICT REPLACE,
+ `name` VARCHAR(100) NOT NULL
+ );
+ CREATE TABLE IF NOT EXISTS `priority`(
+ `value` VARCHAR(45) PRIMARY KEY NOT NULL
+ );
+ INSERT OR IGNORE INTO `priority`(`value`) VALUES ('EMERGENCY');
+ INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NAVIGATION');
+ INSERT OR IGNORE INTO `priority`(`value`) VALUES ('VOICECOMMUNICATION');
+ INSERT OR IGNORE INTO `priority`(`value`) VALUES ('COMMUNICATION');
+ INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NORMAL');
+ INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NONE');
+ CREATE TABLE IF NOT EXISTS `hmi_level`(
+ `value` VARCHAR(45) PRIMARY KEY NOT NULL
+ );
+ INSERT OR IGNORE INTO `hmi_level`(`value`) VALUES ('FULL');
+ INSERT OR IGNORE INTO `hmi_level`(`value`) VALUES ('LIMITED');
+ INSERT OR IGNORE INTO `hmi_level`(`value`) VALUES ('BACKGROUND');
+ INSERT OR IGNORE INTO `hmi_level`(`value`) VALUES ('NONE');
+ CREATE TABLE IF NOT EXISTS `notifications_by_priority`(
+ `priority_value` VARCHAR(45) PRIMARY KEY NOT NULL,
+ `value` INTEGER NOT NULL,
+ CONSTRAINT `fk_notifications_by_priority_priority1`
+ FOREIGN KEY(`priority_value`)
+ REFERENCES `priority`(`value`)
+ );
+ CREATE INDEX IF NOT EXISTS
+ `notifications_by_priority.fk_notifications_by_priority_priority1_idx`
+ ON `notifications_by_priority`(`priority_value`);
+ CREATE TABLE IF NOT EXISTS `language`(
+ `code` VARCHAR(25) PRIMARY KEY NOT NULL
+ );
+ CREATE TABLE IF NOT EXISTS `message_type`(
+ `name` VARCHAR(45) PRIMARY KEY NOT NULL
+ );
+ CREATE TABLE IF NOT EXISTS `version`(
+ `number` VARCHAR(45) NOT NULL
+ );
+ INSERT OR IGNORE INTO `version` (`number`) VALUES('0');
+ CREATE TABLE IF NOT EXISTS `rpc`(
+ `id` INTEGER PRIMARY KEY NOT NULL,
+ `name` VARCHAR(45) NOT NULL,
+ `parameter` VARCHAR(45),
+ `hmi_level_value` VARCHAR(45) NOT NULL,
+ `functional_group_id` INTEGER NOT NULL,
+ CONSTRAINT `fk_rpc_hmi_level1`
+ FOREIGN KEY(`hmi_level_value`)
+ REFERENCES `hmi_level`(`value`),
+ CONSTRAINT `fk_rpc_functional_group1`
+ FOREIGN KEY(`functional_group_id`)
+ REFERENCES `functional_group`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS `rpc.fk_rpc_hmi_level1_idx`
+ ON `rpc`(`hmi_level_value`);
+ CREATE INDEX IF NOT EXISTS `rpc.fk_rpc_functional_group1_idx`
+ ON `rpc`(`functional_group_id`);
+ CREATE INDEX `rpc.select_rpc_name_hmi_level`
+ ON `rpc`(`name`,`hmi_level_value`);
+ CREATE TABLE IF NOT EXISTS `application`(
+ `id` VARCHAR(45) PRIMARY KEY NOT NULL,
+ `keep_context` BOOLEAN,
+ `steal_focus` BOOLEAN,
+ `default_hmi` VARCHAR(45),
+ `priority_value` VARCHAR(45),
+ `is_revoked` BOOLEAN,
+ `is_default` BOOLEAN,
+ `is_predata` BOOLEAN,
+ `memory_kb` INTEGER NOT NULL,
+ `heart_beat_timeout_ms` INTEGER NOT NULL,
+ `certificate` VARCHAR(45),
+ CONSTRAINT `fk_application_hmi_level1`
+ FOREIGN KEY(`default_hmi`)
+ REFERENCES `hmi_level`(`value`),
+ CONSTRAINT `fk_application_priorities1`
+ FOREIGN KEY(`priority_value`)
+ REFERENCES `priority`(`value`)
+ );
+ CREATE INDEX IF NOT EXISTS `application.fk_application_hmi_level1_idx`
+ ON `application`(`default_hmi`);
+ CREATE INDEX IF NOT EXISTS `application.fk_application_priorities1_idx`
+ ON `application`(`priority_value`);
+ CREATE TABLE IF NOT EXISTS `app_group`(
+ `application_id` VARCHAR(45) NOT NULL,
+ `functional_group_id` INTEGER NOT NULL,
+ PRIMARY KEY(`application_id`,`functional_group_id`),
+ CONSTRAINT `fk_application_has_functional_group_application1`
+ FOREIGN KEY(`application_id`)
+ REFERENCES `application`(`id`),
+ CONSTRAINT `fk_application_has_functional_group_functional_group1`
+ FOREIGN KEY(`functional_group_id`)
+ REFERENCES `functional_group`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS `app_group.fk_application_has_functional_group_functional_group1_idx`
+ ON `app_group`(`functional_group_id`);
+ CREATE INDEX IF NOT EXISTS `app_group.fk_application_has_functional_group_application1_idx`
+ ON `app_group`(`application_id`);
+ CREATE TABLE IF NOT EXISTS `preconsented_group`(
+ `application_id` VARCHAR(45) NOT NULL,
+ `functional_group_id` INTEGER NOT NULL,
+ PRIMARY KEY(`application_id`,`functional_group_id`),
+ CONSTRAINT `fk_application_has_functional_group_application2`
+ FOREIGN KEY(`application_id`)
+ REFERENCES `application`(`id`),
+ CONSTRAINT `fk_application_has_functional_group_functional_group2`
+ FOREIGN KEY(`functional_group_id`)
+ REFERENCES `functional_group`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS
+ `preconsented_group.fk_application_has_functional_group_functional_group2_idx`
+ ON `preconsented_group`(`functional_group_id`);
+ CREATE INDEX IF NOT EXISTS
+ `preconsented_group.fk_application_has_functional_group_application2_idx`
+ ON `preconsented_group`(`application_id`);
+ CREATE TABLE IF NOT EXISTS `seconds_between_retry`(
+ `index` INTEGER PRIMARY KEY NOT NULL,
+ `value` INTEGER NOT NULL
+ );
+ CREATE TABLE IF NOT EXISTS `device_consent_group`(
+ `device_id` VARCHAR(100) NOT NULL,
+ `functional_group_id` INTEGER NOT NULL,
+ `is_consented` BOOL NOT NULL,
+ `input` VARCHAR(45),
+ `time_stamp` DATETIME DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY(`device_id`,`functional_group_id`),
+ CONSTRAINT `fk_device_has_functional_group_device1`
+ FOREIGN KEY(`device_id`)
+ REFERENCES `device`(`id`),
+ CONSTRAINT `fk_device_has_functional_group_functional_group1`
+ FOREIGN KEY(`functional_group_id`)
+ REFERENCES `functional_group`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS
+ `device_consent_group.fk_device_has_functional_group_functional_group1_idx`
+ ON `device_consent_group`(`functional_group_id`);
+ CREATE INDEX IF NOT EXISTS
+ `device_consent_group.fk_device_has_functional_group_device1_idx`
+ ON `device_consent_group`(`device_id`);
+ CREATE TABLE IF NOT EXISTS `app_level`(
+ `application_id` VARCHAR(45) PRIMARY KEY NOT NULL,
+ `minutes_in_hmi_full` INTEGER DEFAULT 0,
+ `minutes_in_hmi_limited` INTEGER DEFAULT 0,
+ `minutes_in_hmi_background` INTEGER DEFAULT 0,
+ `minutes_in_hmi_none` INTEGER DEFAULT 0,
+
+ `count_of_user_selections` INTEGER DEFAULT 0,
+ `count_of_rejections_sync_out_of_memory` INTEGER DEFAULT 0,
+ `count_of_rejections_nickname_mismatch` INTEGER DEFAULT 0,
+ `count_of_rejections_duplicate_name` INTEGER DEFAULT 0,
+ `count_of_rejected_rpcs_calls` INTEGER DEFAULT 0,
+ `count_of_rpcs_sent_in_hmi_none` INTEGER DEFAULT 0,
+ `count_of_removals_for_bad_behavior` INTEGER DEFAULT 0,
+ `count_of_run_attempts_while_revoked` INTEGER DEFAULT 0,
+ `app_registration_language_gui` VARCHAR(25),
+ `app_registration_language_vui` VARCHAR(25),
+ CONSTRAINT `fk_app_levels_application1`
+ FOREIGN KEY(`application_id`)
+ REFERENCES `application`(`id`),
+ CONSTRAINT `fk_app_level_language1`
+ FOREIGN KEY(`app_registration_language_gui`)
+ REFERENCES `language`(`code`),
+ CONSTRAINT `fk_app_level_language2`
+ FOREIGN KEY(`app_registration_language_vui`)
+ REFERENCES `language`(`code`)
+ );
+ CREATE INDEX IF NOT EXISTS `app_level.fk_app_levels_application1_idx`
+ ON `app_level`(`application_id`);
+ CREATE INDEX IF NOT EXISTS `app_level.fk_app_level_language1_idx`
+ ON `app_level`(`app_registration_language_gui`);
+ CREATE INDEX IF NOT EXISTS `app_level.fk_app_level_language2_idx`
+ ON `app_level`(`app_registration_language_vui`);
+ CREATE TABLE IF NOT EXISTS `nickname`(
+ `name` VARCHAR(100) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL,
+ PRIMARY KEY(`name`,`application_id`),
+ CONSTRAINT `fk_nickname_application1`
+ FOREIGN KEY(`application_id`)
+ REFERENCES `application`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS `nickname.fk_nickname_application1_idx`
+ ON `nickname`(`application_id`);
+ CREATE TABLE IF NOT EXISTS `app_type`(
+ `name` VARCHAR(50) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL,
+ PRIMARY KEY(`name`,`application_id`),
+ CONSTRAINT `fk_app_type_application1`
+ FOREIGN KEY(`application_id`)
+ REFERENCES `application`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS `app_type.fk_app_type_application1_idx`
+ ON `app_type`(`application_id`);
+ CREATE TABLE IF NOT EXISTS `consent_group`(
+ `device_id` VARCHAR(100) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL,
+ `functional_group_id` INTEGER NOT NULL,
+ `is_consented` BOOL NOT NULL,
+ `input` VARCHAR(45),
+ `time_stamp` DATETIME DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY(`application_id`,`functional_group_id`,`device_id`),
+ CONSTRAINT `fk_consent_group_device1`
+ FOREIGN KEY(`device_id`)
+ REFERENCES `device`(`id`),
+ CONSTRAINT `fk_consent_group_application1`
+ FOREIGN KEY(`application_id`)
+ REFERENCES `application`(`id`),
+ CONSTRAINT `fk_consent_group_functional_group1`
+ FOREIGN KEY(`functional_group_id`)
+ REFERENCES `functional_group`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS
+ `consent_group.fk_consent_group_device1_idx`
+ ON `device_consent_group`(`device_id`);
+ CREATE INDEX IF NOT EXISTS `consent_group.fk_consent_group_functional_group1_idx`
+ ON `consent_group`(`functional_group_id`);
+ CREATE TABLE IF NOT EXISTS `endpoint`(
+ `service` INTEGER NOT NULL,
+ `url` VARCHAR(100) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL,
+ CONSTRAINT `fk_endpoint_application1`
+ FOREIGN KEY(`application_id`)
+ REFERENCES `application`(`id`)
+ );
+ CREATE INDEX IF NOT EXISTS `endpoint.fk_endpoint_application1_idx`
+ ON `endpoint`(`application_id`);
+ CREATE TABLE IF NOT EXISTS `message`(
+ `id` INTEGER PRIMARY KEY NOT NULL,
+ `tts` TEXT,
+ `label` TEXT,
+ `line1` TEXT,
+ `line2` TEXT,
+ `textBody` TEXT,
+ `language_code` VARCHAR(25) NOT NULL,
+ `message_type_name` VARCHAR(45) NOT NULL,
+ CONSTRAINT `fk_messages_languages1`
+ FOREIGN KEY(`language_code`)
+ REFERENCES `language`(`code`),
+ CONSTRAINT `fk_message_consumer_friendly_messages1`
+ FOREIGN KEY(`message_type_name`)
+ REFERENCES `message_type`(`name`)
+ );
+ CREATE INDEX IF NOT EXISTS `message.fk_messages_languages1_idx`
+ ON `message`(`language_code`);
+ CREATE INDEX IF NOT EXISTS `message.fk_message_consumer_friendly_messages1_idx`
+ ON `message`(`message_type_name`);
+COMMIT;
diff --git a/src/components/utils/test/posix_thread_test.cc b/src/components/utils/test/posix_thread_test.cc
new file mode 100644
index 000000000..d597f036d
--- /dev/null
+++ b/src/components/utils/test/posix_thread_test.cc
@@ -0,0 +1,312 @@
+/*
+ * 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"
+#include "threads/thread.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+using namespace sync_primitives;
+using namespace threads;
+
+// TODO(AByzhynar): Change this to use Gtest class to create all variables for every TEST_F
+// TODO(AByzhynar): Add multithreading tests
+
+namespace {
+const uint32_t MAX_SIZE = 20;
+const size_t MyStackSize = 32768;
+const char *threadName("test thread");
+const std::string test_thread_name("THREAD");
+sync_primitives::ConditionalVariable cond_var_;
+sync_primitives::Lock test_mutex_;
+};
+
+// ThreadDelegate successor
+class TestThreadDelegate : public threads::ThreadDelegate {
+ public:
+ TestThreadDelegate()
+ : check_value_(false) {
+ }
+ void threadMain() {
+ AutoLock test_lock(test_mutex_);
+ check_value_ = true;
+ cond_var_.NotifyOne();
+ }
+
+ bool check_value() const {
+ return check_value_;
+ }
+ private:
+ bool check_value_;
+};
+
+TEST(PosixThreadTest, CreateThread_ExpectThreadCreated) {
+ // Arrange
+ threads::Thread *thread = NULL;
+ TestThreadDelegate *threadDelegate = new TestThreadDelegate();
+ // Create thread
+ ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
+ EXPECT_TRUE(thread != NULL);
+ EXPECT_EQ(thread, threadDelegate->thread());
+ EXPECT_EQ(thread->delegate(), threadDelegate);
+ DeleteThread(thread);
+ delete threadDelegate;
+ // Check Delegate Dtor worked successfully
+ EXPECT_EQ(NULL, thread->delegate());
+}
+
+TEST(PosixThreadTest, CheckCreatedThreadName_ExpectCorrectName) {
+ // Arrange
+ threads::Thread *thread = NULL;
+ threads::ThreadDelegate *threadDelegate = new TestThreadDelegate();
+ // Create thread
+ ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
+ // Check thread was created with correct name
+ EXPECT_EQ(threadName, thread->name());
+ DeleteThread(thread);
+ delete threadDelegate;
+ EXPECT_EQ(NULL, thread->delegate());
+}
+
+TEST(PosixThreadTest, CheckCreatedThreadNameChangeToLongName_ExpectThreadNameReduced) {
+ // Arrange
+ threads::Thread *thread = NULL;
+ TestThreadDelegate *threadDelegate = new TestThreadDelegate();
+ AutoLock test_lock(test_mutex_);
+ // Create thread
+ ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
+ thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize));
+ // Rename started thread. Name will be cut to 15 symbols + '\0'
+ // This is the limit in current POSIX thread implementation
+ thread->SetNameForId(thread->thread_handle(),
+ std::string("new thread with changed name"));
+ // Name must be large enough to keep 16 symbols. Read previous comment
+ char name[MAX_SIZE];
+ int result = pthread_getname_np(thread->thread_handle(), name, sizeof(name));
+ if (!result)
+ EXPECT_EQ(std::string("new thread with"), std::string(name));
+ cond_var_.WaitFor(test_lock, 10000);
+ EXPECT_TRUE(threadDelegate->check_value());
+ DeleteThread(thread);
+ delete threadDelegate;
+ EXPECT_EQ(NULL, thread->delegate());
+}
+
+TEST(PosixThreadTest, StartCreatedThreadWithOptionsJoinableAndMyStackSize_ExpectMyStackSizeStackAndJoinableThreadStarted) {
+ // Arrange
+ threads::Thread *thread = NULL;
+ TestThreadDelegate *threadDelegate = new TestThreadDelegate();
+ AutoLock test_lock(test_mutex_);
+ // Create thread
+ ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
+ // Start thread with following options (Stack size = 32768 & thread is joinable)
+ thread->start(threads::ThreadOptions(MyStackSize));
+ // Check thread is joinable
+ EXPECT_TRUE(thread->is_joinable());
+ // Check thread stack size is 32768
+ EXPECT_EQ(MyStackSize, thread->stack_size());
+ cond_var_.WaitFor(test_lock, 10000);
+ EXPECT_TRUE(threadDelegate->check_value());
+ DeleteThread(thread);
+ delete threadDelegate;
+ EXPECT_EQ(NULL, thread->delegate());
+}
+
+TEST(PosixThreadTest, StartCreatedThreadWithDefaultOptions_ExpectZeroStackAndJoinableThreadStarted) {
+ // Arrange
+ threads::Thread *thread = NULL;
+ TestThreadDelegate *threadDelegate = new TestThreadDelegate();
+ AutoLock test_lock(test_mutex_);
+ // Create thread
+ ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
+ // Start thread with default options (Stack size = 0 & thread is joinable)
+ thread->start(threads::ThreadOptions());
+ // Check thread is joinable
+ EXPECT_TRUE(thread->is_joinable());
+ // Check thread stack size is minimum value. Stack can not be 0
+ EXPECT_EQ(Thread::kMinStackSize, thread->stack_size());
+ cond_var_.WaitFor(test_lock, 10000);
+ EXPECT_TRUE(threadDelegate->check_value());
+ DeleteThread(thread);
+ delete threadDelegate;
+ EXPECT_EQ(NULL, thread->delegate());
+}
+
+TEST(PosixThreadTest, StartThreadWithZeroStackAndDetached_ExpectMinimumStackAndDetachedThreadStarted) {
+ // Arrange
+ threads::Thread *thread = NULL;
+ TestThreadDelegate *threadDelegate = new TestThreadDelegate();
+ AutoLock test_lock(test_mutex_);
+ // Create thread
+ ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
+ // Start thread with default options (Stack size = 0 & thread is detached)
+ thread->start(threads::ThreadOptions(0, false));
+ // Check thread is detached
+ EXPECT_FALSE(thread->is_joinable());
+ // Check thread stack size is 0
+ EXPECT_EQ(Thread::kMinStackSize, thread->stack_size());
+ cond_var_.WaitFor(test_lock, 10000);
+ EXPECT_TRUE(threadDelegate->check_value());
+ DeleteThread(thread);
+ delete threadDelegate;
+ EXPECT_EQ(NULL, thread->delegate());
+}
+
+TEST(PosixThreadTest, DISABLED_CheckCreatedThreadNameChangeToEmpty_ExpectThreadNameChangedToEmpty) {
+ // Arrange
+ threads::Thread *thread = NULL;
+ TestThreadDelegate *threadDelegate = new TestThreadDelegate();
+ AutoLock test_lock(test_mutex_);
+ // Create thread
+ ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
+ thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize));
+ // Rename started thread. Name will be cut to 15 symbols + '\0'
+ // This is the limit in current POSIX thread implementation
+ thread->SetNameForId(thread->thread_handle(), std::string(""));
+ // Name must be large enough to keep 16 symbols. Read previous comment
+ char name[MAX_SIZE];
+ int result = pthread_getname_np(thread->thread_handle(), name, sizeof(name));
+ if (!result) {
+ EXPECT_EQ(std::string(""), std::string(name));
+ }
+ cond_var_.WaitFor(test_lock, 10000);
+ EXPECT_TRUE(threadDelegate->check_value());
+ DeleteThread(thread);
+ delete threadDelegate;
+ EXPECT_EQ(NULL, thread->delegate());
+}
+
+TEST(PosixThreadTest, CheckCreatedThreadNameChangeToShortName_ExpectThreadNameChangedToShort) {
+ // Arrange
+ threads::Thread *thread = NULL;
+ TestThreadDelegate *threadDelegate = new TestThreadDelegate();
+ AutoLock test_lock(test_mutex_);
+ // Create thread
+ ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
+ // Start created thread
+ thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize));
+ // Rename started thread. Name will be cut to 15 symbols + '\0'
+ // This is the limit in current POSIX thread implementation
+ thread->SetNameForId(thread->thread_handle(), test_thread_name);
+ // Name must be large enough to keep 16 symbols. Read previous comment
+ char name[MAX_SIZE];
+ int result = pthread_getname_np(thread->thread_handle(), name, sizeof(name));
+ if (!result) {
+ EXPECT_EQ(test_thread_name, std::string(name));
+ }
+ cond_var_.WaitFor(test_lock, 10000);
+ EXPECT_TRUE(threadDelegate->check_value());
+ DeleteThread(thread);
+ delete threadDelegate;
+ EXPECT_EQ(NULL, thread->delegate());
+}
+
+TEST(PosixThreadTest, StartThread_ExpectThreadStarted) {
+ // Arrange
+ threads::Thread *thread = NULL;
+ TestThreadDelegate *threadDelegate = new TestThreadDelegate();
+ AutoLock test_lock(test_mutex_);
+ // Create thread
+ ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
+ // Start created thread
+ EXPECT_TRUE(thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize)));
+ cond_var_.WaitFor(test_lock, 10000);
+ EXPECT_TRUE(threadDelegate->check_value());
+ DeleteThread(thread);
+ delete threadDelegate;
+ EXPECT_EQ(NULL, thread->delegate());
+}
+
+TEST(PosixThreadTest, StartOneThreadTwice_ExpectTheSameThreadStartedTwice) {
+ // Arrange
+ PlatformThreadHandle thread1_id;
+ PlatformThreadHandle thread2_id;
+ threads::Thread *thread = NULL;
+ TestThreadDelegate *threadDelegate = new TestThreadDelegate();
+ AutoLock test_lock(test_mutex_);
+ // Create thread
+ ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
+ // Start created thread
+ EXPECT_TRUE(thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize)));
+ thread1_id = thread->CurrentId();
+ thread->stop();
+ // Try to start thread again
+ EXPECT_TRUE(thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize)));
+ thread2_id = thread->CurrentId();
+ EXPECT_EQ(thread1_id, thread2_id);
+ cond_var_.WaitFor(test_lock, 10000);
+ EXPECT_TRUE(threadDelegate->check_value());
+ DeleteThread(thread);
+ delete threadDelegate;
+ EXPECT_EQ(NULL, thread->delegate());
+}
+
+TEST(PosixThreadTest, StartOneThreadAgainAfterRename_ExpectRenamedThreadStarted) {
+ // Arrange
+ PlatformThreadHandle thread1_id;
+ PlatformThreadHandle thread2_id;
+ threads::Thread *thread = NULL;
+ TestThreadDelegate *threadDelegate = new TestThreadDelegate();
+ AutoLock test_lock(test_mutex_);
+ // Create thread
+ ASSERT_NO_THROW(thread = CreateThread(threadName, threadDelegate));
+ // Start created thread
+ EXPECT_TRUE(thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize)));
+ thread1_id = thread->CurrentId();
+ // Rename started thread. Name will be cut to 15 symbols + '\0'
+ // This is the limit in current POSIX thread implementation
+ thread->SetNameForId(thread->thread_handle(), test_thread_name);
+ // Name must be large enough to keep 16 symbols. Read previous comment
+ char name[MAX_SIZE];
+ int result = pthread_getname_np(thread->thread_handle(), name, sizeof(name));
+ if (!result)
+ EXPECT_EQ(test_thread_name, std::string(name));
+ // Stop thread
+ thread->stop();
+ EXPECT_TRUE(thread->start(threads::ThreadOptions(threads::Thread::kMinStackSize)));
+ thread2_id = thread->CurrentId();
+ // Expect the same thread started with the the same name
+ EXPECT_EQ(test_thread_name, std::string(name));
+ EXPECT_EQ(thread1_id, thread2_id);
+ cond_var_.WaitFor(test_lock, 10000);
+ EXPECT_TRUE(threadDelegate->check_value());
+ DeleteThread(thread);
+ delete threadDelegate;
+ EXPECT_EQ(NULL, thread->delegate());
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/prioritized_queue_test.cc b/src/components/utils/test/prioritized_queue_test.cc
new file mode 100644
index 000000000..19e168cdc
--- /dev/null
+++ b/src/components/utils/test/prioritized_queue_test.cc
@@ -0,0 +1,205 @@
+/*
+ * 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/prioritized_queue.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+using ::utils::PrioritizedQueue;
+
+class TestMessage {
+ public:
+ TestMessage()
+ : priority(0) {
+ }
+ TestMessage(std::string message, size_t msg_priority)
+ : msg_(message),
+ priority(msg_priority) {
+ }
+ size_t PriorityOrder() const;
+ std::string msg() const;
+ friend bool operator==(const TestMessage &msg1, const TestMessage &msg2);
+ private:
+ std::string msg_;
+ size_t priority;
+};
+
+size_t TestMessage::PriorityOrder() const {
+ return priority;
+}
+
+std::string TestMessage::msg() const {
+ return msg_;
+}
+
+bool operator==(const TestMessage &msg1, const TestMessage &msg2) {
+ return (msg1.msg() == msg2.msg()
+ && msg1.PriorityOrder() == msg2.PriorityOrder());
+}
+
+class PrioritizedQueueTest : public testing::Test {
+ protected:
+ PrioritizedQueue<TestMessage> test_queue;
+};
+
+TEST_F(PrioritizedQueueTest, DefaultCtorTest_ExpectEmptyQueueCreated) {
+ EXPECT_TRUE(test_queue.empty());
+}
+
+TEST_F(PrioritizedQueueTest, PushFourElementsTest_ExpectFourElementsAdded) {
+ // Creating 4 messages
+ TestMessage message1("Ford", 2);
+ TestMessage message2("Hello", 1);
+ TestMessage message3("Luxoft", 4);
+ TestMessage message4("from", 3);
+ // Adding created messages to Prioritized queue
+ test_queue.push(message4);
+ test_queue.push(message3);
+ test_queue.push(message1);
+ test_queue.push(message2);
+ // Expect 4 messages were added successfully
+ EXPECT_EQ(4u, test_queue.size());
+}
+
+TEST_F(PrioritizedQueueTest, AddFourElementsTest_ExpectQueueNotEmpty) {
+ // Creating 4 messages with different priorities
+ TestMessage message1("Ford", 2);
+ TestMessage message2("Hello", 1);
+ TestMessage message3("Luxoft", 4);
+ TestMessage message4("from", 3);
+ // Adding created messages to Prioritized queue
+ test_queue.push(message4);
+ test_queue.push(message3);
+ test_queue.push(message1);
+ test_queue.push(message2);
+ // Expect queue not empty
+ EXPECT_FALSE(test_queue.empty());
+}
+
+TEST_F(PrioritizedQueueTest, CheckMessageOrder_ExpectMessageWithHighestPriorityAddedFirst) {
+ // Creating 4 messages with different priorities
+ TestMessage message1("Ford", 111);
+ TestMessage message2("Hello", 21);
+ TestMessage message3("Luxoft", 14);
+ TestMessage message4("from", 4);
+ // Adding created messages to Prioritized queue. Expect queue ordered according priority
+ test_queue.push(message4);
+ test_queue.push(message3);
+ test_queue.push(message1);
+ test_queue.push(message2);
+ // Check the first message is the message with highest priority
+ EXPECT_EQ(message1, test_queue.front());
+}
+
+TEST_F(PrioritizedQueueTest, Push_AddMessagesWithEqualPriority_ExpectMessagesWithEqualPriorityAdded) {
+ // Creating 2 messages with the same priorities
+ TestMessage message1("Hello", 111);
+ TestMessage message2("Luxoft", 111);
+ // Adding created messages to Prioritized queue.
+ test_queue.push(message1);
+ test_queue.push(message2);
+ // Expect 2 messages were added successfully
+ EXPECT_EQ(2u, test_queue.size());
+}
+
+TEST_F(PrioritizedQueueTest, Pop_OneElementInPriorityQueue_ExpectQueueStillAliveWithRestMessagesWithEqualPriority) {
+ // Creating 4 messages with same priorities
+ TestMessage message1("Ford's", 111);
+ TestMessage message2("Partner", 111);
+ // Adding created messages to Prioritized queue.
+ test_queue.push(message1);
+ test_queue.push(message2);
+ // Expect 2 messages were added successfully to One element of prioritized queue
+ EXPECT_EQ(2u, test_queue.size());
+ // Extracting first element from the queue
+ EXPECT_EQ(message1, test_queue.front());
+ test_queue.pop();
+ // Check queue with the same priority messages still alive
+ EXPECT_EQ(1u, test_queue.size());
+ EXPECT_EQ(message2, test_queue.front());
+ test_queue.pop();
+ EXPECT_EQ(0u, test_queue.size());
+}
+
+TEST_F(PrioritizedQueueTest, Pop_TwoElementsInPriorityQueue_ExpectElementErasedIfOnlyOneWithConcretePriorityExist) {
+ // Creating 2 messages with same priority and 1 with different
+ TestMessage message1("Hello", 111);
+ TestMessage message2("Luxoft", 111);
+ TestMessage message3("Company", 77);
+ // Adding created messages to Prioritized queue.
+ test_queue.push(message1);
+ test_queue.push(message2);
+ test_queue.push(message3);
+ // Expect 3 messages were added successfully to Two elements of prioritized queue
+ EXPECT_EQ(3u, test_queue.size());
+ // Extracting first element from the queue
+ EXPECT_EQ(message1, test_queue.front());
+ test_queue.pop();
+ // Check queue with the same priority messages still alive
+ EXPECT_EQ(2u, test_queue.size());
+ EXPECT_EQ(message2, test_queue.front());
+ test_queue.pop();
+ EXPECT_EQ(message3, test_queue.front());
+ // Delete last element. Expect erased.
+ test_queue.pop();
+ EXPECT_EQ(0u, test_queue.size());
+}
+
+TEST_F(PrioritizedQueueTest, NotEmptyPrioritizedQueuePopElement_ExpectQueueDecreasedOneElement) {
+ // Creating 4 prioritized messages
+ TestMessage message1("Alice", 111);
+ TestMessage message2("in", 14);
+ TestMessage message3("Wonderland", 4);
+ // Adding created messages to Prioritized queue
+ test_queue.push(message2);
+ test_queue.push(message3);
+ test_queue.push(message1);
+ // Extracting first element from the queue
+ test_queue.pop();
+ // Check that one message was extracted
+ EXPECT_EQ(2u, test_queue.size());
+ // Checking if extracted message was the message with highest priority
+ // therefore now first message in queue has highest priority
+ EXPECT_EQ(message2, test_queue.front());
+ // Extracting first element from the queue
+ test_queue.pop();
+ // Checking if extracted message was the message with highest priority
+ // therefore now first message in queue has highest priority
+ EXPECT_EQ(message3, test_queue.front());
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/qdbserver.sh b/src/components/utils/test/qdbserver.sh
new file mode 100755
index 000000000..3f0144106
--- /dev/null
+++ b/src/components/utils/test/qdbserver.sh
@@ -0,0 +1,6 @@
+# This script star QDB server for SDL
+# Need superuser to start qdb
+
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/qnx650/target/qnx6/x86/usr/lib
+export LD_LIBRARY_PATH
+/usr/sbin/qdb -c test-qdb.ini
diff --git a/src/components/utils/test/resource_usage_test.cc b/src/components/utils/test/resource_usage_test.cc
new file mode 100644
index 000000000..cac5dc2e3
--- /dev/null
+++ b/src/components/utils/test/resource_usage_test.cc
@@ -0,0 +1,98 @@
+/*
+ * 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 <unistd.h>
+#include "gtest/gtest.h"
+#include "utils/macro.h"
+
+#include "utils/resource_usage.h"
+#include "utils/file_system.h"
+
+namespace utils {
+
+class ResourceUsagePrivateTest : public ::testing::Test {
+ protected:
+ Resources res;
+};
+
+TEST_F(ResourceUsagePrivateTest, ReadStatFileTest) {
+ std::string proc_buf;
+ EXPECT_TRUE(res.ReadStatFile(proc_buf));
+}
+
+TEST_F(ResourceUsagePrivateTest, GetProcInfoTest) {
+ Resources::PidStats pid_stat;
+ EXPECT_TRUE(res.GetProcInfo(pid_stat));
+}
+
+TEST_F(ResourceUsagePrivateTest, GetMemInfoTest) {
+ Resources::MemInfo mem_info;
+ EXPECT_TRUE(res.GetMemInfo(mem_info));
+}
+
+TEST_F(ResourceUsagePrivateTest, GetStatPathTest_FileExists) {
+ //arrange
+ std::string filename = res.GetStatPath();
+ //assert
+ EXPECT_TRUE(file_system::FileExists(filename));
+}
+
+TEST_F(ResourceUsagePrivateTest, GetStatPathTest_ReadFile) {
+ //arrange
+ std::string filename = res.GetStatPath();
+ std::string output;
+ //assert
+ EXPECT_TRUE(file_system::ReadFile(filename, output));
+
+}
+TEST_F(ResourceUsagePrivateTest, GetProcPathTest) {
+ ///arrange
+ std::string fd = res.GetProcPath();
+ std::string filename = res.GetStatPath();
+ //assert
+ EXPECT_EQ(filename, fd + "/stat");
+}
+}
+
+namespace test {
+namespace components {
+namespace utils_test {
+
+TEST(ResourceUsageTest, SuccesfulGrabResources) {
+ ::utils::ResourseUsage* resources = ::utils::Resources::getCurrentResourseUsage();
+ EXPECT_TRUE(resources != NULL);
+ delete resources;
+}
+
+} // namespace utils_test
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/rwlock_posix_test.cc b/src/components/utils/test/rwlock_posix_test.cc
new file mode 100644
index 000000000..779b57ff3
--- /dev/null
+++ b/src/components/utils/test/rwlock_posix_test.cc
@@ -0,0 +1,143 @@
+/*
+ * 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/rwlock.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+using sync_primitives::RWLock;
+
+class RWlockTest : public ::testing::Test {
+ public:
+ void ThreadsDispatcher(void* (*func)(void*)) {
+ for (uint8_t i = 0; i < kNum_threads_; ++i) {
+ bool thread_created = (pthread_create(&thread[i], NULL, func, this) == 0);
+ ASSERT_TRUE(thread_created);
+ }
+ for (uint8_t i = 0; i < kNum_threads_; ++i) {
+ pthread_join(thread[i], NULL);
+ }
+ }
+
+ void ReadLock() {
+ EXPECT_TRUE(test_rwlock.AcquireForReading());
+ EXPECT_TRUE(test_rwlock.Release());
+ }
+
+ void ExpectReadLockFail() {
+ bool temp = test_rwlock.TryAcquireForReading();
+ EXPECT_FALSE(temp);
+ if (temp) {
+ test_rwlock.Release();
+ }
+ }
+
+ void ExpectWriteLockFail() {
+ bool temp = test_rwlock.TryAcquireForWriting();
+ EXPECT_FALSE(temp);
+ if (temp) {
+ test_rwlock.Release();
+ }
+ }
+
+ static void* ReadLock_helper(void *context) {
+ RWlockTest *temp = reinterpret_cast<RWlockTest *>(context);
+ temp->ReadLock();
+ return NULL;
+ }
+
+ static void* TryReadLock_helper(void *context) {
+ RWlockTest *temp = reinterpret_cast<RWlockTest *>(context);
+ temp->ExpectReadLockFail();
+ return NULL;
+ }
+
+ static void* TryWriteLock_helper(void *context) {
+ RWlockTest *temp = reinterpret_cast<RWlockTest *>(context);
+ temp->ExpectWriteLockFail();
+ return NULL;
+ }
+
+ protected:
+ RWLock test_rwlock;
+ enum { kNum_threads_ = 5 };
+ pthread_t thread[kNum_threads_];
+};
+
+TEST_F(RWlockTest, AcquireForReading_ExpectAccessForReading) {
+ // Lock rw lock for reading
+ EXPECT_TRUE(test_rwlock.AcquireForReading());
+ // Try to lock rw lock for reading again
+ EXPECT_TRUE(test_rwlock.AcquireForReading());
+ // Creating kNumThreads threads, starting them with callback function, waits until all of them finished
+ ThreadsDispatcher(&RWlockTest::ReadLock_helper);
+ // Releasing RW locks
+ EXPECT_TRUE(test_rwlock.Release());
+ EXPECT_TRUE(test_rwlock.Release());
+}
+
+TEST_F(RWlockTest, AcquireForReading_ExpectNoAccessForWriting) {
+ // Lock rw lock for reading
+ EXPECT_TRUE(test_rwlock.AcquireForReading());
+ // Try to lock rw lock for writing
+ EXPECT_FALSE(test_rwlock.TryAcquireForWriting());
+ // Creating kNumThreads threads, starting them with callback function, waits until all of them finished
+ ThreadsDispatcher(&RWlockTest::TryWriteLock_helper);
+ EXPECT_TRUE(test_rwlock.Release());
+}
+
+TEST_F(RWlockTest, AcquireForWriting_ExpectNoAccessForReading) {
+ // Lock rw lock for writing
+ EXPECT_TRUE(test_rwlock.AcquireForWriting());
+ // Try to lock rw lock for reading
+ EXPECT_FALSE(test_rwlock.TryAcquireForReading());
+ // Creating kNumThreads threads, starting them with callback function, waits until all of them finished
+ ThreadsDispatcher(&RWlockTest::TryReadLock_helper);
+ EXPECT_TRUE(test_rwlock.Release());
+}
+
+TEST_F(RWlockTest, AcquireForWriting_ExpectNoMoreAccessForWriting) {
+ // Lock rw lock for writing
+ EXPECT_TRUE(test_rwlock.AcquireForWriting());
+ // Try to lock rw lock for reading
+ EXPECT_FALSE(test_rwlock.TryAcquireForWriting());
+ // Creating kNumThreads threads, starting them with callback function, waits until all of them finished
+ ThreadsDispatcher(&RWlockTest::TryWriteLock_helper);
+ EXPECT_TRUE(test_rwlock.Release());
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/scope_guard_test.cc b/src/components/utils/test/scope_guard_test.cc
new file mode 100644
index 000000000..ac05c2828
--- /dev/null
+++ b/src/components/utils/test/scope_guard_test.cc
@@ -0,0 +1,121 @@
+/*
+ * 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 "utils/scope_guard.h"
+#include "utils/macro.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+using ::utils::ScopeGuard;
+using ::utils::MakeGuard;
+using ::utils::MakeObjGuard;
+using ::testing::Mock;
+
+class TestObject {
+ public:
+ MOCK_METHOD0(function_to_call, void());
+ MOCK_METHOD1(function_to_call_with_param, void(void*));
+};
+
+namespace {
+static int call_with_param_count;
+void dealloc(char* ptr) {
+ delete ptr;
+ ++call_with_param_count;
+}
+}
+
+TEST(ScopeGuardTest, CallFreeFunctionWithParam) {
+ {
+ call_with_param_count = 0;
+ char* ptr = new char;
+ ScopeGuard guard = MakeGuard(dealloc, ptr);
+ UNUSED(guard);
+ }
+ EXPECT_EQ(1, call_with_param_count);
+}
+
+TEST(ScopeGuardTest, CallObjectFunction) {
+ TestObject obj;
+ Mock::AllowLeak(&obj); // Google tests bug
+ EXPECT_CALL(obj, function_to_call()).Times(1);
+ {
+ ScopeGuard guard = MakeObjGuard(obj, &TestObject::function_to_call);
+ UNUSED(guard);
+ }
+}
+
+TEST(ScopeGuardTest, CallObjectFunctionWithParam) {
+ TestObject obj;
+ EXPECT_CALL(obj, function_to_call_with_param(&obj)).Times(1);
+ {
+ ScopeGuard guard =
+ MakeObjGuard(obj, &TestObject::function_to_call_with_param, &obj);
+ UNUSED(guard);
+ }
+}
+
+TEST(ScopeGuardTest, DismissCallFreeFunctionWithParam) {
+ {
+ call_with_param_count = 0;
+ char* ptr = new char;
+ ScopeGuard guard = MakeGuard(dealloc, ptr);
+ guard.Dismiss();
+ }
+ EXPECT_EQ(0, call_with_param_count);
+}
+
+TEST(ScopeGuardTest, DismissCallObjectFunction) {
+ TestObject obj;
+ EXPECT_CALL(obj, function_to_call()).Times(0);
+ {
+ ScopeGuard guard = MakeObjGuard(obj, &TestObject::function_to_call);
+ guard.Dismiss();
+ }
+}
+
+TEST(ScopeGuardTest, DismissCallObjectFunctionWithParam) {
+ TestObject obj;
+ EXPECT_CALL(obj, function_to_call_with_param(&obj)).Times(0);
+ {
+ ScopeGuard guard =
+ MakeObjGuard(obj, &TestObject::function_to_call_with_param, &obj);
+ guard.Dismiss();
+ }
+}
+
+} // namespace utils
+} // components
+} // namesapce test
diff --git a/src/components/utils/test/shared_ptr_test.cc b/src/components/utils/test/shared_ptr_test.cc
new file mode 100644
index 000000000..92d867fe7
--- /dev/null
+++ b/src/components/utils/test/shared_ptr_test.cc
@@ -0,0 +1,544 @@
+/*
+ * 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 {
+namespace SharedPtrTest {
+
+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);
+};
+
+} // namespace CMockObject
+} // namespace SmartObjects
+} // namespace components
+} // namespace test
+
+using namespace test::components::utils::SharedPtrTest;
+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, 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);
+}
diff --git a/src/components/utils/test/signals_linux_test.cc b/src/components/utils/test/signals_linux_test.cc
new file mode 100644
index 000000000..263f240ec
--- /dev/null
+++ b/src/components/utils/test/signals_linux_test.cc
@@ -0,0 +1,55 @@
+/*
+ * 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 <unistd.h>
+#include <assert.h>
+#include "gtest/gtest.h"
+#include "utils/signals.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+void handler(int sig) {
+}
+
+TEST(SignalsLinuxTest, SubscribeToTerminateSignal_Positive) {
+ ASSERT_TRUE(::utils::SubscribeToTerminateSignal(handler));
+}
+
+TEST(SignalsLinuxTest, SubscribeToFaultSignal_Positive) {
+ ASSERT_TRUE(::utils::SubscribeToFaultSignal(handler));
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/singleton_test.cc b/src/components/utils/test/singleton_test.cc
new file mode 100644
index 000000000..8a9e6b31e
--- /dev/null
+++ b/src/components/utils/test/singleton_test.cc
@@ -0,0 +1,189 @@
+/*
+ * 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/singleton.h"
+#include <pthread.h>
+
+namespace test {
+namespace components {
+namespace utils {
+
+using ::utils::Singleton;
+
+class SingletonTest : public ::utils::Singleton<SingletonTest> {
+ public:
+
+ void SetValue(int value) {
+ test_value = value;
+ }
+ int GetValue() {
+ return test_value;
+ }
+
+ FRIEND_BASE_SINGLETON_CLASS (SingletonTest);
+ private:
+ int test_value;
+};
+
+TEST(SingletonTest, CreateAndDestroySingleton) {
+ //assert
+ ASSERT_EQ(SingletonTest::instance(), SingletonTest::instance());
+ ASSERT_EQ(0, SingletonTest::instance()->GetValue());
+ ASSERT_TRUE(SingletonTest::exists());
+ SingletonTest::instance()->SetValue(5);
+ ASSERT_EQ(5, SingletonTest::instance()->GetValue());
+
+ //act
+ SingletonTest::destroy();
+
+ //assert
+ ASSERT_FALSE(SingletonTest::exists());
+}
+
+TEST(SingletonTest, DestroySingletonTwice) {
+ //assert
+ ASSERT_EQ(0, SingletonTest::instance()->GetValue());
+ ASSERT_TRUE(SingletonTest::exists());
+
+ //act
+ SingletonTest::destroy();
+ //assert
+ ASSERT_FALSE(SingletonTest::exists());
+
+ //act
+ SingletonTest::destroy();
+ //assert
+ ASSERT_FALSE(SingletonTest::exists());
+}
+
+TEST(SingletonTest, DeleteSingletonCreateAnother) {
+ //arrange
+ SingletonTest::instance()->SetValue(10);
+ //assert
+ ASSERT_TRUE(SingletonTest::exists());
+ ASSERT_EQ(10, SingletonTest::instance()->GetValue());
+ //act
+ SingletonTest::destroy();
+ //assert
+ ASSERT_FALSE(SingletonTest::exists());
+
+ //act
+ SingletonTest::instance();
+
+ //assert
+ ASSERT_EQ(0, SingletonTest::instance()->GetValue());
+ ASSERT_TRUE(SingletonTest::exists());
+ SingletonTest::destroy();
+}
+
+void* func_pthread1(void*) {
+ SingletonTest* singleton_in_other_thread = SingletonTest::instance();
+ pthread_exit(singleton_in_other_thread);
+ return NULL;
+}
+
+void* func_pthread2(void * value) {
+ SingletonTest * instance = reinterpret_cast<SingletonTest *>(value);
+ instance->destroy();
+ pthread_exit (NULL);
+ return NULL;
+}
+
+TEST(SingletonTest, CreateSingletonInDifferentThreads) {
+ //arrange
+ SingletonTest::instance();
+ ASSERT_TRUE(SingletonTest::exists());
+
+ pthread_t thread1;
+ pthread_create(&thread1, NULL, func_pthread1, NULL);
+
+ void *instance2;
+ pthread_join(thread1, &instance2);
+ SingletonTest * instance_2 = reinterpret_cast<SingletonTest *>(instance2);
+
+ //assert
+ ASSERT_EQ(SingletonTest::instance(), instance_2);
+
+ //act
+ SingletonTest::destroy();
+ //assert
+ ASSERT_FALSE(SingletonTest::exists());
+}
+
+TEST(SingletonTest, CreateDeleteSingletonInDifferentThreads) {
+ //arrange
+ pthread_t thread1;
+ pthread_create(&thread1, NULL, func_pthread1, NULL);
+
+ pthread_t thread2;
+ pthread_create(&thread2, NULL, func_pthread1, NULL);
+
+ void *instance1;
+ pthread_join(thread1, &instance1);
+ SingletonTest * instance_1 = reinterpret_cast<SingletonTest *>(instance1);
+
+ void *instance2;
+ pthread_join(thread2, &instance2);
+ SingletonTest * instance_2 = reinterpret_cast<SingletonTest *>(instance2);
+
+ //assert
+ ASSERT_TRUE(instance_1->exists());
+ ASSERT_TRUE(instance_2->exists());
+
+ ASSERT_EQ(instance_1, instance_2);
+
+ //act
+ SingletonTest::destroy();
+
+ //assert
+ ASSERT_FALSE(instance_1->exists());
+ ASSERT_FALSE(instance_2->exists());
+}
+
+TEST(SingletonTest, DeleteSingletonInDifferentThread) {
+ //arrange
+ SingletonTest::instance();
+ ASSERT_TRUE(SingletonTest::exists());
+
+ pthread_t thread1;
+ pthread_create(&thread1, NULL, func_pthread2, SingletonTest::instance());
+
+ pthread_join(thread1, NULL);
+
+ //assert
+ ASSERT_FALSE(SingletonTest::exists());
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/stl_utils_test.cc b/src/components/utils/test/stl_utils_test.cc
new file mode 100644
index 000000000..dfc00de98
--- /dev/null
+++ b/src/components/utils/test/stl_utils_test.cc
@@ -0,0 +1,108 @@
+/*
+ * 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 <vector>
+#include <map>
+#include "gtest/gtest.h"
+#include "utils/stl_utils.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+using ::utils::StlCollectionDeleter;
+using ::utils::StlMapDeleter;
+
+class TestObject {
+ public:
+ ~TestObject() {
+ }
+};
+
+typedef std::map<int, TestObject*> TestMap;
+typedef std::vector<TestObject*> TestVector;
+
+TEST(StlDeleter, DestructMapWithOneElement) {
+ TestMap test_map;
+ test_map[1] = new TestObject();
+
+ EXPECT_EQ(1u, test_map.size());
+ {
+ StlMapDeleter<TestMap> test_list_deleter_(&test_map);
+ }
+ EXPECT_EQ(1u, test_map.size());
+ EXPECT_EQ(NULL, test_map[1]);
+}
+
+TEST(StlDeleter, DestructMapWithSeveralElements) {
+ TestMap test_map;
+ test_map[1] = new TestObject();
+ test_map[2] = new TestObject();
+
+ EXPECT_EQ(2u, test_map.size());
+ {
+ StlMapDeleter<TestMap> test_list_deleter_(&test_map);
+ }
+ EXPECT_EQ(2u, test_map.size());
+ EXPECT_EQ(NULL, test_map[1]);
+ EXPECT_EQ(NULL, test_map[2]);
+}
+
+TEST(StlDeleter, DestructVectorWithOneElement) {
+ TestVector test_vector;
+ test_vector.push_back(new TestObject());
+
+ EXPECT_EQ(1u, test_vector.size());
+ {
+ StlCollectionDeleter<TestVector> test_list_deleter_(&test_vector);
+ }
+ EXPECT_EQ(1u, test_vector.size());
+ EXPECT_EQ(NULL, test_vector[0]);
+}
+
+TEST(StlDeleter, DestructVectorWithSeveralElements) {
+ TestVector test_vector;
+ test_vector.push_back(new TestObject());
+ test_vector.push_back(new TestObject());
+
+ EXPECT_EQ(2u, test_vector.size());
+ {
+ StlCollectionDeleter<TestVector> test_list_deleter_(&test_vector);
+ }
+ EXPECT_EQ(2u, test_vector.size());
+ EXPECT_EQ(NULL, test_vector[0]);
+ EXPECT_EQ(NULL, test_vector[1]);
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/system_test.cc b/src/components/utils/test/system_test.cc
new file mode 100644
index 000000000..42307998b
--- /dev/null
+++ b/src/components/utils/test/system_test.cc
@@ -0,0 +1,125 @@
+/*
+ * 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 "gmock/gmock.h"
+#include "utils/system.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+using namespace ::utils;
+
+TEST(SystemTest, Constructor_WithCommandName_ExpectArgsStored) {
+ // Command creation without any arguments
+ const std::string test_command("ls");
+ System object(test_command);
+
+ // Check if the object was created with correct command
+ ASSERT_EQ(object.command(), test_command);
+ int vec_size = object.argv().size();
+ ASSERT_EQ(vec_size, 1);
+}
+
+TEST(SystemTest, Constructor_WithFileNameCommandName_ExpectArgsStored) {
+ // Command creation with 1 argument
+ const std::string test_command("ls");
+ const std::string test_list_args("-la");
+ System object(test_command, test_list_args);
+
+ // Check if the object was created with correct command
+ ASSERT_EQ(object.command(), test_command);
+
+ // Check if actual number of arguments arec correct
+ int vec_size = object.argv().size();
+ ASSERT_EQ(vec_size, 1); // Correct number of arguments is 1
+
+}
+
+TEST(SystemTest, AddTwoArgsToCommand_ExpectTwoArgsAdded) {
+ const std::string test_command("echo");
+ const char* args[] = {"-e", "\b"};
+ System object(test_command);
+
+ // Adding arguments
+ object.Add(args[0]);
+ object.Add(args[1]);
+
+ // Check if actual number of arguments equal args stored in object
+ int vec_size = object.argv().size();
+ ASSERT_EQ(vec_size, 3); // Correct number of arguments is 3
+}
+
+TEST(SystemTest, AddTwoArgsToCommand_CheckOrder_ExpectOrderCorrect) {
+ const std::string test_command("echo");
+ const char* args[] = {"-e", "\b"};
+ System object(test_command);
+
+ // Adding arguments
+ object.Add(args[0]);
+ object.Add(args[1]);
+
+ // Check if the object was appended by correct arguments in correct order
+ EXPECT_STREQ(object.argv()[1].c_str(), args[0]);
+ EXPECT_STREQ(object.argv()[2].c_str(), args[1]);
+}
+
+
+
+TEST(SystemTest, SynchronousInvokeWithExistingCommand_ExpectSuccessfull) {
+ const std::string test_command("./testscript.sh");
+ System object(test_command);
+
+ // Check if Execute() method is working properly with synchronous command invoke
+ ASSERT_TRUE(object.Execute(true));
+}
+
+TEST(SystemTest, SynchronousInvokeWithEmptyCommand_IncorrectCommand_ExpectFailed) {
+ const std::string test_command(""); // any incorrect command
+ System object(test_command);
+
+ // Check if Execute() method will fail with not correct command (synchronous command invoke)
+ ASSERT_FALSE(object.Execute(true));
+}
+
+TEST(SystemTest, ASynchronousInvokeEmptyCommand_InvokeSuccessfull) {
+ const std::string test_command(""); // Possible to put here any command (existing or incorrect)
+ const std::string test_list_args("anything"); // as command will never be executed from child process
+ System object(test_command, test_list_args); // as parrent process does not wait for child process to be finished
+
+ // Check if Execute() method is working properly with asynchronous command invoke
+ ASSERT_TRUE(object.Execute());
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/test-qdb.ini b/src/components/utils/test/test-qdb.ini
new file mode 100644
index 000000000..5f8c46c0c
--- /dev/null
+++ b/src/components/utils/test/test-qdb.ini
@@ -0,0 +1,11 @@
+# This config file for QDB
+# Format see in manual of QNX
+[policy]
+Filename=policy.db
+Schema File=policy.sql
+
+[test-database]
+Filename=test-database.sqlite
+
+[test-query]
+Filename=test-query.sqlite \ No newline at end of file
diff --git a/src/components/utils/test/testscript.sh b/src/components/utils/test/testscript.sh
new file mode 100755
index 000000000..c42d8e78b
--- /dev/null
+++ b/src/components/utils/test/testscript.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+echo "Hello, Ford "
+
+
+
diff --git a/src/components/utils/test/thread_validator_test.cc b/src/components/utils/test/thread_validator_test.cc
new file mode 100644
index 000000000..16d9d1287
--- /dev/null
+++ b/src/components/utils/test/thread_validator_test.cc
@@ -0,0 +1,53 @@
+/*
+ * 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 <unistd.h>
+
+#include "gtest/gtest.h"
+
+#include "utils/threads/thread_validator.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+using namespace ::threads;
+
+TEST(ThreadValidatorTest, CompareID_CurrentThreadAndPthread_AreEqual) {
+ SingleThreadSimpleValidator object;
+ ASSERT_EQ(object.creation_thread_id(), pthread_self());
+
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/timer_thread_test.cc b/src/components/utils/test/timer_thread_test.cc
new file mode 100644
index 000000000..6a758873f
--- /dev/null
+++ b/src/components/utils/test/timer_thread_test.cc
@@ -0,0 +1,153 @@
+/*
+ * 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 <pthread.h>
+#include <iostream>
+
+#include "lock.h"
+#include "macro.h"
+
+#include "gtest/gtest.h"
+#include "utils/conditional_variable.h"
+#include "utils/timer_thread.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+using namespace timer;
+using namespace sync_primitives;
+
+class TimerThreadTest : public ::testing::Test {
+ public:
+ TimerThreadTest()
+ : check_val(0),
+ val1(3),
+ val2(4),
+ wait_val(3000) {
+ }
+
+ void function() {
+ AutoLock alock(lock_);
+ ++check_val;
+ condvar_.NotifyOne();
+ }
+
+ protected:
+ uint32_t check_val;
+ Lock lock_;
+ ConditionalVariable condvar_;
+ const uint32_t val1;
+ const uint32_t val2;
+ const uint32_t wait_val;
+};
+
+TEST_F(TimerThreadTest, StartTimerThreadWithTimeoutOneSec_ExpectSuccessfullInvokeCallbackFuncOnTimeout) {
+ // Create Timer with TimerDeleagate
+ TimerThread<TimerThreadTest> timer("Test", this, &TimerThreadTest::function,
+ false);
+ AutoLock alock(lock_);
+ EXPECT_EQ(0u, check_val);
+ timer.start(100);
+ condvar_.WaitFor(alock, wait_val);
+ EXPECT_EQ(1u, check_val);
+}
+
+TEST_F(TimerThreadTest, StartTimerThreadWithTimeoutOneSecInLoop_ExpectSuccessfullInvokeCallbackFuncOnEveryTimeout) {
+ // Create Timer with TimerLooperDeleagate
+ TimerThread<TimerThreadTest> timer("Test", this, &TimerThreadTest::function,
+ true);
+ AutoLock alock(lock_);
+ EXPECT_EQ(0u, check_val);
+ timer.start(100);
+ while (check_val < val2) {
+ condvar_.WaitFor(alock, wait_val);
+ }
+ // Check callback function was called 4 times
+ EXPECT_EQ(val2, check_val);
+}
+
+TEST_F(TimerThreadTest, StopStartedTimerThreadWithTimeoutOneSecInLoop_ExpectSuccessfullStop) {
+ // Create Timer with TimerLooperDeleagate
+ TimerThread<TimerThreadTest> timer("Test", this, &TimerThreadTest::function,
+ true);
+ AutoLock alock(lock_);
+ EXPECT_EQ(0u, check_val);
+ timer.start(100);
+ // Stop timer on 3rd second
+ while (check_val < val2) {
+ if (check_val == val1) {
+ timer.stop();
+ break;
+ }
+ condvar_.WaitFor(alock, wait_val);
+ }
+ EXPECT_EQ(val1, check_val);
+}
+
+TEST_F(TimerThreadTest, ChangeTimeoutForStartedTimerThreadWithTimeoutOneSecInLoop_ExpectSuccessfullStop) {
+ // Create Timer with TimerLooperDeleagate
+ TimerThread<TimerThreadTest> timer("Test", this, &TimerThreadTest::function,
+ true);
+ AutoLock alock(lock_);
+ EXPECT_EQ(0u, check_val);
+ timer.start(100);
+ // Change timer timeout
+ while (check_val < val2) {
+ if (check_val == val1) {
+ timer.updateTimeOut(200);
+ }
+ condvar_.WaitFor(alock, wait_val);
+ }
+ EXPECT_EQ(val2, check_val);
+}
+
+TEST_F(TimerThreadTest, CheckStartedTimerIsRunning_ExpectTrue) {
+ // Create Timer with TimerLooperDeleagate
+ TimerThread<TimerThreadTest> timer("Test", this, &TimerThreadTest::function,
+ true);
+ AutoLock alock(lock_);
+ EXPECT_EQ(0u, check_val);
+ timer.start(100);
+ // Change timer timeout on 3rd second
+ while (check_val < val1) {
+ condvar_.WaitFor(alock, wait_val);
+ // Check start is running
+ EXPECT_TRUE(timer.isRunning());
+ }
+ EXPECT_EQ(val1, check_val);
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
+
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 73c0db32f..cb0052e1a 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -8,8 +8,8 @@ include_directories(
${CMAKE_SOURCE_DIR}/test/components/include)
# --- components tests
-add_subdirectory(./components)
-add_subdirectory(./thirdPartyLibs)
+#add_subdirectory(./components)
+#add_subdirectory(./thirdPartyLibs)
add_subdirectory(./tools)
set (INCLUDE_DIR
@@ -17,6 +17,7 @@ set (INCLUDE_DIR
${JSONCPP_INCLUDE_DIRECTORY}
${MESSAGE_BROKER_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${CMAKE_SOURCE_DIR}/src/components/utils/include
../src/appMain
../src/components/application_manager/include
../src/components/hmi_message_handler/include
@@ -105,11 +106,11 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif()
endif()
-add_executable("test_suit" "./test_suit.cc")
-file(COPY ${CMAKE_SOURCE_DIR}/mycert.pem ${CMAKE_SOURCE_DIR}/mykey.pem DESTINATION ${CMAKE_BINARY_DIR}/test/)
-file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+#add_executable("test_suit" "./test_suit.cc")
+#file(COPY ${CMAKE_SOURCE_DIR}/mycert.pem ${CMAKE_SOURCE_DIR}/mykey.pem DESTINATION ${CMAKE_BINARY_DIR}/test/)
+#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-include_directories(${INCLUDE_DIR})
-target_link_libraries("test_suit" ${LIBRARIES})
+#include_directories(${INCLUDE_DIR})
+#target_link_libraries("test_suit" ${LIBRARIES})
# vim: set ts=2 sw=2 et:
diff --git a/test/components/CMakeLists.txt b/test/components/CMakeLists.txt
index 924bb7a88..5a0af2f38 100644
--- a/test/components/CMakeLists.txt
+++ b/test/components/CMakeLists.txt
@@ -6,19 +6,19 @@ add_subdirectory(./transport_manager)
add_subdirectory(./json_handler)
# --- SmartObjects
-add_subdirectory(./smart_objects)
+#add_subdirectory(./smart_objects)
# --- AppMgr
-add_subdirectory(./application_manager)
+#add_subdirectory(./application_manager)
if(ENABLE_SECURITY)
# --- ProtocolHandler
-add_subdirectory(./protocol_handler)
+#add_subdirectory(./protocol_handler)
# --- SecurityManager
-add_subdirectory(./security_manager)
+#add_subdirectory(./security_manager)
# TODO(EZamakhov): split connection tests and security
# --- ConnectionHandler
-add_subdirectory(./connection_handler)
+#add_subdirectory(./connection_handler)
endif()
add_subdirectory(./hmi_message_handler)
@@ -30,7 +30,7 @@ add_subdirectory(./hmi_message_handler)
#add_subdirectory(./media_manager)
# -- rpc_base
-add_subdirectory(./rpc_base)
+#add_subdirectory(./rpc_base)
# --- DBus
if(${QT_HMI})
diff --git a/test/components/application_manager/CMakeLists.txt b/test/components/application_manager/CMakeLists.txt
index cdf43100d..9d5e3802b 100644
--- a/test/components/application_manager/CMakeLists.txt
+++ b/test/components/application_manager/CMakeLists.txt
@@ -7,10 +7,10 @@
include_directories (
${LOG4CXX_INCLUDE_DIRECTORY}
${GMOCK_INCLUDE_DIRECTORY}
+ ${CMAKE_SOURCE_DIR}/src/components/utils/include
../../../src/components/application_manager/include
../../../src/components/smart_objects/include
../../../src/components/formatters/include/
- ../../../src/components/utils/include/
${JSONCPP_INCLUDE_DIRECTORY}
${CMAKE_BINARY_DIR}/src/components/
)
diff --git a/test/components/application_manager/formatters_commands.h b/test/components/application_manager/formatters_commands.h
index 98e382fca..c3530944e 100644
--- a/test/components/application_manager/formatters_commands.h
+++ b/test/components/application_manager/formatters_commands.h
@@ -138,7 +138,7 @@ TEST(json2_command, notification) {
}
TEST(json2_command, request_no_params) {
- std::string incoming_string = "{\"id\":5005,\"jsonrpc\":\"2.0\",\"method\":\"BasicCommunication.GetAppList\"}";
+ std::string incoming_string = "{\"id\":5005,\"jsonrpc\":\"2.0\",\"method\":\"BasicCommunication.GeApplictionSet\"}";
smart_objects::SmartObject incoming_message;
diff --git a/test/components/application_manager/generated_factory.h b/test/components/application_manager/generated_factory.h
index b84c504d8..27ac61def 100644
--- a/test/components/application_manager/generated_factory.h
+++ b/test/components/application_manager/generated_factory.h
@@ -77,7 +77,7 @@ TEST(generated_factory, create) {
"application_manager::SomeClass",
new test_command::SomeClass);
- if (!thread->startWithOptions(
+ if (!thread->start(
threads::ThreadOptions(16384))) {
std::cout << "Something went wrong with thread." << std::endl;
return;
diff --git a/test/components/connection_handler/CMakeLists.txt b/test/components/connection_handler/CMakeLists.txt
index 7d281e33e..9e0a8ba97 100644
--- a/test/components/connection_handler/CMakeLists.txt
+++ b/test/components/connection_handler/CMakeLists.txt
@@ -4,6 +4,7 @@ include_directories (
./include
${CMAKE_SOURCE_DIR}/src/components/connection_handler/include
${CMAKE_SOURCE_DIR}/src/components/protocol_handler/include
+ ${CMAKE_SOURCE_DIR}/src/components/utils/include
../../../src/components/utils/include
../../../src/components/config_profile/include
../security_manager/include
diff --git a/test/components/connection_handler/include/connection_handler/heart_beat_monitor_test.h b/test/components/connection_handler/include/connection_handler/heart_beat_monitor_test.h
index b6fba79e2..01a89618a 100644
--- a/test/components/connection_handler/include/connection_handler/heart_beat_monitor_test.h
+++ b/test/components/connection_handler/include/connection_handler/heart_beat_monitor_test.h
@@ -65,11 +65,12 @@ class ConnectionHandlerMock : public connection_handler::ConnectionHandler {
MOCK_METHOD2(GetDeviceID,
bool(const std::string& mac_address,
connection_handler::DeviceHandle* device_handle));
- MOCK_METHOD1(CloseSession,
- void(uint32_t key));
MOCK_METHOD2(CloseSession,
+ void(uint32_t key, connection_handler::CloseSessionReason));
+ MOCK_METHOD3(CloseSession,
void(connection_handler::ConnectionHandle connection_handle,
- uint8_t session_id));
+ uint8_t session_id,
+ connection_handler::CloseSessionReason));
MOCK_METHOD1(StartSessionHeartBeat,
void(uint32_t key));
MOCK_METHOD2(SendHeartBeat,
@@ -127,7 +128,8 @@ TEST_F(HeartBeatMonitorTest, TimerNotElapsed) {
TEST_F(HeartBeatMonitorTest, TimerElapsed) {
const uint32_t session = conn->AddNewSession();
- EXPECT_CALL(connection_handler_mock, CloseSession(_, session)).Times(1)
+ EXPECT_CALL(connection_handler_mock, CloseSession(
+ _,session, connection_handler::kCommon)).Times(1)
.WillOnce(RemoveSession(conn, session));
EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(1);
EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, session)).Times(1);
@@ -137,7 +139,8 @@ TEST_F(HeartBeatMonitorTest, TimerElapsed) {
}
TEST_F(HeartBeatMonitorTest, KeptAlive) {
- EXPECT_CALL(connection_handler_mock, CloseSession(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock, CloseSession(
+ _, _, connection_handler::kCommon)).Times(0);
EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(0);
EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0);
@@ -155,7 +158,8 @@ TEST_F(HeartBeatMonitorTest, KeptAlive) {
TEST_F(HeartBeatMonitorTest, NotKeptAlive) {
const uint32_t session = conn->AddNewSession();
- EXPECT_CALL(connection_handler_mock, CloseSession(_, session)).Times(1)
+ EXPECT_CALL(connection_handler_mock, CloseSession(
+ _, session, connection_handler::kCommon)).Times(1)
.WillOnce(RemoveSession(conn, session));
EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(1);
EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, session)).Times(1);
@@ -174,9 +178,11 @@ TEST_F(HeartBeatMonitorTest, TwoSessionsElapsed) {
const uint32_t kSession1 = conn->AddNewSession();
const uint32_t kSession2 = conn->AddNewSession();
- EXPECT_CALL(connection_handler_mock, CloseSession(_, kSession1)).Times(1)
+ EXPECT_CALL(connection_handler_mock, CloseSession(
+ _, kSession1, connection_handler::kCommon)).Times(1)
.WillOnce(RemoveSession(conn, kSession1));
- EXPECT_CALL(connection_handler_mock, CloseSession(_, kSession2)).Times(1)
+ EXPECT_CALL(connection_handler_mock, CloseSession(
+ _, kSession2, connection_handler::kCommon)).Times(1)
.WillOnce(RemoveSession(conn, kSession2));
EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(1);
EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession1)).Times(1);
@@ -190,14 +196,15 @@ TEST_F(HeartBeatMonitorTest, TwoSessionsElapsed) {
TEST_F(HeartBeatMonitorTest, IncreaseHeartBeatTimeout) {
const uint32_t kSession = conn->AddNewSession();
- EXPECT_CALL(connection_handler_mock, CloseSession(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock, CloseSession(
+ _, _, connection_handler::kCommon)).Times(0);
EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(0);
EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0);
const int32_t kNewTimeout = kTimeout + 1;
conn->StartHeartBeat(kSession);
- conn->SetHeartBeatTimeout(kNewTimeout);
+ conn->SetHeartBeatTimeout(kNewTimeout, kSession);
// new timeout greater by old timeout so mock object shouldn't be invoked
sleep(kTimeout);
}
@@ -205,14 +212,15 @@ TEST_F(HeartBeatMonitorTest, IncreaseHeartBeatTimeout) {
TEST_F(HeartBeatMonitorTest, DecreaseHeartBeatTimeout) {
const uint32_t kSession = conn->AddNewSession();
- EXPECT_CALL(connection_handler_mock, CloseSession(_, kSession)).Times(1)
+ EXPECT_CALL(connection_handler_mock, CloseSession(
+ _, kSession, connection_handler::kCommon)).Times(1)
.WillOnce(RemoveSession(conn, kSession));;
EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(1);
EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession)).Times(1);
const int32_t kNewTimeout = kTimeout - 1;
conn->StartHeartBeat(kSession);
- conn->SetHeartBeatTimeout(kNewTimeout);
+ conn->SetHeartBeatTimeout(kNewTimeout, kSession);
// new timeout less by old timeout so mock object should be invoked
sleep(kTimeout);
}
diff --git a/test/components/include/protocol_handler/control_message_matcher.h b/test/components/include/protocol_handler/control_message_matcher.h
index 70b4a573e..60400f5b1 100644
--- a/test/components/include/protocol_handler/control_message_matcher.h
+++ b/test/components/include/protocol_handler/control_message_matcher.h
@@ -34,6 +34,7 @@
#include <gmock/gmock.h>
#include <string>
+#include <vector>
#include "protocol/raw_message.h"
#include "protocol_handler/protocol_packet.h"
@@ -44,6 +45,40 @@ namespace protocol_handler_test {
* Matcher for checking RawMessage with ControlMessage
* Check error id
*/
+MATCHER_P2(ControlMessage, ExpectedFrameData, ExpectedEncryption,
+ (std::string(ExpectedEncryption ? "Protected" : "Unprotected")
+ + " control message ")) {
+ // Nack shall be always with flag protected off
+ DCHECK(ExpectedFrameData != 0x03 /*FRAME_DATA_START_SERVICE_NACK*/ ||
+ !ExpectedEncryption);
+ const ::protocol_handler::RawMessagePtr message = arg;
+ ::protocol_handler::ProtocolPacket packet(message->connection_key());
+ const protocol_handler::RESULT_CODE result =
+ packet.deserializePacket(message->data(), message->data_size());
+ if (result != protocol_handler::RESULT_OK) {
+ *result_listener << "Error while message deserialization.";
+ return false;
+ }
+ if (::protocol_handler::FRAME_TYPE_CONTROL != packet.frame_type()) {
+ *result_listener << "Is not control message";
+ return false;
+ }
+ if (ExpectedFrameData != packet.frame_data()) {
+ *result_listener << "Control message with data 0x"
+ << std::hex << static_cast<int>(packet.frame_data())
+ << ", not 0x"
+ << std::hex << static_cast<int>(ExpectedFrameData);
+ return false;
+ }
+ if (ExpectedEncryption != packet.protection_flag()) {
+ *result_listener << "Control message is " <<
+ (ExpectedEncryption ? "" : "not ") << "protected";
+ return false;
+ }
+ return true;
+}
+
+
MATCHER_P4(ControlMessage, ExpectedFrameData, ExpectedEncryption,
ConnectionKey, VectorMatcher,
(std::string(ExpectedEncryption ? "Protected" : "Unprotected")
@@ -51,9 +86,14 @@ MATCHER_P4(ControlMessage, ExpectedFrameData, ExpectedEncryption,
// Nack shall be always with flag protected off
DCHECK(ExpectedFrameData != 0x03 /*FRAME_DATA_START_SERVICE_NACK*/ ||
!ExpectedEncryption);
- const RawMessagePtr message = arg;
- const ::protocol_handler::ProtocolPacket packet(
- message->connection_key(), message->data(), message->data_size());
+ const ::protocol_handler::RawMessagePtr message = arg;
+ ::protocol_handler::ProtocolPacket packet(message->connection_key());
+ const protocol_handler::RESULT_CODE result =
+ packet.deserializePacket(message->data(), message->data_size());
+ if (result != protocol_handler::RESULT_OK) {
+ *result_listener << "Error while message deserialization.";
+ return false;
+ }
if (::protocol_handler::FRAME_TYPE_CONTROL != packet.frame_type()) {
*result_listener << "Is not control message";
return false;
@@ -90,6 +130,8 @@ MATCHER_P4(ControlMessage, ExpectedFrameData, ExpectedEncryption,
}
return true;
}
+
+
} // namespace protocol_handler_test
} // namespace components
} // namespace test
diff --git a/test/components/include/protocol_handler/protocol_handler_mock.h b/test/components/include/protocol_handler/protocol_handler_mock.h
index eac6ecf54..204a56242 100644
--- a/test/components/include/protocol_handler/protocol_handler_mock.h
+++ b/test/components/include/protocol_handler/protocol_handler_mock.h
@@ -42,10 +42,12 @@ namespace protocol_handler_test {
/*
* MOCK implementation of ::protocol_handler::ProtocolObserver interface
*/
+using namespace ::protocol_handler;
+
class ProtocolHandlerMock: public ::protocol_handler::ProtocolHandler {
public:
MOCK_METHOD2(SendMessageToMobileApp,
- void(const RawMessagePtr message,
+ void(const ::protocol_handler::RawMessagePtr message,
bool final_message));
MOCK_METHOD1(AddProtocolObserver,
void(::protocol_handler::ProtocolObserver *observer));
diff --git a/test/components/include/protocol_handler/protocol_observer_mock.h b/test/components/include/protocol_handler/protocol_observer_mock.h
index 6153216ff..9049c9db9 100644
--- a/test/components/include/protocol_handler/protocol_observer_mock.h
+++ b/test/components/include/protocol_handler/protocol_observer_mock.h
@@ -47,9 +47,9 @@ namespace protocol_handler_test {
class ProtocolObserverMock: public ::protocol_handler::ProtocolObserver {
public:
MOCK_METHOD1(OnMessageReceived,
- void(const RawMessagePtr));
+ void(const ::protocol_handler::RawMessagePtr));
MOCK_METHOD1(OnMobileMessageSent,
- void(const RawMessagePtr));
+ void(const ::protocol_handler::RawMessagePtr));
};
} // namespace protocol_handler_test
} // namespace components
diff --git a/test/components/include/protocol_handler/session_observer_mock.h b/test/components/include/protocol_handler/session_observer_mock.h
index c2fe89cc9..91d9b40b3 100644
--- a/test/components/include/protocol_handler/session_observer_mock.h
+++ b/test/components/include/protocol_handler/session_observer_mock.h
@@ -58,6 +58,8 @@ class SessionObserverMock: public ::protocol_handler::SessionObserver {
const uint8_t sessionId,
const uint32_t &hashCode,
const ::protocol_handler::ServiceType &service_type));
+ MOCK_METHOD1(OnApplicationFloodCallBack,
+ void(const uint32_t&));
MOCK_METHOD2(KeyFromPair,
uint32_t(
transport_manager::ConnectionUID connection_handle,
diff --git a/test/components/include/transport_manager/transport_manager_mock.h b/test/components/include/transport_manager/transport_manager_mock.h
index db333b4da..eb8e9b4b5 100644
--- a/test/components/include/transport_manager/transport_manager_mock.h
+++ b/test/components/include/transport_manager/transport_manager_mock.h
@@ -78,6 +78,8 @@ class TransportManagerMock: public ::transport_manager::TransportManager {
int(const DeviceHandle &));
MOCK_CONST_METHOD1(Visibility,
int(const bool &));
+ MOCK_METHOD0(Reinit,
+ int());
};
} // namespace transport_manager_test
} // namespace components
diff --git a/test/components/protocol_handler/CMakeLists.txt b/test/components/protocol_handler/CMakeLists.txt
index 804119ce2..5c0dbbdcd 100644
--- a/test/components/protocol_handler/CMakeLists.txt
+++ b/test/components/protocol_handler/CMakeLists.txt
@@ -1,6 +1,7 @@
include_directories(
${GMOCK_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${CMAKE_SOURCE_DIR}/src/components/utils/include
./include
${CMAKE_SOURCE_DIR}/src/components/protocol_handler/include
${SecurityManagerIncludeDir}
@@ -22,6 +23,8 @@ set(LIBRARIES
set(SOURCES
src/protocol_handler_tm_test.cc
+ src/incoming_data_handler_test.cc
+ src/protocol_header_validator_test.cc
)
create_test(test_ProtocolHandler "${SOURCES}" "${LIBRARIES}")
diff --git a/test/components/protocol_handler/include/protocol_handler/protocol_handler_mock.h b/test/components/protocol_handler/include/protocol_handler/protocol_handler_mock.h
index efa9ecfad..6401c2185 100644
--- a/test/components/protocol_handler/include/protocol_handler/protocol_handler_mock.h
+++ b/test/components/protocol_handler/include/protocol_handler/protocol_handler_mock.h
@@ -68,7 +68,7 @@ class TransportManagerMock: public TransportManager{
MOCK_METHOD1(DisconnectForce,
int(const ConnectionUID &));
MOCK_METHOD1(SendMessageToDevice,
- int(const RawMessageSptr));
+ int(const ::protocol_handler::RawMessagePtr));
MOCK_METHOD1(ReceiveEventFromDevice,
int(const TransportAdapterEvent&));
MOCK_METHOD1(AddTransportAdapter,
@@ -113,6 +113,8 @@ class SessionObserverMock: public protocol_handler::SessionObserver {
const uint8_t sessionId,
const uint32_t& hashCode,
const protocol_handler::ServiceType& service_type));
+ MOCK_METHOD1(OnApplicationFloodCallBack,
+ void(const uint32_t&));
MOCK_METHOD2(KeyFromPair,
uint32_t(
transport_manager::ConnectionUID connection_handle,
@@ -136,6 +138,9 @@ class SessionObserverMock: public protocol_handler::SessionObserver {
MOCK_METHOD2(IsHeartBeatSupported,
bool( transport_manager::ConnectionUID connection_handle,
uint8_t session_id));
+ MOCK_METHOD3(ProtocolVersionUsed,
+ bool(uint32_t connection_id, uint8_t session_id,
+ uint8_t& protocol_version));
};
#ifdef ENABLE_SECURITY
@@ -158,34 +163,6 @@ class SecurityManagerMock: public security_manager::SecurityManager {
const uint32_t ));
};
#endif // ENABLE_SECURITY
-
-/*
- * Matcher for checking RawMessage with InternalError Query
- * Check error id
- */
-MATCHER_P2(ControlMessage, ExpectedFrameData, ExpectedEncryption,
- std::string(ExpectedEncryption ? "Protected" : "Unprotected") + " control message ") {
- // Nack shall be always with flag protected off
- DCHECK(ExpectedFrameData != 0x03 /*FRAME_DATA_START_SERVICE_NACK*/ ||
- !ExpectedEncryption);
- const RawMessagePtr message = arg;
- const ProtocolPacket packet(message->connection_key(), message->data(), message->data_size());
- if (FRAME_TYPE_CONTROL != packet.frame_type()) {
- *result_listener << "Is not control message";
- return false;
- }
- if (ExpectedFrameData != packet.frame_data()) {
- *result_listener << "Control message is not with data 0x"
- << std::hex << (int)ExpectedFrameData;
- return false;
- }
- if (ExpectedEncryption != packet.protection_flag()) {
- *result_listener << "Control message is " <<
- (ExpectedEncryption ? "" : "not ") << "protected";
- return false;
- }
- return true;
-}
} // namespace test
} // namespace components
} // namespace protocol_handler_test
diff --git a/test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h b/test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h
index 0139d0e0d..08f661b80 100644
--- a/test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h
+++ b/test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h
@@ -48,6 +48,7 @@
#include "security_manager/security_manager_mock.h"
#include "security_manager/ssl_context_mock.h"
#include "transport_manager/transport_manager_mock.h"
+#include "protocol_handler/control_message_matcher.h"
namespace test {
namespace components {
@@ -64,7 +65,7 @@ using ::transport_manager::TransportManagerListener;
using protocol_handler_test::ControlMessage;
using ::testing::Return;
using ::testing::ReturnNull;
-using ::testing::AllOf;
+using ::testing::AnyOf;
using ::testing::Ge;
using ::testing::Le;
using ::testing::_;
@@ -72,18 +73,23 @@ using ::testing::Invoke;
class ProtocolHandlerImplTest : public ::testing::Test {
protected:
- void SetUp() OVERRIDE {
- protocol_handler_impl.reset(new ProtocolHandlerImpl(&transport_manager_mock));
+ void IntitProtocolHandlerImpl(const size_t period_msec, const size_t max_messages) {
+ protocol_handler_impl.reset(new ProtocolHandlerImpl(&transport_manager_mock,
+ period_msec, max_messages));
protocol_handler_impl->set_session_observer(&session_observer_mock);
tm_listener = protocol_handler_impl.get();
+ }
+ void SetUp() OVERRIDE {
+ IntitProtocolHandlerImpl(0u, 0u);
connection_id = 0xAu;
session_id = 0xFFu;
connection_key = 0xFF00AAu;
message_id = 0xABCDEFu;
+ some_date.resize(256, 0xAB);
// expect ConnectionHandler support methods call (conversion, check heartbeat)
EXPECT_CALL(session_observer_mock,
- KeyFromPair(connection_id, session_id)).
+ KeyFromPair(connection_id, _)).
//return some connection_key
WillRepeatedly(Return(connection_key));
EXPECT_CALL(session_observer_mock,
@@ -91,6 +97,7 @@ class ProtocolHandlerImplTest : public ::testing::Test {
//return false to avoid call KeepConnectionAlive
WillRepeatedly(Return(false));
}
+
void TearDown() OVERRIDE {
// Wait call methods in thread
usleep(100000);
@@ -118,7 +125,7 @@ class ProtocolHandlerImplTest : public ::testing::Test {
// expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service,
- callback_protection_flag)).
+ callback_protection_flag, _)).
//return sessions start success
WillOnce(Return(session_id));
@@ -140,20 +147,20 @@ class ProtocolHandlerImplTest : public ::testing::Test {
uint8_t version, bool protection, uint8_t frameType,
uint8_t serviceType, uint8_t frameData,
uint8_t sessionId, uint32_t dataSize,
- uint32_t messageID, const uint8_t *data = 0,
- uint32_t packet_id = 0) {
+ uint32_t messageID, const uint8_t *data = 0) {
// Create packet
const ProtocolPacket packet(
connection_id, version, protection, frameType,
serviceType, frameData, sessionId, dataSize,
- messageID, data, packet_id);
+ messageID, data);
// Emulate resive packet from transoprt manager
tm_listener->OnTMMessageReceived(packet.serializePacket());
}
void SendControlMessage(bool protection, uint8_t service_type,
- uint8_t sessionId, uint32_t frame_data) {
+ uint8_t sessionId, uint32_t frame_data,
+ uint32_t dataSize = 0u, const uint8_t *data = NULL) {
SendTMMessage(connection_id, PROTOCOL_VERSION_3, protection, FRAME_TYPE_CONTROL,
- service_type, frame_data, sessionId, 0, message_id);
+ service_type, frame_data, sessionId, dataSize, message_id, data);
}
::utils::SharedPtr<ProtocolHandlerImpl> protocol_handler_impl;
@@ -165,6 +172,7 @@ class ProtocolHandlerImplTest : public ::testing::Test {
// uniq id as connection_id and session_id in one
uint32_t connection_key;
uint32_t message_id;
+ std::vector<uint8_t> some_date;
// Strict mocks (same as all methods EXPECT_CALL().Times(0))
testing::StrictMock<transport_manager_test::TransportManagerMock> transport_manager_mock;
testing::StrictMock<protocol_handler_test::SessionObserverMock> session_observer_mock;
@@ -198,7 +206,7 @@ TEST_F(ProtocolHandlerImplTest, RecieveEmptyRawMessage) {
* ProtocolHandler shall disconnect on no connection
*/
TEST_F(ProtocolHandlerImplTest, RecieveOnUnknownConenction) {
- // expect force dicsonnect on no connection for recieved data
+ // expect force dicsonnect on no connection for received data
EXPECT_CALL(transport_manager_mock,
DisconnectForce(connection_id)).
WillOnce(Return(E_SUCCESS));
@@ -211,12 +219,13 @@ TEST_F(ProtocolHandlerImplTest, RecieveOnUnknownConenction) {
* Check protection flag OFF for all services from kControl to kBulk
*/
TEST_F(ProtocolHandlerImplTest, StartSession_Unprotected_SessionObserverReject) {
- const int call_times = kBulk - kControl;
+ const int call_times = 5;
AddConnection();
// expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, AllOf(Ge(kControl), Le(kBulk)), PROTECTION_OFF)).
+ connection_id, NEW_SESSION_ID, AnyOf(kControl, kRpc, kAudio,
+ kMobileNav, kBulk), PROTECTION_OFF, _)).
Times(call_times).
//return sessions start rejection
WillRepeatedly(Return(SESSION_START_REJECT));
@@ -227,9 +236,11 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Unprotected_SessionObserverReject)
Times(call_times).
WillRepeatedly(Return(E_SUCCESS));
- for (uint8_t service_type = kControl; service_type < kBulk; ++service_type) {
- SendControlMessage(PROTECTION_OFF, kControl, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
- }
+ SendControlMessage(PROTECTION_OFF, kControl, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_OFF, kRpc, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_OFF, kAudio, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_OFF, kMobileNav,NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_OFF, kBulk, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
}
/*
* ProtocolHandler shall send NAck on session_observer rejection
@@ -237,7 +248,7 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Unprotected_SessionObserverReject)
* For ENABLE_SECURITY=OFF session_observer shall be called with protection flag OFF
*/
TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
- const int call_times = kBulk - kControl;
+ const int call_times = 5;
AddConnection();
#ifdef ENABLE_SECURITY
// For enabled protection callback shall use protection ON
@@ -248,8 +259,9 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
#endif // ENABLE_SECURITY
// expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionStartedCallback(connection_id, NEW_SESSION_ID, AllOf(Ge(kControl), Le(kBulk)),
- callback_protection_flag)).
+ OnSessionStartedCallback(
+ connection_id, NEW_SESSION_ID, AnyOf(kControl, kRpc, kAudio,
+ kMobileNav, kBulk), callback_protection_flag, _)).
Times(call_times).
//return sessions start rejection
WillRepeatedly(Return(SESSION_START_REJECT));
@@ -260,9 +272,11 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
Times(call_times).
WillRepeatedly(Return(E_SUCCESS));
- for (uint8_t service_type = kControl; service_type < kBulk; ++service_type) {
- SendControlMessage(PROTECTION_ON, kControl, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
- }
+ SendControlMessage(PROTECTION_ON, kControl, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_ON, kRpc, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_ON, kAudio, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_ON, kMobileNav,NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+ SendControlMessage(PROTECTION_ON, kBulk, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
}
/*
* ProtocolHandler shall send Ack on session_observer accept
@@ -273,7 +287,7 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Unprotected_SessionObserverAccept)
const ServiceType start_service = kRpc;
// expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF)).
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _)).
//return sessions start success
WillOnce(Return(session_id));
@@ -292,6 +306,7 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Unprotected_SessionObserverAccept)
TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverAccept) {
AddSession();
}
+// TODO(EZamakhov): add test for get_hash_id/set_hash_id from protocol_handler_impl.cc
/*
* ProtocolHandler shall send NAck on session_observer rejection
*/
@@ -301,31 +316,11 @@ TEST_F(ProtocolHandlerImplTest, EndSession_SessionObserverReject) {
// expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionEndedCallback(connection_id, session_id, message_id, service)).
- //return sessions start success
+ OnSessionEndedCallback(connection_id, session_id, _, service)).
+ // reject session start
WillOnce(Return(SESSION_START_REJECT));
- // expect send Ack
- EXPECT_CALL(transport_manager_mock,
- SendMessageToDevice(ControlMessage(FRAME_DATA_END_SERVICE_NACK, PROTECTION_OFF))).
- WillOnce(Return(E_SUCCESS));
-
- SendControlMessage(PROTECTION_OFF, service, session_id, FRAME_DATA_END_SERVICE);
-}
-/*
- * ProtocolHandler shall send NAck on wrong hash code
- */
-TEST_F(ProtocolHandlerImplTest, EndSession_WrongHash) {
- AddSession();
- const ServiceType service = kRpc;
-
- // expect ConnectionHandler check
- EXPECT_CALL(session_observer_mock,
- OnSessionEndedCallback(connection_id, session_id, message_id, service)).
- //return sessions start success
- WillOnce(Return(connection_key ^ 0xFF));
-
- // expect send Ack
+ // expect send NAck
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(ControlMessage(FRAME_DATA_END_SERVICE_NACK, PROTECTION_OFF))).
WillOnce(Return(E_SUCCESS));
@@ -339,13 +334,10 @@ TEST_F(ProtocolHandlerImplTest, EndSession_Success) {
AddSession();
const ServiceType service = kRpc;
- //Send with correct hash code
- const uint32_t hash = connection_key;
-
// expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionEndedCallback(connection_id, session_id, hash, service)).
- //return sessions start success
+ OnSessionEndedCallback(connection_id, session_id, _, service)).
+ // return sessions start success
WillOnce(Return(connection_key));
// expect send Ack
@@ -353,8 +345,7 @@ TEST_F(ProtocolHandlerImplTest, EndSession_Success) {
SendMessageToDevice(ControlMessage(FRAME_DATA_END_SERVICE_ACK, PROTECTION_OFF))).
WillOnce(Return(E_SUCCESS));
- SendTMMessage(connection_id, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
- service, FRAME_DATA_END_SERVICE, session_id, 0, hash);
+ SendControlMessage(PROTECTION_OFF, service, session_id, FRAME_DATA_END_SERVICE);
}
#ifdef ENABLE_SECURITY
@@ -369,7 +360,7 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) {
const ServiceType start_service = kRpc;
// expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF)).
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _)).
//return sessions start success
WillOnce(Return(session_id));
@@ -391,7 +382,7 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) {
const ServiceType start_service = kRpc;
// expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF)).
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _)).
//return sessions start success
WillOnce(Return(session_id));
@@ -411,7 +402,7 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) {
const ServiceType start_service = kRpc;
// expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON)).
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)).
//return sessions start success
WillOnce(Return(session_id));
@@ -437,7 +428,7 @@ TEST_F(ProtocolHandlerImplTest,SecurityEnable_StartSessionProtected_SSLInitializ
const ServiceType start_service = kRpc;
// expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON)).
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)).
//return sessions start success
WillOnce(Return(session_id));
@@ -473,7 +464,7 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_HandshakeFa
const ServiceType start_service = kRpc;
// expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON)).
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)).
//return sessions start success
WillOnce(Return(session_id));
@@ -523,7 +514,7 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_HandshakeSu
const ServiceType start_service = kRpc;
// expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON)).
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)).
//return sessions start success
WillOnce(Return(session_id));
@@ -578,7 +569,7 @@ TEST_F(ProtocolHandlerImplTest,
const ServiceType start_service = kRpc;
// expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON)).
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)).
//return sessions start success
WillOnce(Return(session_id));
@@ -633,7 +624,7 @@ TEST_F(ProtocolHandlerImplTest,
const ServiceType start_service = kRpc;
// expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON)).
+ OnSessionStartedCallback(connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)).
//return sessions start success
WillOnce(Return(session_id));
@@ -682,6 +673,85 @@ TEST_F(ProtocolHandlerImplTest,
SendControlMessage(PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
}
+TEST_F(ProtocolHandlerImplTest,
+ FloodVerification) {
+ const size_t period_msec = 1000;
+ const size_t max_messages = 1000;
+ IntitProtocolHandlerImpl(period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect flood notification to CH
+ EXPECT_CALL(session_observer_mock,
+ OnApplicationFloodCallBack(connection_key)).
+ Times(1);
+
+ for (size_t i = 0; i < max_messages + 1; ++i) {
+ SendTMMessage(connection_id, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_date.size(), message_id, &some_date[0]);
+ }
+}
+TEST_F(ProtocolHandlerImplTest,
+ FloodVerification_ThresholdValue) {
+ const size_t period_msec = 1000;
+ const size_t max_messages = 1000;
+ IntitProtocolHandlerImpl(period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect NO flood notification to CH
+ for (size_t i = 0; i < max_messages - 1; ++i) {
+ SendTMMessage(connection_id, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_date.size(), message_id, &some_date[0]);
+ }
+}
+TEST_F(ProtocolHandlerImplTest,
+ FloodVerification_VideoFrameSkip) {
+ const size_t period_msec = 1000;
+ const size_t max_messages = 1000;
+ IntitProtocolHandlerImpl(period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect NO flood notification to CH on video data streaming
+ for (size_t i = 0; i < max_messages + 1; ++i) {
+ SendTMMessage(connection_id, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kMobileNav, FRAME_DATA_SINGLE, session_id,
+ some_date.size(), message_id, &some_date[0]);
+ }
+}
+TEST_F(ProtocolHandlerImplTest,
+ FloodVerification_AudioFrameSkip) {
+ const size_t period_msec = 1000;
+ const size_t max_messages = 1000;
+ IntitProtocolHandlerImpl(period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect NO flood notification to CH on video data streaming
+ for (size_t i = 0; i < max_messages + 1; ++i) {
+ SendTMMessage(connection_id, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kAudio, FRAME_DATA_SINGLE, session_id,
+ some_date.size(), message_id, &some_date[0]);
+ }
+}
+TEST_F(ProtocolHandlerImplTest,
+ FloodVerificationDisable) {
+ const size_t period_msec = 0;
+ const size_t max_messages = 0;
+ IntitProtocolHandlerImpl(period_msec, max_messages);
+ AddConnection();
+ AddSession();
+
+ // expect NO flood notification to session observer
+ for (size_t i = 0; i < max_messages + 1; ++i) {
+ SendTMMessage(connection_id, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_SINGLE,
+ kControl, FRAME_DATA_SINGLE, session_id,
+ some_date.size(), message_id, &some_date[0]);
+ }
+}
#endif // ENABLE_SECURITY
} // namespace test
} // namespace components
diff --git a/test/components/rpc_base/CMakeLists.txt b/test/components/rpc_base/CMakeLists.txt
index 3ee4eddca..5ebf73541 100644
--- a/test/components/rpc_base/CMakeLists.txt
+++ b/test/components/rpc_base/CMakeLists.txt
@@ -26,4 +26,4 @@ if (${HMI_DBUS_API})
set (SOURCES ${SOURCES} rpc_base_dbus_test.cc)
endif ()
-create_test("test_rpc_base" "${SOURCES}" "${LIBRARIES}")
+create_test("rpc_base_test" ${SOURCES}" "${LIBRARIES})
diff --git a/test/components/security_manager/CMakeLists.txt b/test/components/security_manager/CMakeLists.txt
index 072f83d7d..c7c5b3dde 100644
--- a/test/components/security_manager/CMakeLists.txt
+++ b/test/components/security_manager/CMakeLists.txt
@@ -28,26 +28,28 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+set (COMPONENTS_DIR ${CMAKE_SOURCE_DIR}/src/components)
+
include_directories(
- ${LOG4CXX_INCLUDE_DIRECTORY}
- ${GMOCK_INCLUDE_DIRECTORY}
- ./include/
- ../../../src/thirdPartyLibs/gmock-1.7.0/include
- ../../../src/thirdPartyLibs/gmock-1.7.0/gtest/include
+ include
${SecurityManagerIncludeDir}
+ ${CMAKE_SOURCE_DIR}/src/components/utils/include
${CMAKE_SOURCE_DIR}/src/components/protocol_handler/include
+ ${CMAKE_SOURCE_DIR}/src/components/utils/include/
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.7.0/include
+ ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/gmock-1.7.0/gtest/include
)
set(SOURCES
- ./src/crypto_manager_impl_test.cc
- ./src/security_manager_test.cc
- ./src/security_query_test.cc
- ./src/security_query_matcher.cc
+ src/crypto_manager_impl_test.cc
+ src/security_manager_test.cc
+ src/security_query_test.cc
+ src/security_query_matcher.cc
)
set(LIBRARIES
- gtest
- gtest_main
gmock
gmock_main
${SecurityManagerLibrary}
diff --git a/test/components/security_manager/include/security_manager/security_manager_mock.h b/test/components/security_manager/include/security_manager/security_manager_mock.h
index 4d4657500..8051153c6 100644
--- a/test/components/security_manager/include/security_manager/security_manager_mock.h
+++ b/test/components/security_manager/include/security_manager/security_manager_mock.h
@@ -71,6 +71,8 @@ namespace security_manager_test {
const uint8_t sessionId,
const uint32_t& hashCode,
const protocol_handler::ServiceType& service_type));
+ MOCK_METHOD1(OnApplicationFloodCallBack,
+ void(const uint32_t&));
MOCK_METHOD2(KeyFromPair,
uint32_t(
transport_manager::ConnectionUID connection_handle,
@@ -94,7 +96,12 @@ namespace security_manager_test {
MOCK_METHOD2(IsHeartBeatSupported,
bool( transport_manager::ConnectionUID connection_handle,
uint8_t session_id));
+ MOCK_METHOD3(ProtocolVersionUsed,
+ bool(uint32_t connection_id, uint8_t session_id,
+ uint8_t& protocol_version));
+
};
+
/*
* MOCK implementation of protocol_handler::ProtocolObserver interface
*/
diff --git a/test/components/security_manager/include/security_manager/security_manager_test.h b/test/components/security_manager/include/security_manager/security_manager_test.h
index ece82c8d9..e4dd9d1bb 100644
--- a/test/components/security_manager/include/security_manager/security_manager_test.h
+++ b/test/components/security_manager/include/security_manager/security_manager_test.h
@@ -277,7 +277,7 @@ using namespace ::security_manager;
call_OnMessageReceived(NULL, 0, kInvalidServiceType);
}
/*
- * Shall send InternallError on null data recieved
+ * Shall send InternallError on null data received
*/
TEST_F(SecurityManagerTest, GetEmptyQuery) {
EXPECT_CALL(mock_protocol_handler,
@@ -289,7 +289,7 @@ using namespace ::security_manager;
call_OnMessageReceived(NULL, 0, secureServiceType);
}
/*
- * Shall send InternallError on null data recieved
+ * Shall send InternallError on null data received
*/
TEST_F(SecurityManagerTest, GetWrongJSONSize) {
SetMockCryptoManger();
diff --git a/test/components/transport_manager/CMakeLists.txt b/test/components/transport_manager/CMakeLists.txt
index dfc87ebd1..502978366 100644
--- a/test/components/transport_manager/CMakeLists.txt
+++ b/test/components/transport_manager/CMakeLists.txt
@@ -3,13 +3,13 @@ include_directories (
./include
${CMAKE_SOURCE_DIR}/src/components/transport_manager/include
${CMAKE_SOURCE_DIR}/src/components/config_profile/include/
+ ${CMAKE_SOURCE_DIR}/src/components/utils/include/
${LIBUSB_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${CMAKE_SOURCE_DIR}/src/components/utils/include
)
set (LIBRARIES
- gtest
- gtest_main
gmock
gmock_main
TransportManager
diff --git a/test/components/transport_manager/include/transport_manager/mock_transport_adapter_listener.h b/test/components/transport_manager/include/transport_manager/mock_transport_adapter_listener.h
index 43fa69337..767291152 100644
--- a/test/components/transport_manager/include/transport_manager/mock_transport_adapter_listener.h
+++ b/test/components/transport_manager/include/transport_manager/mock_transport_adapter_listener.h
@@ -43,10 +43,12 @@
using namespace transport_manager;
using transport_manager::transport_adapter::TransportAdapter;
using transport_manager::transport_adapter::TransportAdapterListener;
+using ::protocol_handler::RawMessagePtr;
namespace test {
namespace components {
namespace transport_manager {
+using namespace ::protocol_handler;
class MockTransportAdapterListener : public TransportAdapterListener {
public:
diff --git a/test/components/transport_manager/include/transport_manager/raw_message_matcher.h b/test/components/transport_manager/include/transport_manager/raw_message_matcher.h
index 3d7ec5a2b..899e6e3b2 100644
--- a/test/components/transport_manager/include/transport_manager/raw_message_matcher.h
+++ b/test/components/transport_manager/include/transport_manager/raw_message_matcher.h
@@ -45,10 +45,15 @@ using ::testing::Matcher;
using ::testing::MatcherInterface;
using ::testing::MatchResultListener;
+using RawMessagePtr = ::protocol_handler::RawMessagePtr;
+using RawMessage = ::protocol_handler::RawMessage;
+
namespace test {
namespace components {
namespace transport_manager {
+using namespace ::protocol_handler;
+
class RawMessageMatcher : public MatcherInterface<RawMessagePtr> {
public:
explicit RawMessageMatcher(RawMessagePtr ptr);
diff --git a/test/components/transport_manager/src/mock_connection.cc b/test/components/transport_manager/src/mock_connection.cc
index 0f912ac80..589716ed1 100644
--- a/test/components/transport_manager/src/mock_connection.cc
+++ b/test/components/transport_manager/src/mock_connection.cc
@@ -41,7 +41,13 @@
#include "transport_manager/common.h"
#include "transport_manager/mock_connection.h"
+<<<<<<< HEAD:test/components/transport_manager/src/mock_connection.cc
#include <algorithm>
+=======
+DeviceType MmeTransportAdapter::GetDeviceType() const {
+ return MME;
+}
+>>>>>>> 35db1ec... APPLINK-12266. Implement ability to handle transport type.:src/components/transport_manager/src/mme/mme_transport_adapter.cc
#include "transport_manager/mock_transport_adapter.h"
diff --git a/test/components/transport_manager/src/raw_message_matcher.cc b/test/components/transport_manager/src/raw_message_matcher.cc
index 335f36bfa..510c66221 100644
--- a/test/components/transport_manager/src/raw_message_matcher.cc
+++ b/test/components/transport_manager/src/raw_message_matcher.cc
@@ -1,3 +1,4 @@
+<<<<<<< HEAD:test/components/transport_manager/src/raw_message_matcher.cc
/*
* \file matchers.cc
* \brief customers matchers for gmock
@@ -65,3 +66,70 @@ void RawMessageMatcher::DescribeNegationTo(::std::ostream* os) const {
} // namespace transport_manager
} // namespace components
} // namespace test
+=======
+/*
+ * 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 "transport_manager/pasa_bt/bluetooth_PASA_transport_adapter.h"
+
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
+#include <iomanip>
+#include <set>
+
+#include "transport_manager/pasa_bt/bluetooth_PASA_listener.h"
+#include "transport_manager/pasa_bt/bluetooth_PASA_connection_factory.h"
+#include "transport_manager/pasa_bt/bluetooth_PASA_device.h"
+#include "resumption/last_state.h"
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+BluetoothPASATransportAdapter::BluetoothPASATransportAdapter()
+ : TransportAdapterImpl(0, new BluetoothPASAConnectionFactory(this),
+ new BluetoothPASAListener(this)) {
+}
+
+DeviceType BluetoothPASATransportAdapter::GetDeviceType() const {
+ return PASA_BLUETOOTH;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+>>>>>>> 35db1ec... APPLINK-12266. Implement ability to handle transport type.:src/components/transport_manager/src/pasa_bt/bluetooth_PASA_transport_adapter.cc
diff --git a/test/components/transport_manager/src/test_dnssd_service_browser.cc b/test/components/transport_manager/src/test_dnssd_service_browser.cc
index 46411435b..e13e294a5 100644
--- a/test/components/transport_manager/src/test_dnssd_service_browser.cc
+++ b/test/components/transport_manager/src/test_dnssd_service_browser.cc
@@ -23,7 +23,7 @@ class MockTransportAdapterController : public TransportAdapterController {
MOCK_CONST_METHOD1(FindDevice,
DeviceSptr(const DeviceUID& device_handle));
MOCK_METHOD3(ConnectionCreated,
- void(Connection* connection, const DeviceUID& device_handle, const ApplicationHandle& app_handle));
+ void(ConnectionSPtr connection, const DeviceUID& device_handle, const ApplicationHandle& app_handle));
MOCK_METHOD2(ConnectDone,
void(const DeviceUID& device_handle, const ApplicationHandle& app_handle));
MOCK_METHOD3(ConnectFailed,
diff --git a/test/components/transport_manager/src/test_tcp_transport_adapter.cc b/test/components/transport_manager/src/test_tcp_transport_adapter.cc
index c0f28270c..614583529 100644
--- a/test/components/transport_manager/src/test_tcp_transport_adapter.cc
+++ b/test/components/transport_manager/src/test_tcp_transport_adapter.cc
@@ -13,15 +13,40 @@
namespace transport_manager {
namespace transport_adapter {
-TEST(TcpAdapterBasicTest, Basic) {
- TransportAdapter* transport_adapter = new TcpTransportAdapter(12345);
-
- EXPECT_EQ("sdl-tcp", transport_adapter->GetDeviceType());
- EXPECT_TRUE(transport_adapter->IsServerOriginatedConnectSupported());
- EXPECT_TRUE(transport_adapter->IsClientOriginatedConnectSupported());
- EXPECT_TRUE(transport_adapter->IsSearchDevicesSupported());
+using RawMessage = ::protocol_handler::RawMessage;
+using namespace ::protocol_handler;
+
+//TEST(TcpAdapterBasicTest, Basic) {
+// TransportAdapter* transport_adapter = new TcpTransportAdapter(12345);
+//
+// EXPECT_EQ("sdl-tcp", transport_adapter->GetDeviceType());
+// EXPECT_TRUE(transport_adapter->IsServerOriginatedConnectSupported());
+// EXPECT_TRUE(transport_adapter->IsClientOriginatedConnectSupported());
+// EXPECT_TRUE(transport_adapter->IsSearchDevicesSupported());
+//}
+
+
+//--should be changed
+TEST(TcpAdapterBasicTest, GetDeviceType_Return_sdl-tcp) {
+ TransportAdapter* transport_adapter = new TcpTransportAdapter(12345);
+ EXPECT_EQ("sdl-tcp", transport_adapter->GetDeviceType());
}
+//TEST(TcpAdapterBasicTest, isServerOriginatedConnectSupported_Return_True) {
+// TransportAdapter* transport_adapter = new TcpTransportAdapter(12345);
+// EXPECT_TRUE(transport_adapter->IsServerOriginatedConnectSupported());
+//}
+//
+//TEST(TcpAdapterBasicTest, isClientOriginatedConnectSupported_Return_True) {
+// TransportAdapter* transport_adapter = new TcpTransportAdapter(12345);
+// EXPECT_TRUE(transport_adapter->IsClientOriginatedConnectSupported());
+//}
+//TEST(TcpAdapterBasicTest, isSearchDevicesSupported_Return_True) {
+// TransportAdapter* transport_adapter = new TcpTransportAdapter(12345);
+// EXPECT_TRUE(transport_adapter->IsSearchDevicesSupported());
+//}
+
+
TEST(TcpAdapterBasicTest, NotInitialised) {
TransportAdapter* transport_adapter = new TcpTransportAdapter(12345);
diff --git a/test/components/transport_manager/transport_manager_instance_test.cc b/test/components/transport_manager/transport_manager_instance_test.cc
index 223527684..f584f443f 100644
--- a/test/components/transport_manager/transport_manager_instance_test.cc
+++ b/test/components/transport_manager/transport_manager_instance_test.cc
@@ -47,4 +47,401 @@
- TM client calls DisconnectDevice
- TM client receives onApplicationDisconnected
*/
-#include "transport_manager_instance_test.h"
+//
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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_TRANSPORT_MANAGER_TRANSPORT_MANAGER_INSTANCE_TEST_H
+#define TEST_COMPONENTS_TRANSPORT_MANAGER_TRANSPORT_MANAGER_INSTANCE_TEST_H
+
+/*
+ Tests transport manager functionality with single device adapter that behaves correctly and single client
+ Following sequence is tested:
+ - TM created and runned
+ - TM client registered as listener
+ - TM client requests device scaning
+ - single device was returned to TM client with onDeviceListUpdated callback
+ - TM client calls "connect" on found device
+ - device adapter sends onApplicationConnected
+ - TM client receives onApplicationConnected
+ - device adapter sends three data parts that represents single frame
+ - TM client receives single frame with onFrameReceived callback
+ - TM client calls sendFrame with some frame data and user data
+ - TM client receives onFrameSendCompleted
+ - TM client calls DisconnectDevice
+ - TM client receives onApplicationDisconnected
+ */
+#include <stddef.h>
+#include <stdio.h>
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+
+#include "include/transport_manager/transport_manager.h"
+#include "include/transport_manager/transport_manager_impl.h"
+//#include "../../../src/components/TransportManager/src/CTransportManager.hpp"
+//#include "TransportManager/ITransportManagerDataListener.hpp"
+//#include "TransportManager/ITransportManagerDeviceListener.hpp"
+
+
+//using namespace NsSmartDeviceLink::NsTransportManager;
+
+namespace test /*{ namespace components { namespace transport_manager*/ { namespace test_transport_manager_instance {
+TEST(test_transport_manager_instance, test_transport_manager_instance)
+{
+ transport_manager::TransportManager *Instance = transport_manager::TransportManagerImpl::Instance();
+ ASSERT_EQ(Instance, transport_manager::TransportManagerImpl::Instance());
+}
+//
+// // ---------------- TEST DATA ---------------- //
+// namespace Data
+// {
+// static const tDeviceHandle DeviceHandle = 123;
+// static const EDeviceType DeviceType = DeviceBluetooth;
+// static const std::string UserFriendlyName("MY USER FRIENDLY NAME");
+// static const std::string UniqueDeviceId("MY_UNIQUE_DEVICE_ID");
+//
+// static const tConnectionHandle ConnectionHandle = 666;
+//
+// static const int UserData = 123;
+// }
+//
+// // ---------------- TEST CLASSES ---------------- //
+//
+// /**
+// * @brief Class that represents custom device adapter that will send known data
+// * and check it's methods calls
+// **/
+// class MockTransportAdapter : public ITransportAdapter
+// {
+// public:
+// MockTransportAdapter(ITransportAdapterListener & Listener, IHandleGenerator & HandleGenerator)
+// : mListener(Listener)
+// , mHandleGenerator(HandleGenerator)
+// , mLogger(log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("TransportManagerTest")))
+// {
+// }
+//
+// virtual EDeviceType GetDeviceType(void ) const
+// {
+// return DeviceBluetooth;
+// }
+// MOCK_METHOD1(ConnectDevice, void (const tDeviceHandle DeviceHandle));
+// MOCK_METHOD1(DisconnectDevice, void (const tDeviceHandle DeviceHandle));
+// MOCK_METHOD0(run, void());
+// MOCK_METHOD0(scanForNewDevices, void());
+// MOCK_METHOD4(sendFrame, void(tConnectionHandle ConnectionHandle, const uint8_t* Data, size_t DataSize, int UserData));
+//
+// void doScanForNewDevices()
+// {
+// LOG4CPLUS_INFO_EXT(mLogger, "-------------- Scanning new devices -----------------");
+// SInternalDeviceInfo deviceInfo;
+// deviceInfo.mDeviceHandle = Data::DeviceHandle;
+// deviceInfo.mUniqueDeviceId = Data::UniqueDeviceId;
+// deviceInfo.mUserFriendlyName = Data::UserFriendlyName;
+//
+// tInternalDeviceList list;
+// list.push_back(deviceInfo);
+//
+// LOG4CPLUS_INFO_EXT(mLogger, "-------------- Sending device list update -----------------");
+// mListener.onDeviceListUpdated(this, list);
+// }
+//
+// void doConnectDevice(const tDeviceHandle DeviceHandle)
+// {
+// LOG4CPLUS_INFO_EXT(mLogger, "-------------- Connecting device -----------------");
+// // Application connect
+//
+// SDeviceInfo deviceInfo;
+// deviceInfo.mDeviceHandle = Data::DeviceHandle;
+// deviceInfo.mUniqueDeviceId = Data::UniqueDeviceId;
+// deviceInfo.mUserFriendlyName = Data::UserFriendlyName;
+//
+// LOG4CPLUS_INFO_EXT(mLogger, "-------------- Sending ApplicationConnected -----------------");
+// mListener.onApplicationConnected(this, deviceInfo, Data::ConnectionHandle);
+//
+// // Send three frames to transport manager
+//
+// uint8_t raw_data[] = {
+// 0x22, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC8,
+// 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+// 0xFF, 0xFF, 0xFF, 0xFF
+// };
+//
+// // Sending only header first
+// uint8_t *pSendBuff = raw_data;
+//
+// LOG4CPLUS_INFO_EXT(mLogger, "-------------- Sending Frame #1 -----------------");
+// mListener.onFrameReceived(this, Data::ConnectionHandle, pSendBuff, 12);
+//
+// // Sending first part of the data
+// pSendBuff+=12;
+// LOG4CPLUS_INFO_EXT(mLogger, "-------------- Sending Frame #2 -----------------");
+// mListener.onFrameReceived(this, Data::ConnectionHandle, pSendBuff, static_cast<size_t>(100));
+//
+// // Sending last part of the data
+// pSendBuff+=100;
+// LOG4CPLUS_INFO_EXT(mLogger, "-------------- Sending Frame #3 -----------------");
+// mListener.onFrameReceived(this, Data::ConnectionHandle, pSendBuff, static_cast<size_t>(100));
+// }
+//
+// void doSendFrame(tConnectionHandle ConnectionHandle, const uint8_t* Data, size_t DataSize, const int UserData)
+// {
+// LOG4CPLUS_INFO_EXT(mLogger, "-------------- doSendFrame called. Sending FrameSendCompleted -----------------");
+// mListener.onFrameSendCompleted(this, Data::ConnectionHandle, Data::UserData, SendStatusOK);
+// }
+//
+// void doDisconnectDevice(const tDeviceHandle DeviceHandle)
+// {
+// LOG4CPLUS_INFO_EXT(mLogger, "-------------- doDisconnectDevice -----------------");
+// SDeviceInfo deviceInfo;
+// deviceInfo.mDeviceHandle = Data::DeviceHandle;
+// deviceInfo.mUniqueDeviceId = Data::UniqueDeviceId;
+// deviceInfo.mUserFriendlyName = Data::UserFriendlyName;
+//
+// LOG4CPLUS_INFO_EXT(mLogger, "-------------- sending ApplicationDisconnected -----------------");
+// mListener.onApplicationDisconnected(this, deviceInfo, Data::ConnectionHandle);
+// }
+//
+// protected:
+// ITransportAdapterListener & mListener;
+// IHandleGenerator & mHandleGenerator;
+// Logger mLogger;
+// };
+//
+// /**
+// * @brief Custom transport manager client that will check data, sent by transport manager
+// **/
+// class MockTransportManagerClient : public ITransportManagerDataListener
+// , public ITransportManagerDeviceListener
+// {
+// public:
+// MockTransportManagerClient(ITransportManager & TransportManager)
+// : mTransportManager(TransportManager)
+// , mDeviceList()
+// , mLogger(log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("TransportManagerTest")))
+// {
+//
+// }
+// MOCK_METHOD2(onApplicationConnected, void(const SDeviceInfo& ConnectedDevice, const tConnectionHandle Connection));
+// MOCK_METHOD2(onApplicationDisconnected, void(const SDeviceInfo& DisconnectedDevice, const tConnectionHandle Connection));
+// MOCK_METHOD1(onDeviceListUpdated, void(const tDeviceList& DeviceList));
+// MOCK_METHOD3(onFrameReceived, void(tConnectionHandle ConnectionHandle, const uint8_t* Data, size_t DataSize));
+// MOCK_METHOD3(onFrameSendCompleted, void(tConnectionHandle ConnectionHandle, int UserData, ESendStatus SendStatus));
+//
+// void doDeviceListUpdated(const tDeviceList& DeviceList)
+// {
+// LOG4CPLUS_INFO_EXT(mLogger, "-------------- doDeviceListUpdated -----------------");
+// mDeviceList = DeviceList;
+//
+// tDeviceList::const_iterator device;
+// for(device = mDeviceList.begin(); device != mDeviceList.end(); ++device)
+// {
+// mTransportManager.ConnectDevice(device->mDeviceHandle);
+// }
+// }
+//
+// void doFrameReceived(tConnectionHandle ConnectionHandle, const uint8_t* Data, size_t DataSize)
+// {
+// LOG4CPLUS_INFO_EXT(mLogger, "-------------- doFrameReceived -----------------");
+// // Sending frame
+// uint8_t data[512]={1};
+// mTransportManager.sendFrame(ConnectionHandle, data, 512, Data::UserData);
+// }
+//
+// void doFrameSendCompleted(tConnectionHandle ConnectionHandle, int UserData, ESendStatus SendStatus)
+// {
+// LOG4CPLUS_INFO_EXT(mLogger, "-------------- doFrameSendCompleted -----------------");
+//
+// tDeviceList::const_iterator device;
+// for(device = mDeviceList.begin(); device != mDeviceList.end(); ++device)
+// {
+// mTransportManager.DisconnectDevice(device->mDeviceHandle);
+// }
+// }
+//
+// protected:
+// ITransportManager & mTransportManager;
+// tDeviceList mDeviceList;
+// Logger mLogger;
+// };
+//
+// /**
+// * @brief Inherited transport manager class used for some small preparation of class for
+// * testing (disabling another adapters etc.)
+// **/
+// class TestTransportManager : public CTransportManager
+// {
+// public:
+// TestTransportManager(void )
+// : CTransportManager()
+// , mLogger(log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("TransportManagerTest")))
+// {
+// }
+//
+// virtual ~TestTransportManager(void )
+// {
+//
+// }
+//
+// virtual void initializeTransportAdapters()
+// {
+// // Preparing custom device adapter
+// mpTransportAdapter = new MockTransportAdapter(*this, *this);
+//
+// EXPECT_CALL(*mpTransportAdapter, run()).Times(1);
+// EXPECT_CALL(*mpTransportAdapter, scanForNewDevices())
+// .Times(1)
+// .WillOnce(Invoke(mpTransportAdapter, &MockTransportAdapter::doScanForNewDevices))
+// ;
+//
+// EXPECT_CALL(*mpTransportAdapter, ConnectDevice(Data::DeviceHandle))
+// .Times(1)
+// .WillOnce(Invoke(mpTransportAdapter, &MockTransportAdapter::doConnectDevice))
+// ;
+//
+// EXPECT_CALL(*mpTransportAdapter, sendFrame(Data::ConnectionHandle, _, 512, Data::UserData))
+// .Times(1)
+// .WillOnce(Invoke(mpTransportAdapter, &MockTransportAdapter::doSendFrame))
+// ;
+//
+// EXPECT_CALL(*mpTransportAdapter, DisconnectDevice(Data::DeviceHandle))
+// .Times(1)
+// .WillOnce(Invoke(mpTransportAdapter, &MockTransportAdapter::doDisconnectDevice))
+// ;
+//
+// AddTransportAdapter(mpTransportAdapter);
+// LOG4CPLUS_INFO_EXT(mLogger, "Transport adapters initialized");
+// }
+//
+// protected:
+// MockTransportAdapter *mpTransportAdapter;
+// Logger mLogger;
+// };
+//
+// // ----------------------- TESTS ----------------------- //
+//
+// TEST(test_TestWithCorrectTransportAdapter, CorrectTransportAdapterBehavior)
+// {
+// Logger logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("TransportManagerTest"));
+//
+// LOG4CPLUS_INFO_EXT(logger, "*************************** Starting test *****************************");
+// // All expectations must be sequenced
+// //InSequence dummy;
+//
+// // Creating transport manager
+// TestTransportManager *pTm = new TestTransportManager();
+//
+// // Preparing transport manage client
+// MockTransportManagerClient tmClient(*pTm);
+//
+// // Expected device list
+// SDeviceInfo deviceInfo;
+// deviceInfo.mDeviceHandle = Data::DeviceHandle;
+// deviceInfo.mUniqueDeviceId = Data::UniqueDeviceId;
+// deviceInfo.mUserFriendlyName = Data::UserFriendlyName;
+// tDeviceList deviceList;
+// deviceList.push_back(deviceInfo);
+//
+// EXPECT_CALL(tmClient, onDeviceListUpdated(ContainerEq(deviceList)))
+// .Times(1)
+// .WillOnce(Invoke(&tmClient, &MockTransportManagerClient::doDeviceListUpdated))
+// ;
+//
+// EXPECT_CALL(tmClient, onApplicationConnected(deviceInfo, Data::ConnectionHandle))
+// .Times(1)
+// ;
+//
+// EXPECT_CALL(tmClient, onFrameReceived(Data::ConnectionHandle, _, 212))
+// .Times(1)
+// .WillOnce(Invoke(&tmClient, &MockTransportManagerClient::doFrameReceived))
+// ;
+//
+// EXPECT_CALL(tmClient, onFrameSendCompleted(Data::ConnectionHandle, Data::UserData, SendStatusOK))
+// .Times(1)
+// .WillOnce(Invoke(&tmClient, &MockTransportManagerClient::doFrameSendCompleted))
+// ;
+//
+// EXPECT_CALL(tmClient, onApplicationDisconnected(deviceInfo, Data::ConnectionHandle))
+// .Times(1)
+// ;
+//
+//
+//
+// // Running test
+//
+// pTm->addDataListener(&tmClient);
+// pTm->addDeviceListener(&tmClient);
+//
+// LOG4CPLUS_INFO_EXT(logger, "*************************** Calling RUN *****************************");
+// pTm->run();
+//
+// sleep(1);
+//
+// LOG4CPLUS_INFO_EXT(logger, "*************************** Calling SCAN FOR DEVICES *****************************");
+// pTm->scanForNewDevices();
+//
+// sleep(2);
+//
+// LOG4CPLUS_INFO_EXT(logger, "*************************** Deleting TM and shutting down *****************************");
+//
+// // Shutdown transport manager
+// delete pTm;
+// pTm = 0;
+//
+// }
+}/*}}*/} // End of namespaces
+
+#endif
+
diff --git a/test/test_suit.cc b/test/test_suit.cc
index 6a5554d1b..1a8cdb68a 100644
--- a/test/test_suit.cc
+++ b/test/test_suit.cc
@@ -36,15 +36,17 @@
#include "config_profile/profile.h"
#include "utils/logger.h"
-#include "protocol_handler/protocol_handler_tm_test.h"
+//#include "protocol_handler/protocol_handler_tm_test.h"
+//#include "protocol_handler/incoming_data_handler_test.h"
+//#include "protocol_handler/protocol_header_validator_test.h"
#include "application_manager/formatters_commands.h"
-#include "connection_handler/heart_beat_monitor_test.h"
+//#include "connection_handler/heart_beat_monitor_test.h" // always core dumped
// TODO(Ezamakhov): add skip tests
#ifdef ENABLE_SECURITY
-#include "connection_handler/connection_test.h"
-#include "connection_handler/connection_handler_impl_test.h"
+//#include "connection_handler/connection_test.h"
+//#include "connection_handler/connection_handler_impl_test.h"
#include "security_manager/crypto_manager_impl_test.h"
#include "security_manager/security_manager_test.h"
#include "security_manager/security_query_test.h"
diff --git a/tools/intergen/tmp/intergen-cfgcmd.txt b/tools/intergen/tmp/intergen-cfgcmd.txt
new file mode 100644
index 000000000..cf97a5dd0
--- /dev/null
+++ b/tools/intergen/tmp/intergen-cfgcmd.txt
@@ -0,0 +1 @@
+cmd='/usr/bin/cmake;-DCMAKE_INSTALL_PREFIX=/media/akutsan/Media/development/applink/tools/intergen;-GUnix Makefiles;/media/akutsan/Media/development/applink/tools/intergen'
diff --git a/tools/intergen/tmp/intergen-cfgcmd.txt.in b/tools/intergen/tmp/intergen-cfgcmd.txt.in
new file mode 100644
index 000000000..b3f09efc8
--- /dev/null
+++ b/tools/intergen/tmp/intergen-cfgcmd.txt.in
@@ -0,0 +1 @@
+cmd='@cmd@'